예제 #1
0
 /**
  * 
  * @param integer|string $topicId
  */
 public function actionRemote($topicId)
 {
     $topic = \humanized\scoopit\models\Topic::findOne(!is_numeric($topicId) ? ['name' => $topicId] : $topicId);
     if (NULL === $topic) {
         $this->stdout("No Such Topic \n");
         return 1;
     }
     $queryParams = ['action' => 'delete'];
     $client = new Client();
     foreach ($client->getScoops($topic->id) as $remoteScoop) {
         $queryParams['id'] = $remoteScoop->id;
         $client->post('api/1/post', ['query' => $queryParams]);
     }
 }