Skip to content

Instantly share code, notes, and snippets.

@jlamim
Last active November 30, 2016 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlamim/bea4f7f4e215d255c5688ab72d1a113d to your computer and use it in GitHub Desktop.
Save jlamim/bea4f7f4e215d255c5688ab72d1a113d to your computer and use it in GitHub Desktop.
Live CodeIgniter 4 - Configurações no Model
<?php
use \CodeIgniter\Database\ConnectionInterface;
class UserModel extends \CodeIgniter\Model
{
protected $table = 'users';
protected $primaryKey = 'id';
protected $returnType = 'array';
protected $useSoftDeletes = true;
protected $allowedFields = ['name', 'email'];
protected $useTimestamps = false;
protected $validationRules = [];
protected $validationMessages = [];
protected $skipValidation = false;
protected $db;
public function __construct(ConnectionInterface &$db)
{
$this->db =& $db;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment