src/orm/classes/Table.php
protected function entityFactory(array $values)
    {
        if (!array_key_exists($this->getPrimaryKey(), $values))
        {
            throw new InvalidArgumentException('Primary key not found in a given array');
        }

        $id = $values[$this->getPrimaryKey()];
        if (array_key_exists($id, $this->registry))
        {
            return $this->registry[$id];
        }

        $entityClass = $this->getEntityClass();
        $entity = new $entityClass($values);
        $this->registry[$id] = $entity;
        return $entity;
    }
protected function entityFactory(array $values)
    {
        if (!array_key_exists($this->getPrimaryKey(), $values))
        {
            throw new InvalidArgumentException('Primary key not found in a given array');
        }

        $id = $values[$this->getPrimaryKey()];
        if (array_key_exists($id, $this->registry))
        {
            return $this->registry[$id];
        }

        $entityClass = $this->getEntityClass();
        $entity = new $entityClass($values);
        $this->registry[$id] = $entity;
        return $entity;
    }
Фабрика сущностей

@param array $values

@throws InvalidArgumentException

@return ORM_Entity

@since 1.00