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


PHP object::flush方法代码示例

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


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

示例1: copyLocaleData

 public function copyLocaleData(LocaleInterface $sourceLocale, LocaleInterface $targetLocale)
 {
     $repositories = $this->getTranslatableRespositories();
     $repositories->map(function (EntityRepository $repository) use($sourceLocale, $targetLocale) {
         $this->copyTranslatableEntities($repository, $sourceLocale, $targetLocale);
     });
     $this->entityManager->flush();
 }
开发者ID:wellcommerce,项目名称:wellcommerce,代码行数:8,代码来源:LocaleCopier.php

示例2: set

 public function set($configKey, $value)
 {
     $configItem = $this->get($configKey);
     if (!$configItem) {
         $configItem = ConfigItemFactory::createConfigItem($configKey, $value, $this->applicationId);
     }
     $this->_em->persist($configItem);
     $this->_em->flush();
     $this->_em->clear();
     return $configItem;
 }
开发者ID:EvoCommerceTeam,项目名称:ConfigBundle,代码行数:11,代码来源:OrmDataSource.php

示例3: setOauthCode

 /**
  * Sets oauth code to database.
  * @param string $authCode
  * @param object $client
  * @return boolean
  * @throws \Exception
  */
 public function setOauthCode($authCode, $client)
 {
     $oauthCode = new OauthCode();
     $oauthCode->setClient($client);
     $oauthCode->setCode($authCode);
     $oauthCode->setExpired('false');
     try {
         $this->em->persist($oauthCode);
         $this->em->flush();
         return true;
     } catch (\Exception $ex) {
         throw new \Exception($ex->getMessage());
     }
 }
开发者ID:narensgh,项目名称:ZF2-auth2,代码行数:21,代码来源:Authorize.php

示例4: execute

 public function execute()
 {
     /** @var Ticket $ticket */
     $ticket = $this->context->getFact()->getTarget();
     $branchId = $this->context->getParameters()->has('branch') ? $this->context->getParameters()->get('branch') : null;
     if (is_null($branchId)) {
         throw new \RuntimeException("Invalid rule configuration");
     }
     $branch = $this->em->getRepository('DiamanteDeskBundle:Branch')->get($branchId);
     $ticket->move($branch);
     $this->em->persist($ticket);
     $this->em->flush();
     $this->em->clear($ticket);
 }
开发者ID:jalopezsuarez,项目名称:diamantedesk-application,代码行数:14,代码来源:MoveToBranchAction.php

示例5: afterScenario

 /**
  * Listens to "scenario.after" and "outline.example.after" event.
  *
  * @param \Behat\Behat\Tester\Event\AbstractScenarioTested $event
  */
 public function afterScenario(ScenarioTested $event)
 {
     if ('scenario' !== $this->lifetime) {
         return;
     }
     $this->fixtureService->flush();
 }
开发者ID:Spomky,项目名称:DoctrineDataFixturesExtension,代码行数:12,代码来源:HookListener.php

示例6: afterOutlineExample

 /**
  * Listens to "outline.example.after" event.
  *
  * @param \Behat\Behat\Event\OutlineExampleEvent $event
  */
 public function afterOutlineExample(OutlineExampleEvent $event)
 {
     if ('scenario' !== $this->lifetime) {
         return;
     }
     $this->fixtureService->flush();
 }
开发者ID:austinpapp,项目名称:push-notifications-temp,代码行数:12,代码来源:HookListener.php

示例7: authenticate

 /**
  * Performs an authentication attempt
  *
  * @throws Zend_Auth_Adapter_Exception If authentication cannot be performed
  * @return Zend_Auth_Result
  */
 public function authenticate()
 {
     $user = $this->_em->getRepository($this->_model)->findOneBy(array('username' => $this->_username));
     $result = array('code' => Zend_Auth_Result::FAILURE, 'identity' => array('username' => $this->_username), 'messages' => array());
     if (!$user) {
         return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND, $result['identity'], $result['messages']);
     }
     $pwcheck = false;
     if (!$this->_haveCookie) {
         $pwcheck = OSS_Auth_Password::verify($this->_password, $user->getPassword(), $this->_aoptions);
         if (!$pwcheck) {
             if (method_exists($user, 'setFailedLogins')) {
                 $user->setFailedLogins($user->getFailedLogins() + 1);
                 $this->_em->flush();
                 $result['identity'] = array('count' => $user->getFailedLogins());
             }
             return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, $result['identity'], $result['messages']);
         }
     }
     if ($pwcheck || $this->_haveCookie) {
         $result['code'] = Zend_Auth_Result::SUCCESS;
         $result['messages'] = array();
         $result['identity'] = array('username' => $this->_username, 'user' => $user, 'id' => $user->getId());
     } else {
         die('Huh? This should not have happened....');
     }
     return new Zend_Auth_Result($result['code'], $result['identity'], $result['messages']);
 }
