Beispiel #1
0
 function owner_store($data)
 {
     if (!$data) {
         return null;
     }
     return hyoo_author::make($data);
 }
 function author_store($data)
 {
     return hyoo_author::make($data);
 }
Beispiel #3
0
 function post_resource($data)
 {
     $authorCurrent = hyoo_author::make();
     if ($this->key && $this !== $authorCurrent) {
         return so_output::forbidden("User [{$this->name}] is already registered");
     }
     $this->about = $data['hyoo_author_about'] ?: $this->about;
     $this->key = so_crypt::hash($this->uri, so_user::make()->key);
     $this->exists = true;
     so_cookie::make('hyoo_author_name')->value = $this->name;
     #return so_output::ok( 'Updated' );
     return so_output::created((string) $this);
 }
Beispiel #4
0
 function delete_resource($data)
 {
     if ($this->author !== hyoo_author::make()) {
         return so_output::forbidden("Permission denied");
     }
     $this->exists = false;
     return so_output::ok('Deleted');
 }