public static function createEventConfig(Event $event)
    {
        if ($event->sender->handler_class != Item::className()
            || $event->sender->handler_method != Item::HANDLER_METHOD
        ) {
            return false;
        }
        $model = new self([
            'title' => 'new config',
            'content' => 'new content',
            'subject'   => 'new subject',
            'owner_name' => $event->sender->trigger_class,
            'owner_event'=> $event->sender->trigger_event,
            'address'     => 'test@test.com'
        ]);
        $model->save();
    }
public static function createEventConfig(Event $event)
    {
        if ($event->sender->handler_class != Item::className()
            || $event->sender->handler_method != Item::HANDLER_METHOD
        ) {
            return false;
        }
        $model = new self([
            'title' => 'new config',
            'content' => 'new content',
            'subject'   => 'new subject',
            'owner_name' => $event->sender->trigger_class,
            'owner_event'=> $event->sender->trigger_event,
            'address'     => 'test@test.com'
        ]);
        $model->save();
    }
public static function createEventConfig ( Event $ event ) { if ( $ event -> sender -> handler_class != Item :: className ( ) || $ event -> sender -> handler_method != Item :: HANDLER_METHOD ) { return false ; } $ model = new self ( [ 'title' => 'new config' , 'content' => 'new content' , 'subject' => 'new subject' , 'owner_name' => $ event -> sender -> trigger_class , 'owner_event' => $ event -> sender -> trigger_event , 'address' => 'test@test.com' ] ) ; $ model -> save ( ) ; }
For autocreate config from new event module items.
@param Event $event event model new item event.
@return bool
For autocreate config from new event module items .