Don't publish some fields

This commit is contained in:
Michael 2020-10-25 17:42:42 +00:00
parent 72efcc8169
commit 825189e8e9
2 changed files with 36 additions and 0 deletions

View File

@ -132,4 +132,20 @@ class Account extends BaseEntity
$this->fields = $fields->getArrayCopy();
}
/**
* Returns the current entity as an array
*
* @return array
*/
public function toArray()
{
$account = parent::toArray();
if (empty($account['moved'])) {
unset($account['moved']);
}
return $account;
}
}

View File

@ -137,4 +137,24 @@ class Status extends BaseEntity
$this->card = $card->toArray();
$this->poll = null;
}
/**
* Returns the current entity as an array
*
* @return array
*/
public function toArray()
{
$status = parent::toArray();
if (!$status['pinned']) {
unset($status['pinned']);
}
if (empty($status['application']['name'])) {
unset($status['application']);
}
return $status;
}
}