/**
  * Return in instance of Board get from the board name.
  *
  * @param string $boardName
  *
  * @return \Trello\Model\Board|null
  */
 public function getBoard(string $boardName)
 {
     $boards = $this->client->api('member')->boards()->all('me');
     foreach ($boards as $board) {
         if ($board['name'] == $boardName) {
             $boardId = $board['id'];
         }
     }
     $manager = new Manager($this->client);
     if (!isset($boardId)) {
         return;
     }
     return $manager->getBoard($boardId);
 }
Exemplo n.º 2
0
 /**
  * Constructor.
  *
  * @param ClientInterface               $client
  * @param EventDispatcherInterface|null $dispatcher
  */
 public function __construct(ClientInterface $client, EventDispatcherInterface $dispatcher = null)
 {
     parent::__construct($client);
     $this->dispatcher = $dispatcher ? $dispatcher : new EventDispatcher();
 }