Programming Language PHP
Namespace Oro\Component\PhpUtils
Class ClassGenerator
Method/Function addImplement
Total Examples 2
2 code examples of PHP Oro\Component\PhpUtils\ClassGenerator::addImplement extracted from open source projects
public function generate(array $schema, ClassGenerator $class): void
{
if (!empty($schema['inherit'])) {
$class->addExtend($schema['inherit']);
} elseif ('Custom' === $schema['type']) {
// generate 'id' property and '__toString' method only for Custom entity without inheritance
$class->addProperty('id')->setProtected();
$class->addMethod('getId')->addBody('return $this->id;');
$this->generateToStringMethod($schema, $class);
}
$this->generateConstructor($schema, $class);
$class->addImplement(ExtendEntityInterface::class);
$this->generateProperties('property', $schema, $class);
$this->generateProperties('relation', $schema, $class);
$this->generateProperties('default', $schema, $class);
$this->generateCollectionMethods($schema, $class);
}
public function generate(array $schema, ClassGenerator $class): void
{
$class->addImplement(ActivityInterface::class);
parent::generate($schema, $class);
}