Skip to content

Commit

Permalink
Prefixable tel (#10)
Browse files Browse the repository at this point in the history
* make tel prefixable

* make tel prefixable
  • Loading branch information
lifeofguenter authored Feb 20, 2018
1 parent ed6c9de commit 5acf602
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/Transformer/Transformers/Tel.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,19 @@

class Tel extends Transformer
{
protected $prefix = '';

public function transform(array $columns_n, array $values, $column)
{
return $this->replaceValue($values[$column], sprintf('999%d', rand(1000000000, 9999999999)));
return $this->replaceValue($values[$column], sprintf('%s999%d', $this->prefix, rand(1000000000, 9999999999)));
}

public function setParam($param)
{
$this->param = $param;

if (!empty($param)) {
$this->prefix = $param;
}
}
}

0 comments on commit 5acf602

Please sign in to comment.