You are here

class LazyLoadableObjectClassMetadata in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/LazyLoadableObjectClassMetadata.php \Doctrine\Tests\Common\Proxy\LazyLoadableObjectClassMetadata

Class metadata test asset for @author Marco Pivetta <ocramius@gmail.com> @since 2.4

Hierarchy

Expanded class hierarchy of LazyLoadableObjectClassMetadata

See also

LazyLoadableObject

File

vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/LazyLoadableObjectClassMetadata.php, line 31

Namespace

Doctrine\Tests\Common\Proxy
View source
class LazyLoadableObjectClassMetadata implements ClassMetadata {

  /**
   * @var ReflectionClass
   */
  protected $reflectionClass;

  /**
   * @var array
   */
  protected $identifier = array(
    'publicIdentifierField' => true,
    'protectedIdentifierField' => true,
  );

  /**
   * @var array
   */
  protected $fields = array(
    'publicIdentifierField' => true,
    'protectedIdentifierField' => true,
    'publicPersistentField' => true,
    'protectedPersistentField' => true,
  );

  /**
   * @var array
   */
  protected $associations = array(
    'publicAssociation' => true,
    'protectedAssociation' => true,
  );

  /**
   * {@inheritDoc}
   */
  public function getName() {
    return $this
      ->getReflectionClass()
      ->getName();
  }

  /**
   * {@inheritDoc}
   */
  public function getIdentifier() {
    return array_keys($this->identifier);
  }

  /**
   * {@inheritDoc}
   */
  public function getReflectionClass() {
    if (null === $this->reflectionClass) {
      $this->reflectionClass = new \ReflectionClass(__NAMESPACE__ . '\\LazyLoadableObject');
    }
    return $this->reflectionClass;
  }

  /**
   * {@inheritDoc}
   */
  public function isIdentifier($fieldName) {
    return isset($this->identifier[$fieldName]);
  }

  /**
   * {@inheritDoc}
   */
  public function hasField($fieldName) {
    return isset($this->fields[$fieldName]);
  }

  /**
   * {@inheritDoc}
   */
  public function hasAssociation($fieldName) {
    return isset($this->associations[$fieldName]);
  }

  /**
   * {@inheritDoc}
   */
  public function isSingleValuedAssociation($fieldName) {
    throw new \BadMethodCallException('not implemented');
  }

  /**
   * {@inheritDoc}
   */
  public function isCollectionValuedAssociation($fieldName) {
    throw new \BadMethodCallException('not implemented');
  }

  /**
   * {@inheritDoc}
   */
  public function getFieldNames() {
    return array_keys($this->fields);
  }

  /**
   * {@inheritDoc}
   */
  public function getIdentifierFieldNames() {
    return $this
      ->getIdentifier();
  }

  /**
   * {@inheritDoc}
   */
  public function getAssociationNames() {
    return array_keys($this->associations);
  }

  /**
   * {@inheritDoc}
   */
  public function getTypeOfField($fieldName) {
    return 'string';
  }

  /**
   * {@inheritDoc}
   */
  public function getAssociationTargetClass($assocName) {
    throw new \BadMethodCallException('not implemented');
  }

  /**
   * {@inheritDoc}
   */
  public function isAssociationInverseSide($assocName) {
    throw new \BadMethodCallException('not implemented');
  }

  /**
   * {@inheritDoc}
   */
  public function getAssociationMappedByTargetField($assocName) {
    throw new \BadMethodCallException('not implemented');
  }

  /**
   * {@inheritDoc}
   */
  public function getIdentifierValues($object) {
    throw new \BadMethodCallException('not implemented');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
LazyLoadableObjectClassMetadata::$associations protected property
LazyLoadableObjectClassMetadata::$fields protected property
LazyLoadableObjectClassMetadata::$identifier protected property
LazyLoadableObjectClassMetadata::$reflectionClass protected property
LazyLoadableObjectClassMetadata::getAssociationMappedByTargetField public function Returns the target field of the owning side of the association. Overrides ClassMetadata::getAssociationMappedByTargetField
LazyLoadableObjectClassMetadata::getAssociationNames public function Returns a numerically indexed list of association names of this persistent class. Overrides ClassMetadata::getAssociationNames
LazyLoadableObjectClassMetadata::getAssociationTargetClass public function Returns the target class name of the given association. Overrides ClassMetadata::getAssociationTargetClass
LazyLoadableObjectClassMetadata::getFieldNames public function A numerically indexed list of field names of this persistent class. Overrides ClassMetadata::getFieldNames
LazyLoadableObjectClassMetadata::getIdentifier public function Gets the mapped identifier field name. Overrides ClassMetadata::getIdentifier
LazyLoadableObjectClassMetadata::getIdentifierFieldNames public function Returns an array of identifier field names numerically indexed. Overrides ClassMetadata::getIdentifierFieldNames
LazyLoadableObjectClassMetadata::getIdentifierValues public function Returns the identifier of this object as an array with field name as key. Overrides ClassMetadata::getIdentifierValues
LazyLoadableObjectClassMetadata::getName public function Gets the fully-qualified class name of this persistent class. Overrides ClassMetadata::getName
LazyLoadableObjectClassMetadata::getReflectionClass public function Gets the ReflectionClass instance for this mapped class. Overrides ClassMetadata::getReflectionClass
LazyLoadableObjectClassMetadata::getTypeOfField public function Returns a type name of this field. Overrides ClassMetadata::getTypeOfField
LazyLoadableObjectClassMetadata::hasAssociation public function Checks if the given field is a mapped association for this class. Overrides ClassMetadata::hasAssociation
LazyLoadableObjectClassMetadata::hasField public function Checks if the given field is a mapped property for this class. Overrides ClassMetadata::hasField
LazyLoadableObjectClassMetadata::isAssociationInverseSide public function Checks if the association is the inverse side of a bidirectional association. Overrides ClassMetadata::isAssociationInverseSide
LazyLoadableObjectClassMetadata::isCollectionValuedAssociation public function Checks if the given field is a mapped collection valued association for this class. Overrides ClassMetadata::isCollectionValuedAssociation
LazyLoadableObjectClassMetadata::isIdentifier public function Checks if the given field name is a mapped identifier for this class. Overrides ClassMetadata::isIdentifier
LazyLoadableObjectClassMetadata::isSingleValuedAssociation public function Checks if the given field is a mapped single valued association for this class. Overrides ClassMetadata::isSingleValuedAssociation