enabled() public method

Check if a feature slug is enabled for a particular bucket index.
public enabled ( string $slug, binary $index ) : boolean
$slug string
$index binary
return boolean
Example #1
0
 /**
  * Check if a behavior is enabled for a particular context/bucket combination.
  *
  * @param \Zumba\Swivel\BehaviorInterface $behavior
  *
  * @return bool
  *
  * @see \Zumba\Swivel\BucketInterface
  */
 public function enabled(BehaviorInterface $behavior)
 {
     $slug = $behavior->getSlug();
     if (!$this->featureMap->slugExists($slug)) {
         call_user_func($this->callback, $slug);
     }
     return $this->featureMap->enabled($slug, $this->index);
 }
Example #2
0
 /**
  * Check if a behavior is enabled for a particular context/bucket combination
  *
  * @param \Zumba\Swivel\BehaviorInterface $behavior
  * @return boolean
  * @see \Zumba\Swivel\BucketInterface
  */
 public function enabled(BehaviorInterface $behavior)
 {
     return $this->featureMap->enabled($behavior->getSlug(), $this->index);
 }