@@ 115-134 (lines=20) @@ | ||
112 | } |
|
113 | ||
114 | break; |
|
115 | case 'list': |
|
116 | if (!isset($options['organization'])) { |
|
117 | $options['organization'] = $this->config->get('trello.organization'); |
|
118 | } |
|
119 | if (!isset($options['board'])) { |
|
120 | $options['board'] = $this->config->get('trello.board'); |
|
121 | } |
|
122 | ||
123 | $boardId = $this->getObjectId('board', $options['board'], ['organization' => $options['organization']]); |
|
124 | if (!isset($this->cache['lists'][$boardId])) { |
|
125 | $this->cache['lists'][$boardId] = $this->api('board')->lists()->all($boardId); |
|
126 | } |
|
127 | ||
128 | foreach ($this->cache['lists'][$boardId] as $item) { |
|
129 | if ($name == $item['name']) { |
|
130 | return $item['id']; |
|
131 | } |
|
132 | } |
|
133 | ||
134 | break; |
|
135 | case 'label': |
|
136 | if (!isset($options['organization'])) { |
|
137 | $options['organization'] = $this->config->get('trello.organization'); |
|
@@ 135-154 (lines=20) @@ | ||
132 | } |
|
133 | ||
134 | break; |
|
135 | case 'label': |
|
136 | if (!isset($options['organization'])) { |
|
137 | $options['organization'] = $this->config->get('trello.organization'); |
|
138 | } |
|
139 | if (!isset($options['board'])) { |
|
140 | $options['board'] = $this->config->get('trello.board'); |
|
141 | } |
|
142 | ||
143 | $boardId = $this->getObjectId('board', $options['board'], ['organization' => $options['organization']]); |
|
144 | if (!isset($this->cache['labels'][$boardId])) { |
|
145 | $this->cache['labels'][$boardId] = $this->api('board')->labels()->all($boardId); |
|
146 | } |
|
147 | ||
148 | foreach ($this->cache['labels'][$boardId] as $item) { |
|
149 | if ($name == $item['name']) { |
|
150 | return $item['id']; |
|
151 | } |
|
152 | } |
|
153 | ||
154 | break; |
|
155 | } |
|
156 | ||
157 | return false; |