public function findFirst($key,$value)
    {
        $result = $this->findItems(
            function (ClientObject $item) use ($key, $value) {
                return $item->getProperty($key) === $value;
            });
        return ((count($result) > 0) ? array_values($result)[0] : null);
    }
public function findFirst($key,$value)
    {
        $result = $this->findItems(
            function (ClientObject $item) use ($key, $value) {
                return $item->getProperty($key) === $value;
            });
        return ((count($result) > 0) ? array_values($result)[0] : null);
    }
public function findFirst ( $ key , $ value ) { $ result = $ this -> findItems ( function ( ClientObject $ item ) use ( $ key , $ value ) { return $ item -> getProperty ( $ key ) === $ value ; } ) ; return ( ( count ( $ result ) > 0 ) ? array_values ( $ result ) [ 0 ] : null ) ; }
Finds the first item
@param string $key
@param string $value
@return ClientObject|null
Finds the first item