本文整理汇总了PHP中Entity::getTableId方法的典型用法代码示例。如果您正苦于以下问题:PHP Entity::getTableId方法的具体用法?PHP Entity::getTableId怎么用?PHP Entity::getTableId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entity
的用法示例。
在下文中一共展示了Entity::getTableId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: equals
public function equals(Entity $entity)
{
if ($entity == null) {
return false;
}
if (!$entity instanceof Entity) {
return false;
}
if ($entity->getTableId()->getFieldName() !== $this->getTableId()->getFieldName()) {
return false;
}
return $entity->getIdValue() === $this->getIdValue();
}
示例2: getEntityIdField
private function getEntityIdField(Entity $entity)
{
return "moldp_" . $entity->getTableName() . "_" . $entity->getTableId()->getFieldName();
}
示例3: getIdFromEntity
private function getIdFromEntity(Entity $entity)
{
$getter = "get" . $entity->getTableId()->getParameterName();
return $entity->{$getter}();
}
示例4: 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, ",");
}
示例5: 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));
}