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

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

Get the data for the object from database for the given id
public getById ( integer $id )
$id integer
    public function getById($id)
    {
        $data = $this->db->fetchRow("SELECT objects.*, tree_locks.locked as o_locked FROM objects\n            LEFT JOIN tree_locks ON objects.o_id = tree_locks.id AND tree_locks.type = 'object'\n                WHERE o_id = ?", $id);
        if ($data["o_id"]) {
            $this->assignVariablesToModel($data);
        } else {
            throw new \Exception("Object with the ID " . $id . " doesn't exists");
        }
    }