123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- <?php
- namespace Doctrine\Tests\Common\Proxy;
- use ReflectionClass;
- use Doctrine\Common\Persistence\Mapping\ClassMetadata;
- class LazyLoadableObjectClassMetadata implements ClassMetadata
- {
-
- protected $reflectionClass;
-
- protected $identifier = array(
- 'publicIdentifierField' => true,
- 'protectedIdentifierField' => true,
- );
-
- protected $fields = array(
- 'publicIdentifierField' => true,
- 'protectedIdentifierField' => true,
- 'publicPersistentField' => true,
- 'protectedPersistentField' => true,
- );
-
- protected $associations = array(
- 'publicAssociation' => true,
- 'protectedAssociation' => true,
- );
-
- public function getName()
- {
- return $this->getReflectionClass()->getName();
- }
-
- public function getIdentifier()
- {
- return array_keys($this->identifier);
- }
-
- public function getReflectionClass()
- {
- if (null === $this->reflectionClass) {
- $this->reflectionClass = new \ReflectionClass(__NAMESPACE__ . '\LazyLoadableObject');
- }
- return $this->reflectionClass;
- }
-
- public function isIdentifier($fieldName)
- {
- return isset($this->identifier[$fieldName]);
- }
-
- public function hasField($fieldName)
- {
- return isset($this->fields[$fieldName]);
- }
-
- public function hasAssociation($fieldName)
- {
- return isset($this->associations[$fieldName]);
- }
-
- public function isSingleValuedAssociation($fieldName)
- {
- throw new \BadMethodCallException('not implemented');
- }
-
- public function isCollectionValuedAssociation($fieldName)
- {
- throw new \BadMethodCallException('not implemented');
- }
-
- public function getFieldNames()
- {
- return array_keys($this->fields);
- }
-
- public function getIdentifierFieldNames()
- {
- return $this->getIdentifier();
- }
-
- public function getAssociationNames()
- {
- return array_keys($this->associations);
- }
-
- public function getTypeOfField($fieldName)
- {
- return 'string';
- }
-
- public function getAssociationTargetClass($assocName)
- {
- throw new \BadMethodCallException('not implemented');
- }
-
- public function isAssociationInverseSide($assocName)
- {
- throw new \BadMethodCallException('not implemented');
- }
-
- public function getAssociationMappedByTargetField($assocName)
- {
- throw new \BadMethodCallException('not implemented');
- }
-
- public function getIdentifierValues($object)
- {
- throw new \BadMethodCallException('not implemented');
- }
- }
|