public function createFromDatabaseValues($data, $entity = null)
    {
        $entity = $this->getEntity($entity);
        $fields = $this->getFields();

        // set fields
        foreach ($fields as $key => $mapping) {
            $fieldType = $this->fieldManager->get($mapping['fieldtype'], $mapping);
            if ($fieldType instanceof FieldTypeInterface) {
                $fieldType->hydrate($data, $entity);
            }
        }

        return $entity;
    }
public function createFromDatabaseValues($data, $entity = null)
    {
        $entity = $this->getEntity($entity);
        $fields = $this->getFields();

        // set fields
        foreach ($fields as $key => $mapping) {
            $fieldType = $this->fieldManager->get($mapping['fieldtype'], $mapping);
            if ($fieldType instanceof FieldTypeInterface) {
                $fieldType->hydrate($data, $entity);
            }
        }

        return $entity;
    }
public function createFromDatabaseValues ( $ data , $ entity = null ) { $ entity = $ this -> getEntity ( $ entity ) ; $ fields = $ this -> getFields ( ) ; // set fields foreach ( $ fields as $ key => $ mapping ) { $ fieldType = $ this -> fieldManager -> get ( $ mapping [ 'fieldtype' ] , $ mapping ) ; if ( $ fieldType instanceof FieldTypeInterface ) { $ fieldType -> hydrate ( $ data , $ entity ) ; } } return $ entity ; }
Performs database to PHP transforms before creating new entity.

@param array       $data
@param object|null $entity

@throws \Bolt\Exception\StorageException

@return object $entity
Performs database to PHP transforms before creating new entity .