public function identifyEntity(ModelInterface $model, &$entity, $identifier)
    {
        $primaryKeys = $model->primaryFields();
        if (count($primaryKeys) !== 1) {
            return;
        }

        $field = reset($primaryKeys)->name();

        $this->setPropertyValue($entity, $field, $identifier);
    }
public function identifyEntity(ModelInterface $model, &$entity, $identifier)
    {
        $primaryKeys = $model->primaryFields();
        if (count($primaryKeys) !== 1) {
            return;
        }

        $field = reset($primaryKeys)->name();

        $this->setPropertyValue($entity, $field, $identifier);
    }
public function identifyEntity ( ModelInterface $ model , & $ entity , $ identifier ) { $ primaryKeys = $ model -> primaryFields ( ) ; if ( count ( $ primaryKeys ) !== 1 ) { return ; } $ field = reset ( $ primaryKeys ) -> name ( ) ; $ this -> setPropertyValue ( $ entity , $ field , $ identifier ) ; }
Assigns passed identifier to primary key
Possible only when entity has one primary key

@param ModelInterface $model
@param mixed          $entity
@param int|string     $identifier

@return void
Assigns passed identifier to primary key Possible only when entity has one primary key