当前位置: 首页>>代码示例>>PHP>>正文


PHP org_glizy_ObjectFactory::createModel方法代码示例

本文整理汇总了PHP中org_glizy_ObjectFactory::createModel方法的典型用法代码示例。如果您正苦于以下问题:PHP org_glizy_ObjectFactory::createModel方法的具体用法?PHP org_glizy_ObjectFactory::createModel怎么用?PHP org_glizy_ObjectFactory::createModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org_glizy_ObjectFactory的用法示例。


在下文中一共展示了org_glizy_ObjectFactory::createModel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 function execute()
 {
     if (__Request::get('mbModuleType') == 'csv') {
         $tableName = $this->parent->getTableName();
         $fields = __Request::get('fieldName');
         $modelName = 'userModules.' . $tableName . '.models.Model';
         $fieldsMap = array();
         foreach ($fields as $f) {
             $col = str_replace('row_', '', $f);
             $fieldsMap[] = array($f, $col);
         }
         $ar = org_glizy_ObjectFactory::createModel($modelName);
         $csvIterator = org_glizy_ObjectFactory::createObject('movio.modules.modulesBuilder.services.CVSImporter', __Request::get('mbCsvOptions'));
         foreach ($csvIterator as $row) {
             if ($f) {
                 $ar->emptyRecord();
                 foreach ($fieldsMap as $f) {
                     $ar->{$f[0]} = $row->{$f[1]};
                 }
                 $ar->publish();
             }
         }
     }
     return true;
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:25,代码来源:12ImportCsvData.php

示例2:

 function &current()
 {
     $fields = $this->_rs->fields;
     $activeRecord =& org_glizy_ObjectFactory::createModel($this->_recordClassName);
     $activeRecord->loadFromArray($fields);
     return $activeRecord;
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:7,代码来源:RecordIterator.php

示例3: createChildComponents

 function createChildComponents()
 {
     $entityTypeService = $this->_application->retrieveProxy('movio.modules.ontologybuilder.service.EntityTypeService');
     $properties = $entityTypeService->getEntityTypeAttributeProperties(__Request::get('entityTypeId'), $this->_parent->getId());
     $moduleId = $properties['entity_properties_params'];
     $this->_content['title'] = $this->data->text;
     $c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Text', $this->_application, $this, 'glz:Text', 'title', 'title');
     $this->addChild($c);
     $this->_content['url'] = __Routing::makeUrl($moduleId, array('document_id' => $this->data->id, 'title' => $this->data->text));
     $c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Text', $this->_application, $this, 'glz:Text', 'url', 'url');
     $this->addChild($c);
     $module = org_glizy_Modules::getModule($moduleId);
     $ar = org_glizy_ObjectFactory::createModel($module->classPath . '.models.Model');
     $ar->load($this->data->id);
     if ($ar->fieldExists('image')) {
         $this->_content['__image'] = $ar->image;
         $c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Image', $this->_application, $this, 'glz:Image', '__image', '__image');
         $c->setAttribute('width', __Config::get('THUMB_WIDTH'));
         $c->setAttribute('height', __Config::get('THUMB_HEIGHT'));
         $c->setAttribute('crop', true);
         $this->addChild($c);
     } else {
         $c =& org_glizy_ObjectFactory::createComponent('movio.modules.ontologybuilder.views.components.NoImage', $this->_application, $this, 'glz:Image', '__image', '__image');
         $c->setAttribute('width', __Config::get('THUMB_SMALL_WIDTH'));
         $c->setAttribute('height', __Config::get('THUMB_SMALL_HEIGHT'));
         $this->addChild($c);
     }
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:28,代码来源:Module.php

示例4: executeLater

 public function executeLater()
 {
     if ($this->user->isLogged() && $this->submit && $this->controller->validate()) {
         $ar = org_glizy_ObjectFactory::createModel('org.glizy.models.User');
         $ar->load($this->user->id);
         $email = org_glizy_Request::get('user_email', '');
         if ($email != $ar->user_loginId) {
             $ar2 = org_glizy_ObjectFactory::createModel('org.glizy.models.User');
             if ($ar2->find(array('user_loginId' => $email)) && $ar2->user_id != $ar->user_id) {
                 $this->view->validateAddError('L\'email è già presente nel database, usare un\'altra email');
                 return;
             }
         }
         // TODO migliorare così siamo esposti a problemi di sicurezza
         $fields = $ar->getFields();
         foreach ($fields as $k => $v) {
             if ($k == 'user_password') {
                 continue;
             }
             if (__Request::exists($k)) {
                 $ar->{$k} = __Request::get($k);
             }
         }
         $password = __Request::get('user_password');
         if ($password) {
             $ar->user_password = glz_password($password);
         }
         $ar->user_loginId = $email;
         $ar->user_email = $email;
         $ar->save();
         $this->changeAction('modifyConfirm');
     }
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:33,代码来源:Modify.php

示例5: executeLater

 public function executeLater()
 {
     if ($this->submit && $this->controller->validate()) {
         $email = org_glizy_Request::get('user_email', '');
         $ar = org_glizy_ObjectFactory::createModel('org.glizy.models.User');
         if ($ar->find(array('user_loginId' => $email))) {
             // TODO tradurre
             $this->view->validateAddError('L\'email è già presente nel database, usare un\'altra email o richiedere la password');
             return;
         }
         $fields = $ar->getFields();
         foreach ($fields as $k => $v) {
             if (__Request::exists($k)) {
                 $ar->{$k} = __Request::get($k);
             }
         }
         $ar->user_FK_usergroup_id = __Config::get('USER_DEFAULT_USERGROUP');
         $ar->user_isActive = __Config::get('USER_DEFAULT_ACTIVE_STATE');
         $ar->user_password = glz_password(__Request::get('user_password'));
         $ar->user_loginId = $email;
         $ar->user_email = $email;
         $ar->user_dateCreation = new org_glizy_types_DateTime();
         $ar->save();
         $this->changeAction('registrationConfirm');
     }
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:26,代码来源:Registration.php

示例6: execute

 public function execute()
 {
     $id = __Request::get('id');
     $media = org_glizy_ObjectFactory::createModel('org.glizycms.models.Media');
     $media->load($id);
     $data = $media->getValuesAsArray();
     $this->view->setData($data);
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:8,代码来源:Edit.php

示例7: __construct

 function __construct($options = array(), $level = GLZ_LOG_DEBUG, $group = '')
 {
     parent::__construct($options, $level, $group);
     $this->_ar = org_glizy_ObjectFactory::createModel('org.glizy.models.Log');
     $this->application = org_glizy_ObjectValues::get('org.glizy', 'application');
     // TODO
     //$this->_ar->enableQueue();
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:8,代码来源:DB.php

示例8: switchEditingLanguage

 function switchEditingLanguage($id)
 {
     $ar = org_glizy_ObjectFactory::createModel('org.glizycms.core.models.Language');
     $ar->load($id);
     org_glizy_Session::set('glizy.editingLanguage', $ar->language_code);
     org_glizy_Session::set('glizy.editingLanguageId', $ar->language_id);
     org_glizy_Session::set('glizy.editingLanguageIsDefault', $ar->language_isDefault);
     org_glizy_ObjectValues::set('org.glizy', 'editingLanguageId', $ar->language_id);
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:9,代码来源:AdminApplication.php

示例9: execute

 function execute()
 {
     if ($this->id > 0) {
         $this->logAndMessage(__T('Record cancellato'));
         $ar = org_glizy_ObjectFactory::createModel($this->modelName);
         $ar->delete($this->id);
         $this->changePage('link', array('pageId' => $this->pageId));
     }
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:9,代码来源:Delete.php

示例10: loadeRecord

 protected function loadeRecord($id)
 {
     $this->arPico = org_glizy_ObjectFactory::createModel('org.glizy.oaipmh.models.PicoQueue');
     if ($this->arPico->find(array('picoqueue_identifier' => $id))) {
         // record trovato
         $this->setClass = org_glizy_ObjectFactory::createObject($this->arPico->picoqueue_recordModule, $this->_application);
     } else {
         $this->arPico = null;
     }
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:10,代码来源:GetRecord.php

示例11: create

 function create($params)
 {
     $this->_reset();
     $this->record =& org_glizy_ObjectFactory::createModel($this->_className);
     $this->record->setProcessRelations(false);
     if (count($params)) {
         $this->record->loadFromArray($params);
     }
     $this->_bindRecordFields();
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:10,代码来源:RelationHasMany.php

示例12: executeLater

 function executeLater()
 {
     if ($this->submit) {
         if ($this->controller->validate()) {
             $isNewRecord = $this->id == 0;
             $ar = org_glizy_ObjectFactory::createModel($this->modelName);
             $ar->loadFromArray(__Request::getAllAsArray());
             $this->id = $ar->save();
             $this->redirect($isNewRecord);
         }
     }
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:12,代码来源:Add.php

示例13:

 /**
  * @param $id
  *
  * @return GlizyObject|null
  */
 static function &getMediaById($id)
 {
     $ar = org_glizy_ObjectFactory::createModel('org.glizycms.models.Media');
     if ($ar->load($id)) {
         $media =& org_glizycms_mediaArchive_MediaManager::getMediaByRecord($ar);
         return $media;
     } else {
         // TODO
         // ERRORE
     }
     return NULL;
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:17,代码来源:MediaManager.php

示例14: remove

 static function remove($path)
 {
     $params =& org_glizy_Registry::_getValuesArray();
     if (array_key_exists($path, $params)) {
         unset($params[$path]);
     }
     $rs = org_glizy_ObjectFactory::createModel('org.glizy.models.Registry');
     $rs->registry_path = $path;
     if ($rs->find()) {
         $rs->delete();
     }
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:12,代码来源:Registry.php

示例15: getPermissionName

 private function getPermissionName($permissions)
 {
     $names = array();
     $permissions = explode(',', $permissions);
     $ar = org_glizy_ObjectFactory::createModel('org.glizycms.roleManager.models.Role');
     foreach ($permissions as $v) {
         if ($ar->load($v)) {
             $names[] = array('id' => $ar->role_id, 'text' => $ar->role_name);
         }
     }
     return $names;
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:12,代码来源:ModuleContentProxy.php


注:本文中的org_glizy_ObjectFactory::createModel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。