<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Форум ReadyScript &mdash; Не расширяется ORM объект]]></title>
	<link rel="self" href="https://forum.readyscript.ru/feed/atom/topic/721" />
	<updated>2016-05-24T15:50:54Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.readyscript.ru/topic/721/ne-rasshiryaetsya-orm-obekt/</id>
		<entry>
			<title type="html"><![CDATA[Re: Не расширяется ORM объект]]></title>
			<link rel="alternate" href="https://forum.readyscript.ru/post/3276/#p3276" />
			<content type="html"><![CDATA[<p>Так модуль &quot;Меню&quot; надо было переустанавливать, а я свой пытался. Теперь ясно.</p>]]></content>
			<author>
				<name><![CDATA[Ярослав]]></name>
				<uri>https://forum.readyscript.ru/user/74/</uri>
			</author>
			<updated>2016-05-24T15:50:54Z</updated>
			<id>https://forum.readyscript.ru/post/3276/#p3276</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Не расширяется ORM объект]]></title>
			<link rel="alternate" href="https://forum.readyscript.ru/post/3274/#p3274" />
			<content type="html"><![CDATA[<p>Вы нашли наиболее правильный вариант.</p><p>Вы также могли просто переустановить модуль Меню. <br />В вашем случае, в базу бы также было добавлено поле из стороннего модуля.</p>]]></content>
			<author>
				<name><![CDATA[admin]]></name>
				<uri>https://forum.readyscript.ru/user/2/</uri>
			</author>
			<updated>2016-05-24T11:46:27Z</updated>
			<id>https://forum.readyscript.ru/post/3274/#p3274</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Не расширяется ORM объект]]></title>
			<link rel="alternate" href="https://forum.readyscript.ru/post/3266/#p3266" />
			<content type="html"><![CDATA[<p>Создал handlers.inc.php в папке своего модуля evaddons со следующим содержанием:<br /></p><div class="codebox"><pre><code>&lt;?php
namespace evAddons\Config;
use \RS\Orm\Type;
/**
* Класс содержит обработчики событий, на которые подписан модуль

ДЛя 8 марта и темы evTheme
2016_05_06 Добавление поля css к меню
*/
class Handlers extends \RS\Event\HandlerAbstract
{
    /**
    * Добавляет подписку на события
    * 
    * @return void
    */
    function init()
    {
        $this-&gt;bind(&#039;orm.init.menu-menu&#039;); //добавим css
    }
       

   
      public static function ormInitMenuMenu(\Menu\Model\Orm\Menu $orm_menu) 
        {
        $orm_menu-&gt;getPropertyIterator()-&gt;append(array(//Добавляем свойства к объекту
            t(&#039;Основные&#039;), //Закладка
                      &#039;css&#039; =&gt; new Type\Varchar(array(
                      &#039;maxLength&#039; =&gt; &#039;50&#039;,
                        &#039;description&#039; =&gt; &#039;Класс CSS&#039;,
                         &#039;hint&#039; =&gt; t(&#039;Дополнительный CSS класс для пункта меню&#039;)
                        
                    ))
       
                 ));
        }     
}</code></pre></div><p>Досмотрел до 44 минуты) И там как раз то что надо. Создал файл install.inc.php и все заработало, спасибо! В текстовой документации не нашел данные рекомендации.<br /></p><div class="codebox"><pre><code>&lt;?php
namespace evAddons\Config;

/**
* Класс отвечает за установку и обновление модуля
*/
class Install extends \RS\Module\AbstractInstall
{
function install()
    {
        
        $result = parent::install();
        if ($result) {
            $menu = new \Menu\Model\Orm\Menu();
            $menu-&gt;dbUpdate();
        }
        
        return $result;
    }
    
    /**
    * Функция обновления модуля, вызывается только при обновлении
    */
    function update()
    {
        $result = parent::update();
        if ($result) {
            $menu = new \Menu\Model\Orm\Menu();
            $menu-&gt;dbUpdate();
        }
        return $result;
    }     
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Ярослав]]></name>
				<uri>https://forum.readyscript.ru/user/74/</uri>
			</author>
			<updated>2016-05-23T10:47:32Z</updated>
			<id>https://forum.readyscript.ru/post/3266/#p3266</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Не расширяется ORM объект]]></title>
			<link rel="alternate" href="https://forum.readyscript.ru/post/3265/#p3265" />
			<content type="html"><![CDATA[<p>А что Вы сделали, для того, чтобы оно создалось в таблице? <br /><a href="http://readyscript.ru/video/?t=developer">http://readyscript.ru/video/?t=developer</a></p>]]></content>
			<author>
				<name><![CDATA[Закусило Александр]]></name>
				<uri>https://forum.readyscript.ru/user/20/</uri>
			</author>
			<updated>2016-05-23T07:19:09Z</updated>
			<id>https://forum.readyscript.ru/post/3265/#p3265</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Не расширяется ORM объект]]></title>
			<link rel="alternate" href="https://forum.readyscript.ru/post/3261/#p3261" />
			<content type="html"><![CDATA[<p>Здравствуйте! Хочу добавить допполе к объекту &quot;пункт Меню&quot;<br /></p><div class="codebox"><pre><code>  function init()
    {
        $this-&gt;bind(&#039;orm.init.menu-menu&#039;); //добавим css
    }
       

   
      public static function ormInitMenuMenu(\Menu\Model\Orm\Menu $orm_menu) 
        {
        $orm_menu-&gt;getPropertyIterator()-&gt;append(array(//Добавляем свойства к объекту
            t(&#039;Основные&#039;), //Закладка, появится в форме редактирования товара
                      &#039;css&#039; =&gt; new Type\Varchar(array(
                      &#039;maxLength&#039; =&gt; &#039;50&#039;,
                       &#039;description&#039; =&gt; &#039;Класс CSS&#039;,
                       &#039;hint&#039; =&gt; t(&#039;Дополнительный CSS класс для пункта меню&#039;)
                        
                    ))
       
                 ));
        }     </code></pre></div><p>В таблице поле не создается, а в карточке меню оно есть. <br />Что-то делаю не так...</p>]]></content>
			<author>
				<name><![CDATA[Ярослав]]></name>
				<uri>https://forum.readyscript.ru/user/74/</uri>
			</author>
			<updated>2016-05-22T12:21:23Z</updated>
			<id>https://forum.readyscript.ru/post/3261/#p3261</id>
		</entry>
</feed>
