Pezzotton

Signed-off-by: Riccardo Di Dato <r.didato@asdynamics.it>
This commit is contained in:
Riccardo Di Dato
2017-08-18 16:40:43 +02:00
parent a52f4a5238
commit a0009108e8
2 changed files with 4 additions and 0 deletions
@@ -96,6 +96,7 @@ abstract class DaoSaveableDefaultImplementation implements DaoSaveable, Serializ
*/
public function updateFromSaveableObj($saveableObject){
$this->saveableObject = $this->toObject($saveableObject);
if (!property_exists($this->saveableObject, "deleted")){
$this->saveableObject->deleted = false;
}
+3
View File
@@ -164,6 +164,9 @@ class GenericDao{
$bulk = new MongoDB\Driver\BulkWrite();
if ( array_key_exists("_id", $saveObj) && !is_null($saveObj["_id"]) ){
if (is_string( $saveObj["_id"]) ){
$saveObj["_id"] = new MongoDB\BSON\ObjectID($saveObj["_id"]);
}
$bulk->update(array("_id"=>$saveObj["_id"] ),$saveObj);
}
else {