Pimcore\Model\Document::setProperty PHP Method

setProperty() public method

Set the document property.
public setProperty ( string $name, string $type, mixed $data, boolean $inherited = false, boolean $inheritable = true ) : Document
$name string
$type string
$data mixed
$inherited boolean
$inheritable boolean
return Document
    public function setProperty($name, $type, $data, $inherited = false, $inheritable = true)
    {
        $this->getProperties();
        $property = new Property();
        $property->setType($type);
        $property->setCid($this->getId());
        $property->setName($name);
        $property->setCtype("document");
        $property->setData($data);
        $property->setInherited($inherited);
        $property->setInheritable($inheritable);
        $this->properties[$name] = $property;
        return $this;
    }