public function load() { $this->evalClass($this->classmetadata); $builder = new ProxyBuilder(); $builder->setNamespace($this->classmetadata->getNamespace()); $builder->setClassName($this->originalClassName); $builder->setParentClass("\\" . $this->classmetadata->getNamespace() . "\\" . $this->classmetadata->getName()); foreach ($this->classmetadata->getMethods() as $method) { $builder->addMethod($method); } $builder->loadProxy(); }
public function merge(ClassMetadata $metadata) { $reflection = $metadata->getReflection(); if (false === $reflection->isInterface()) { throw new \InvalidArgumentException('You can only merge metadata from interfaces.'); } if (false === $this->reflection->implementsInterface($reflection->getName())) { throw new \InvalidArgumentException(sprintf('"%s" does not implement "%s".', $this->reflection->getName(), $reflection->getName())); } foreach ($metadata->getMethods() as $name => $method) { if (!isset($this->methods[$name])) { $this->methods[$name] = new MethodMetadata($this->reflection->getMethod($name)); } $this->methods[$name]->merge($method); } }