add() public static method

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
Esempio n. 1
0
 /**
  * Add an asset to the category
  *
  * @param Asset $asset
  * @return $this
  */
 public function addAsset(Asset $asset)
 {
     ListManager::add($this, 'assets', $asset);
     return $this;
 }
Esempio n. 2
0
 /**
  * Add an article to the category
  *
  * @param Article $article
  * @return $this
  */
 public function addArticle(Article $article)
 {
     ListManager::add($this, 'articles', $article);
     return $this;
 }