Expanded class hierarchy of FakeMetadataFactory
class FakeMetadataFactory implements MetadataFactoryInterface {
protected $metadatas = array();
public function getMetadataFor($class) {
if (is_object($class)) {
$class = get_class($class);
}
if (!is_string($class)) {
throw new NoSuchMetadataException(sprintf('No metadata for type %s', gettype($class)));
}
if (!isset($this->metadatas[$class])) {
throw new NoSuchMetadataException(sprintf('No metadata for "%s"', $class));
}
return $this->metadatas[$class];
}
public function hasMetadataFor($class) {
if (is_object($class)) {
$class = get_class($class);
}
if (!is_string($class)) {
return false;
}
return isset($this->metadatas[$class]);
}
public function addMetadata(ClassMetadata $metadata) {
$this->metadatas[$metadata
->getClassName()] = $metadata;
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FakeMetadataFactory:: |
protected | property | ||
FakeMetadataFactory:: |
public | function | ||
FakeMetadataFactory:: |
public | function |
Returns the metadata for the given value. Overrides MetadataFactoryInterface:: |
|
FakeMetadataFactory:: |
public | function |
Returns whether metadata exists for the given value. Overrides MetadataFactoryInterface:: |