Ejemplo n.º 1
0
    /**
     * Vérifie si un objet à déjà la location donnée
     * Attention cette méthode utilise les locations en cache
     * @param SQLIContent $content
     * @param SQLILocation $parentLocation
     * @return boolean
     */
    public static function isAlreadyLocatedIn(SQLIContent $content, $parentLocation)
    {
        $node_id = $parentLocation;

        if ($parentLocation instanceof SQLILocation)
            $node_id = $parentLocation->getNodeId();

        reset($content->locations);

        foreach($content->locations as $location)
        {
            if ($location->getNodeId() == $node_id)
                return true;
        }

        return false;
    }