21 lines
501 B
PHP
Executable File
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);
|
|
}
|
|
} |