Don't publish some fields
This commit is contained in:
parent
72efcc8169
commit
825189e8e9
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue