Pimcore\Model\Object\QuantityValue\Unit\Dao::getByReference PHP Method

getByReference() public method

public getByReference ( string $reference ) : void
$reference string
return void
    public function getByReference($reference)
    {
        $classRaw = $this->db->fetchRow("SELECT * FROM " . self::TABLE_NAME . " WHERE reference=" . $this->db->quote($reference));
        if (empty($classRaw)) {
            throw new \Exception("Unit " . $reference . " not found.");
        }
        $this->assignVariablesToModel($classRaw);
    }