예제 #1
0
 /**
  * Generate a unique key from the method name and arguments
  *
  * @param  string   $method  The method name
  * @param  array    $args    Method arguments
  * @param  array    $options Options
  * @return string
  * @throws Exception
  */
 public function generateKey($method, array $args = array(), array $options = array())
 {
     $classOptions = $this->getOptions();
     if (!isset($options['callback_key'])) {
         if (isset($options['entity_key']) && ($entityKey = $options['entity_key']) !== null || ($entityKey = $classOptions->getObjectKey() !== null)) {
             $options['callback_key'] = $entityKey . '::' . strtolower($method);
             unset($options['entity_key']);
         }
     }
     return parent::generateKey(array($classOptions->getObject(), $method), $args, $options);
 }
예제 #2
0
 /**
  * Generate a key from the method name and arguments
  *
  * @param  string   $method  The method name
  * @param  array    $args    Method arguments
  * @return string
  * @throws Exception
  */
 public function generateKey($method, array $args = array(), array $options = array())
 {
     // speed up key generation
     $classOptions = $this->getOptions();
     if (!isset($options['callback_key'])) {
         $callback = $classOptions->getClass() . '::' . strtolower($method);
         $options['callback_key'] = $callback;
     } else {
         $callback = $classOptions->getClass() . '::' . $method;
     }
     return parent::generateKey($callback, $args, $options);
 }