Exemplo n.º 1
0
 public function __call($method, $params)
 {
     switch (true) {
         # Checking status: $paramsost->is_pending();
         case strpos($method, 'is_') === 0:
             $status = str_replace('is_', '', $method);
             return $this->status == $status;
         default:
             return parent::__call($method, $params);
     }
 }
Exemplo n.º 2
0
 public function toXml(array $options = array())
 {
     return parent::toXml(array_merge($options, ['attributes' => $this->api_attributes()]));
 }
Exemplo n.º 3
0
 public function toXml(array $options = [])
 {
     return parent::toXml(['attributes' => ['id' => $this->id, 'post_id' => $this->post_id, 'tags' => $this->tags], 'root' => "tag_history"]);
 }
Exemplo n.º 4
0
 public static function authenticate_hash($name, $pass)
 {
     $user = parent::where("lower(name) = lower(?) AND password_hash = ?", $name, $pass)->first();
     return $user;
 }
Exemplo n.º 5
0
 public function toXml(array $options = [])
 {
     return parent::toXml(array_merge($options, ['root' => 'wiki_page', 'attributes' => ['id' => $this->id, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, 'title' => $this->title, 'body' => $this->body, 'updater_id' => $this->user_id, 'locked' => (bool) (int) $this->is_locked, 'version' => $this->version]]));
 }
Exemplo n.º 6
0
 public function toXml(array $options = [])
 {
     return parent::toXml(array_merge($options, ['root' => "forum-post", 'attributes' => $this->api_attributes()]));
 }
Exemplo n.º 7
0
 public function toXml(array $options = array())
 {
     $options['root'] = "artist";
     $options['attributes'] = $this->api_attributes();
     return parent::toXml($options);
 }