本文整理汇总了PHP中Entity::getEntityFields方法的典型用法代码示例。如果您正苦于以下问题:PHP Entity::getEntityFields方法的具体用法?PHP Entity::getEntityFields怎么用?PHP Entity::getEntityFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entity
的用法示例。
在下文中一共展示了Entity::getEntityFields方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fillEntity
private function fillEntity(Entity $entity)
{
foreach ($entity->getEntityFields() as $entityField) {
if ($entityField->isEager()) {
$this->fetchComposedEntity($entity, $entityField);
}
}
return $entity;
}
示例2: appendTableToEntityFields
private function appendTableToEntityFields(Entity $entity)
{
$prefix = "moldp_" . $entity->getTableName();
$entityFields = " {$prefix}." . $entity->getTableId()->getFieldName() . " AS " . $prefix . "_" . $entity->getTableId()->getFieldName() . ",";
foreach ($entity->getEntityFields() as $key => $entityField) {
if (!$entityField->isMappedEntity()) {
$entityFields .= " {$prefix}." . $entityField->getColumnName() . " AS " . $prefix . "_" . $entityField->getColumnName() . ",";
}
}
return rtrim($entityFields, ",");
}
示例3: getEntityFieldOrIdFieldFromEntityByParameter
/**
* @param $entity Entity
* @param $field String
* @return String
*/
private static function getEntityFieldOrIdFieldFromEntityByParameter(Entity $entity, $field)
{
foreach ($entity->getEntityFields() as $key => $entityField) {
if (strtoupper($entityField->getParameterName()) === strtoupper($field)) {
return $entityField->getParameterName();
}
}
if (strtoupper($entity->getTableId()->getParameterName()) === strtoupper($field)) {
return $entity->getTableId()->getParameterName();
}
throw new InvalidArgumentException("Parameter '" . $field . "' not found in Entity " . get_class($entity));
}