Skip to content

Commit

Permalink
Remove id property from Note modal. Fixes #87
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Humphrey committed May 6, 2015
1 parent 3372a41 commit f64c774
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/Gitlab/Model/Note.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
/**
* Class Note
*
* @property-read int $id
* @property-read User $author
* @property-read string $body
* @property-read string $created_at
Expand All @@ -20,7 +19,6 @@ class Note extends AbstractModel
* @var array
*/
protected static $properties = array(
'id',
'author',
'body',
'created_at',
Expand All @@ -38,7 +36,7 @@ class Note extends AbstractModel
*/
public static function fromArray(Client $client, Noteable $type, array $data)
{
$comment = new static($type, $data['id'], $client);
$comment = new static($type, $client);

if (isset($data['author'])) {
$data['author'] = User::fromArray($client, $data['author']);
Expand All @@ -49,14 +47,12 @@ public static function fromArray(Client $client, Noteable $type, array $data)

/**
* @param Noteable $type
* @param int $id
* @param Client $client
*/
public function __construct(Noteable $type, $id = null, Client $client = null)
public function __construct(Noteable $type, Client $client = null)
{
$this->setClient($client);
$this->setData('parent_type', get_class($type));
$this->setData('parent', $type);
$this->setData('id', $id);
}
}

0 comments on commit f64c774

Please sign in to comment.