예제 #1
0
 public function register(Feature $feature, $strategyName)
 {
     if (!$this->isStrategyRegistered($strategyName)) {
         throw new \InvalidArgumentException(sprintf("Strategy '%s' is not registered.", $strategyName));
     }
     $this->features[] = $feature;
     $this->featureStrategyMapping[$feature->getName()] = $strategyName;
 }
예제 #2
0
파일: Pdo.php 프로젝트: leoht/erlenmeyer
 public function save(Feature $feature, $userKey, $variant)
 {
     $table = $this->tableName;
     $stmt = $this->pdo->prepare("INSERT INTO {$table} (id, user, feature, variant) VALUES (NULL, :user, :feature, :variant)");
     $stmt->bindParam('user', $userKey);
     $stmt->bindParam('feature', $feature->getName());
     $stmt->bindParam('variant', $variant);
     return $stmt->execute();
 }