Example #1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $goal = $input->getArgument('goal');
     $writer = $this->getProfileWriter($input);
     if (\Tiki_Profile_InstallHandler_Goal::export($writer, $goal)) {
         $writer->save();
     } else {
         $output->writeln("<error>Goal not found: {$goal}</error>");
         return;
     }
 }
Example #2
0
 public static function export($writer)
 {
     $goallib = TikiLib::lib('goal');
     $goals = $goallib->listGoals();
     $ids = [];
     foreach ($goals as $goal) {
         if (Tiki_Profile_InstallHandler_Goal::export($writer, $goal['goalId'])) {
             $ids[] = $goal['goalId'];
         }
     }
     $writer->addObject('goal_set', 'set', array('goals' => $writer->getReference('goal', $ids)));
     return true;
 }