-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
547 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
====================== | ||
|
||
### Set label | ||
```php | ||
setLabel(\Trello\Model\LabelInterface $label) | ||
``` | ||
|
||
### Get label | ||
```php | ||
getLabel() | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
====================== | ||
|
||
### Get id | ||
```php | ||
getId() | ||
``` | ||
|
||
### Set name | ||
```php | ||
setName($name) | ||
``` | ||
|
||
### Get name | ||
```php | ||
getName() | ||
``` | ||
|
||
### Set color | ||
```php | ||
setColor($color) | ||
``` | ||
|
||
### Get color | ||
```php | ||
getColor() | ||
``` | ||
|
||
### Set boardId | ||
```php | ||
setBoardId($boardId) | ||
``` | ||
|
||
### Get boardId | ||
```php | ||
getBoardId() | ||
``` | ||
|
||
### Set board | ||
```php | ||
setBoard(\Trello\Model\BoardInterface $board) | ||
``` | ||
|
||
### Get board | ||
```php | ||
getBoard() | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
====================== | ||
|
||
### Get id | ||
```php | ||
getId() | ||
``` | ||
|
||
### Set name | ||
```php | ||
setName($name) | ||
``` | ||
|
||
### Get name | ||
```php | ||
getName() | ||
``` | ||
|
||
### Set color | ||
```php | ||
setColor($color) | ||
``` | ||
|
||
### Get color | ||
```php | ||
getColor() | ||
``` | ||
|
||
### Set boardId | ||
```php | ||
setBoardId($boardId) | ||
``` | ||
|
||
### Get boardId | ||
```php | ||
getBoardId() | ||
``` | ||
|
||
### Set board | ||
```php | ||
setBoard(\Trello\Model\BoardInterface $board) | ||
``` | ||
|
||
### Get board | ||
```php | ||
getBoard() | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
<?php | ||
|
||
namespace Trello\Api; | ||
|
||
use Trello\Exception\InvalidArgumentException; | ||
|
||
class Label extends AbstractApi | ||
{ | ||
/** | ||
* Base path of labels api | ||
* @var string | ||
*/ | ||
protected $path = 'labels'; | ||
|
||
|
||
public static $fields = array( | ||
'idBoard', | ||
'name', | ||
'color', | ||
); | ||
|
||
/** | ||
* Find a label by id | ||
* @link https://developers.trello.com/reference/#id | ||
* | ||
* @param string $id the label's id | ||
* @param array $params optional attributes | ||
* | ||
* @return array label info | ||
*/ | ||
public function show($id, array $params = array()) | ||
{ | ||
return $this->get($this->getPath().'/'.rawurlencode($id), $params); | ||
} | ||
|
||
/** | ||
* Create a label | ||
* @link https://developers.trello.com/reference/#id-1 | ||
* | ||
* @param array $params optional attributes | ||
* | ||
* @return array label info | ||
*/ | ||
public function create(array $params = array()) | ||
{ | ||
$this->validateRequiredParameters(array('name', 'idBoard', 'color'), $params); | ||
|
||
return $this->post('boards/'.rawurlencode($params['idBoard']).'/labels/', $params); | ||
} | ||
|
||
/** | ||
* Update a label | ||
* @link https://developers.trello.com/reference/#id-1 | ||
* | ||
* @param string $id the label's id | ||
* @param array $params label attributes to update | ||
* | ||
* @return array label info | ||
*/ | ||
public function update($id, array $params = array()) | ||
{ | ||
return $this->put($this->getPath().'/'.rawurlencode($id).'/labels/', $params); | ||
} | ||
|
||
/** | ||
* Set a given label's board | ||
* @link https://developers.trello.com/reference/#id-1 | ||
* | ||
* @param string $id the label's id | ||
* @param string $boardId the board's id | ||
* | ||
* @return array board info | ||
*/ | ||
public function setBoard($id, $boardId) | ||
{ | ||
return $this->put($this->getPath().'/'.rawurlencode($id).'/idBoard', array('value' => $boardId)); | ||
} | ||
|
||
/** | ||
* Get a given label's board | ||
* @link https://developers.trello.com/reference/#id | ||
* | ||
* @param string $id the label's id | ||
* @param array $params optional parameters | ||
* | ||
* @return array board info | ||
*/ | ||
public function getBoard($id, array $params = array()) | ||
{ | ||
return $this->get($this->getPath().'/'.rawurlencode($id).'/board', $params); | ||
} | ||
|
||
/** | ||
* Get the field of a board of a given label | ||
* @link https://developers.trello.com/reference/#id | ||
* | ||
* @param string $id the label's id | ||
* @param array $field the name of the field | ||
* | ||
* @return array | ||
* | ||
* @throws InvalidArgumentException if the field does not exist | ||
*/ | ||
public function getBoardField($id, $field) | ||
{ | ||
$this->validateAllowedParameters(Board::$fields, $field, 'field'); | ||
|
||
return $this->get($this->getPath().'/'.rawurlencode($id).'/board/'.rawurlencode($field)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Trello\Event; | ||
|
||
use Trello\Model\LabelInterface; | ||
|
||
class CardChecklistEvent extends CardEvent | ||
{ | ||
/** | ||
* @var LabelInterface | ||
*/ | ||
protected $checklist; | ||
|
||
/** | ||
* Set label | ||
* | ||
* @param LabelInterface $label | ||
*/ | ||
public function setLabel(LabelInterface $label) | ||
{ | ||
$this->label = $label; | ||
} | ||
|
||
/** | ||
* Get label | ||
* | ||
* @return LabelInterface | ||
*/ | ||
public function getLabel() | ||
{ | ||
return $this->label; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.