Jackalope\Property::__construct PHP Метод

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

To indicate a property has newly been created locally, make sure to pass true for the $new parameter. In that case, you should pass an empty array for $data and use setValue afterwards to let the type magic be handled. Then multivalue is determined on setValue For binary properties, the value is the length of the data(s), not the data itself.
public __construct ( jackalope\FactoryInterface $factory, array $data, string $path, jackalope\Session $session, ObjectManager $objectManager, boolean $new = false )
$factory jackalope\FactoryInterface the object factory
$data array array with fields type (integer or string from PropertyType) and value (data for creating the property value - array for multivalue property)
$path string the absolute path of this item
$session jackalope\Session the session instance
$objectManager ObjectManager the objectManager instance - the caller has to take care of registering this item with the object manager
$new boolean optional: set to true to make this property aware its not yet existing on the server. defaults to false
    public function __construct(FactoryInterface $factory, array $data, $path, Session $session, ObjectManager $objectManager, $new = false)
    {
        parent::__construct($factory, $path, $session, $objectManager, $new);
        $this->wrapBinaryStreams = $session->getRepository()->getDescriptor(Repository::JACKALOPE_OPTION_STREAM_WRAPPER);
        if (null === $data && $new) {
            return;
        }
        if (!isset($data['value'])) {
            throw new InvalidArgumentException("Can't create property at {$path} without any data");
        }
        $this->_setValue($data['value'], isset($data['type']) ? $data['type'] : PropertyType::UNDEFINED, true);
    }