Skip to content

Commit

Permalink
fix the bug. ColumnDTOCollection getPrimaryKey empty
Browse files Browse the repository at this point in the history
  • Loading branch information
telanflow committed Nov 5, 2019
1 parent ca4f1a9 commit 182d0bd
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/DTO/ColumnDTOCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ class ColumnDTOCollection extends Collection
*/
private $primaryKey = '';

public function __construct($items = [])
/**
* @return string
*/
public function getPrimaryKey(): string
{
parent::__construct($items);
if (!empty($this->primaryKey)) {
return $this->primaryKey;
}

if(!empty($this->items) && is_array($this->items))
{
Expand All @@ -26,13 +31,7 @@ public function __construct($items = [])
}
}
}
}

/**
* @return string
*/
public function getPrimaryKey(): string
{
return $this->primaryKey;
}

Expand Down

0 comments on commit 182d0bd

Please sign in to comment.