protected function hasParent($id, array $relationships)
    {
        foreach ($relationships as $parentId => $children) {
            // 0 is reserved, therefore must be ignored
            if ($parentId == 0) {
                continue;
            }

            if (in_array($id, $children)) {
                return true;
            }
        }

        // By default
        return false;
    }
protected function hasParent($id, array $relationships)
    {
        foreach ($relationships as $parentId => $children) {
            // 0 is reserved, therefore must be ignored
            if ($parentId == 0) {
                continue;
            }

            if (in_array($id, $children)) {
                return true;
            }
        }

        // By default
        return false;
    }
protected function hasParent ( $ id , array $ relationships ) { foreach ( $ relationships as $ parentId => $ children ) { // 0 is reserved, therefore must be ignored if ( $ parentId == 0 ) { continue ; } if ( in_array ( $ id , $ children ) ) { return true ; } } // By default return false ; }
Determines whether given id has a parent

@param string|integer $id
@param array $relationships
@return boolean
Determines whether given id has a parent