コード例 #1
0
 function attachMethodsToModelDescriptor(ModelDescriptor $descriptor)
 {
     $alias = $this->name;
     $attachedMethod = new AttachedMethod($this, 'select', $alias);
     $descriptor->addAttachedMethod($alias, $attachedMethod);
     $alias = 'set' . ucfirst($this->name);
     $attachedMethod = new AttachedMethod($this, 'set', $alias);
     $descriptor->addAttachedMethod($alias, $attachedMethod);
     $alias = 'unset' . ucfirst($this->name);
     $attachedMethod = new AttachedMethod($this, 'remove', $alias);
     $descriptor->addAttachedMethod($alias, $attachedMethod);
 }
コード例 #2
0
 function attachMethodsToModelDescriptor(ModelDescriptor &$descriptor)
 {
     $alias = $this->name;
     $attachedMethod = new AttachedMethod($this, 'selectModel', $alias);
     $descriptor->addAttachedMethod($alias, $attachedMethod);
     $alias = 'addTo' . ucfirst($this->name);
     $attachedMethod = new AttachedMethod($this, 'addTo', $alias);
     $descriptor->addAttachedMethod($alias, $attachedMethod);
     $alias = 'removeFrom' . ucfirst($this->name);
     $attachedMethod = new AttachedMethod($this, 'removeFrom', $alias);
     $descriptor->addAttachedMethod($alias, $attachedMethod);
 }