Пример #1
0
 public static function update($data)
 {
     $author = Author::instance()->findByPK(self::data('id_author'))->get(1);
     $author->copyfrom('POST', function ($data) {
         return $data;
     });
     $data['password'] || ($author->password = null);
     $saved = $author->save();
     !$saved || self::login($author->cast(), $author->is_admin);
     return $saved;
 }
Пример #2
0
 public function delete($moe)
 {
     $moe->send(array('result' => Author::instance()->findByPK($moe->get('GET.id'))->findByNotId_author(Auth::data('id_author'))->get(1)->delete()));
 }
Пример #3
0
 public function profile($moe, $params)
 {
     $this->pageTitle('Profile of ' . $params['username']);
     $moe->set('profile', Author::instance()->profile($params['username']));
     $moe->send('home/profile');
 }