Esempio n. 1
0
 protected function author($url)
 {
     $post = new Model_Post($this->data['id']);
     $post->load();
     $authors = array_keys($post['meta']['author']);
     $authors = Database::get_vector('author', array('alias', 'name'), Database::array_in('alias', $authors), $authors);
     $this->data['author'] = $authors;
 }
Esempio n. 2
0
 public function __construct($reader = null, $writer = null)
 {
     parent::__construct($reader, $writer);
     $data = $this->reader->get_data();
     if (empty($data['id']) || !Check::id($data['id'])) {
         throw new Error_Update('Incorrect Id');
     }
     $model = new Model_Post($data['id']);
     $model->load();
     if ($model->is_phantom()) {
         throw new Error_Update('Incorrect Id');
     }
     if ($model['area'] != 'workshop' && !sets::user('rights')) {
         throw new Error_Update('Not enough rights');
     }
     $this->model = $model;
 }