src/Collections/PopoloCollection.php
public function get($filters)
    {
        $matches = $this->filter($filters);
        $n = count($matches);
        if ($n == 0) {
            $msg = "No ".$this->objectClass." found matching ".json_encode($filters);
            throw new Exceptions\ObjectDoesNotExistException($msg);
        } elseif ($n > 1) {
            $msg = "Multiple ".$this->objectClass." objects ($n) found matching ".json_encode($filters);
            throw new Exceptions\MultipleObjectsReturnedException($msg);
        }
        return $matches[0];
    }
public function get($filters)
    {
        $matches = $this->filter($filters);
        $n = count($matches);
        if ($n == 0) {
            $msg = "No ".$this->objectClass." found matching ".json_encode($filters);
            throw new Exceptions\ObjectDoesNotExistException($msg);
        } elseif ($n > 1) {
            $msg = "Multiple ".$this->objectClass." objects ($n) found matching ".json_encode($filters);
            throw new Exceptions\MultipleObjectsReturnedException($msg);
        }
        return $matches[0];
    }
public function get ( $ filters ) { $ matches = $ this -> filter ( $ filters ) ; $ n = count ( $ matches ) ; if ( $ n == 0 ) { $ msg = "No " . $ this -> objectClass . " found matching " . json_encode ( $ filters ) ; throw new Exceptions \ ObjectDoesNotExistException ( $ msg ) ; } elseif ( $ n > 1 ) { $ msg = "Multiple " . $ this -> objectClass . " objects ($n) found matching " . json_encode ( $ filters ) ; throw new Exceptions \ MultipleObjectsReturnedException ( $ msg ) ; } return $ matches [ 0 ] ; }
Gets a single matching item, according to the
array of filters provided. Filters are key-value pairs
that are ANDed together, i.e. returned items match all
the criteria. If more or less than one item matches,
an exception is thrown

@param string[] $filters key-value set of criteria

@return object
Gets a single matching item according to the array of filters provided . Filters are key - value pairs that are ANDed together i . e . returned items match all the criteria . If more or less than one item matches an exception is thrown