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


PHP ElggEntity::save方法代码示例

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


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

示例1: setUp

 /**
  * Called before each test method.
  */
 public function setUp()
 {
     _elgg_services()->hooks->backup();
     $this->entity = new \ElggObject();
     $this->entity->subtype = 'elgg_annotation_test';
     $this->entity->access_id = ACCESS_PUBLIC;
     $this->entity->save();
 }
开发者ID:nirajkaushal,项目名称:Elgg,代码行数:11,代码来源:ElggAnnotationTest.php

示例2: testSubtypeIsString

 public function testSubtypeIsString()
 {
     $this->assertTrue($this->entity->save());
     $guid = $this->entity->guid;
     _elgg_invalidate_cache_for_entity($guid);
     $this->entity = null;
     $this->entity = get_entity($guid);
     $this->assertEqual('elgg_entity_test_subtype', $this->entity->subtype);
 }
开发者ID:tjcaverly,项目名称:Elgg,代码行数:9,代码来源:ElggEntityTest.php

示例3: setUp

 /**
  * Called before each test method.
  */
 public function setUp()
 {
     $this->original_hooks = _elgg_services()->hooks;
     _elgg_services()->hooks = new \Elgg\PluginHooksService();
     $this->entity = new \ElggObject();
     $this->entity->subtype = 'elgg_annotation_test';
     $this->entity->access_id = ACCESS_PUBLIC;
     $this->entity->save();
 }
开发者ID:ibou77,项目名称:elgg,代码行数:12,代码来源:ElggAnnotationTest.php

示例4: testSubtypePropertyReads

 public function testSubtypePropertyReads()
 {
     $this->assertTrue($this->entity->save());
     $guid = $this->entity->guid;
     $subtype_prop = $this->entity->subtype;
     $this->assertIsA($subtype_prop, 'int');
     $this->assertEqual($subtype_prop, get_subtype_id('object', 'elgg_entity_test_subtype'));
     _elgg_invalidate_cache_for_entity($guid);
     $this->entity = null;
     $this->entity = get_entity($guid);
     $subtype_prop = $this->entity->subtype;
     $this->assertIsA($subtype_prop, 'int');
     $this->assertEqual($subtype_prop, get_subtype_id('object', 'elgg_entity_test_subtype'));
 }
开发者ID:Twizanex,项目名称:GuildWoW,代码行数:14,代码来源:ElggEntityTest.php

示例5: setUp

 /**
  * Called before each test method.
  */
 public function setUp()
 {
     _elgg_services()->events->backup();
     $this->entity1 = new ElggObject();
     $this->entity1->subtype = 'elgg_relationship_test';
     $this->entity1->access_id = ACCESS_PUBLIC;
     $this->entity1->save();
     $this->entity2 = new ElggObject();
     $this->entity2->subtype = 'elgg_relationship_test';
     $this->entity2->access_id = ACCESS_PUBLIC;
     $this->entity2->save();
     $this->entity3 = new ElggObject();
     $this->entity3->subtype = 'elgg_relationship_test';
     $this->entity3->access_id = ACCESS_PUBLIC;
     $this->entity3->save();
 }
开发者ID:nirajkaushal,项目名称:Elgg,代码行数:19,代码来源:ElggRelationshipTest.php

示例6: setUp

 /**
  * Called before each test method.
  */
 public function setUp()
 {
     $this->original_events = _elgg_services()->events;
     _elgg_services()->events = new Elgg\EventsService();
     $this->entity1 = new ElggObject();
     $this->entity1->subtype = 'elgg_relationship_test';
     $this->entity1->access_id = ACCESS_PUBLIC;
     $this->entity1->save();
     $this->entity2 = new ElggObject();
     $this->entity2->subtype = 'elgg_relationship_test';
     $this->entity2->access_id = ACCESS_PUBLIC;
     $this->entity2->save();
     $this->entity3 = new ElggObject();
     $this->entity3->subtype = 'elgg_relationship_test';
     $this->entity3->access_id = ACCESS_PUBLIC;
     $this->entity3->save();
 }
开发者ID:cyrixhero,项目名称:Elgg,代码行数:20,代码来源:ElggRelationshipTest.php

示例7: testSaveWithoutType

 /**
  * @expectedException InvalidParameterException
  */
 public function testSaveWithoutType()
 {
     $db = $this->getMock('\\Elgg\\Database', array('getData', 'getTablePrefix', 'sanitizeString'), array(), '', false);
     $db->expects($this->any())->method('sanitizeString')->will($this->returnArgument(0));
     _elgg_services()->setValue('db', $db);
     // requires type to be set
     $this->obj->save();
 }
开发者ID:ibou77,项目名称:elgg,代码行数:11,代码来源:ElggEntityTest.php

