Pimcore\Model\Document\Dao::getById PHP Метод

getById() публичный Метод

Fetch a row by an id from the database and assign variables to the document model.
public getById ( $id )
$id
    public function getById($id)
    {
        try {
            $data = $this->db->fetchRow("SELECT documents.*, tree_locks.locked FROM documents\n                LEFT JOIN tree_locks ON documents.id = tree_locks.id AND tree_locks.type = 'document'\n                    WHERE documents.id = ?", $id);
        } catch (\Exception $e) {
        }
        if ($data["id"] > 0) {
            $this->assignVariablesToModel($data);
        } else {
            throw new \Exception("Document with the ID " . $id . " doesn't exists");
        }
    }