示例#1
0
 public function generate($rows, &$values = array(), $last = array())
 {
     $linkedSourcesData = array();
     # build data from any sources added during the building process
     foreach ($this->getChildren() as $child) {
         if ($child instanceof HasDatasourceInterface) {
             $s = $child->getDatasource();
             $linkedSourcesData[] = $s->fetchOne();
         }
     }
     # send that data to the type if its has implemented the required
     # interface
     if ($this->type instanceof BindDataInterface) {
         $this->type->bindData($linkedSourcesData);
     }
     return $this->type->generate($rows, $values, $last);
 }
示例#2
0
 public function generate($rows, &$values = array(), $last = array())
 {
     $index = $this->selector->generate($rows, $values, $last);
     return $this->children[$index - 1]->generate($rows, $values, $last);
 }