Exemplo n.º 1
0
 /**
  * create default score rule for the current account
  */
 public static function createDefaultScoreRule($accountId)
 {
     $now = time();
     ScoreRule::getCollection()->batchInsert([['name' => ScoreRule::NAME_PERFECT_INFO, 'type' => ScoreRule::TYPE_EVENT, "accountId" => $accountId, "createdAt" => new \MongoDate($now), "updatedAt" => new \MongoDate($now), "isEnabled" => false, "isDeleted" => false], ['name' => ScoreRule::NAME_BIRTHDAY, 'type' => ScoreRule::TYPE_EVENT, "accountId" => $accountId, "createdAt" => new \MongoDate($now), "updatedAt" => new \MongoDate($now), "isEnabled" => false, "isDeleted" => false], ['name' => ScoreRule::NAME_FIRST_CARD, 'type' => ScoreRule::TYPE_EVENT, "accountId" => $accountId, "createdAt" => new \MongoDate($now), "updatedAt" => new \MongoDate($now), "isEnabled" => false, "isDeleted" => false]]);
 }