예제 #1
0
 /**
  * Returns a value of a metadata property
  *
  * @param object         $entity
  * @param string         $field
  * @param EntityMetadata $entityMetadata
  *
  * @return mixed
  */
 protected function getMetadataFieldValue($entity, $field, $entityMetadata)
 {
     switch ($field) {
         case self::DISCRIMINATOR_FIELD:
             return $entityMetadata->getDiscriminatorValue(ClassUtils::getClass($entity));
         case self::CLASS_FIELD:
             return ClassUtils::getClass($entity);
         default:
             return null;
     }
 }
예제 #2
0
 /**
  * Returns a value of a metadata property
  *
  * @param object         $entity
  * @param string         $propertyPath
  * @param EntityMetadata $entityMetadata
  *
  * @return mixed
  */
 public function getMetadataProperty($entity, $propertyPath, $entityMetadata)
 {
     switch ($propertyPath) {
         case ConfigUtil::DISCRIMINATOR:
             return $entityMetadata->getDiscriminatorValue(ClassUtils::getClass($entity));
         case ConfigUtil::CLASS_NAME:
             return ClassUtils::getClass($entity);
         default:
             return null;
     }
 }