Sequenzia/app/models/Tag/ApiMethods.php
2013-10-26 18:06:58 -05:00

21 lines
501 B
PHP
Executable File

<?php
trait TagApiMethods
{
public function api_attributes()
{
return [
'id' => $this->id,
'name' => $this->name,
'count' => $this->post_count,
'type' => $this->tag_type,
'ambiguous' => $this->is_ambiguous
];
}
public function toXml(array $options = [])
{
$options['root'] = 'tag';
$options['attributes'] = $this->api_attributes();
return parent::toXml($options);
}
}