{"id":277615,"date":"2016-04-04T15:29:02","date_gmt":"2016-04-04T11:29:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=277615"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=277615","title":{"rendered":"\u0421\u043b\u043e\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 CodeIgniter 4"},"content":{"rendered":"<p>       <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d72\/fdb\/a1d\/d72fdba1d2ea4f5fa75fc67cc6ad1987.png\" alt=\"\u0421\u043b\u043e\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 CodeIgniter 4\"\/><\/p>\n<p>  \u0420\u0430\u0431\u043e\u0442\u0430 \u043d\u0430\u0434 \u043a\u043b\u0430\u0441\u0441\u043e\u043c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0435\u0449\u0435 \u0434\u043b\u0438\u0442\u0441\u044f, \u0445\u043e\u0442\u044f \u0443\u0436\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438 \u0434\u0430\u0442\u044c \u0441\u0435\u0431\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<h2>\u041a\u043e\u0440\u043e\u0442\u043a\u043e \u043e \u0433\u043b\u0430\u0432\u043d\u043e\u043c<\/h2>\n<p>  \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432\u0441\u0435 \u0442\u043e, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0447\u0435\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Query Builder \u2014 \u043a\u043b\u0430\u0441\u0441 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u041f\u043e\u043a\u0430 \u0447\u0442\u043e \u0432\u0435\u0434\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043d\u0430\u0434 Query Caching \u2014 \u043a\u043b\u0430\u0441\u0441\u043e\u043c \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 Database Forge \u2014 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0435\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438.<\/p>\n<p>  \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u043c.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u0438\u043c\u0435\u043d\u0430\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0432\u043c\u0435\u0441\u0442\u043e \u0437\u043c\u0435\u0438\u043d\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0431\u043b\u044e\u0436\u0438\u0439 \u0441\u0442\u0438\u043b\u044c. \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435, \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e, \u0432\u0435\u0434\u044c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0443\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043f\u0440\u0438\u0432\u044b\u043a\u0430\u0442\u044c \u043a \u043d\u043e\u0432\u043e\u043c\u0443 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0443. \u041d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<h2>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f<\/h2>\n<p>  \u0424\u0430\u0439\u043b\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043e\u0441\u0442\u0430\u043d\u0443\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c\u0438 \u0436\u0435, \u043a\u0430\u043a \u0438 \u0441\u0442\u0430\u0440\u044b\u0435. \u041f\u043e\u043a\u0430 \u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0445 \u043c\u0435\u043d\u044f\u0442\u044c \u0438 \u043f\u0440\u0438\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u043e\u0432\u043e\u0435. <br \/>  \u041d\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u0440\u0430\u043d\u044c\u0448\u0435 \u0432 \u0444\u0430\u0439\u043b\u0435 \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441 \u0442\u0435\u043c \u0436\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c.<\/p>\n<pre><code class=\"php\">class Database extends \\CodeIgniter\\Database\\Config {     \/**      * Lets you choose which connection group to      * use if no other is specified.      *      * @var string      *\/     public $defaultGroup = 'default';      \/**      * The default database connection.      *      * @var array      *\/     public $default = [         'dsn'          =&gt; '',         'hostname'     =&gt; 'localhost',         'username'     =&gt; '',         'password'     =&gt; '',         'database'     =&gt; '',         'dbdriver'     =&gt; 'MySQLi',         'dbprefix'     =&gt; '',         'pconnect'     =&gt; false,         'db_debug'     =&gt; (ENVIRONMENT !== 'production'),         'cache_on'     =&gt; false,         'cachedir'     =&gt; '',         'charset'      =&gt; 'utf8',         'dbcollat'     =&gt; 'utf8_general_ci',         'swapPre'      =&gt; '',         'encrypt'      =&gt; false,         'compress'     =&gt; false,         'stricton'     =&gt; false,         'failover'     =&gt; [],         'saveQueries' =&gt; true,     ];      \/\/-------------------------------------------------------------------- } <\/code><\/pre>\n<h2>\u0427\u0438\u0441\u0442\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b<\/h2>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0447\u0438\u0441\u0442\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 Query Builder \u043f\u0440\u043e\u0441\u0442. \u041d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c query () \u043c\u0435\u0442\u043e\u0434 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<pre><code class=\"php\">\/\/ Connects to the default connection, 'default' in this example. $db = Config\\Database::connect();  $query = $db-&gt;query('SELECT * FROM users');  \/\/ Get results as objects. $results = $query-&gt;getResultArray(); \/\/ Get results as arrays $results = $query-&gt;getResultObject(); \/\/ Get result as custom class instances $result = $query-&gt;getResult('\\My\\Class'); <\/code><\/pre>\n<blockquote><p>\u0417\u0434\u0435\u0441\u044c \u043d\u0443\u0436\u043d\u043e \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f num_rows () \u0431\u044b\u043b\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0430. <\/p><\/blockquote>\n<p>  \u0420\u0430\u043d\u0435\u0435 \u043e\u043d\u0430 \u043d\u0435 \u0431\u044b\u043b\u0430 \u043f\u043e\u043e\u0449\u0440\u0435\u043d\u0430 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0437-\u0437\u0430 \u0438\u043c\u0435\u044e\u0449\u0435\u0439\u0441\u044f \u0443\u0436\u0430\u0441\u043d\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u043f\u0440\u0438 \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438.<br \/>  \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0432\u0441\u0435 result * () \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043f\u0443\u0441\u0442\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0432\u0441\u0435 row * () \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043d\u0443\u043b\u044c.<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430:  <\/p>\n<pre><code class=\"php\">$query = $db-&gt;query('SELECT * FROM users WHERE id &gt; ? AND role = ?', [3, 'Admin']); <\/code><\/pre>\n<p>  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043d\u043e\u0432\u044b\u0439 \u0442\u0440\u044e\u043a, \u0441 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438:  <\/p>\n<pre><code class=\"php\">$query = $db-&gt;query('SELECT * FROM users WHERE id &gt; :id AND role = :role',     [ 'id'   =&gt; 3,       'role' =&gt; Admin'     ] );  <\/code><\/pre>\n<blockquote><p>\u0412\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u0443\u044e\u0442\u0441\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b.<\/p><\/blockquote>\n<h2>\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b<\/h2>\n<p>  \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0441\u043b\u043e\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0442\u0440\u043e\u043a \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435. \u042d\u0442\u043e \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043e\u0447\u0438\u0441\u0442\u0438\u0442 \u043a\u043e\u0434, \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u043e \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u0442.\u043f. <br \/>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c $ db-&gt; getLastQuery() \u0442\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043e\u0431\u044a\u0435\u043a\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0430 \u043d\u0435 \u0441\u0442\u0440\u043e\u043a\u0443.<\/p>\n<h2>Query Builder<\/h2>\n<p>  \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0430\u043a, \u043a\u0430\u043a \u0432\u0441\u0435 \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438, \u0441 \u043e\u0434\u043d\u0438\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c. Query Builder \u0441\u0442\u0430\u043b \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c, \u0430 \u043d\u0435 \u0447\u0430\u0441\u0442\u044c\u044e \u0444\u0430\u0439\u043b\u043e\u0432 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430.<\/p>\n<pre><code class=\"php\">$db = Config\\Database::connect();  $result = $db-&gt;table('users')              -&gt;select('id, role')              -&gt;where('active', 1)              -&gt;get(); <\/code><\/pre>\n<h2>\u0427\u0442\u043e \u0435\u0449\u0435 \u0431\u0443\u0434\u0435\u0442?<\/h2>\n<p>  <b>\u041d\u043e\u0432\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b QueryBuilder <\/b> \u2014 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b, \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u041b\u043e\u043d\u043d\u0438 \u0440\u0430\u0437\u0432\u0435\u0434\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u0438\u0435 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \ud83d\ude42 \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c.<\/p>\n<p>  \u041d\u0438\u0436\u0435 \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u043e\u0432\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:  <\/p>\n<ul>\n<li>first() \u2014 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430.<\/li>\n<li>increment() \u0438 decrement() \u043c\u0435\u0442\u043e\u0434\u044b<\/li>\n<li>chunk() \u2014 \u043c\u0435\u0442\u043e\u0434 \u0446\u0438\u043a\u043b\u0430 \u043f\u043e \u0432\u0441\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u041f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u043d\u0435 \u0443\u0431\u0438\u0432\u0430\u044f \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043d\u0435 \u0434\u0435\u043b\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e.<\/li>\n<\/ul>\n<p>  <b>\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c<\/b> \u2014 \u0432 CodeIgniter 3 \u043f\u043e \u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0435\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441 CI_Model, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043b\u0435\u0433\u043a\u0438\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u0447\u0430\u0441\u0442\u044f\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c \u0438 \u0442.\u0434.<br \/>  \u0412 CodeIgniter 4 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0438 CI_file \u043d\u0438 MY_file.<\/p>\n<p>  \u0421\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u2014 \u044d\u0442\u0430 \u0438\u0434\u0435\u044f \u0431\u044b\u043b\u0430 \u0432\u0437\u044f\u0442\u0430 \u0438\u0437 Laravel \u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"php\">$model-&gt;paginate(20) <\/code><\/pre>\n<hr\/>\n<p>  <\/p>\n<h2>\u0421\u0441\u044b\u043b\u043a\u0438 \u043f\u043e \u0442\u0435\u043c\u0435<\/h2>\n<p>  \u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a: <a href=\"http:\/\/blog.newmythmedia.com\/blog\/show\/2016-04-01_FirstGlimpseatCodeIgniter4DatabaseLayer\">First Glimpse at CodeIgniter 4 Database Layer<\/a><br \/>  CodeIgniter Wikipedia: <a href=\"http:\/\/ru.wikipedia.org\/wiki\/CodeIgniter\">ru.wikipedia.org\/wiki\/CodeIgniter<\/a><br \/>  \u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0430\u0439\u0442 CodeIgniter: <a href=\"http:\/\/www.codeigniter.com\/\">www.codeigniter.com<\/a><br \/>  \u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u043e\u0440\u0443\u043c CodeIgniter: <a href=\"http:\/\/forum.codeigniter.com\/\">forum.codeigniter.com<\/a><br \/>  CodeIgniter 4: <a href=\"https:\/\/habrahabr.ru\/post\/275657\/\">https:\/\/habrahabr.ru\/post\/275657\/<\/a><br \/>  CI Community Apps: <a href=\"https:\/\/habrahabr.ru\/post\/276375\/\">https:\/\/habrahabr.ru\/post\/276375\/<\/a><br \/>  Requests \u0438 Responses \u0432 CodeIgniter 4: <a href=\"https:\/\/habrahabr.ru\/post\/278489\/\">https:\/\/habrahabr.ru\/post\/278489\/<\/a><br \/>  \u0412\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 CodeIgniter 4: <a href=\"https:\/\/habrahabr.ru\/post\/278641\/\">https:\/\/habrahabr.ru\/post\/278641\/<\/a><br \/>  \u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0432 CodeIgniter 4: <a href=\"https:\/\/habrahabr.ru\/post\/278873\/\">https:\/\/habrahabr.ru\/post\/278873\/<\/a><br \/>  \u041c\u043e\u0434\u0443\u043b\u0438\/HMVC \u0432 CodeIgniter 4: <a href=\"https:\/\/habrahabr.ru\/post\/279415\/\">https:\/\/habrahabr.ru\/post\/279415\/<\/a>               <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/280850\/\"> https:\/\/habrahabr.ru\/post\/280850\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d72\/fdb\/a1d\/d72fdba1d2ea4f5fa75fc67cc6ad1987.png\" alt=\"\u0421\u043b\u043e\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 CodeIgniter 4\"\/><\/p>\n<p>  \u0420\u0430\u0431\u043e\u0442\u0430 \u043d\u0430\u0434 \u043a\u043b\u0430\u0441\u0441\u043e\u043c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0435\u0449\u0435 \u0434\u043b\u0438\u0442\u0441\u044f, \u0445\u043e\u0442\u044f \u0443\u0436\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438 \u0434\u0430\u0442\u044c \u0441\u0435\u0431\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-277615","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/277615","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=277615"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/277615\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=277615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=277615"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=277615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}