Jarves\Objects::add PHP Метод

add() публичный Метод

Adds a item.
public add ( string $objectKey, array $values, mixed $targetPk = null, string $position = 'first', boolean $targetObjectKey = null, array $options = [] ) : mixed
$objectKey string
$values array
$targetPk mixed Full PK as array or as primary key string (url).
$position string If nested set. `first` (child), `last` (last child), `prev` (sibling), `next` (sibling)
$targetObjectKey boolean If this object key differs from $objectKey then we'll use $pk as `scope`. Also it is then only possible to have position `first` and `last`.
$options array
Результат mixed
    public function add($objectKey, $values, $targetPk = null, $position = 'first', $targetObjectKey = null, array $options = array())
    {
        $targetPk = $this->normalizePk($objectKey, $targetPk);
        $objectKey = Objects::normalizeObjectKey($objectKey);
        if ($targetObjectKey) {
            $targetObjectKey = Objects::normalizeObjectKey($targetObjectKey);
        }
        $repository = $this->getRepository($objectKey, $options);
        return $repository->add($values, $targetPk, $position, $targetObjectKey);
    }