Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- interface NameInterface
- {
- public function getName();
- }
- abstract class ValueObject implements NameInterface
- {
- protected $name;
- public function getName()
- {
- return $this->name;
- }
- }
- class Concrete extends ValueObject
- {
- public function setValue($value)
- {
- $this->name = $value;
- return $this;
- }
- }
- $c = (new Concrete())->setValue('test name');
- echo $c->getName();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement