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


PHP Field::commit方法代码示例

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


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

示例1: commit

 function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array();
     $fields['field_id'] = $id;
     $fields['default_location'] = $this->get('default_location');
     if (!$fields['default_location']) {
         $fields['default_location'] = 'Brisbane, Australia';
     }
     include_once TOOLKIT . '/class.gateway.php';
     $ch = new Gateway();
     $ch->init();
     $ch->setopt('URL', 'http://maps.google.com/maps/geo?q=' . urlencode($fields['default_location']) . '&output=xml&key=' . $this->_engine->Configuration->get('google-api-key', 'map-location-field'));
     $response = $ch->exec();
     if (!preg_match('/<Placemark/i', $response)) {
         $fields['default_location'] = 'Brisbane, Australia';
         $fields['default_location_coords'] = '-27.46, 153.025';
     } else {
         $xml = new SimpleXMLElement($response);
         $coords = preg_split('/,/', $xml->Response->Placemark[0]->Point->coordinates, -1, PREG_SPLIT_NO_EMPTY);
         $fields['default_location_coords'] = $coords[1] . ',' . $coords[0];
     }
     $this->_engine->Database->query("DELETE FROM `tbl_fields_" . $this->handle() . "` WHERE `field_id` = '{$id}' LIMIT 1");
     return $this->_engine->Database->insert($fields, 'tbl_fields_' . $this->handle());
 }
开发者ID:pointybeard,项目名称:maplocationfield,代码行数:31,代码来源:field.maplocation.php

示例2: commit

 public function commit()
 {
     if (!Field::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     // set field instance values
     $fields = array();
     $fields['field_id'] = $id;
     if (!is_null($this->get('related_field_id'))) {
         $fields['related_field_id'] = implode(',', $this->get('related_field_id'));
     }
     $fields['allow_multiple_selection'] = $this->get('allow_multiple_selection') ? $this->get('allow_multiple_selection') : 'no';
     $fields['limit'] = max(1, (int) $this->get('limit'));
     $fields['field_type'] = $this->get('field_type') ? $this->get('field_type') : 'select';
     // save/replace field instance
     $this->Database->query("DELETE FROM `tbl_fields_" . $this->handle() . "` WHERE `field_id` = '{$id}'");
     if (!$this->Database->insert($fields, 'tbl_fields_' . $this->handle())) {
         return false;
     }
     // build associations
     $this->removeSectionAssociation($id);
     if (!is_null($this->get('related_field_id'))) {
         foreach ($this->get('related_field_id') as $field_id) {
             $this->createSectionAssociation(NULL, $id, $field_id);
         }
     }
     return true;
 }
开发者ID:brendo,项目名称:referencelink,代码行数:32,代码来源:field.referencelink.php

示例3: commit

 public function commit()
 {
     if (!parent::commit() or $this->get('id') === false) {
         return false;
     }
     $fields = array('field_id' => $this->get('id'), 'pre_populate' => $this->get('pre_populate') ? $this->get('pre_populate') : 'no');
     $this->_engine->Database->query("\n\t\t\t\tDELETE FROM\n\t\t\t\t\t`tbl_fields_datetaglist`\n\t\t\t\tWHERE\n\t\t\t\t\t`field_id` = '{$id}'\n\t\t\t\tLIMIT 1\n\t\t\t");
     return $this->_engine->Database->insert($fields, 'tbl_fields_datetaglist');
 }
开发者ID:psychoticmeowArchives,项目名称:datetaglistfield,代码行数:9,代码来源:field.datetaglist.php

示例4: commit

 public function commit()
 {
     $field_id = $this->get('id');
     if (!parent::commit() or $this->get('id') === false) {
         return false;
     }
     $fields = array('field_id' => $this->get('id'));
     $this->_engine->Database->query("\n\t\t\t\tDELETE FROM\n\t\t\t\t\t`tbl_fields_memberemail`\n\t\t\t\tWHERE\n\t\t\t\t\t`field_id` = '{$field_id}'\n\t\t\t\tLIMIT 1\n\t\t\t");
     return $this->_engine->Database->insert($fields, 'tbl_fields_memberemail');
 }
开发者ID:psychoticmeowArchives,项目名称:frontendmembermanager,代码行数:10,代码来源:field.memberemail.php

示例5: commit

 public function commit()
 {
     $id = $this->get('id');
     $handle = $this->handle();
     if (!parent::commit() or $id === false) {
         return false;
     }
     $fields = array('field_id' => $id);
     $this->_engine->Database->query("\n\t\t\t\tDELETE FROM\n\t\t\t\t\t`tbl_fields_{$handle}`\n\t\t\t\tWHERE\n\t\t\t\t\t`field_id` = '{$id}'\n\t\t\t\tLIMIT 1\n\t\t\t");
     return $this->_engine->Database->insert($fields, "tbl_fields_{$handle}");
 }
开发者ID:bauhouse,项目名称:sym-extensions,代码行数:11,代码来源:field.memberstatus.php

示例6: commit

 public function commit()
 {
     if (!parent::commit() or $field_id === false) {
         return false;
     }
     $field_id = $this->get('id');
     $handle = $this->handle();
     $fields = array('field_id' => $field_id, 'nth_entry' => (int) $this->get('nth_entry'));
     Symphony::Database()->query("\n\t\t\t\tDELETE FROM\n\t\t\t\t\t`tbl_fields_{$handle}`\n\t\t\t\tWHERE\n\t\t\t\t\t`field_id` = '{$field_id}'\n\t\t\t\tLIMIT 1\n\t\t\t");
     return Symphony::Database()->insert($fields, "tbl_fields_{$handle}");
 }
开发者ID:psychoticmeowArchives,项目名称:numericgroupingfield,代码行数:11,代码来源:field.numericgrouping.php

示例7: commit

 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array('validator' => null);
     $fields['validator'] = $fields['validator'] == 'custom' ? null : $this->get('validator');
     return FieldManager::saveSettings($id, $fields);
 }
