@@ -174,10 +174,10 @@ |
||
| 174 | 174 | $sContent = ''; |
| 175 | 175 | |
| 176 | 176 | if ($this->getType() === 'text' || $this->getType() === 'password' || $this->getType() === 'file' |
| 177 | - || $this->getType() === 'tel' || $this->getType() === 'url' || $this->getType() === 'email' |
|
| 178 | - || $this->getType() === 'search' || $this->getType() === 'date' || $this->getType() === 'time' |
|
| 179 | - || $this->getType() === 'datetime' || $this->getType() === 'month' || $this->getType() === 'week' |
|
| 180 | - || $this->getType() === 'number' || $this->getType() === 'range' || $this->getType() === 'color') { |
|
| 177 | + || $this->getType() === 'tel' || $this->getType() === 'url' || $this->getType() === 'email' |
|
| 178 | + || $this->getType() === 'search' || $this->getType() === 'date' || $this->getType() === 'time' |
|
| 179 | + || $this->getType() === 'datetime' || $this->getType() === 'month' || $this->getType() === 'week' |
|
| 180 | + || $this->getType() === 'number' || $this->getType() === 'range' || $this->getType() === 'color') { |
|
| 181 | 181 | |
| 182 | 182 | $sContent .= '<label>'.$this->getLabel().'</label> '; |
| 183 | 183 | } |
@@ -73,24 +73,24 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | public function createView() |
| 75 | 75 | { |
| 76 | - $oView = new \stdClass; |
|
| 77 | - $oView->form = $this->_sView; |
|
| 78 | - $oView->form_start = $this->_oForm->getFormInObject()->start; |
|
| 79 | - $oView->form_end = $this->_oForm->getFormInObject()->end; |
|
| 80 | - $oView->form_row = array(); |
|
| 76 | + $oView = new \stdClass; |
|
| 77 | + $oView->form = $this->_sView; |
|
| 78 | + $oView->form_start = $this->_oForm->getFormInObject()->start; |
|
| 79 | + $oView->form_end = $this->_oForm->getFormInObject()->end; |
|
| 80 | + $oView->form_row = array(); |
|
| 81 | 81 | |
| 82 | - foreach ($this->_oForm->getFormInObject()->form as $sKey => $mValue) { |
|
| 82 | + foreach ($this->_oForm->getFormInObject()->form as $sKey => $mValue) { |
|
| 83 | 83 | |
| 84 | - if ($mValue instanceof Container) { |
|
| 84 | + if ($mValue instanceof Container) { |
|
| 85 | 85 | |
| 86 | - $oNewForm = $mValue->createView(); |
|
| 87 | - $oView->form_row[$sKey] = $oNewForm->form_row; |
|
| 88 | - } |
|
| 89 | - else { |
|
| 86 | + $oNewForm = $mValue->createView(); |
|
| 87 | + $oView->form_row[$sKey] = $oNewForm->form_row; |
|
| 88 | + } |
|
| 89 | + else { |
|
| 90 | 90 | |
| 91 | - $oView->form_row[$sKey] = $mValue; |
|
| 92 | - } |
|
| 93 | - } |
|
| 91 | + $oView->form_row[$sKey] = $mValue; |
|
| 92 | + } |
|
| 93 | + } |
|
| 94 | 94 | |
| 95 | 95 | return $oView; |
| 96 | 96 | } |
@@ -117,48 +117,48 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | public function handleRequest(array $aRequest) : bool |
| 119 | 119 | { |
| 120 | - if (!count($_POST)) { return true; } |
|
| 120 | + if (!count($_POST)) { return true; } |
|
| 121 | 121 | |
| 122 | - // Validation |
|
| 123 | - foreach ($this->_oForm->getElement() as $sKey => $sValue) { |
|
| 122 | + // Validation |
|
| 123 | + foreach ($this->_oForm->getElement() as $sKey => $sValue) { |
|
| 124 | 124 | |
| 125 | - if (!$sValue instanceof self && !$this->_validate($sValue)) { |
|
| 125 | + if (!$sValue instanceof self && !$this->_validate($sValue)) { |
|
| 126 | 126 | |
| 127 | - return false; |
|
| 128 | - } |
|
| 129 | - } |
|
| 127 | + return false; |
|
| 128 | + } |
|
| 129 | + } |
|
| 130 | 130 | |
| 131 | - // Save |
|
| 131 | + // Save |
|
| 132 | 132 | if ($this->_oForm->getIdEntity() > 0 && $this->_oForm->getSynchronizeEntity() !== null && count($aRequest) > 0) { |
| 133 | 133 | |
| 134 | - $sModelName = str_replace('Entity', 'Model', $this->_oForm->getSynchronizeEntity()); |
|
| 135 | - $oModel = new $sModelName; |
|
| 134 | + $sModelName = str_replace('Entity', 'Model', $this->_oForm->getSynchronizeEntity()); |
|
| 135 | + $oModel = new $sModelName; |
|
| 136 | 136 | |
| 137 | - $oEntity = new $this->_oForm->getSynchronizeEntity(); |
|
| 138 | - $sPrimaryKey = LibEntity::getPrimaryKeyNameWithoutMapping($oEntity); |
|
| 139 | - $sMethodName = 'set_'.$sPrimaryKey; |
|
| 137 | + $oEntity = new $this->_oForm->getSynchronizeEntity(); |
|
| 138 | + $sPrimaryKey = LibEntity::getPrimaryKeyNameWithoutMapping($oEntity); |
|
| 139 | + $sMethodName = 'set_'.$sPrimaryKey; |
|
| 140 | 140 | |
| 141 | - call_user_func_array(array(&$oEntity, $sMethodName), array($this->_oForm->getIdEntity())); |
|
| 141 | + call_user_func_array(array(&$oEntity, $sMethodName), array($this->_oForm->getIdEntity())); |
|
| 142 | 142 | |
| 143 | - foreach ($this->_oForm->getElement() as $sKey => $sValue) { |
|
| 143 | + foreach ($this->_oForm->getElement() as $sKey => $sValue) { |
|
| 144 | 144 | |
| 145 | - $sMethodName = 'set_'.$sValue->getName().''; |
|
| 146 | - call_user_func_array(array(&$oEntity, $sMethodName), array($aRequest[$sValue->getName()])); |
|
| 147 | - } |
|
| 145 | + $sMethodName = 'set_'.$sValue->getName().''; |
|
| 146 | + call_user_func_array(array(&$oEntity, $sMethodName), array($aRequest[$sValue->getName()])); |
|
| 147 | + } |
|
| 148 | 148 | |
| 149 | - $oEntity->save(); |
|
| 149 | + $oEntity->save(); |
|
| 150 | 150 | } |
| 151 | 151 | else if ($this->_oForm->getSynchronizeEntity() !== null && isset($aRequest) && count($aRequest) > 0) { |
| 152 | 152 | |
| 153 | - $oEntity = new $this->_oForm->_sSynchronizeEntity; |
|
| 153 | + $oEntity = new $this->_oForm->_sSynchronizeEntity; |
|
| 154 | 154 | |
| 155 | - foreach ($this->_oForm->getElement() as $sKey => $sValue) { |
|
| 155 | + foreach ($this->_oForm->getElement() as $sKey => $sValue) { |
|
| 156 | 156 | |
| 157 | - $sMethodName = 'set_'.$sValue->getName().''; |
|
| 158 | - call_user_func_array(array(&$oEntity, $sMethodName), array($aRequest[$sValue->getName()])); |
|
| 159 | - } |
|
| 157 | + $sMethodName = 'set_'.$sValue->getName().''; |
|
| 158 | + call_user_func_array(array(&$oEntity, $sMethodName), array($aRequest[$sValue->getName()])); |
|
| 159 | + } |
|
| 160 | 160 | |
| 161 | - $this->_oForm->setIdEntityCreated($oEntity->save()); |
|
| 161 | + $this->_oForm->setIdEntityCreated($oEntity->save()); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | $this->_bHandleRequestActivate = true; |
@@ -199,13 +199,13 @@ discard block |
||
| 199 | 199 | */ |
| 200 | 200 | public function isSubmitted() : bool |
| 201 | 201 | { |
| 202 | - if (isset($_POST['validform'.$this->_oForm->getFormNumber()]) && $_POST['validform'.$this->_oForm->getFormNumber()] == 1) { |
|
| 202 | + if (isset($_POST['validform'.$this->_oForm->getFormNumber()]) && $_POST['validform'.$this->_oForm->getFormNumber()] == 1) { |
|
| 203 | 203 | |
| 204 | - return true; |
|
| 205 | - } |
|
| 204 | + return true; |
|
| 205 | + } |
|
| 206 | 206 | else { |
| 207 | 207 | |
| 208 | - return false; |
|
| 208 | + return false; |
|
| 209 | 209 | } |
| 210 | 210 | } |
| 211 | 211 | |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | */ |
| 219 | 219 | public function isClicked(string $sElementName) : bool |
| 220 | 220 | { |
| 221 | - if (isset($_POST[$sElementName]) && $_POST[$sElementName]) { return true; } |
|
| 221 | + if (isset($_POST[$sElementName]) && $_POST[$sElementName]) { return true; } |
|
| 222 | 222 | else { return false; } |
| 223 | 223 | } |
| 224 | 224 | |
@@ -231,14 +231,14 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | private function _validate($oElement) : bool |
| 233 | 233 | { |
| 234 | - foreach ($oElement->getConstraint() as $oConstraint) { |
|
| 234 | + foreach ($oElement->getConstraint() as $oConstraint) { |
|
| 235 | 235 | |
| 236 | - if (!$oConstraint->validate($_POST[$oElement->getName()])) { |
|
| 236 | + if (!$oConstraint->validate($_POST[$oElement->getName()])) { |
|
| 237 | 237 | |
| 238 | - return false; |
|
| 239 | - } |
|
| 240 | - } |
|
| 238 | + return false; |
|
| 239 | + } |
|
| 240 | + } |
|
| 241 | 241 | |
| 242 | - return true; |
|
| 242 | + return true; |
|
| 243 | 243 | } |
| 244 | 244 | } |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function set(string $sName, $mValue) : Session |
| 51 | 51 | { |
| 52 | - $_SESSION[$sName] = $mValue; |
|
| 53 | - return $this; |
|
| 52 | + $_SESSION[$sName] = $mValue; |
|
| 53 | + return $this; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * @param string $sName name of the session |
| 85 | 85 | * @param string $sValue value of this sesion var |
| 86 | 86 | * @return \Venus\lib\Session |
| 87 | - */ |
|
| 87 | + */ |
|
| 88 | 88 | public function setFlashBag($sName, $sValue) |
| 89 | 89 | { |
| 90 | 90 | if (!isset($_SESSION['flashbag'])) { $_SESSION['flashbag'] = array(); } |
@@ -109,10 +109,10 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | $aParams = session_get_cookie_params(); |
| 111 | 111 | |
| 112 | - setcookie(session_name(), '', time() - 42000, |
|
| 113 | - $aParams["path"], $aParams["domain"], |
|
| 114 | - $aParams["secure"], $aParams["httponly"] |
|
| 115 | - ); |
|
| 112 | + setcookie(session_name(), '', time() - 42000, |
|
| 113 | + $aParams["path"], $aParams["domain"], |
|
| 114 | + $aParams["secure"], $aParams["httponly"] |
|
| 115 | + ); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | session_destroy(); |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | * the from of mail |
| 40 | 40 | * @access private |
| 41 | 41 | * @var string |
| 42 | - */ |
|
| 42 | + */ |
|
| 43 | 43 | private $_sFrom = "[email protected]"; |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -81,11 +81,11 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public static function setPointInLog(string $sName = 'default') |
| 83 | 83 | { |
| 84 | - $oLogger = Debug::getInstance(); |
|
| 84 | + $oLogger = Debug::getInstance(); |
|
| 85 | 85 | $oLogger->setLogger($oLogger); |
| 86 | 86 | |
| 87 | 87 | $oLogger->getLogger() |
| 88 | - ->log('BENCHMARK: Time at this point '.(microtime(true) - self::$_fStart).' - '.$sName); |
|
| 88 | + ->log('BENCHMARK: Time at this point '.(microtime(true) - self::$_fStart).' - '.$sName); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /** |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | public function setLogger(LoggerInterface $logger) |
| 99 | 99 | { |
| 100 | - if ($this->_oLogger === null) { $this->_oLogger = $logger; } |
|
| 100 | + if ($this->_oLogger === null) { $this->_oLogger = $logger; } |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
@@ -30,13 +30,13 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | class Vendor |
| 32 | 32 | { |
| 33 | - /** |
|
| 34 | - * cache of the vendor available |
|
| 35 | - * |
|
| 36 | - * @access private |
|
| 37 | - * @var array |
|
| 38 | - */ |
|
| 39 | - private static $_aCache = null; |
|
| 33 | + /** |
|
| 34 | + * cache of the vendor available |
|
| 35 | + * |
|
| 36 | + * @access private |
|
| 37 | + * @var array |
|
| 38 | + */ |
|
| 39 | + private static $_aCache = null; |
|
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * constructor - factory |
@@ -54,31 +54,31 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | public static function getVendor(string $sVendorName, $mParam = null, $mParam2 = null) |
| 56 | 56 | { |
| 57 | - if ($sVendorName === 'Apollina\Template') { |
|
| 57 | + if ($sVendorName === 'Apollina\Template') { |
|
| 58 | 58 | |
| 59 | - $oApollina = new $sVendorName($mParam, str_replace('lib', '', __DIR__), |
|
| 60 | - str_replace('bundles'.DIRECTORY_SEPARATOR.'lib', CACHE_DIR, __DIR__), $mParam2); |
|
| 59 | + $oApollina = new $sVendorName($mParam, str_replace('lib', '', __DIR__), |
|
| 60 | + str_replace('bundles'.DIRECTORY_SEPARATOR.'lib', CACHE_DIR, __DIR__), $mParam2); |
|
| 61 | 61 | |
| 62 | - return $oApollina->addFunctionPath(__DIR__.DIRECTORY_SEPARATOR.'Functions', '\Venus\lib\Functions\\'); |
|
| 63 | - } |
|
| 64 | - else if ($sVendorName === 'Attila\Orm') { |
|
| 62 | + return $oApollina->addFunctionPath(__DIR__.DIRECTORY_SEPARATOR.'Functions', '\Venus\lib\Functions\\'); |
|
| 63 | + } |
|
| 64 | + else if ($sVendorName === 'Attila\Orm') { |
|
| 65 | 65 | |
| 66 | - $oDbConfig = Config::get('Db')->configuration; |
|
| 66 | + $oDbConfig = Config::get('Db')->configuration; |
|
| 67 | 67 | |
| 68 | - return new $sVendorName($oDbConfig->db, $oDbConfig->type, $oDbConfig->host, $oDbConfig->user, $oDbConfig->password, |
|
| 69 | - $oDbConfig->db); |
|
| 70 | - } |
|
| 71 | - else if (isset($mParam) && isset($mParam2)) { |
|
| 68 | + return new $sVendorName($oDbConfig->db, $oDbConfig->type, $oDbConfig->host, $oDbConfig->user, $oDbConfig->password, |
|
| 69 | + $oDbConfig->db); |
|
| 70 | + } |
|
| 71 | + else if (isset($mParam) && isset($mParam2)) { |
|
| 72 | 72 | |
| 73 | - return new $sVendorName($mParam, $mParam2); |
|
| 74 | - } |
|
| 75 | - else if (isset($mParam)) { |
|
| 73 | + return new $sVendorName($mParam, $mParam2); |
|
| 74 | + } |
|
| 75 | + else if (isset($mParam)) { |
|
| 76 | 76 | |
| 77 | - return new $sVendorName($mParam); |
|
| 78 | - } |
|
| 79 | - else { |
|
| 77 | + return new $sVendorName($mParam); |
|
| 78 | + } |
|
| 79 | + else { |
|
| 80 | 80 | |
| 81 | - return new $sVendorName; |
|
| 82 | - } |
|
| 81 | + return new $sVendorName; |
|
| 82 | + } |
|
| 83 | 83 | } |
| 84 | 84 | } |
@@ -30,41 +30,41 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | class Type extends Common |
| 32 | 32 | { |
| 33 | - /** |
|
| 34 | - * type |
|
| 35 | - * @var type |
|
| 36 | - */ |
|
| 37 | - private $_sType = ''; |
|
| 33 | + /** |
|
| 34 | + * type |
|
| 35 | + * @var type |
|
| 36 | + */ |
|
| 37 | + private $_sType = ''; |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * constructor |
|
| 41 | - * |
|
| 42 | - * @access public |
|
| 43 | - * @param string $sType type |
|
| 44 | - * @return Type |
|
| 45 | - */ |
|
| 46 | - public function __construct(string $sType) |
|
| 47 | - { |
|
| 48 | - $this->_sType = $sType; |
|
| 49 | - } |
|
| 39 | + /** |
|
| 40 | + * constructor |
|
| 41 | + * |
|
| 42 | + * @access public |
|
| 43 | + * @param string $sType type |
|
| 44 | + * @return Type |
|
| 45 | + */ |
|
| 46 | + public function __construct(string $sType) |
|
| 47 | + { |
|
| 48 | + $this->_sType = $sType; |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - /** |
|
| 52 | - * validate the Type |
|
| 53 | - * |
|
| 54 | - * @access public |
|
| 55 | - * @param string $sValue |
|
| 56 | - * @return bool |
|
| 57 | - */ |
|
| 58 | - public function validate(string $sValue = null) : bool |
|
| 59 | - { |
|
| 60 | - if ($this->_sType == 'DateTime') { |
|
| 51 | + /** |
|
| 52 | + * validate the Type |
|
| 53 | + * |
|
| 54 | + * @access public |
|
| 55 | + * @param string $sValue |
|
| 56 | + * @return bool |
|
| 57 | + */ |
|
| 58 | + public function validate(string $sValue = null) : bool |
|
| 59 | + { |
|
| 60 | + if ($this->_sType == 'DateTime') { |
|
| 61 | 61 | |
| 62 | - if (preg_match('#^[0-9]{4}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}#', $sValue)) { |
|
| 62 | + if (preg_match('#^[0-9]{4}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}#', $sValue)) { |
|
| 63 | 63 | |
| 64 | - return true; |
|
| 65 | - } |
|
| 66 | - } |
|
| 64 | + return true; |
|
| 65 | + } |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - return false; |
|
| 69 | - } |
|
| 68 | + return false; |
|
| 69 | + } |
|
| 70 | 70 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | } |
| 60 | 60 | else if (isset($this->_aDependencyInjectorContener[md5($sNameOfDi)])) { |
| 61 | 61 | |
| 62 | - return $this->_aDependencyInjectorContener[md5($sNameOfDi)]; |
|
| 62 | + return $this->_aDependencyInjectorContener[md5($sNameOfDi)]; |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | return false; |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function set(string $sNameOfDi, callable $cFunction, bool $bShared = false) : Di |
| 78 | 78 | { |
| 79 | - if ($bShared === true) { self::$_aSharedDependencyInjectorContener[md5($sNameOfDi)] = $cFunction; } |
|
| 80 | - else { $this->_aDependencyInjectorContener[md5($sNameOfDi)] = $cFunction; } |
|
| 79 | + if ($bShared === true) { self::$_aSharedDependencyInjectorContener[md5($sNameOfDi)] = $cFunction; } |
|
| 80 | + else { $this->_aDependencyInjectorContener[md5($sNameOfDi)] = $cFunction; } |
|
| 81 | 81 | return $this; |
| 82 | 82 | } |
| 83 | 83 | } |
@@ -141,14 +141,14 @@ discard block |
||
| 141 | 141 | */ |
| 142 | 142 | public function add($sName, $mType, $sLabel = null, $mValue = null, $mOptions = null) |
| 143 | 143 | { |
| 144 | - if ($mType instanceof Container) { |
|
| 144 | + if ($mType instanceof Container) { |
|
| 145 | 145 | |
| 146 | - $this->_aElement[$sName] = $mType; |
|
| 147 | - } |
|
| 146 | + $this->_aElement[$sName] = $mType; |
|
| 147 | + } |
|
| 148 | 148 | else if ($mType === 'text' || $mType === 'submit' || $mType === 'password' || $mType === 'file' || $mType === 'tel' |
| 149 | - || $mType === 'url' || $mType === 'email' || $mType === 'search' || $mType === 'date' || $mType === 'time' |
|
| 150 | - || $mType === 'datetime' || $mType === 'month' || $mType === 'week' || $mType === 'number' || $mType === 'range' |
|
| 151 | - || $mType === 'color') { |
|
| 149 | + || $mType === 'url' || $mType === 'email' || $mType === 'search' || $mType === 'date' || $mType === 'time' |
|
| 150 | + || $mType === 'datetime' || $mType === 'month' || $mType === 'week' || $mType === 'number' || $mType === 'range' |
|
| 151 | + || $mType === 'color') { |
|
| 152 | 152 | |
| 153 | 153 | $this->_aElement[$sName] = new Input($sName, $mType, $sLabel, $mValue); |
| 154 | 154 | } |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | |
| 295 | 295 | $oContainer = new Container; |
| 296 | 296 | $oContainer->setView($sFormContent) |
| 297 | - ->setForm($this); |
|
| 297 | + ->setForm($this); |
|
| 298 | 298 | |
| 299 | 299 | return $oContainer; |
| 300 | 300 | } |
@@ -308,67 +308,67 @@ discard block |
||
| 308 | 308 | */ |
| 309 | 309 | public function getFormInObject() |
| 310 | 310 | { |
| 311 | - if ($this->_iIdEntity > 0 && $this->_sSynchronizeEntity !== null && count($_POST) < 1) { |
|
| 311 | + if ($this->_iIdEntity > 0 && $this->_sSynchronizeEntity !== null && count($_POST) < 1) { |
|
| 312 | 312 | |
| 313 | - $sModelName = str_replace('Entity', 'Model', $this->_sSynchronizeEntity); |
|
| 314 | - $oModel = new $sModelName; |
|
| 313 | + $sModelName = str_replace('Entity', 'Model', $this->_sSynchronizeEntity); |
|
| 314 | + $oModel = new $sModelName; |
|
| 315 | 315 | |
| 316 | - $oEntity = new $this->_sSynchronizeEntity; |
|
| 317 | - $sPrimaryKey = LibEntity::getPrimaryKeyNameWithoutMapping($oEntity); |
|
| 318 | - $sMethodName = 'findOneBy'.$sPrimaryKey; |
|
| 319 | - $oCompleteEntity = call_user_func_array(array(&$oModel, $sMethodName), array($this->_iIdEntity)); |
|
| 316 | + $oEntity = new $this->_sSynchronizeEntity; |
|
| 317 | + $sPrimaryKey = LibEntity::getPrimaryKeyNameWithoutMapping($oEntity); |
|
| 318 | + $sMethodName = 'findOneBy'.$sPrimaryKey; |
|
| 319 | + $oCompleteEntity = call_user_func_array(array(&$oModel, $sMethodName), array($this->_iIdEntity)); |
|
| 320 | 320 | |
| 321 | - if (is_object($oCompleteEntity)) { |
|
| 321 | + if (is_object($oCompleteEntity)) { |
|
| 322 | 322 | |
| 323 | - foreach ($this->_aElement as $sKey => $sValue) { |
|
| 323 | + foreach ($this->_aElement as $sKey => $sValue) { |
|
| 324 | 324 | |
| 325 | - if ($sValue instanceof \Venus\lib\Form\Radio) { |
|
| 325 | + if ($sValue instanceof \Venus\lib\Form\Radio) { |
|
| 326 | 326 | |
| 327 | - $sExKey = $sKey; |
|
| 328 | - $sKey = substr($sKey, 0, -6); |
|
| 329 | - } |
|
| 327 | + $sExKey = $sKey; |
|
| 328 | + $sKey = substr($sKey, 0, -6); |
|
| 329 | + } |
|
| 330 | 330 | |
| 331 | - if ($sValue instanceof Form) { |
|
| 331 | + if ($sValue instanceof Form) { |
|
| 332 | 332 | |
| 333 | - ; |
|
| 334 | - } |
|
| 335 | - else { |
|
| 333 | + ; |
|
| 334 | + } |
|
| 335 | + else { |
|
| 336 | 336 | |
| 337 | - $sMethodNameInEntity = 'get_'.$sKey; |
|
| 338 | - $mValue = $oCompleteEntity->$sMethodNameInEntity(); |
|
| 337 | + $sMethodNameInEntity = 'get_'.$sKey; |
|
| 338 | + $mValue = $oCompleteEntity->$sMethodNameInEntity(); |
|
| 339 | 339 | |
| 340 | - if ($sValue instanceof \Venus\lib\Form\Radio && method_exists($this->_aElement[$sExKey], 'setValueChecked')) { |
|
| 340 | + if ($sValue instanceof \Venus\lib\Form\Radio && method_exists($this->_aElement[$sExKey], 'setValueChecked')) { |
|
| 341 | 341 | |
| 342 | - $this->_aElement[$sExKey]->setValueChecked($mValue); |
|
| 343 | - } |
|
| 344 | - else if (isset($mValue) && method_exists($this->_aElement[$sKey], 'setValue')) { |
|
| 342 | + $this->_aElement[$sExKey]->setValueChecked($mValue); |
|
| 343 | + } |
|
| 344 | + else if (isset($mValue) && method_exists($this->_aElement[$sKey], 'setValue')) { |
|
| 345 | 345 | |
| 346 | - $this->_aElement[$sKey]->setValue($mValue); |
|
| 347 | - } |
|
| 348 | - } |
|
| 349 | - } |
|
| 350 | - } |
|
| 351 | - } |
|
| 346 | + $this->_aElement[$sKey]->setValue($mValue); |
|
| 347 | + } |
|
| 348 | + } |
|
| 349 | + } |
|
| 350 | + } |
|
| 351 | + } |
|
| 352 | 352 | |
| 353 | - $oForm = new \StdClass(); |
|
| 354 | - $oForm->start = '<form name="form'.$this->_iFormNumber.'" method="post"><input type="hidden" value="1" name="validform'.$this->_iFormNumber.'">'; |
|
| 355 | - $oForm->form = array(); |
|
| 353 | + $oForm = new \StdClass(); |
|
| 354 | + $oForm->start = '<form name="form'.$this->_iFormNumber.'" method="post"><input type="hidden" value="1" name="validform'.$this->_iFormNumber.'">'; |
|
| 355 | + $oForm->form = array(); |
|
| 356 | 356 | |
| 357 | - foreach ($this->_aElement as $sKey => $sValue) { |
|
| 357 | + foreach ($this->_aElement as $sKey => $sValue) { |
|
| 358 | 358 | |
| 359 | - if ($sValue instanceof Container) { |
|
| 359 | + if ($sValue instanceof Container) { |
|
| 360 | 360 | |
| 361 | - $oForm->form[$sKey] = $sValue; |
|
| 362 | - } |
|
| 363 | - else { |
|
| 361 | + $oForm->form[$sKey] = $sValue; |
|
| 362 | + } |
|
| 363 | + else { |
|
| 364 | 364 | |
| 365 | - $oForm->form[$sKey] = $sValue->fetch(); |
|
| 366 | - } |
|
| 367 | - } |
|
| 365 | + $oForm->form[$sKey] = $sValue->fetch(); |
|
| 366 | + } |
|
| 367 | + } |
|
| 368 | 368 | |
| 369 | - $oForm->end = '</form>'; |
|
| 369 | + $oForm->end = '</form>'; |
|
| 370 | 370 | |
| 371 | - return $oForm; |
|
| 371 | + return $oForm; |
|
| 372 | 372 | } |
| 373 | 373 | |
| 374 | 374 | /** |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | */ |
| 450 | 450 | public function getElement() { |
| 451 | 451 | |
| 452 | - return $this->_aElement; |
|
| 452 | + return $this->_aElement; |
|
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | /** |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | */ |
| 461 | 461 | public function getIdEntity() { |
| 462 | 462 | |
| 463 | - return $this->_iIdEntity; |
|
| 463 | + return $this->_iIdEntity; |
|
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | /** |
@@ -471,6 +471,6 @@ discard block |
||
| 471 | 471 | */ |
| 472 | 472 | public function getSynchronizeEntity() { |
| 473 | 473 | |
| 474 | - return $this->_sSynchronizeEntity; |
|
| 474 | + return $this->_sSynchronizeEntity; |
|
| 475 | 475 | } |
| 476 | 476 | } |