Return 'null' on empty card

pull/9458/head
Michael 2020-10-25 16:55:05 +00:00
rodzic efcd76d3a7
commit 13b14bff91
1 zmienionych plików z 14 dodań i 0 usunięć

Wyświetl plik

@ -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();
}
}