Jackalope\Property::refresh PHP Method

refresh() protected method

{@inheritDoc} In Jackalope, this is also called internally to refresh when the node is accessed in state DIRTY. Triggers a reload of the containing node, as a property can only ever be loaded attached to a node. TODO: refactor this if we implement loading single properties
See also: Item::checkState
protected refresh ( $keepChanges, $internal = false )
    protected function refresh($keepChanges, $internal = false)
    {
        if ($this->isDeleted()) {
            if ($internal) {
                // @codeCoverageIgnoreStart
                // FIXME: this should not be possible
                return;
                // @codeCoverageIgnoreEnd
            }
            throw new InvalidItemStateException('This property is deleted');
        }
        // Let the node refresh us
        try {
            // do not use getParent to avoid checkState - could lead to an endless loop
            $this->objectManager->getNodeByPath($this->parentPath)->refresh($keepChanges);
        } catch (ItemNotFoundException $e) {
            $this->setDeleted();
        }
    }