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

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

Get the data for the object from database for the given id
public getById ( integer $id ) : void
$id integer
Результат void
    public function getById($id)
    {
        try {
            $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);
                $this->getData();
            } else {
                throw new \Exception("Object with the ID " . $id . " doesn't exists");
            }
        } catch (\Exception $e) {
            Logger::warning($e);
        }
    }