SQL strict mode fixes. Closes #127

This commit is contained in:
Dan Cryer 2013-10-08 07:45:20 +01:00
commit cc09d95a3d
7 changed files with 145 additions and 32 deletions

View file

@ -70,22 +70,27 @@ class UserBase extends Model
'length' => '11',
'primary_key' => true,
'auto_increment' => true,
'default' => null,
),
'email' => array(
'type' => 'varchar',
'length' => '250',
'default' => '',
),
'hash' => array(
'type' => 'varchar',
'length' => '250',
'default' => '',
),
'is_admin' => array(
'type' => 'tinyint',
'length' => '1',
'default' => '0',
),
'name' => array(
'type' => 'varchar',
'length' => '250',
'default' => '',
),
);
@ -179,7 +184,7 @@ class UserBase extends Model
{
$this->_validateNotNull('Id', $value);
$this->_validateInt('Id', $value);
if ($this->data['id'] == $value) {
if ($this->data['id'] === $value) {
return;
}
@ -198,7 +203,7 @@ class UserBase extends Model
{
$this->_validateNotNull('Email', $value);
$this->_validateString('Email', $value);
if ($this->data['email'] == $value) {
if ($this->data['email'] === $value) {
return;
}
@ -217,7 +222,7 @@ class UserBase extends Model
{
$this->_validateNotNull('Hash', $value);
$this->_validateString('Hash', $value);
if ($this->data['hash'] == $value) {
if ($this->data['hash'] === $value) {
return;
}
@ -236,7 +241,7 @@ class UserBase extends Model
{
$this->_validateNotNull('IsAdmin', $value);
$this->_validateInt('IsAdmin', $value);
if ($this->data['is_admin'] == $value) {
if ($this->data['is_admin'] === $value) {
return;
}
@ -255,7 +260,7 @@ class UserBase extends Model
{
$this->_validateNotNull('Name', $value);
$this->_validateString('Name', $value);
if ($this->data['name'] == $value) {
if ($this->data['name'] === $value) {
return;
}