3
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
* This software consists of voluntary contributions made by many individuals
16
* and is licensed under the MIT license. For more information, see
17
* <http://www.doctrine-project.org>.
20
namespace Doctrine\Tests\Common\Proxy;
23
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
26
* Class metadata test asset for @see LazyLoadableObject
28
* @author Marco Pivetta <ocramius@gmail.com>
31
class LazyLoadableObjectClassMetadata implements ClassMetadata
34
* @var ReflectionClass
36
protected $reflectionClass;
41
protected $identifier = array(
42
'publicIdentifierField' => true,
43
'protectedIdentifierField' => true,
49
protected $fields = array(
50
'publicIdentifierField' => true,
51
'protectedIdentifierField' => true,
52
'publicPersistentField' => true,
53
'protectedPersistentField' => true,
59
protected $associations = array(
60
'publicAssociation' => true,
61
'protectedAssociation' => true,
67
public function getName()
69
return $this->getReflectionClass()->getName();
75
public function getIdentifier()
77
return array_keys($this->identifier);
83
public function getReflectionClass()
85
if (null === $this->reflectionClass) {
86
$this->reflectionClass = new \ReflectionClass(__NAMESPACE__ . '\LazyLoadableObject');
89
return $this->reflectionClass;
95
public function isIdentifier($fieldName)
97
return isset($this->identifier[$fieldName]);
103
public function hasField($fieldName)
105
return isset($this->fields[$fieldName]);
111
public function hasAssociation($fieldName)
113
return isset($this->associations[$fieldName]);
119
public function isSingleValuedAssociation($fieldName)
121
throw new \BadMethodCallException('not implemented');
127
public function isCollectionValuedAssociation($fieldName)
129
throw new \BadMethodCallException('not implemented');
135
public function getFieldNames()
137
return array_keys($this->fields);
143
public function getIdentifierFieldNames()
145
return $this->getIdentifier();
151
public function getAssociationNames()
153
return array_keys($this->associations);
159
public function getTypeOfField($fieldName)
167
public function getAssociationTargetClass($assocName)
169
throw new \BadMethodCallException('not implemented');
175
public function isAssociationInverseSide($assocName)
177
throw new \BadMethodCallException('not implemented');
183
public function getAssociationMappedByTargetField($assocName)
185
throw new \BadMethodCallException('not implemented');
191
public function getIdentifierValues($object)
193
throw new \BadMethodCallException('not implemented');