public function getKey($item, $return_all = false)
    {
        if ($return_all === true) {
            return $this->getKeys();
        }

        if ($this->hasKey($item->getIdentifier())) {
            return $item->getIdentifier();
        }

        return false;
    }
public function getKey($item, $return_all = false)
    {
        if ($return_all === true) {
            return $this->getKeys();
        }

        if ($this->hasKey($item->getIdentifier())) {
            return $item->getIdentifier();
        }

        return false;
    }
public function getKey ( $ item , $ return_all = false ) { if ( $ return_all === true ) { return $ this -> getKeys ( ) ; } if ( $ this -> hasKey ( $ item -> getIdentifier ( ) ) ) { return $ item -> getIdentifier ( ) ; } return false ; }
Return the key for the given item.

If you wish to receive all keys, set the '$return_all' parameter to true.

@param mixed $item
@param boolean $return_all

@return mixed Returns the key of the item, an array of all keys or false, if the item is not present.
Return the key for the given item .