src/SetterTrait.php
public function setAssignments($items, $userId)
    {
        if (is_string($items)) {
            $items = explode(',', $items);
        }
        foreach ($items as $item) {
            $this->setAssignment($item, $userId);
        }
    }
public function setAssignments($items, $userId)
    {
        if (is_string($items)) {
            $items = explode(',', $items);
        }
        foreach ($items as $item) {
            $this->setAssignment($item, $userId);
        }
    }
public function setAssignments ( $ items , $ userId ) { if ( is_string ( $ items ) ) { $ items = explode ( ',' , $ items ) ; } foreach ( $ items as $ item ) { $ this -> setAssignment ( $ item , $ userId ) ; } }
Assigns items to a user.
@param string|array $items
@param string|integer $userId
Assigns items to a user .