Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions lib/MY_Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ class MY_Model extends CI_Model {
*
* @var bool
*/
protected $validate_field_existence = FALSE;
protected $validate_field_existence = false;

/**
* Used if there is no primary key for the table
*
* @var bool
*/
protected $no_primary_key = FALSE;
protected $no_primary_key = false;

function __construct()
{
Expand All @@ -76,7 +76,7 @@ function add($options = array())
{
if ( ! $this->_required($this->required_fields, $options))
{
return FALSE;
return false;
}

$this->_set_editable_fields($this->primary_table);
Expand All @@ -102,13 +102,13 @@ function add($options = array())

if ($query)
{
if ($this->no_primary_key == FALSE)
if ($this->no_primary_key == false)
{
return $this->db->insert_id();
}
else
{
return TRUE;
return true;
}
}
}
Expand Down Expand Up @@ -198,7 +198,7 @@ function update($options = array())
$required = array($this->primary_key);
if ( ! $this->_required($required, $options))
{
return FALSE;
return false;
}

$this->_set_editable_fields($this->primary_table);
Expand Down Expand Up @@ -240,7 +240,7 @@ function delete($options = array())
$required = array($this->primary_key);
if ( ! $this->_required($required, $options))
{
return FALSE;
return false;
}

$this->db->where($this->primary_key, $options[$this->primary_key]);
Expand All @@ -257,7 +257,7 @@ function delete($options = array())
*/
function _validate_options_exist($options)
{
if ($this->validate_field_existence == TRUE)
if ($this->validate_field_existence == true)
{
foreach ($options as $key => $value)
{
Expand Down Expand Up @@ -301,10 +301,10 @@ function _required($required, $data)
{
if ( ! isset($data[$field]))
{
return FALSE;
return false;
}
}
return TRUE;
return true;
}

/**
Expand Down