Pimcore\Model\Document\DocType\Dao::getById PHP Method

getById() public method

Get the data for the object from database for the given id
public getById ( null $id = null )
$id null
    public function getById($id = null)
    {
        if ($id != null) {
            $this->model->setId($id);
        }
        $data = $this->db->getById($this->model->getId());
        if (isset($data["id"])) {
            $this->assignVariablesToModel($data);
        } else {
            throw new \Exception("Doc-type with id " . $this->model->getId() . " doesn't exist");
        }
    }