Files
fdn2/private/lib/dao/DaoSaveableDefaultImplementation.php
T

50 lines
988 B
PHP

<?php
/*
Author: Riccardo Di Dato
Creation Date: 23/dic/2015
*/
class DaoSaveableDefaultImplementation implements DaoSaveable {
private $collectionName;
private $saveableObject;
public function __construct($collectionName, $saveableObject){
$this->collectionName = $collectionName;
$this->saveableObject = $saveableObject;
}
/**
* (non-PHPdoc)
* @see DaoSaveable::getSaveableObj()
*/
public function getSaveableObj(){
return $this->saveableObject;
}
/**
* (non-PHPdoc)
* @see DaoSaveable::getCollectionName()
*/
public function getCollectionName(){
return $this->collectionName;
}
/**
* (non-PHPdoc)
* @see DaoSaveable::buildFromSaveableObj()
*/
public function buildFromSaveableObj($collectionName, $saveableObject){
return new static($collectionName, $saveableObject);
}
/**
* (non-PHPdoc)
* @see DaoSaveable::updateFromSaveableObj()
*/
public function updateFromSaveableObj($obj){
$this->saveableObject = $obj;
}
}
?>