public function getPrincipalByPath($path)
    {
        $fields = [
            'id',
            'uri',
        ];

        foreach ($this->fieldMap as $key => $value) {
            $fields[] = $value['dbField'];
        }
        $stmt = $this->pdo->prepare('SELECT '.implode(',', $fields).'  FROM '.$this->tableName.' WHERE uri = ?');
        $stmt->execute([$path]);

        $row = $stmt->fetch(\PDO::FETCH_ASSOC);
        if (!$row) {
            return;
        }

        $principal = [
            'id' => $row['id'],
            'uri' => $row['uri'],
        ];
        foreach ($this->fieldMap as $key => $value) {
            if ($row[$value['dbField']]) {
                $principal[$key] = $row[$value['dbField']];
            }
        }

        return $principal;
    }
public function getPrincipalByPath($path)
    {
        $fields = [
            'id',
            'uri',
        ];

        foreach ($this->fieldMap as $key => $value) {
            $fields[] = $value['dbField'];
        }
        $stmt = $this->pdo->prepare('SELECT '.implode(',', $fields).'  FROM '.$this->tableName.' WHERE uri = ?');
        $stmt->execute([$path]);

        $row = $stmt->fetch(\PDO::FETCH_ASSOC);
        if (!$row) {
            return;
        }

        $principal = [
            'id' => $row['id'],
            'uri' => $row['uri'],
        ];
        foreach ($this->fieldMap as $key => $value) {
            if ($row[$value['dbField']]) {
                $principal[$key] = $row[$value['dbField']];
            }
        }

        return $principal;
    }
public function getPrincipalByPath ( $ path ) { $ fields = [ 'id' , 'uri' , ] ; foreach ( $ this -> fieldMap as $ key => $ value ) { $ fields [ ] = $ value [ 'dbField' ] ; } $ stmt = $ this -> pdo -> prepare ( 'SELECT ' . implode ( ',' , $ fields ) . '  FROM ' . $ this -> tableName . ' WHERE uri = ?' ) ; $ stmt -> execute ( [ $ path ] ) ; $ row = $ stmt -> fetch ( \ PDO :: FETCH_ASSOC ) ; if ( ! $ row ) { return ; } $ principal = [ 'id' => $ row [ 'id' ] , 'uri' => $ row [ 'uri' ] , ] ; foreach ( $ this -> fieldMap as $ key => $ value ) { if ( $ row [ $ value [ 'dbField' ] ] ) { $ principal [ $ key ] = $ row [ $ value [ 'dbField' ] ] ; } } return $ principal ; }
Returns a specific principal, specified by it's path.
The returned structure should be the exact same as from
getPrincipalsByPrefix.

@param string $path

@return array
Returns a specific principal specified by it s path . The returned structure should be the exact same as from getPrincipalsByPrefix .