开发者ID:rc1,项目名称:WebAppsWithCmsStartHere,代码行数:13,代码来源:field.input.php

示例8: commit

 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array();
     $fields['field_id'] = $id;
     return FieldManager::saveSettings($id, $fields);
 }
开发者ID:henrysingleton,项目名称:publish_tabs,代码行数:13,代码来源:field.publish_tabs.php

示例9: commit

 /**
  * Persist field configuration
  */
 function commit()
 {
     // set up standard Field settings
     if (!parent::commit()) {
         return FALSE;
     }
     $id = $this->get('id');
     if ($id === FALSE) {
         return FALSE;
     }
     $fields = array();
     $fields['field_id'] = $id;
     return FieldManager::saveSettings($id, $fields);
 }
开发者ID:symphonists,项目名称:search_index,代码行数:17,代码来源:field.search_index.php

示例10: commit

 public function commit()
 {
     if (!parent::commit()) {
         return FALSE;
     }
     $id = $this->get('id');
     if ($id === FALSE) {
         return FALSE;
     }
     $query = "DELETE FROM `tbl_fields_" . $this->handle() . "` WHERE `field_id` = '{$id}' LIMIT 1";
     Symphony::Database()->query($query);
     $fields = array('field_id' => $id, 'starting_value' => $this->get('starting_value'), 'hide' => $this->get('hide'));
     return Symphony::Database()->insert($fields, 'tbl_fields_' . $this->handle());
 }
开发者ID:jeremyboles,项目名称:symphony-incremented_field,代码行数:14,代码来源:field.incremented.php

示例11: commit

 public function commit()
 {
     if (!parent::commit()) {
         return;
     }
     $id = $this->get('id');
     if ($id === FALSE) {
         return;
     }
     $fields = array('field_id' => $id, 'url_expression' => $this->get('url_expression'));
     $handle = $this->handle();
     Symphony::Database()->query("\n            DELETE FROM\n                `tbl_fields_{$handle}`\n            WHERE\n                `field_id` = '{$id}'\n            LIMIT 1\n        ");
     return Symphony::Database()->insert($fields, "tbl_fields_{$handle}");
 }
开发者ID:symphonists,项目名称:html_panel,代码行数:14,代码来源:field.html_panel.php

示例12: commit

 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     $handle = $this->handle();
     if ($id === false) {
         return false;
     }
     $fields = array('field_id' => $id, 'anchor_label' => $this->get('anchor_label'), 'expression' => $this->get('expression'), 'new_window' => $this->get('new_window'), 'hide' => $this->get('hide'));
     Symphony::Database()->query("DELETE FROM `tbl_fields_{$handle}` WHERE `field_id` = '{$id}' LIMIT 1");
     return Symphony::Database()->insert($fields, "tbl_fields_{$handle}");
 }
开发者ID:symphonists,项目名称:entry_url_field,代码行数:14,代码来源:field.entry_url.php

示例13: commit

 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     $handle = $this->handle();
     if ($id === false) {
         return false;
     }
     $fields = array('field_id' => $id, 'expression' => $this->get('expression'), 'hide' => $this->get('hide'));
     Symphony::Database()->query("\n\t\t\t\tDELETE FROM\n\t\t\t\t\t`tbl_fields_{$handle}`\n\t\t\t\tWHERE\n\t\t\t\t\t`field_id` = '{$id}'\n\t\t\t\tLIMIT 1\n\t\t\t");
     return Symphony::Database()->insert($fields, "tbl_fields_{$handle}");
 }
开发者ID:klaftertief,项目名称:geocodingfield,代码行数:14,代码来源:field.geocoding.php

示例14: commit

 function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array();
     $fields['field_id'] = $id;
     $this->_engine->Database->query("DELETE FROM `tbl_fields_" . $this->handle() . "` WHERE `field_id` = '{$id}' LIMIT 1");
     return $this->_engine->Database->insert($fields, 'tbl_fields_' . $this->handle());
 }
开发者ID:pointybeard,项目名称:hashfield,代码行数:14,代码来源:field.hash.php

示例15: commit

 public function commit()
 {
     if (!parent::commit()) {
         return false;
     }
     $id = $this->get('id');
     if ($id === false) {
         return false;
     }
     $fields = array();
     $fields['field_id'] = $id;
     $fields['validator'] = $fields['validator'] == 'custom' ? NULL : $this->get('validator');
     Symphony::Database()->query("DELETE FROM `tbl_fields_" . $this->handle() . "` WHERE `field_id` = '{$id}' LIMIT 1");
     return Symphony::Database()->insert($fields, 'tbl_fields_' . $this->handle());
 }
开发者ID:rainerborene,项目名称:symphony-2,代码行数:15,代码来源:field.input.php


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