本文整理汇总了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;
}
示例2:
function ¤t()
{
$fields = $this->_rs->fields;
$activeRecord =& org_glizy_ObjectFactory::createModel($this->_recordClassName);
$activeRecord->loadFromArray($fields);
return $activeRecord;
}
示例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);
}
}
示例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');
}
}
示例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');
}
}
示例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);
}
示例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();
}
示例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);
}
示例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));
}
}
示例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;
}
}
示例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();
}
示例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);
}
}
}
示例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;
}
示例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();
}
}
示例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;
}