remove() public static method

Remove an item from a list
public static remove ( object $entity, string $property, object $value, array $fns, string $getter = null, string $setter = null )
$entity object
$property string Property name to remove from, not needed if providing both a getter and setter
$value object Value to remove
$fns array Array of getter functions which must have equal value to consider a match
$getter string Custom getter name
$setter string Custom setter name
Example #1
0
 /**
  * Remove an asset from the category
  *
  * @param Asset $asset
  * @return $this
  */
 public function removeAsset(Asset $asset)
 {
     ListManager::remove($this, 'assets', $asset, ['getId']);
     return $this;
 }
Example #2
0
 /**
  * Remove an article from the category
  *
  * @param Article $article
  * @return $this
  */
 public function removeArticle(Article $article)
 {
     ListManager::remove($this, 'articles', $article, ['getId']);
     return $this;
 }