Пример #1
0
 public function setVersion($v, $subType = self::FILE_SYNC_UICONF_SUB_TYPE_CONFIG)
 {
     switch ($subType) {
         case self::FILE_SYNC_UICONF_SUB_TYPE_CONFIG:
             return parent::setVersion($v);
         case self::FILE_SYNC_UICONF_SUB_TYPE_DATA:
             return $this->setConfFileVersion($v);
         case self::FILE_SYNC_UICONF_SUB_TYPE_FEATURES:
             return $this->setConfFileFeaturesVersion($v);
     }
     return parent::setVersion($v);
 }
Пример #2
0
 /**
  * Returns a peer instance associated with this om.
  *
  * Since Peer classes are not to have any instance attributes, this method returns the
  * same instance for all member of this class. The method could therefore
  * be static, but this would prevent one from overriding the behavior.
  *
  * @return     uiConfPeer
  */
 public function getPeer()
 {
     if (self::$peer === null) {
         self::$peer = new uiConfPeer();
     }
     return self::$peer;
 }
 public function setConfFilePath($v)
 {
     if (kString::beginsWith($v, "..")) {
         $err = "Error in " . __METHOD__ . ": attmpting to set ConfFilePath to [{$v}]";
         KalturaLog::log($err);
         throw new APIException(APIErrors::ERROR_SETTING_FILE_PATH_FOR_UI_CONF, $v);
     }
     if ($this->getCreationMode() == self::UI_CONF_CREATION_MODE_MANUAL) {
         if (!kString::beginsWith($v, $this->getUiConfRootDirectory() . "uiconf/")) {
             $v = $this->getUiConfRootDirectory() . "uiconf/" . $v;
         }
         $real_v = realpath(dirname($v)) . "/" . pathinfo($v, PATHINFO_BASENAME);
         if ($v) {
             if ($real_v) {
                 /*
                  * TODO - add this id the service IS externally use via the API					
                 					// the file exists - make sure we're not overiding someone elses file 
                 					$ui_confs_with_same_path = uiConfPeer::retrieveByConfFilePath ( $real_v , $this->getId() );
                 					foreach ( $ui_confs_with_same_path as $ui_conf  )
                 					{
                 						if ( $ui_conf->getPartnerId ( ) != $this->getPartnerId() )
                 						{
                 							$err = "Error in " . __METHOD__ . ": attmpting to set ConfFilePath to [$v]";
                 							KalturaLog::log( $err );
                 							throw new APIException ( APIErrors::ERROR_SETTING_FILE_PATH_FOR_UI_CONF , $v );							
                 						}
                 					}
                 */
                 $v = $real_v;
             }
         }
         parent::setConfFilePath($v);
     } else {
         parent::setConfFilePath($v);
         //			throw new APIException ( APIErrors::ERROR_SETTING_FILE_PATH_FOR_UI_CONF , $v );
     }
 }