Doctrine\ODM\PHPCR\UnitOfWork::processAssoc PHP Метод

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

Stores keys and null fields in the node and returns the processed values
public processAssoc ( PHPCR\NodeInterface $node, array $mapping, array $assoc ) : array
$node PHPCR\NodeInterface the node where to store the assoc array
$mapping array the field's mapping
$assoc array the associative array
Результат array
    public function processAssoc(NodeInterface $node, array $mapping, array $assoc)
    {
        $isNull = function ($item) {
            return null === $item;
        };
        $isNotNull = function ($item) {
            return null !== $item;
        };
        $keys = array_keys($assoc);
        $values = array_values(array_filter($assoc, $isNotNull));
        $nulls = array_keys(array_filter($assoc, $isNull));
        if (empty($keys)) {
            $this->removeAssoc($node, $mapping);
        } else {
            $node->setProperty($mapping['assoc'], $keys, PropertyType::STRING);
            $node->setProperty($mapping['assocNulls'], $nulls, PropertyType::STRING);
        }
        return $values;
    }
UnitOfWork