{"id":161199,"date":"2012-12-03T19:30:03","date_gmt":"2012-12-03T15:30:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=161199"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=161199","title":{"rendered":"<span class=\"post_title\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Leap ORM \u0432 Kohana<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/ff7\/9df\/a20\/ff79dfa20306db45bd3ecfc96931b686.jpg\" align=\"right\"\/><br \/>  Leap \u2014 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 ORM. \u041e\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 ORM \u043d\u0435\u0442. Leap \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 SQL \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u0440\u0435\u0434\u0443 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0435\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, Leap \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 ORM, \u0441\u043b\u0435\u0434\u0443\u044f \u0441\u043b\u0430\u0431\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u0438 \u0442\u0435\u0441\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u044f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0431 \u044d\u0442\u043e\u043c \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c ORM \u043d\u0430 \u0425\u0430\u0431\u0440\u0430\u0445\u0430\u0431\u0440\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043f\u044b\u0442\u0430\u044e\u0441\u044c \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e. <\/p>\n<h4>0. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438<\/h4>\n<p>  <\/p>\n<ul>\n<li><b>\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/b><br \/>  \u041f\u043b\u0430\u0433\u0438\u043d\u044b \u0434\u043b\u044f DB2, Drizzle, Firebird, MariaDB, MS SQL, MySQL, Oracle, PostgreSQL \u0438 SQLite.<\/li>\n<li><b>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/b><br \/>  \u0411\u0438\u043b\u0434\u0435\u0440 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 SQL \u0434\u0438\u0430\u043b\u0435\u043a\u0442\u0430\u043c\u0438.  <\/li>\n<li><b>\u041e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439.<\/b><br \/>  \u0421\u0442\u0430\u0432\u0438\u0442 PHP \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044f \u0441\u0438\u043b\u044c\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/li>\n<li><b>\u041b\u0435\u0433\u043a\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u044b\u0439.<\/b><\/li>\n<li><b>\u0425\u043e\u0440\u043e\u0448\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d.<\/b><br \/>  \u041c\u043d\u043e\u0433\u043e <a href=\"http:\/\/orm.spadefootcode.com\/tutorials\/index\/\">\u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438 \u0443\u0447\u0435\u0431\u043d\u044b\u0445 \u043f\u043e\u0441\u043e\u0431\u0438\u0439<\/a>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f <a href=\"http:\/\/orm.spadefootcode.com\/api\/annotated.html\">API<\/a>.  <\/li>\n<\/ul>\n<p>  <\/p>\n<h4>1. \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430<\/h4>\n<p>  \u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 ORM.  <\/p>\n<table>\n<tr>\n<td><\/td>\n<th>LEAP<\/th>\n<th>K3 ORM<\/th>\n<th>Jelly<\/th>\n<th>Sprig<\/th>\n<\/tr>\n<tr>\n<td>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u0427\u0430\u0441\u0442\u0438\u0447\u043d\u043e<\/td>\n<\/tr>\n<tr>\n<td>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 API<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u0411\u043e\u043b\u0435\u0435 \u043c\u0435\u043d\u0435\u0435<\/td>\n<td>\u0411\u043e\u043b\u0435\u0435 \u043c\u0435\u043d\u0435\u0435<\/td>\n<td>\u0414\u0430<\/td>\n<\/tr>\n<tr>\n<td>\u041b\u0435\u0433\u043a\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u044b\u0439<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u0411\u043e\u043b\u0435\u0435 \u043c\u0435\u043d\u0435\u0435<\/td>\n<td>\u0411\u043e\u043b\u0435\u0435 \u043c\u0435\u043d\u0435\u0435<\/td>\n<td>\u0411\u043e\u043b\u0435\u0435 \u043c\u0435\u043d\u0435\u0435<\/td>\n<\/tr>\n<tr>\n<td>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 SQL \u0434\u0438\u0430\u043b\u0435\u043a\u0442\u043e\u0432<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u041e\u0442\u0447\u0430\u0441\u0442\u0438<\/td>\n<td>\u041e\u0442\u0447\u0430\u0441\u0442\u0438<\/td>\n<td>\u041e\u0442\u0447\u0430\u0441\u0442\u0438<\/td>\n<\/tr>\n<tr>\n<td>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0439 \u0411\u0414<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u041d\u0435\u0442<\/td>\n<td>\u041d\u0435\u0442<\/td>\n<td>\u041d\u0435\u0442<\/td>\n<\/tr>\n<tr>\n<td>\u041a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u0414\u0430<\/td>\n<\/tr>\n<tr>\n<td>Query Builder<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u0414\u0430<\/td>\n<\/tr>\n<tr>\n<td>\u0421\u0438\u043b\u044c\u043d\u043e \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u041d\u0435\u0442<\/td>\n<td>\u0411\u043e\u043b\u0435\u0435 \u043c\u0435\u043d\u0435\u0435<\/td>\n<td>\u0411\u043e\u043b\u0435\u0435 \u043c\u0435\u043d\u0435\u0435<\/td>\n<\/tr>\n<tr>\n<td>\u041d\u0435\u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u041d\u0435\u0442<\/td>\n<td>\u041d\u0435\u0442<\/td>\n<td>\u0414\u0430<\/td>\n<\/tr>\n<tr>\n<td>\u0421\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u041d\u0435\u0442<\/td>\n<td>\u041d\u0435\u0442<\/td>\n<td>\u0427\u0430\u0441\u0442\u0438\u0447\u043d\u043e<\/td>\n<\/tr>\n<tr>\n<td>\u041f\u0441\u0435\u0432\u0434\u043e\u043d\u0438\u043c\u044b \u043f\u043e\u043b\u0435\u0439 (aliases)<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u041d\u0435\u0442<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u041d\u0435\u0442<\/td>\n<\/tr>\n<tr>\n<td>\u0410\u0434\u0430\u043f\u0442\u0435\u0440\u044b \u043f\u043e\u043b\u0435\u0439<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u041d\u0435\u0442<\/td>\n<td>\u041d\u0435\u0442<\/td>\n<td>\u041d\u0435\u0442<\/td>\n<\/tr>\n<tr>\n<td>\u0421\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 \u043f\u043e\u043b\u044f\u043c\u0438<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u0414\u0430<\/td>\n<\/tr>\n<tr>\n<td>\u0427\u0442\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u041d\u0435\u0442<\/td>\n<td>\u041d\u0435\u0442<\/td>\n<td>\u041d\u0435\u0442<\/td>\n<\/tr>\n<tr>\n<td>\u0410\u0432\u0442\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f HTML-\u0444\u043e\u0440\u043c<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u041d\u0435\u0442<\/td>\n<td>\u041d\u0435\u0442<\/td>\n<td>\u0414\u0430<\/td>\n<\/tr>\n<tr>\n<td>\u041a\u043b\u0430\u0441\u0441 Auth<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u0414\u0430<\/td>\n<\/tr>\n<tr>\n<td>Modified Preorder Tree Traversal (MPTT)<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u0414\u0430<\/td>\n<td>\u0414\u0430<\/td>\n<\/tr>\n<\/table>\n<p>  <\/p>\n<h4>2. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/h4>\n<p>  <\/p>\n<ol>\n<li>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 <a href=\"http:\/\/orm.spadefootcode.com\/tutorials\/installing-leap\/\">\u0441\u043a\u0430\u0447\u0430\u0435\u043c<\/a> Leap ORM \u043f\u043e\u0434 \u0441\u0432\u043e\u044e \u0432\u0435\u0440\u0441\u0438\u044e Kohana \u0432 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435.<\/li>\n<li>\u0424\u0430\u0439\u043b\u044b \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0443 <b><i>modules\/leap<\/i><\/b> \u043d\u0430 \u0441\u0432\u043e\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/li>\n<li>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c \u0432 <b><i>application\/bootstrap.php<\/i><\/b>.<br \/> \n<pre><code class=\"php\">Kohana::modules(array(     ...     'leap' =&gt; MODPATH . 'leap',     ... )); <\/code><\/pre>\n<p>  <\/li>\n<li>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0448\u0430\u0433\u043e\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0444\u0430\u0439\u043b\u0435 <b><i>modules\/leap\/config\/database.php<\/i><\/b>.<br \/> \n<pre><code class=\"php\">&lt;?php defined('SYSPATH') OR die('No direct script access.');  $config = array();  $config['default'] = array(     'type'          =&gt; 'SQL',       \/\/ string (e.g. SQL, NoSQL, or LDAP)     'dialect'       =&gt; 'MySQL',     \/\/ string (e.g. DB2, Drizzle, Firebird, MariaDB, MsSQL, MySQL, Oracle, PostgreSQL, or SQLite)     'driver'        =&gt; 'Standard',  \/\/ string (e.g. Standard, Improved, or PDO)     'connection'    =&gt; array(         'persistent'    =&gt; FALSE,       \/\/ boolean         'hostname'      =&gt; 'localhost', \/\/ string         'port'          =&gt; '',          \/\/ string         'database'      =&gt; '',          \/\/ string         'username'      =&gt; 'root',      \/\/ string         'password'      =&gt; 'root',      \/\/ string         'role'          =&gt; '',          \/\/ string     ),     'caching'       =&gt; FALSE,       \/\/ boolean     'charset'       =&gt; 'utf8',      \/\/ string );  return $config; ?&gt; <\/code><\/pre>\n<p>  <\/li>\n<li>\u041c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Leap ORM \u0434\u043b\u044f <a href=\"http:\/\/orm.spadefootcode.com\/tutorials\/defining-a-model\/\">\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f<\/a> \u043c\u043e\u0434\u0435\u043b\u0435\u0439.<\/li>\n<\/ol>\n<p>  <\/p>\n<h4>3. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/h4>\n<p>  \u0412 Leap ORM \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438, \u043f\u0435\u0440\u0435\u0434 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0432 \u0444\u0430\u0439\u043b\u0435 <b><i>modules\/leap\/config\/database.php<\/i><\/b>.  <\/p>\n<ol>\n<li>\u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 factory \u043a\u043b\u0430\u0441\u0441\u0430 DB_Connection.<br \/> \n<pre><code class=\"php\">$connection = DB_Connection::factory('default'); \/\/ \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f $connection-&gt;open(); \/\/ \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 $results = $connection-&gt;query('SELECT * FROM `user`;'); \/\/ \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 $connection-&gt;close(); <\/code><\/pre>\n<p>  <i>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u043e \u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430. <\/i>   <\/li>\n<li>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c DB_Connection_Pool, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u043a\u043e\u0439 \u0441\u0445\u0435\u043c\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430 \u0412\u0430\u0441 Leap.<br \/> \n<pre><code class=\"php\">\/\/ \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f $connection = DB_Connection_Pool::instance()-&gt;get_connection('default'); \/\/ \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 $results = $connection-&gt;query('SELECT * FROM `user`;');\t         <\/code><\/pre>\n<p>  <\/li>\n<\/ol>\n<h4>4. \u0417\u0430\u043f\u0440\u043e\u0441\u044b<\/h4>\n<p>  \u041f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043f\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043d\u0430\u0432\u0435\u0440\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0438\u0436\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u044b. \u041a\u043e\u0434 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u0435\u043d, \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0433\u043a\u043e, \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u0432\u0441\u044e \u0434\u043e\u043a\u0443 \u043b\u0443\u0447\u0448\u0435 \u043d\u0430 github&#8217;\u0435 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438.   <\/p>\n<ul>\n<li><a href=\"http:\/\/orm.spadefootcode.com\/tutorials\/querying-sql-statements\/\">\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/a><\/li>\n<li><a href=\"http:\/\/orm.spadefootcode.com\/tutorials\/working-with-results-sets\/\">\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430<\/a><\/li>\n<li>Building SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432:<br \/> \n<ul>\n<li><a href=\"http:\/\/orm.spadefootcode.com\/tutorials\/building-sql-statements\/#create\">\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443<\/a> (INSERT)<\/li>\n<li><a href=\"http:\/\/orm.spadefootcode.com\/tutorials\/building-sql-statements\/#read\">\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/a> (SELECT) <\/li>\n<li><a href=\"http:\/\/orm.spadefootcode.com\/tutorials\/building-sql-statements\/#update\">\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435<\/a> (UPDATE)<\/li>\n<li><a href=\"http:\/\/orm.spadefootcode.com\/tutorials\/building-sql-statements\/#delete\">\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/a> (DELETE)<\/li>\n<\/ul>\n<p>  <\/li>\n<li><a href=\"http:\/\/orm.spadefootcode.com\/tutorials\/extending-the-query-builder\/\">\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 Query Builder<\/a><\/li>\n<li><a href=\"http:\/\/orm.spadefootcode.com\/tutorials\/defining-a-model\/\">\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0434\u0435\u043b\u0438<\/a><\/li>\n<li>\u041a\u0430\u0440\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u0438:<br \/> \n<ul>\n<li><a href=\"http:\/\/orm.spadefootcode.com\/tutorials\/building-sql-statements\/#create\">\u0410\u0434\u0430\u043f\u0442\u043e\u0440\u044b<\/a><\/li>\n<li><a href=\"http:\/\/orm.spadefootcode.com\/tutorials\/building-sql-statements\/#read\">\u041f\u0441\u0435\u0432\u0434\u043e\u043d\u0438\u043c\u044b (aliases)<\/a><\/li>\n<li><a href=\"http:\/\/orm.spadefootcode.com\/tutorials\/building-sql-statements\/#update\">\u041f\u043e\u043b\u044f<\/a><\/li>\n<li><a href=\"http:\/\/orm.spadefootcode.com\/tutorials\/building-sql-statements\/#delete\">\u0421\u0432\u044f\u0437\u0438<\/a><\/li>\n<\/ul>\n<p>  <\/li>\n<li><a href=\"http:\/\/orm.spadefootcode.com\/tutorials\/using-a-model\/\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438<\/a><\/li>\n<\/ul>\n<p>  \u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0430\u0439\u0442 \u2014 <a href=\"http:\/\/orm.spadefootcode.com\">orm.spadefootcode.com<\/a><br \/>  \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0438 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u044b \u2014 <a href=\"http:\/\/orm.spadefootcode.com\/tutorials\">orm.spadefootcode.com\/tutorials<\/a><br \/>  Leap ORM API \u2014 <a href=\"http:\/\/orm.spadefootcode.com\/api\/annotated.html\">orm.spadefootcode.com\/api\/annotated.html<\/a><br \/>  GitHub \u2014 <a href=\"https:\/\/github.com\/spadefoot\/kohana-orm-leap\">github.com\/spadefoot\/kohana-orm-leap<\/a><br \/>  Bug\u0422\u0440\u0435\u043a\u0435\u0440 \u2014 <a href=\"https:\/\/github.com\/spadefoot\/kohana-orm-leap\/issues\">github.com\/spadefoot\/kohana-orm-leap\/issues<\/a> \t\t\t \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/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=\"http:\/\/habrahabr.ru\/post\/161199\/\"> http:\/\/habrahabr.ru\/post\/161199\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/ff7\/9df\/a20\/ff79dfa20306db45bd3ecfc96931b686.jpg\" align=\"right\"\/><br \/>  Leap \u2014 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 ORM. \u041e\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 ORM \u043d\u0435\u0442. Leap \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 SQL \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u0440\u0435\u0434\u0443 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0435\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, Leap \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 ORM, \u0441\u043b\u0435\u0434\u0443\u044f \u0441\u043b\u0430\u0431\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u0438 \u0442\u0435\u0441\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.  <\/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-161199","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/161199","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=161199"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/161199\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=161199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=161199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=161199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}