Skip to content

Commit

Permalink
created fillColumns function, which only fills uuid columns without s…
Browse files Browse the repository at this point in the history
…aving it
  • Loading branch information
waska14 committed Jan 18, 2019
1 parent b8069aa commit 0dbc988
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/Traits/Uuid.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,25 @@ trait UuidTrait
* @return void
*/
public function save(array $options = [])
{
$this->fillColumns($options);
return parent::save($options);
}

/**
* This method get uuid_columns and for each uuid column name
* generates uuid string.
*
* @param string $column_name. Column to set uuid.
*
* @return void
*/
public function fillColumns(array $options = [])
{
foreach ($this->getUuidColumns() as $column_name) {
$this->setUuid($column_name);
}
return parent::save($options);
return true;
}

/**
Expand Down

0 comments on commit 0dbc988

Please sign in to comment.