开发者ID:opensolutions,项目名称:oss-framework,代码行数:34,代码来源:Doctrine2Adapter.php

示例8: getCache

 /**
  * Do any Page Caching if $this->cacheMethod is set.
  * You should also look at output caching by overriding the outputBody Method.
  *
  * Note that Caching is disabled in a number of situations.
  *   a) cacheMethod is empty
  *   b) POST requests
  *   c) if sess is set (Eg. if you are using sessions)
  *   d) useCache is not set in the [Cache] section of the config.
  * 
  * utilizes $this->getCacheID() to  
  *
  * @return   none|boolean|string|int|object    Description
  * @access   public|private
  * @see      see also methods.....
  */
 function getCache()
 {
     if (!$this->cacheMethod) {
         return;
     }
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         return;
     }
     /* lets assume we can cache ourselves.. */
     $coptions = PEAR::getStaticProperty('Cache', 'options');
     if (!$coptions) {
         return;
     }
     if (empty($coptions['useCache'])) {
         return;
     }
     require_once 'Cache.php';
     $this->_cache = new Cache($coptions['container'], $coptions);
     $id = $this->_cache->generateID($this->getCacheID());
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         $this->_cache->flush($id);
         return;
     }
     if ($data = $this->_cache->get($id)) {
         echo $data;
         return TRUE;
     }
 }
开发者ID:roojs,项目名称:pear,代码行数:44,代码来源:Page.php

示例9: delete

 /**
  * Deletes the specified cache or each one if '' given
  * 	 
  * @param string $name cache name
  *
  * @return bool
  */
 public function delete($name = '')
 {
     if ($name == '') {
         return $this->provider->flush();
     } else {
         return $this->provider->delete($this->prefix . $name);
     }
 }
开发者ID:kemist80,项目名称:Cache,代码行数:15,代码来源:AbstractStorage.php

示例10: clean

 /**
  * Clean the Cache
  *
  * @return	bool	false on failure/true on success
  */
 public function clean()
 {
     if ($this->is_supported()) {
         return $this->_memcached->flush();
     } else {
         return FALSE;
     }
 }
开发者ID:897475686,项目名称:vc,代码行数:13,代码来源:Cache_memcached.php

示例11: deleteSaved

 /**
  * Delete all the saved models.
  *
  * @throws \League\FactoryMuffin\Exceptions\DeletingFailedException
  *
  * @return void
  */
 public function deleteSaved()
 {
     parent::deleteSaved();
     try {
         $this->storage->flush();
     } catch (\Exception $e) {
         throw new DeletingFailedException([$e]);
     }
 }
开发者ID:DavertMik,项目名称:factory-muffin,代码行数:16,代码来源:RepositoryStore.php

示例12: clear_cache

 /**
  * Leerung des Cache
  *
  * @since   2.0.7
  * @change  2.0.7
  */
 public static function clear_cache()
 {
     /* Server connect */
     if (!self::_connect_server()) {
         return;
     }
     /* Flush */
     @self::$_memcached->flush();
 }
开发者ID:pattyland,项目名称:cachify,代码行数:15,代码来源:cachify_memcached.class.php

示例13: Clean

		/**
		 * Set option
		 *
		 * @param $key
		 * @param $value
		 */
		public function Clean()
		{
			if (!$this->IsConnected)
				$this->Connect();
			
			if ($this->IsConnected)	
				return $this->MemCache->flush();
			else 
				return false;
		}
开发者ID:rchicoria,项目名称:epp-drs,代码行数:16,代码来源:class.MemcacheCacheDriver.php

示例14: _write

 /**
  * The session save handler callback for writing data to the session.
  *
  * @param string $key The key of the data to be returned.
  * @param mixed $value The value to be written to the session.
  * @return boolean True if write was successful, false otherwise.
  */
 public function _write($id, $data)
 {
     $expires = new \DateTime();
     $expires->add(\DateInterval::createFromDateString($this->config['expiration']));
     $this->record->setId($id);
     $this->record->setData($data ?: null);
     $this->record->setExpires($expires);
     $this->entityManager->persist($this->record);
     $this->entityManager->flush($this->record);
 }
开发者ID:mariano,项目名称:li3_doctrine2,代码行数:17,代码来源:Entity.php

示例15: load

 /**
  * Load data fixtures with the passed EntityManager
  *
  * @param object $manager
  */
 function load($manager)
 {
     foreach (range(0, 10) as $n) {
         $feature = new Feature();
         $feature->setName("feature-" . $n);
         $feature->setDescription("feature-" . $n);
         $feature->setProject($this->getReference('project-salgamos'));
         $this->addReference('feature-' . $n, $feature);
         $manager->persist($feature);
     }
     $manager->flush();
 }
开发者ID:ratasxy,项目名称:Aguila,代码行数:17,代码来源:FeatureFixture.php


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