Newscoop\Subscription\Subscription::setSections PHP Method

setSections() public method

Set sections
public setSections ( array $values ) : void
$values array
return void
    public function setSections(array $values)
    {
        $ids = array_map(function ($section) {
            return !empty($section['id']) ? $section['id'] : null;
        }, $values);
        foreach ($this->sections as $key => $section) {
            if (!in_array($section->getId(), $ids)) {
                $this->sections->remove($key);
            }
        }
    }

Usage Example

 public function setSections(array $values)
 {
     $this->__load();
     return parent::setSections($values);
 }
All Usage Examples Of Newscoop\Subscription\Subscription::setSections