{"id":177257,"date":"2013-04-19T07:40:02","date_gmt":"2013-04-19T03:40:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=177257"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=177257","title":{"rendered":"<span class=\"post_title\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0434\u0430\u0442\u0430\u043c\u0438 Doctrine 2. \u041d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u0432 Symfony 2. \u0418, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u043f\u0440\u043e\u0447\u0438\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0441\u0442\u0438<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e \u0432\u0441\u0435\u0445! \u0410 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u043e\u043f\u0438\u043a-\u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0443 \u043f\u043e Symfony \u0438 Doctrine.<\/p>\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u042f \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0441\u0438\u0431\u0438\u0440\u0441\u043a\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0432 \u0436\u0438\u0437\u043d\u0438 \u0437\u0430\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u043c\u0438\u0440 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043b\u044e\u0434\u0435\u0439 \u0441\u0447\u0430\u0441\u0442\u043b\u0438\u0432\u0435\u0435. \u041d\u0430 Symfony \u0441\u0434\u0435\u043b\u0430\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438\u043d\u043e\u0433\u0434\u0430 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0437\u0430\u0434\u0430\u0447\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435, \u043b\u0438\u0431\u043e \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e \u0438 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u0430\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0435 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435, \u0433\u0434\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0440\u0435\u0448\u0430\u043b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0432\u043e\u0438 \u0437\u0430\u0434\u0430\u0447\u0438, \u0430 \u0432\u044b, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u0435 \u043c\u0435\u043d\u044f \u043d\u0430 \u043f\u0443\u0442\u044c \u0438\u0441\u0442\u0438\u043d\u043d\u044b\u0439 \u0438\u043b\u0438 \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u0435\u0441\u044c \u0438 \u0442\u043e\u0436\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u0441\u0432\u043e\u0438\u043c\u0438 \u0445\u0430\u043a\u0430\u043c\u0438. \u0414\u0430\u043d\u043d\u044b\u0439 \u0442\u043e\u043f\u0438\u043a \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0442\u0435\u0445 \u043b\u044e\u0434\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432\u044b\u0448\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043d\u0443 \u0438\u043b\u0438 \u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b. \u0410 \u0442\u0430\u043a \u0436\u0435 \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0442\u0435\u0445 \u0438\u043b\u0438 \u0438\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438.<\/p>\n<h4>\u0411\u043b\u0438\u0436\u0435 \u043a \u0434\u0435\u043b\u0443<\/h4>\n<p>  <\/p>\n<h6>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u0442\u0430\u043c\u0438 \u0438 Doctrine<\/h6>\n<p>  \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0435\u0431\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043b\u0438\u0447\u043d\u044b\u0439 \u0431\u043b\u043e\u0433. \u041d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u043e\u0432 \u0441 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u043f\u043e \u0433\u043e\u0434\u0443 \u0438 \u043c\u0435\u0441\u044f\u0446\u0443. \u041e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430. \u0412\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 BlogRepository, \u0438 <a name=\"habracut\"><\/a>\u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0435 \u0435\u0433\u043e \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 getArchiveByMonths(). \u041d\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0435 \u043f\u0438\u0448\u0438\u0442\u0435 \u043a\u043e\u0434 \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u043d\u0430:<\/p>\n<pre><code class=\"php\">$qb = $this-&gt;createQueryBuilder('p');         return $qb             -&gt;addSelect('MONTHNAME(p.created) as month')             -&gt;addSelect('YEAR(p.created) as year')             -&gt;addSelect('COUNT(p) as cnt')             -&gt;groupBy('month, year')             -&gt;orderBy('p.created', 'DESC')             -&gt;getQuery()             -&gt;getArrayResult(); <\/code><\/pre>\n<p>  \u0418 \u043f\u043e\u043b\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0443: <code>Expected known function, got 'MONTHNAME' <\/code><br \/>  \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c \u0447\u0442\u043e Doctrine \u0437\u043d\u0430\u0435\u0442 \u043d\u0435 \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u0442\u043e\u0439. \u0417\u043d\u0430\u0447\u0438\u0442 \u043d\u0443\u0436\u043d\u043e \u0438\u0445 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c. \u0412 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u043e \u0442\u043e\u043c \u043a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438(<a href=\"http:\/\/symfony.com\/doc\/current\/cookbook\/doctrine\/custom_dql_functions.html\">\u0422\u044b\u0446<\/a>)<\/p>\n<p>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435: \u0435\u0441\u0442\u044c \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439: <a href=\"https:\/\/github.com\/simukti\/DoctrineExtensions\">github.com\/simukti\/DoctrineExtensions<\/a>, \u0442\u0430\u043c \u043d\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b 2 \u043a\u043b\u0430\u0441\u0441\u0430:<br \/>  <code>DoctrineExtensions\\Query\\Mysql\\Month;<\/code><br \/>  <code>DoctrineExtensions\\Query\\Mysql\\Year;<\/code><\/p>\n<p>  \u041f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0438\u043c\u0438 \u043d\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f? \u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0438\u0445 \u043a \u0441\u0435\u0431\u0435 \u0432 \u0431\u0430\u043d\u0434\u043b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u043f\u0430\u043f\u043a\u0443 Dql, \u043c\u0435\u043d\u044f\u0435\u043c namespace \u043d\u0430 <code>Acme\\BlogBundle\\Dql<\/code> \u0438 \u0440\u0430\u0434\u0443\u0435\u043c\u0441\u044f \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439. \u0424\u0443\u043d\u043a\u0446\u0438\u044e <code>Monthname<\/code> \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0443 <code>Month<\/code>. \u0418 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"http:\/\/symfony.com\/doc\/current\/cookbook\/doctrine\/custom_dql_functions.html\">\u0441\u0441\u044b\u043b\u043a\u0438<\/a>, \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u043a\u0430\u0437\u0430\u0442\u044c doctrine \u043e\u0431 \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445.<\/p>\n<p>  \u0412 config.yml \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c:  <\/p>\n<pre><code class=\"ruby\"># Doctrine Configuration doctrine:     orm:         dql:             datetime_functions:                 month: Acme\\BlogBundle\\Dql\\Month                 monthname: Acme\\BlogBundle\\Dql\\Monthname                 year: Acme\\BlogBundle\\Dql\\Year <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0448\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<p>  \u0414\u043b\u044f \u043c\u0435\u043d\u044f \u0431\u044b\u043b\u043e \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e \u0447\u0442\u043e Doctrine \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445. \u041d\u043e \u043c\u043e\u0436\u043d\u043e \u0435\u0439 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0432 \u0432\u0438\u0434\u0443 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043b\u044e\u0441\u043e\u0432.<\/p>\n<h6>\u041d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u0438 \u0445\u043b\u0435\u0431\u043d\u044b\u0435 \u043a\u0440\u043e\u0448\u043a\u0438<\/h6>\n<p>  \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e <a href=\"https:\/\/github.com\/KnpLabs\/KnpMenuBundle\">KnpMenuBundle<\/a>. \u041a\u0430\u043a \u0435\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435. \u0418\u0442\u0430\u043a, \u043c\u044b \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b\u0438, \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0441\u0432\u043e\u0435 \u043f\u0435\u0440\u0432\u043e\u0435 \u043c\u0435\u043d\u044e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0435:  <\/p>\n<pre><code class=\"php\">namespace Acme\\BlogBundle\\Menu;  use Knp\\Menu\\FactoryInterface; use Knp\\Menu\\MenuItem; use Symfony\\Component\\DependencyInjection\\ContainerAware;  class Builder extends ContainerAware {      public function mainMenu (FactoryInterface $factory, array $options) {         $menu = $factory-&gt;createItem('root');          $request = $this-&gt;container-&gt;get('request');          $menu             -&gt;addChild('Homepage', array(                 'route' =&gt; 'homepage',             ));          $blog = $menu-&gt;addChild('Blog', array(             'route' =&gt; 'blog'         ));          $blog-&gt;addChild('BlogView',array(             'route' =&gt; 'blog_post_view',             'routeParameters' =&gt; array('id' =&gt; $request-&gt;get('id', 1)),             'display' =&gt; false         ));          return $menu;     } <\/code><\/pre>\n<p>  \u0412\u044b\u0432\u0435\u043b\u0438 \u044d\u0442\u043e \u043c\u0435\u043d\u044e \u0433\u0434\u0435-\u043d\u0438\u0431\u0443\u0434\u044c \u0432 \u043b\u0435\u0432\u043e\u0439\/\u043f\u0440\u0430\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0430\u0439\u0442\u0430. \u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0445\u043b\u0435\u0431\u043d\u044b\u0435 \u043a\u0440\u043e\u0448\u043a\u0438. \u0418 \u0432\u043e\u0442 \u0442\u0443\u0442 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435\u0442 \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0433\u043e \u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043a\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043c\u043d\u0435 \u043f\u043e\u0434\u0441\u043a\u0430\u0436\u0435\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u0410 \u043f\u043e\u043a\u0430 \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0441\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. <\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442 \u043c\u0435\u043d\u044e. \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432 \u0431\u0430\u043d\u0434\u043b\u0435 \u043e\u0442 Knp \u043d\u0435\u0442. \u0420\u0430\u0441\u0448\u0438\u0440\u0438\u043c \u043d\u0430\u0448 MenuBuilder:  <\/p>\n<pre><code class=\"php\">namespace Acme\\BlogBundle\\Menu;  use Knp\\Menu\\FactoryInterface; use Knp\\Menu\\Iterator\\CurrentItemFilterIterator; use Knp\\Menu\\Iterator\\RecursiveItemIterator; use Knp\\Menu\\MenuItem; use Symfony\\Component\\DependencyInjection\\ContainerAware;  class Builder extends ContainerAware {      public function mainMenu (FactoryInterface $factory, array $options) {         $menu = $factory-&gt;createItem('root');          $request = $this-&gt;container-&gt;get('request');          $menu             -&gt;addChild('Homepage', array(                 'route' =&gt; 'homepage',             ));          $blog = $menu-&gt;addChild('Blog', array(             'route' =&gt; 'blog'         ));          $blog-&gt;addChild('BlogView',array(             'route' =&gt; 'blog_view',             'routeParameters' =&gt; array('id' =&gt; $request-&gt;get('id', 1)),             'display' =&gt; false         ));          return $menu;     }      public function getCurrentItem (FactoryInterface $factory, array $options) {         $menu = $this-&gt;mainMenu($factory, $options);          $matcher = $this-&gt;container-&gt;get('knp_menu.matcher');         $voter = $this-&gt;container-&gt;get('knp_menu.voter.router');         $matcher-&gt;addVoter($voter);          $treeIterator = new \\RecursiveIteratorIterator(             new RecursiveItemIterator(                 new \\ArrayIterator(array($menu))             ),             \\RecursiveIteratorIterator::SELF_FIRST         );          $iterator = new CurrentItemFilterIterator($treeIterator, $matcher);          \/\/ Set Current as an empty Item in order to avoid exceptions on knp_menu_get         $current = new MenuItem('', $factory);          foreach ($iterator as $item) {             $current = $item;             break;         }          return $current;     } <\/code><\/pre>\n<p>  \u041c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u0443\u043d\u043a\u0442\u0430 \u043c\u0435\u043d\u044e. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0435\u0433\u043e. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u0438\u0448\u0435\u043c:   <\/p>\n<pre><code class=\"php\">{%  set breadcrumbs = knp_menu_get('AcmeBlogBundle:Builder:getCurrentItem').getBreadcrumbsArray() %}  &lt;ul class=&quot;breadcrumb&quot;&gt;     &lt;li&gt;         &lt;i class=&quot;icon-home&quot;&gt;&lt;\/i&gt;         &lt;a href=&quot;{{ path('homepage') }}&quot;&gt;Home&lt;\/a&gt;         &lt;span class=&quot;icon-angle-right&quot;&gt;&lt;\/span&gt;     &lt;\/li&gt;     {% for link in breadcrumbs %}         {% if link.label != 'root' %}         &lt;li&gt;             &lt;a href=&quot;{{ link.uri }}&quot;&gt;{{ link.label|trans }}&lt;\/a&gt;             {% if not loop.last %}             &lt;span class=&quot;icon-angle-right&quot;&gt;&lt;\/span&gt;             {% endif %}         &lt;\/li&gt;         {% endif %}     {% endfor %} &lt;\/ul&gt; <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043c\u0435\u0442\u043e\u0434 <code>getBreadCrumbsArray()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u0432\u0435\u0440\u043d\u0435\u0442 \u0442\u043e \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e. <\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u0436\u0430\u043b\u0443\u0439 \u0438 \u0432\u0441\u0435. \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0431\u044b\u043b \u043f\u043e\u043b\u0435\u0437\u0435\u043d. \u041e \u043e\u0448\u0438\u0431\u043a\u0430\u0445 \u043f\u0440\u043e\u0441\u044c\u0431\u0430 \u0432 \u043b\u0438\u0447\u043a\u0443, \u0432\u0435\u0434\u044c \u0447\u0443\u043a\u0447\u0430 \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u0435\u043b\u044c, \u0447\u0443\u043a\u0447\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0439\u0442\u0435 \u0441\u0432\u043e\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e\u043f\u0438\u043a \u0435\u0449\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u0435\u0435. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.    \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\/177257\/\"> http:\/\/habrahabr.ru\/post\/177257\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e \u0432\u0441\u0435\u0445! \u0410 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u043e\u043f\u0438\u043a-\u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0443 \u043f\u043e Symfony \u0438 Doctrine.<\/p>\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u042f \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0441\u0438\u0431\u0438\u0440\u0441\u043a\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0432 \u0436\u0438\u0437\u043d\u0438 \u0437\u0430\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u043c\u0438\u0440 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043b\u044e\u0434\u0435\u0439 \u0441\u0447\u0430\u0441\u0442\u043b\u0438\u0432\u0435\u0435. \u041d\u0430 Symfony \u0441\u0434\u0435\u043b\u0430\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438\u043d\u043e\u0433\u0434\u0430 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0437\u0430\u0434\u0430\u0447\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435, \u043b\u0438\u0431\u043e \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e \u0438 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u0430\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0435 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435, \u0433\u0434\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0440\u0435\u0448\u0430\u043b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0432\u043e\u0438 \u0437\u0430\u0434\u0430\u0447\u0438, \u0430 \u0432\u044b, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u0435 \u043c\u0435\u043d\u044f \u043d\u0430 \u043f\u0443\u0442\u044c \u0438\u0441\u0442\u0438\u043d\u043d\u044b\u0439 \u0438\u043b\u0438 \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u0435\u0441\u044c \u0438 \u0442\u043e\u0436\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u0441\u0432\u043e\u0438\u043c\u0438 \u0445\u0430\u043a\u0430\u043c\u0438. \u0414\u0430\u043d\u043d\u044b\u0439 \u0442\u043e\u043f\u0438\u043a \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0442\u0435\u0445 \u043b\u044e\u0434\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432\u044b\u0448\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043d\u0443 \u0438\u043b\u0438 \u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b. \u0410 \u0442\u0430\u043a \u0436\u0435 \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0442\u0435\u0445 \u0438\u043b\u0438 \u0438\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438.<\/p>\n<h4>\u0411\u043b\u0438\u0436\u0435 \u043a \u0434\u0435\u043b\u0443<\/h4>\n<p>  <\/p>\n<h6>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u0442\u0430\u043c\u0438 \u0438 Doctrine<\/h6>\n<p>  \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0435\u0431\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043b\u0438\u0447\u043d\u044b\u0439 \u0431\u043b\u043e\u0433. \u041d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u043e\u0432 \u0441 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u043f\u043e \u0433\u043e\u0434\u0443 \u0438 \u043c\u0435\u0441\u044f\u0446\u0443. \u041e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430. \u0412\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 BlogRepository, \u0438 <\/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-177257","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/177257","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=177257"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/177257\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=177257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=177257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=177257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}