|
@@ 298-311 (lines=14) @@
|
| 295 |
|
* @param ZohoBeanInterface $zohoBean |
| 296 |
|
* @param array $row |
| 297 |
|
*/ |
| 298 |
|
private function insertDataZohoBean(AbstractZohoDao $dao, ZohoBeanInterface $zohoBean, array $row) |
| 299 |
|
{ |
| 300 |
|
foreach ($row as $columnName => $columnValue) { |
| 301 |
|
$fieldMethod = $dao->getFieldFromFieldName($columnName); |
| 302 |
|
if (!in_array($columnName, EntitiesGeneratorService::$defaultDateFields) && $fieldMethod |
| 303 |
|
&& (!in_array($columnName, ['id', 'uid'])) && !is_null($columnValue) |
| 304 |
|
) { |
| 305 |
|
$type = $fieldMethod->getType(); |
| 306 |
|
$value = $this->formatValueToBeans($type, $columnValue); |
| 307 |
|
$setterMethod = $fieldMethod->getSetter(); |
| 308 |
|
$zohoBean->{$setterMethod}($value); |
| 309 |
|
} |
| 310 |
|
} |
| 311 |
|
} |
| 312 |
|
|
| 313 |
|
/** |
| 314 |
|
* Insert data to bean in order to update zoho records. |
|
@@ 321-332 (lines=12) @@
|
| 318 |
|
* @param type $columnName |
| 319 |
|
* @param type $valueDb |
| 320 |
|
*/ |
| 321 |
|
private function updateDataZohoBean(AbstractZohoDao $dao, ZohoBeanInterface $zohoBean, $columnName, $valueDb) |
| 322 |
|
{ |
| 323 |
|
$fieldMethod = $dao->getFieldFromFieldName($columnName); |
| 324 |
|
if (!in_array($columnName, EntitiesGeneratorService::$defaultDateFields) && $fieldMethod |
| 325 |
|
&& !in_array($columnName, ['id', 'uid']) |
| 326 |
|
) { |
| 327 |
|
$type = $fieldMethod->getType(); |
| 328 |
|
$value = is_null($valueDb) ? $valueDb : $this->formatValueToBeans($type, $valueDb); |
| 329 |
|
$setterMethod = $fieldMethod->getSetter(); |
| 330 |
|
$zohoBean->{$setterMethod}($value); |
| 331 |
|
} |
| 332 |
|
} |
| 333 |
|
|
| 334 |
|
/** |
| 335 |
|
* Change the value to the good format. |