Skip to content

Commit

Permalink
Доработки
Browse files Browse the repository at this point in the history
  • Loading branch information
mzhelskiy committed Sep 30, 2016
1 parent 188e358 commit b32d3f4
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 1 deletion.
File renamed without changes.
15 changes: 15 additions & 0 deletions classes/engine/Entity.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,18 @@ public function _getValidateRules()
return $this->aValidateRules;
}

/**
* Хук, срабатывает перед валидацией сущности
*
* @return bool
*/
protected function beforeValidate()
{
$bResult = true;
$this->RunBehaviorHook('before_validate', array('bResult' => &$bResult));
return $bResult;
}

/**
* Выполняет валидацию данных сущности
* Если $aFields=null, то выполняется валидация по всем полям из $this->aValidateRules, иначе по пересечению
Expand All @@ -280,6 +292,9 @@ public function _getValidateRules()
*/
public function _Validate($aFields = null, $bClearErrors = true)
{
if (!$this->beforeValidate()) {
return false;
}
if ($bClearErrors) {
$this->_clearValidateErrors();
}
Expand Down
2 changes: 1 addition & 1 deletion classes/modules/database/Database.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function GetConnect($aConfig = null, $bForce = false)
* Устанавливаем настройки соединения, по хорошему этого здесь не должно быть :)
* считайте это костылём
*/
$oDbSimple->query("set character_set_client='utf8', character_set_results='utf8', collation_connection='utf8_bin' ");
$oDbSimple->query("set character_set_client='utf8', character_set_results='utf8', collation_connection='utf8_bin', sql_mode='' ");
/**
* Сохраняем коннект
*/
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions utilities/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Order Deny,Allow
Deny from all

0 comments on commit b32d3f4

Please sign in to comment.