Exemple #1
0
 /**
  * Return a TemplatesArray of Templates using this field
  *
  * @return TemplatesArray
  *
  */
 public function getTemplates()
 {
     $templates = new TemplatesArray();
     $fieldgroups = $this->getFieldgroups();
     foreach ($this->templates as $template) {
         foreach ($fieldgroups as $fieldgroup) {
             if ($template->fieldgroups_id == $fieldgroup->id) {
                 $templates->add($template);
                 break;
             }
         }
     }
     return $templates;
 }
Exemple #2
0
 /**
  * Given a Fieldgroup, return a TemplatesArray of all templates using the Fieldgroup
  *
  * @param Fieldgroup $fieldgroup
  * @return TemplatesArray
  *
  */
 public function getTemplates(Fieldgroup $fieldgroup)
 {
     $templates = new TemplatesArray();
     $cnt = 0;
     foreach ($this->fuel('templates') as $tpl) {
         if ($tpl->fieldgroup->id == $fieldgroup->id) {
             $templates->add($tpl);
         }
     }
     return $templates;
 }