Pimcore\Model\Metadata\Predefined\Dao::getById PHP Method

getById() public method

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("Predefined asset metadata with id: " . $this->model->getId() . " does not exist");
        }
    }