LeanMapper\IMapper::getEntityField PHP Метод

getEntityField() публичный Метод

Gets entity field (property) name from given table name and table column
public getEntityField ( string $table, string $column ) : string
$table string
$column string
Результат string
    public function getEntityField($table, $column);

Usage Example

Пример #1
0
 private function replaceEntitiesForItsPrimaryKeyValues(array $entities)
 {
     foreach ($entities as &$entity) {
         if ($entity instanceof LeanMapper\Entity) {
             $entityTable = $this->mapper->getTable(get_class($entity));
             // FIXME: Column name could be specified in the entity instead of mapper provided by 'getEntityField' function.
             $idField = $this->mapper->getEntityField($entityTable, $this->mapper->getPrimaryKey($entityTable));
             $entity = $entity->{$idField};
         }
     }
     return $entities;
 }
All Usage Examples Of LeanMapper\IMapper::getEntityField