示例8: update

 /**
  * Updates entity information with user input values
  * @return \ElggEntity|false
  */
 public function update()
 {
     hypePrototyper()->prototype->saveStickyValues($this->action);
     // first handle attributes
     foreach ($this->fields as $field) {
         if ($field->getDataType() == 'attribute') {
             $this->entity = $field->handle($this->entity);
         }
     }
     if (!$this->entity->save()) {
         return false;
     }
     foreach ($this->fields as $field) {
         if ($field->getDataType() !== 'attribute') {
             $this->entity = $field->handle($this->entity);
         }
     }
     if (!$this->entity->save()) {
         return false;
     }
     hypePrototyper()->prototype->clearStickyValues($this->action);
     return $this->entity;
 }
开发者ID:hypejunction,项目名称:hypeprototyper,代码行数:27,代码来源:ActionController.php

示例9: save

 /**
  * Saves this user to the database.
  * @return true|false
  */
 public function save()
 {
     // Save generic stuff
     if (!parent::save()) {
         return false;
     }
     // Now save specific stuff
     return create_user_entity($this->get('guid'), $this->get('name'), $this->get('username'), $this->get('password'), $this->get('salt'), $this->get('email'), $this->get('language'), $this->get('code'));
 }
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:13,代码来源:users.php

示例10: save

 /**
  * Saves site-specific attributes.
  *
  * @internal Site attributes are saved in the sites_entity table.
  *
  * @return bool
  */
 public function save()
 {
     global $CONFIG;
     // Save generic stuff
     if (!parent::save()) {
         return false;
     }
     // make sure the site guid is set (if not, set to self)
     if (!$this->get('site_guid')) {
         $guid = $this->get('guid');
         update_data("UPDATE {$CONFIG->dbprefix}entities SET site_guid={$guid}\n\t\t\t\tWHERE guid={$guid}");
     }
     // Now save specific stuff
     return create_site_entity($this->get('guid'), $this->get('name'), $this->get('description'), $this->get('url'));
 }
开发者ID:redvabel,项目名称:Vabelgg,代码行数:22,代码来源:ElggSite.php

示例11: save

 /**
  * Override the save function.
  *
  * @return bool
  */
 public function save()
 {
     // Save generic stuff
     if (!parent::save()) {
         return false;
     }
     // Now save specific stuff
     _elgg_disable_caching_for_entity($this->guid);
     $ret = create_group_entity($this->get('guid'), $this->get('name'), $this->get('description'));
     _elgg_enable_caching_for_entity($this->guid);
     return $ret;
 }
开发者ID:elainenaomi,项目名称:labxp2014,代码行数:17,代码来源:ElggGroup.php

示例12: save

 /**
  * Saves object-specific attributes.
  *
  * @internal Object attributes are saved in the objects_entity table.
  *
  * @return bool
  */
 public function save()
 {
     // Save ElggEntity attributes
     if (!parent::save()) {
         return false;
     }
     // Save ElggObject-specific attributes
     _elgg_disable_caching_for_entity($this->guid);
     $ret = create_object_entity($this->get('guid'), $this->get('title'), $this->get('description'));
     _elgg_enable_caching_for_entity($this->guid);
     return $ret;
 }
开发者ID:elainenaomi,项目名称:labxp2014,代码行数:19,代码来源:ElggObject.php

示例13: save

 /**
  * Override the save function.
  * @return true|false
  */
 public function save()
 {
     // Save generic stuff
     if (!parent::save()) {
         return false;
     }
     // Now save specific stuff
     return create_object_entity($this->get('guid'), $this->get('title'), $this->get('description'), $this->get('container_guid'));
 }
开发者ID:eokyere,项目名称:elgg,代码行数:13,代码来源:objects.php

示例14: save

 /**
  * Override the save function.
  *
  * @return bool
  */
 public function save()
 {
     // Save generic stuff
     if (!parent::save()) {
         return false;
     }
     // Now save specific stuff
     return create_group_entity($this->get('guid'), $this->get('name'), $this->get('description'));
 }
开发者ID:redvabel,项目名称:Vabelgg,代码行数:14,代码来源:ElggGroup.php

示例15: save

 /** @override */
 public function save()
 {
     global $CONFIG;
     // Save generic stuff
     $result = parent::save();
     if (!$result) {
         return false;
     }
     // make sure the site guid is set (if not, set to self)
     if (!$this->get('site_guid')) {
         $guid = (int) $this->get('guid');
         update_data("UPDATE {$CONFIG->dbprefix}entities SET site_guid={$guid} WHERE guid={$guid}");
     }
     return $result;
 }
开发者ID:nogsus,项目名称:Elgg,代码行数:16,代码来源:ElggSite.php


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