/** * * @param type $lastUpdate * @return int */ public function actionIndex($lastUpdate) { $client = new Client(); $topics = $client->getTopics(TRUE); foreach ($topics as $topic) { $this->actionSync($topic['id'], $lastUpdate); } return 0; }
public function actionIndex($publish = 0) { if ($publish != 1 && $publish != 0) { throw new \InvalidArgumentException('provided publish parameter must be either 0 or 1'); } /** * GuzzleHttp\Client; */ $client = new Client(); $topics = $client->getTopics(TRUE); $this->stdout('found ' . count($topics) . ' topics' . "\n"); foreach ($topics as $topic) { $this->_syncTopic($topic, $publish); $this->actionKeywords($topic['id']); } }