Example #1
0
 public function validateSystemNameDuplication($serverNodeId = null, $type)
 {
     $c = KalturaCriteria::create(ServerNodePeer::OM_CLASS);
     if ($serverNodeId) {
         $c->add(ServerNodePeer::ID, $serverNodeId, Criteria::NOT_EQUAL);
     }
     $c->add(ServerNodePeer::SYSTEM_NAME, $this->systemName);
     $c->add(ServerNodePeer::TYPE, $type);
     if (ServerNodePeer::doCount($c)) {
         throw new KalturaAPIException(KalturaErrors::SYSTEM_NAME_ALREADY_EXISTS, $this->systemName);
     }
 }