コード例 #1
0
 public function __construct($id = '')
 {
     $this->setPrivateProp('shouldBePrivate');
     $this->setReadOnlyProp('shouldBeReadOnly');
     $this->shouldBePrivate = 'default';
     $this->shouldBeReadOnly = 'default';
     parent::__construct($id);
 }
コード例 #2
0
 public function __construct($id = '')
 {
     $this->id = new Id();
     $this->projectsProperties = new MapOf(function ($data) {
         return new ProjectProperties();
     });
     $this->projectUserProfiles = new MapOf(function ($data) {
         return new SfchecksUserProfile();
     });
     parent::__construct($id);
 }
コード例 #3
0
 public function __construct($id = '')
 {
     $this->fruitsMap = new MapOf(function ($data) {
         if (array_key_exists('numOfSlices', $data)) {
             return new Apple();
         } elseif (array_key_exists('peelThickness', $data)) {
             return new Orange();
         } else {
             return new Fruit();
         }
     });
     $this->fruitsArray = new ArrayOf(function ($data) {
         if (array_key_exists('numOfSlices', $data)) {
             return new Apple();
         } elseif (array_key_exists('peelThickness', $data)) {
             return new Orange();
         } else {
             return new Fruit();
         }
     });
     parent::__construct($id);
 }