From 468d16a24f2ecd07e922e158f541e9f6831636f2 Mon Sep 17 00:00:00 2001 From: Tomaz Lovrec Date: Fri, 16 Dec 2016 12:00:19 +0000 Subject: Remove needless constructor in model documentation PHP will execute the parent constructor regardless if a constructor method is defined in the child class or not. Defining an empty constructor just to call the parents constructor can be considered bad practice. --- user_guide_src/source/general/models.rst | 6 ------ 1 file changed, 6 deletions(-) diff --git a/user_guide_src/source/general/models.rst b/user_guide_src/source/general/models.rst index 1cfe736de..08e9f5b30 100644 --- a/user_guide_src/source/general/models.rst +++ b/user_guide_src/source/general/models.rst @@ -22,12 +22,6 @@ model class might look like:: public $content; public $date; - public function __construct() - { - // Call the CI_Model constructor - parent::__construct(); - } - public function get_last_ten_entries() { $query = $this->db->get('entries', 10); -- cgit v1.2.3-24-g4f1b