add() 공개 정적인 메소드

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
예제 #1
0
파일: Category.php 프로젝트: bravo3/orm
 /**
  * Add an asset to the category
  *
  * @param Asset $asset
  * @return $this
  */
 public function addAsset(Asset $asset)
 {
     ListManager::add($this, 'assets', $asset);
     return $this;
 }
예제 #2
0
파일: Category.php 프로젝트: bravo3/orm
 /**
  * Add an article to the category
  *
  * @param Article $article
  * @return $this
  */
 public function addArticle(Article $article)
 {
     ListManager::add($this, 'articles', $article);
     return $this;
 }