Return 'null' on empty card
This commit is contained in:
parent
efcd76d3a7
commit
13b14bff91
1 changed files with 14 additions and 0 deletions
|
@ -59,4 +59,18 @@ class Card extends BaseEntity
|
|||
$this->type = $attachment['type'] ?? '';
|
||||
$this->image = $attachment['image'] ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current entity as an array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray()
|
||||
{
|
||||
if (empty($this->url)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return parent::toArray();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue