예제 #1
0
 public function synchronizeBoardCards(Board $board)
 {
     $json = $this->send($this->http->createRequest('GET', 'boards/' . $board->getId() . '/cards', array('debug' => true)));
     $cards = array();
     foreach ($json as $card) {
         $card->board = $board;
         $event = new CardReceivedEvent($card);
         $event->setFqn('Webforge\\Trello\\Entities\\Card');
         $event->setName(Events::CARD_RECEIVED);
         $this->dispatcher->dispatch($event->getName(), $event);
         $cards[] = $event->getEntity();
     }
     return $cards;
 }
예제 #2
0
 /**
  * @param Webforge\Trello\Entities\Board $board
  */
 public function setBoard(Board $board)
 {
     if (isset($this->board) && $this->board !== $board) {
         $this->board->removeCard($this);
     }
     $this->board = $board;
     $board->addCard($this);
     return $this;
 }