Add an item to a list
public static add ( object $entity, string $property, object $value, string $getter = null, string $setter = null ) | ||
$entity | object | |
$property | string | Property name to add to, not needed if providing both a getter and setter |
$value | object | Value to add |
$getter | string | Custom getter name |
$setter | string | Custom setter name |
/** * Add an asset to the category * * @param Asset $asset * @return $this */ public function addAsset(Asset $asset) { ListManager::add($this, 'assets', $asset); return $this; }
/** * Add an article to the category * * @param Article $article * @return $this */ public function addArticle(Article $article) { ListManager::add($this, 'articles', $article); return $this; }