Skip to content

Commit

Permalink
adding clone
Browse files Browse the repository at this point in the history
  • Loading branch information
swaros committed Sep 14, 2017
1 parent de7913b commit 38b1c18
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Types/Props.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,13 @@ public function assignValue($propNameOrig, $propValue) {
$this->$propName = $propValue;
}
}

public function __clone () {
foreach ($this as $name => &$var) {
if (is_object( $var )) {
$var = clone $var;
}
}
}

}
8 changes: 8 additions & 0 deletions src/Types/PropsFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ private function getKey($key = NULL){

}

/**
* gets the current primary key
* @return string the primary key
*/
public function getPrimaryKey(){
return $this->__keyName;
}

/**
* ovewrite parent becasue of catching all
* props
Expand Down

0 comments on commit 38b1c18

Please sign in to comment.