Jackalope\Item::isSame PHP Method

isSame() public method

{@inheritDoc}
public isSame ( PHPCR\ItemInterface $otherItem )
$otherItem PHPCR\ItemInterface
    public function isSame(ItemInterface $otherItem)
    {
        $this->checkState();
        if ($this === $otherItem) {
            // trivial case
            return true;
        }
        if ($this->session->getRepository() === $otherItem->getSession()->getRepository() && $this->session->getWorkspace() === $otherItem->getSession()->getWorkspace() && get_class($this) == get_class($otherItem)) {
            if ($this instanceof Node) {
                if ($this->uuid == $otherItem->getIdentifier()) {
                    return true;
                }
                // assert($this instanceof Property)
            } elseif ($this->name == $otherItem->getName() && $this->getParent()->isSame($otherItem->getParent())) {
                return true;
            }
        }
        return false;
    }