diff --git a/api/libretime_api/legacy/migrations/0029_3_0_0_alpha_13_3.py b/api/libretime_api/legacy/migrations/0029_3_0_0_alpha_13_3.py
new file mode 100644
index 000000000..63d3281af
--- /dev/null
+++ b/api/libretime_api/legacy/migrations/0029_3_0_0_alpha_13_3.py
@@ -0,0 +1,41 @@
+from django.db import migrations
+
+from ._migrations import legacy_migration_factory
+
+UP = """
+ALTER TABLE "cc_files" DROP CONSTRAINT "cc_music_dirs_folder_fkey";
+ALTER TABLE "cc_files" DROP COLUMN "directory";
+DROP TABLE "cc_music_dirs";
+"""
+
+DOWN = """
+CREATE TABLE "cc_music_dirs"
+(
+ "id" serial NOT NULL,
+ "directory" TEXT,
+ "type" VARCHAR(255),
+ "exists" BOOLEAN DEFAULT 't',
+ "watched" BOOLEAN DEFAULT 't',
+ PRIMARY KEY ("id"),
+ CONSTRAINT "cc_music_dir_unique" UNIQUE ("directory")
+);
+
+ALTER TABLE "cc_files" ADD COLUMN "directory" INTEGER;
+ALTER TABLE "cc_files" ADD CONSTRAINT "cc_music_dirs_folder_fkey"
+ FOREIGN KEY ("directory")
+ REFERENCES "cc_music_dirs" ("id");
+"""
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("legacy", "0028_3_0_0_alpha_13_2"),
+ ]
+ operations = [
+ migrations.RunPython(
+ code=legacy_migration_factory(
+ target="3.0.0-alpha.13.3",
+ sql=UP,
+ )
+ )
+ ]
diff --git a/api/libretime_api/legacy/migrations/__init__.py b/api/libretime_api/legacy/migrations/__init__.py
index 8804155dc..5aa304542 100644
--- a/api/libretime_api/legacy/migrations/__init__.py
+++ b/api/libretime_api/legacy/migrations/__init__.py
@@ -1 +1 @@
-LEGACY_SCHEMA_VERSION = "3.0.0-alpha.13.2"
+LEGACY_SCHEMA_VERSION = "3.0.0-alpha.13.3"
diff --git a/api/libretime_api/legacy/migrations/sql/schema.sql b/api/libretime_api/legacy/migrations/sql/schema.sql
index 2b705d17f..94a948486 100644
--- a/api/libretime_api/legacy/migrations/sql/schema.sql
+++ b/api/libretime_api/legacy/migrations/sql/schema.sql
@@ -1,21 +1,4 @@
------------------------------------------------------------------------
--- cc_music_dirs
------------------------------------------------------------------------
-
-DROP TABLE IF EXISTS "cc_music_dirs" CASCADE;
-
-CREATE TABLE "cc_music_dirs"
-(
- "id" serial NOT NULL,
- "directory" TEXT,
- "type" VARCHAR(255),
- "exists" BOOLEAN DEFAULT 't',
- "watched" BOOLEAN DEFAULT 't',
- PRIMARY KEY ("id"),
- CONSTRAINT "cc_music_dir_unique" UNIQUE ("directory")
-);
-
-----------------------------------------------------------------------
-- cc_files
-----------------------------------------------------------------------
@@ -28,7 +11,6 @@ CREATE TABLE "cc_files"
"name" VARCHAR(255) DEFAULT '' NOT NULL,
"mime" VARCHAR(255) DEFAULT '' NOT NULL,
"ftype" VARCHAR(128) DEFAULT '' NOT NULL,
- "directory" INTEGER,
"filepath" TEXT DEFAULT '',
"import_status" INTEGER DEFAULT 1 NOT NULL,
"currentlyaccessing" INTEGER DEFAULT 0 NOT NULL,
@@ -792,10 +774,6 @@ ALTER TABLE "cc_files" ADD CONSTRAINT "cc_files_editedby_fkey"
FOREIGN KEY ("editedby")
REFERENCES "cc_subjs" ("id");
-ALTER TABLE "cc_files" ADD CONSTRAINT "cc_music_dirs_folder_fkey"
- FOREIGN KEY ("directory")
- REFERENCES "cc_music_dirs" ("id");
-
ALTER TABLE "cloud_file" ADD CONSTRAINT "cloud_file_FK_1"
FOREIGN KEY ("cc_file_id")
REFERENCES "cc_files" ("id")
diff --git a/api/libretime_api/schedule/tests/views/test_schedule.py b/api/libretime_api/schedule/tests/views/test_schedule.py
index c65abc5fa..0aa8efae3 100644
--- a/api/libretime_api/schedule/tests/views/test_schedule.py
+++ b/api/libretime_api/schedule/tests/views/test_schedule.py
@@ -5,7 +5,7 @@ from django.utils import dateparse
from model_bakery import baker
from rest_framework.test import APITestCase
-from ...._fixtures import AUDIO_FILENAME, fixture_path
+from ...._fixtures import AUDIO_FILENAME
class TestScheduleViewSet(APITestCase):
@@ -15,13 +15,8 @@ class TestScheduleViewSet(APITestCase):
cls.token = settings.CONFIG.general.api_key
def test_schedule_item_full_length(self):
- music_dir = baker.make(
- "storage.MusicDir",
- directory=str(fixture_path),
- )
file = baker.make(
"storage.File",
- directory=music_dir,
mime="audio/mp3",
filepath=AUDIO_FILENAME,
length=timedelta(seconds=40.86),
@@ -51,13 +46,8 @@ class TestScheduleViewSet(APITestCase):
self.assertEqual(dateparse.parse_duration(result[0]["cue_out"]), file.cueout)
def test_schedule_item_trunc(self):
- music_dir = baker.make(
- "storage.MusicDir",
- directory=str(fixture_path),
- )
file = baker.make(
"storage.File",
- directory=music_dir,
mime="audio/mp3",
filepath=AUDIO_FILENAME,
length=timedelta(seconds=40.86),
@@ -88,13 +78,8 @@ class TestScheduleViewSet(APITestCase):
)
def test_schedule_item_invalid(self):
- music_dir = baker.make(
- "storage.MusicDir",
- directory=str(fixture_path),
- )
file = baker.make(
"storage.File",
- directory=music_dir,
mime="audio/mp3",
filepath=AUDIO_FILENAME,
length=timedelta(seconds=40.86),
@@ -134,13 +119,8 @@ class TestScheduleViewSet(APITestCase):
self.assertEqual(dateparse.parse_duration(result[0]["cue_out"]), file.cueout)
def test_schedule_item_range(self):
- music_dir = baker.make(
- "storage.MusicDir",
- directory=str(fixture_path),
- )
file = baker.make(
"storage.File",
- directory=music_dir,
mime="audio/mp3",
filepath=AUDIO_FILENAME,
length=timedelta(seconds=40.86),
diff --git a/api/libretime_api/settings/_schema.py b/api/libretime_api/settings/_schema.py
index 80b1b876f..5b339f775 100644
--- a/api/libretime_api/settings/_schema.py
+++ b/api/libretime_api/settings/_schema.py
@@ -3,6 +3,7 @@ from libretime_shared.config import (
DatabaseConfig,
GeneralConfig,
RabbitMQConfig,
+ StorageConfig,
)
@@ -10,3 +11,4 @@ class Config(BaseConfig):
general: GeneralConfig
database: DatabaseConfig = DatabaseConfig()
rabbitmq: RabbitMQConfig = RabbitMQConfig()
+ storage: StorageConfig = StorageConfig()
diff --git a/api/libretime_api/settings/testing.py b/api/libretime_api/settings/testing.py
index d884a3a7f..e75aa74ea 100644
--- a/api/libretime_api/settings/testing.py
+++ b/api/libretime_api/settings/testing.py
@@ -1,8 +1,11 @@
import os
+from .._fixtures import fixture_path
+
os.environ.setdefault("LIBRETIME_DEBUG", "true")
os.environ.setdefault("LIBRETIME_GENERAL_PUBLIC_URL", "http://localhost")
os.environ.setdefault("LIBRETIME_GENERAL_API_KEY", "testing")
+os.environ.setdefault("LIBRETIME_STORAGE_PATH", str(fixture_path))
# pylint: disable=wrong-import-position,unused-import
from .prod import (
diff --git a/api/libretime_api/storage/models/__init__.py b/api/libretime_api/storage/models/__init__.py
index 6a0f0dbd6..aabfb9d53 100644
--- a/api/libretime_api/storage/models/__init__.py
+++ b/api/libretime_api/storage/models/__init__.py
@@ -1,4 +1,3 @@
from .cloud_file import CloudFile
from .file import File
-from .storage import MusicDir
from .track_type import TrackType
diff --git a/api/libretime_api/storage/models/file.py b/api/libretime_api/storage/models/file.py
index ddbba8017..ac2e6cc0e 100644
--- a/api/libretime_api/storage/models/file.py
+++ b/api/libretime_api/storage/models/file.py
@@ -5,9 +5,6 @@ class File(models.Model):
name = models.CharField(max_length=255)
mime = models.CharField(max_length=255)
ftype = models.CharField(max_length=128)
- directory = models.ForeignKey(
- "MusicDir", models.DO_NOTHING, db_column="directory", blank=True, null=True
- )
filepath = models.TextField(blank=True, null=True)
import_status = models.IntegerField()
currently_accessing = models.IntegerField(db_column="currentlyaccessing")
diff --git a/api/libretime_api/storage/models/storage.py b/api/libretime_api/storage/models/storage.py
deleted file mode 100644
index ea4fdc14e..000000000
--- a/api/libretime_api/storage/models/storage.py
+++ /dev/null
@@ -1,12 +0,0 @@
-from django.db import models
-
-
-class MusicDir(models.Model):
- directory = models.TextField(unique=True, blank=True, null=True)
- type = models.CharField(max_length=255, blank=True, null=True)
- exists = models.BooleanField(blank=True, null=True)
- watched = models.BooleanField(blank=True, null=True)
-
- class Meta:
- managed = False
- db_table = "cc_music_dirs"
diff --git a/api/libretime_api/storage/router.py b/api/libretime_api/storage/router.py
index ee37a1f0b..675ca3e93 100644
--- a/api/libretime_api/storage/router.py
+++ b/api/libretime_api/storage/router.py
@@ -1,9 +1,8 @@
from rest_framework import routers
-from .views import CloudFileViewSet, FileViewSet, MusicDirViewSet, TrackTypeViewSet
+from .views import CloudFileViewSet, FileViewSet, TrackTypeViewSet
router = routers.DefaultRouter()
router.register("files", FileViewSet)
-router.register("music-dirs", MusicDirViewSet)
router.register("cloud-files", CloudFileViewSet)
router.register("track-types", TrackTypeViewSet)
diff --git a/api/libretime_api/storage/serializers/__init__.py b/api/libretime_api/storage/serializers/__init__.py
index cd1b48f63..279d99f94 100644
--- a/api/libretime_api/storage/serializers/__init__.py
+++ b/api/libretime_api/storage/serializers/__init__.py
@@ -1,4 +1,3 @@
from .cloud_file import CloudFileSerializer
from .file import FileSerializer
-from .storage import MusicDirSerializer
from .track_type import TrackTypeSerializer
diff --git a/api/libretime_api/storage/serializers/storage.py b/api/libretime_api/storage/serializers/storage.py
deleted file mode 100644
index 211b844f0..000000000
--- a/api/libretime_api/storage/serializers/storage.py
+++ /dev/null
@@ -1,9 +0,0 @@
-from rest_framework import serializers
-
-from ..models import MusicDir
-
-
-class MusicDirSerializer(serializers.HyperlinkedModelSerializer):
- class Meta:
- model = MusicDir
- fields = "__all__"
diff --git a/api/libretime_api/storage/tests/views/test_file.py b/api/libretime_api/storage/tests/views/test_file.py
index 05d12415c..07e51b806 100644
--- a/api/libretime_api/storage/tests/views/test_file.py
+++ b/api/libretime_api/storage/tests/views/test_file.py
@@ -24,13 +24,8 @@ class TestFileViewSet(APITestCase):
self.assertEqual(response.status_code, 404)
def test_exists(self):
- music_dir = baker.make(
- "storage.MusicDir",
- directory=str(fixture_path),
- )
file = baker.make(
"storage.File",
- directory=music_dir,
mime="audio/mp3",
filepath=AUDIO_FILENAME,
)
diff --git a/api/libretime_api/storage/views/__init__.py b/api/libretime_api/storage/views/__init__.py
index a489b503d..0c88b6c69 100644
--- a/api/libretime_api/storage/views/__init__.py
+++ b/api/libretime_api/storage/views/__init__.py
@@ -1,4 +1,3 @@
from .cloud_file import CloudFileViewSet
from .file import FileViewSet
-from .storage import MusicDirViewSet
from .track_type import TrackTypeViewSet
diff --git a/api/libretime_api/storage/views/file.py b/api/libretime_api/storage/views/file.py
index ebffc1389..7f09b68a2 100644
--- a/api/libretime_api/storage/views/file.py
+++ b/api/libretime_api/storage/views/file.py
@@ -1,5 +1,6 @@
import os
+from django.conf import settings
from django.http import FileResponse
from django.shortcuts import get_object_or_404
from rest_framework import viewsets
@@ -20,7 +21,5 @@ class FileViewSet(viewsets.ModelViewSet):
pk = IntegerField().to_internal_value(data=pk)
file = get_object_or_404(File, pk=pk)
- storage = file.directory
- path = os.path.join(storage.directory, file.filepath)
-
+ path = os.path.join(settings.CONFIG.storage.path, file.filepath)
return FileResponse(open(path, "rb"), content_type=file.mime)
diff --git a/api/libretime_api/storage/views/storage.py b/api/libretime_api/storage/views/storage.py
deleted file mode 100644
index 3da80c953..000000000
--- a/api/libretime_api/storage/views/storage.py
+++ /dev/null
@@ -1,10 +0,0 @@
-from rest_framework import viewsets
-
-from ..models import MusicDir
-from ..serializers import MusicDirSerializer
-
-
-class MusicDirViewSet(viewsets.ModelViewSet):
- queryset = MusicDir.objects.all()
- serializer_class = MusicDirSerializer
- model_permission_name = "musicdir"
diff --git a/install b/install
index 5fda18bce..039806e38 100755
--- a/install
+++ b/install
@@ -396,7 +396,6 @@ info "creating project directories"
mkdir_and_chown "$LIBRETIME_USER" "$CONFIG_DIR"
mkdir_and_chown "$LIBRETIME_USER" "$WORKING_DIR"
mkdir_and_chown "$LIBRETIME_USER" "$LOG_DIR"
-mkdir_and_chown "$LIBRETIME_USER" "$STORAGE_DIR"
if $is_first_install; then
[[ -f "$CONFIG_TMP_FILEPATH" ]] || cp "$CONFIG_EXAMPLE_FILEPATH" "$CONFIG_TMP_FILEPATH"
@@ -406,6 +405,9 @@ if $is_first_install; then
set_config "$LIBRETIME_PUBLIC_URL" general public_url
fi
set_config "$(generate_random_password)" general api_key
+
+ mkdir_and_chown "$LIBRETIME_USER" "$STORAGE_DIR"
+ set_config "$STORAGE_DIR" storage path
fi
# PostgreSQL
diff --git a/installer/config.yml b/installer/config.yml
index 6d577ad8b..ed2e731e0 100644
--- a/installer/config.yml
+++ b/installer/config.yml
@@ -17,6 +17,10 @@ general:
# Specify a class like LibreTime_Auth_Adaptor_FreeIpa to replace the built-in adaptor
auth: local
+storage:
+ # Path of the storage directory, default is /srv/libretime
+ path: /srv/libretime
+
database:
# The hostname of the PostgreSQL server, default is localhost
host: localhost
diff --git a/legacy/application/common/FileDataHelper.php b/legacy/application/common/FileDataHelper.php
index cc4b65a4d..f64c60e4c 100644
--- a/legacy/application/common/FileDataHelper.php
+++ b/legacy/application/common/FileDataHelper.php
@@ -93,8 +93,7 @@ class FileDataHelper
$get_file_content = file_get_contents($path);
}
} else {
- $storDir = Application_Model_MusicDir::getStorDir();
- $path = $storDir->getDirectory() . $file . '-' . $size;
+ $path = Config::getStoragePath() . $file . '-' . $size;
if (!file_exists($path)) {
$get_file_content = $default;
} else {
@@ -132,8 +131,8 @@ class FileDataHelper
$Image = 'data:' . $mime . ';charset=utf-8;base64,' . base64_encode($getFileInfo['comments']['picture'][0]['data']);
$base64 = @$Image;
- if (!file_exists($importDir . '/' . 'artwork/')) {
- if (!mkdir($importDir . '/' . 'artwork/', 0777, true)) {
+ if (!file_exists($importDir . 'artwork/')) {
+ if (!mkdir($importDir . 'artwork/', 0777, true)) {
Logging::error('Failed to create artwork directory.');
throw new Exception('Failed to create artwork directory.');
@@ -179,8 +178,7 @@ class FileDataHelper
$file = Application_Model_StoredFile::RecallById($trackid);
$md = $file->getMetadata();
- $storDir = Application_Model_MusicDir::getStorDir();
- $fp = $storDir->getDirectory();
+ $fp = Config::getStoragePath();
$dbAudioPath = $md['MDATA_KEY_FILEPATH'];
$fullpath = $fp . $dbAudioPath;
@@ -243,8 +241,7 @@ class FileDataHelper
$file = Application_Model_StoredFile::RecallById($trackid);
$md = $file->getMetadata();
- $storDir = Application_Model_MusicDir::getStorDir();
- $fp = $storDir->getDirectory();
+ $fp = Config::getStoragePath();
$dbAudioPath = $md['MDATA_KEY_FILEPATH'];
$fullpath = $fp . $dbAudioPath;
@@ -295,8 +292,7 @@ class FileDataHelper
$file = Application_Model_StoredFile::RecallById($trackid);
$md = $file->getMetadata();
- $storDir = Application_Model_MusicDir::getStorDir();
- $fp = $storDir->getDirectory();
+ $fp = Config::getStoragePath();
$dbAudioPath = $md['MDATA_KEY_ARTWORK'];
$fullpath = $fp . $dbAudioPath;
diff --git a/legacy/application/common/Storage.php b/legacy/application/common/Storage.php
new file mode 100644
index 000000000..012b29122
--- /dev/null
+++ b/legacy/application/common/Storage.php
@@ -0,0 +1,15 @@
+ 'airtime/om/BaseCcMountName.php',
'BaseCcMountNamePeer' => 'airtime/om/BaseCcMountNamePeer.php',
'BaseCcMountNameQuery' => 'airtime/om/BaseCcMountNameQuery.php',
- 'BaseCcMusicDirs' => 'airtime/om/BaseCcMusicDirs.php',
- 'BaseCcMusicDirsPeer' => 'airtime/om/BaseCcMusicDirsPeer.php',
- 'BaseCcMusicDirsQuery' => 'airtime/om/BaseCcMusicDirsQuery.php',
'BaseCcPerms' => 'airtime/om/BaseCcPerms.php',
'BaseCcPermsPeer' => 'airtime/om/BaseCcPermsPeer.php',
'BaseCcPermsQuery' => 'airtime/om/BaseCcPermsQuery.php',
@@ -158,10 +155,6 @@ return [
'CcMountNamePeer' => 'airtime/CcMountNamePeer.php',
'CcMountNameQuery' => 'airtime/CcMountNameQuery.php',
'CcMountNameTableMap' => 'airtime/map/CcMountNameTableMap.php',
- 'CcMusicDirs' => 'airtime/CcMusicDirs.php',
- 'CcMusicDirsPeer' => 'airtime/CcMusicDirsPeer.php',
- 'CcMusicDirsQuery' => 'airtime/CcMusicDirsQuery.php',
- 'CcMusicDirsTableMap' => 'airtime/map/CcMusicDirsTableMap.php',
'CcPerms' => 'airtime/CcPerms.php',
'CcPermsPeer' => 'airtime/CcPermsPeer.php',
'CcPermsQuery' => 'airtime/CcPermsQuery.php',
diff --git a/legacy/application/configs/conf.php b/legacy/application/configs/conf.php
index f94ae52ad..ed55ff342 100644
--- a/legacy/application/configs/conf.php
+++ b/legacy/application/configs/conf.php
@@ -76,7 +76,17 @@ class Config
// Storage
// //////////////////////////////////////////////////////////////////////////////
- $CC_CONFIG['current_backend'] = $values['current_backend']['storage_backend'] ?? 'file';
+ $CC_CONFIG['storagePath'] = $values['storage']['path'] ?? '/srv/libretime';
+ if (!is_dir($CC_CONFIG['storagePath'])) {
+ echo "the configured storage.path '{$CC_CONFIG['storagePath']}' does not exists!";
+
+ exit;
+ }
+ if (!is_writable($CC_CONFIG['storagePath'])) {
+ echo "the configured storage.path '{$CC_CONFIG['storagePath']}' is not writable!";
+
+ exit;
+ }
// Facebook (DEPRECATED)
// //////////////////////////////////////////////////////////////////////////////
@@ -146,4 +156,9 @@ class Config
return in_array(strtolower($value), ['yes', 'true']);
}
+
+ public static function getStoragePath()
+ {
+ return rtrim(self::getConfig()['storagePath'], '/') . '/';
+ }
}
diff --git a/legacy/application/controllers/ApiController.php b/legacy/application/controllers/ApiController.php
index 998654974..f3534ec22 100644
--- a/legacy/application/controllers/ApiController.php
+++ b/legacy/application/controllers/ApiController.php
@@ -604,8 +604,7 @@ class ApiController extends Zend_Controller_Action
throw new ZendActionHttpException($this, 400, 'ERROR: No ID was given.');
}
- $storDir = Application_Model_MusicDir::getStorDir();
- $fp = $storDir->getDirectory();
+ $fp = Config::getStoragePath();
// $this->view->type = $type;
$file = Application_Model_StoredFile::RecallById($trackid);
@@ -876,13 +875,9 @@ class ApiController extends Zend_Controller_Action
public function mediaMonitorSetupAction()
{
- $this->view->stor = Application_Model_MusicDir::getStorDir()->getDirectory();
+ $this->view->stor = Config::getStoragePath();
- $watchedDirs = Application_Model_MusicDir::getWatchedDirs();
$watchedDirsPath = [];
- foreach ($watchedDirs as $wd) {
- $watchedDirsPath[] = $wd->getDirectory();
- }
$this->view->watched_dirs = $watchedDirsPath;
}
@@ -1051,46 +1046,6 @@ class ApiController extends Zend_Controller_Action
Application_Model_StoredFile::listAllFiles($dir_id, $all);
}
- public function listAllWatchedDirsAction()
- {
- $result = [];
-
- $arrWatchedDirs = Application_Model_MusicDir::getWatchedDirs();
- $storDir = Application_Model_MusicDir::getStorDir();
-
- $result[$storDir->getId()] = $storDir->getDirectory();
-
- foreach ($arrWatchedDirs as $watchedDir) {
- $result[$watchedDir->getId()] = $watchedDir->getDirectory();
- }
-
- $this->view->dirs = $result;
- }
-
- public function addWatchedDirAction()
- {
- $request = $this->getRequest();
- $path = base64_decode($request->getParam('path'));
-
- $this->view->msg = Application_Model_MusicDir::addWatchedDir($path);
- }
-
- public function removeWatchedDirAction()
- {
- $request = $this->getRequest();
- $path = base64_decode($request->getParam('path'));
-
- $this->view->msg = Application_Model_MusicDir::removeWatchedDir($path);
- }
-
- public function setStorageDirAction()
- {
- $request = $this->getRequest();
- $path = base64_decode($request->getParam('path'));
-
- $this->view->msg = Application_Model_MusicDir::setStorDir($path);
- }
-
public function getStreamSettingAction()
{
$info = Application_Model_StreamSetting::getStreamSetting();
@@ -1171,84 +1126,6 @@ class ApiController extends Zend_Controller_Action
Application_Model_Preference::SetSourceStatus($sourcename, $status);
}
- // handles addition/deletion of mount point which watched dirs reside
- public function updateFileSystemMountAction()
- {
- $request = $this->getRequest();
-
- $params = $request->getParams();
- $added_list = empty($params['added_dir']) ? [] : explode(',', $params['added_dir']);
- $removed_list = empty($params['removed_dir']) ? [] : explode(',', $params['removed_dir']);
-
- // get all watched dirs
- $watched_dirs = Application_Model_MusicDir::getWatchedDirs(null, null);
-
- foreach ($added_list as $ad) {
- $ad .= '/';
- foreach ($watched_dirs as $dir) {
- $dirPath = $dir->getDirectory();
-
- // if mount path itself was watched
- if ($dirPath == $ad) {
- Application_Model_MusicDir::addWatchedDir($dirPath, false);
- } elseif (substr($dirPath, 0, strlen($ad)) === $ad && $dir->getExistsFlag() == false) {
- // if dir contains any dir in removed_list( if watched dir resides on new mounted path )
- Application_Model_MusicDir::addWatchedDir($dirPath, false);
- } elseif (substr($ad, 0, strlen($dirPath)) === $dirPath) {
- // is new mount point within the watched dir?
- // pyinotify doesn't notify anyhing in this case, so we add this mount point as
- // watched dir
- // bypass nested loop check
- Application_Model_MusicDir::addWatchedDir($ad, false, true);
- }
- }
- }
-
- foreach ($removed_list as $rd) {
- $rd .= '/';
- foreach ($watched_dirs as $dir) {
- $dirPath = $dir->getDirectory();
- // if dir contains any dir in removed_list( if watched dir resides on new mounted path )
- if (substr($dirPath, 0, strlen($rd)) === $rd && $dir->getExistsFlag() == true) {
- Application_Model_MusicDir::removeWatchedDir($dirPath, false);
- } elseif (substr($rd, 0, strlen($dirPath)) === $dirPath) {
- // is new mount point within the watched dir?
- // pyinotify doesn't notify anyhing in this case, so we walk through all files within
- // this watched dir in DB and mark them deleted.
- // In case of h) of use cases, due to pyinotify behaviour of noticing mounted dir, we need to
- // compare agaisnt all files in cc_files table
-
- $watchDir = Application_Model_MusicDir::getDirByPath($rd);
- // get all the files that is under $dirPath
- $files = Application_Model_StoredFile::listAllFiles(
- $dir->getId(),
- $all = false
- );
- foreach ($files as $f) {
- // if the file is from this mount
- $filePaths = $f->getFilePaths();
- $filePath = $filePaths[0];
- if (substr($filePath, 0, strlen($rd)) === $rd) {
- $f->delete();
- }
- }
- if ($watchDir) {
- Application_Model_MusicDir::removeWatchedDir($rd, false);
- }
- }
- }
- }
- }
-
- // handles case where watched dir is missing
- public function handleWatchedDirMissingAction()
- {
- $request = $this->getRequest();
-
- $dir = base64_decode($request->getParam('dir'));
- Application_Model_MusicDir::removeWatchedDir($dir, false);
- }
-
/* This action is for use by our dev scripts, that make
* a change to the database and we want rabbitmq to send
* out a message to pypo that a potential change has been made. */
diff --git a/legacy/application/controllers/LibraryController.php b/legacy/application/controllers/LibraryController.php
index cc57c9d17..44da3bba2 100644
--- a/legacy/application/controllers/LibraryController.php
+++ b/legacy/application/controllers/LibraryController.php
@@ -417,11 +417,11 @@ class LibraryController extends Zend_Controller_Action
$file = Application_Model_StoredFile::RecallById($id);
$this->view->type = $type;
$md = $file->getMetadata();
+ $storagePath = Config::getStoragePath();
foreach ($md as $key => $value) {
if ($key == 'MDATA_KEY_DIRECTORY' && !is_null($value)) {
- $musicDir = Application_Model_MusicDir::getDirByPK($value);
- $md['MDATA_KEY_FILEPATH'] = Application_Common_OsPath::join($musicDir->getDirectory(), $md['MDATA_KEY_FILEPATH']);
+ $md['MDATA_KEY_FILEPATH'] = Application_Common_OsPath::join($storagePath, $md['MDATA_KEY_FILEPATH']);
}
}
diff --git a/legacy/application/controllers/PreferenceController.php b/legacy/application/controllers/PreferenceController.php
index 13fc11399..5b9f73e82 100644
--- a/legacy/application/controllers/PreferenceController.php
+++ b/legacy/application/controllers/PreferenceController.php
@@ -380,58 +380,6 @@ class PreferenceController extends Zend_Controller_Action
$this->_helper->json->sendJson($result);
}
- public function changeStorDirectoryAction()
- {
- $chosen = $this->getRequest()->getParam('dir');
- $element = $this->getRequest()->getParam('element');
- $watched_dirs_form = new Application_Form_WatchedDirPreferences();
-
- $res = Application_Model_MusicDir::setStorDir($chosen);
- if ($res['code'] != 0) {
- $watched_dirs_form->populate(['storageFolder' => $chosen]);
- $watched_dirs_form->getElement($element)->setErrors([$res['error']]);
- }
-
- $this->view->subform = $watched_dirs_form->render();
- }
-
- public function reloadWatchDirectoryAction()
- {
- $chosen = $this->getRequest()->getParam('dir');
- $element = $this->getRequest()->getParam('element');
- $watched_dirs_form = new Application_Form_WatchedDirPreferences();
-
- $res = Application_Model_MusicDir::addWatchedDir($chosen);
- if ($res['code'] != 0) {
- $watched_dirs_form->populate(['watchedFolder' => $chosen]);
- $watched_dirs_form->getElement($element)->setErrors([$res['error']]);
- }
-
- $this->view->subform = $watched_dirs_form->render();
- }
-
- public function rescanWatchDirectoryAction()
- {
- $dir_path = $this->getRequest()->getParam('dir');
- $dir = Application_Model_MusicDir::getDirByPath($dir_path);
- $data = ['directory' => $dir->getDirectory(),
- 'id' => $dir->getId(), ];
- Application_Model_RabbitMq::SendMessageToMediaMonitor('rescan_watch', $data);
- Logging::info("Unhiding all files belonging to:: {$dir_path}");
- $dir->unhideFiles();
- $this->_helper->json->sendJson(null);
- }
-
- public function removeWatchDirectoryAction()
- {
- $chosen = $this->getRequest()->getParam('dir');
-
- $dir = Application_Model_MusicDir::removeWatchedDir($chosen);
-
- $watched_dirs_form = new Application_Form_WatchedDirPreferences();
- $this->view->subform = $watched_dirs_form->render();
- }
-
public function isImportInProgressAction()
{
$now = time();
diff --git a/legacy/application/models/MusicDir.php b/legacy/application/models/MusicDir.php
deleted file mode 100644
index 1ab002e0b..000000000
--- a/legacy/application/models/MusicDir.php
+++ /dev/null
@@ -1,478 +0,0 @@
-_dir = $dir;
- }
-
- public function getId()
- {
- return $this->_dir->getId();
- }
-
- public function getType()
- {
- return $this->_dir->getType();
- }
-
- public function setType($type)
- {
- $this->_dir->setType($type);
- }
-
- public function getDirectory()
- {
- return $this->_dir->getDirectory();
- }
-
- public function setDirectory($dir)
- {
- $this->_dir->setDirectory($dir);
- $this->_dir->save();
- }
-
- public function setExistsFlag($flag)
- {
- $this->_dir->setExists($flag);
- $this->_dir->save();
- }
-
- public function setWatchedFlag($flag)
- {
- $this->_dir->setWatched($flag);
- $this->_dir->save();
- }
-
- public function getWatchedFlag()
- {
- return $this->_dir->getWatched();
- }
-
- public function getExistsFlag()
- {
- return $this->_dir->getExists();
- }
-
- /**
- * There are 2 cases where this function can be called.
- * 1. When watched dir was removed
- * 2. When some dir was watched, but it was unmounted.
- *
- * In case of 1, $userAddedWatchedDir should be true
- * In case of 2, $userAddedWatchedDir should be false
- *
- * When $userAddedWatchedDir is true, it will set "Watched" flag to false
- * otherwise, it will set "Exists" flag to true
- *
- * @param mixed $userAddedWatchedDir
- */
- public function remove($userAddedWatchedDir = true)
- {
- $music_dir_id = $this->getId();
-
- $sql = <<<'SQL'
-SELECT DISTINCT s.instance_id
-FROM cc_music_dirs AS md
-LEFT JOIN cc_files AS f ON f.directory = md.id
-RIGHT JOIN cc_schedule AS s ON s.file_id = f.id
-WHERE md.id = :musicDirId;
-SQL;
- $show_instances = Application_Common_Database::prepareAndExecute(
- $sql,
- [':musicDirId' => $music_dir_id],
- 'all'
- );
-
- // get all the files on this dir
- $sql = <<<'SQL'
-UPDATE cc_files
-SET file_exists = 'f'
-WHERE id IN
- (SELECT f.id
- FROM cc_music_dirs AS md
- LEFT JOIN cc_files AS f ON f.directory = md.id
- WHERE md.id = :musicDirId);
-SQL;
-
- $affected = Application_Common_Database::prepareAndExecute(
- $sql,
- [':musicDirId' => $music_dir_id],
- 'all'
- );
-
- // set RemovedFlag to true
- if ($userAddedWatchedDir) {
- self::setWatchedFlag(false);
- } else {
- self::setExistsFlag(false);
- }
- // $res = $this->_dir->delete();
-
- foreach ($show_instances as $show_instance_row) {
- $temp_show = new Application_Model_ShowInstance($show_instance_row['instance_id']);
- $temp_show->updateScheduledTime();
- }
- Application_Model_RabbitMq::PushSchedule();
- }
-
- /**
- * Checks if p_dir1 is the ancestor of p_dir2. Returns
- * true if it is the ancestor, false otherwise. Note that
- * /home/user is considered the ancestor of /home/user.
- *
- * @param string $p_dir1
- * The potential ancestor directory
- * @param string $p_dir2
- * The potential descendent directory
- *
- * @return bool
- * Returns true if it is the ancestor, false otherwise
- */
- private static function isAncestorDir($p_dir1, $p_dir2)
- {
- if (strlen($p_dir1) > strlen($p_dir2)) {
- return false;
- }
-
- return substr($p_dir2, 0, strlen($p_dir1)) == $p_dir1;
- }
-
- /**
- * Checks whether the path provided is a valid path. A valid path
- * is defined as not being nested within an existing watched directory,
- * or vice-versa. Throws a NestedDirectoryException if invalid.
- *
- * @param string $p_path
- * The path we want to validate
- */
- public static function isPathValid($p_path)
- {
- $dirs = self::getWatchedDirs();
- $dirs[] = self::getStorDir();
-
- foreach ($dirs as $dirObj) {
- $dir = $dirObj->getDirectory();
- $diff = strlen($dir) - strlen($p_path);
- if ($diff == 0) {
- if ($dir == $p_path) {
- throw new NestedDirectoryException(sprintf(_('%s is already watched.'), $p_path));
- }
- } elseif ($diff > 0) {
- if (self::isAncestorDir($p_path, $dir)) {
- throw new NestedDirectoryException(sprintf(_('%s contains nested watched directory: %s'), $p_path, $dir));
- }
- } else { // diff < 0
- if (self::isAncestorDir($dir, $p_path)) {
- throw new NestedDirectoryException(sprintf(_('%s is nested within existing watched directory: %s'), $p_path, $dir));
- }
- }
- }
- }
-
- /** There are 2 cases where this function can be called.
- * 1. When watched dir was added
- * 2. When some dir was watched, but it was unmounted somehow, but gets mounted again.
- *
- * In case of 1, $userAddedWatchedDir should be true
- * In case of 2, $userAddedWatchedDir should be false
- *
- * When $userAddedWatchedDir is true, it will set "Removed" flag to false
- * otherwise, it will set "Exists" flag to true
- *
- * @param $nestedWatch - if true, bypass path check, and Watched to false
- * @param mixed $p_path
- * @param mixed $p_type
- * @param mixed $userAddedWatchedDir
- */
- public static function addDir($p_path, $p_type, $userAddedWatchedDir = true, $nestedWatch = false)
- {
- if (!is_dir($p_path)) {
- return ['code' => 2, 'error' => sprintf(_('%s is not a valid directory.'), $p_path)];
- }
- $real_path = Application_Common_OsPath::normpath($p_path) . '/';
- if ($real_path != '/') {
- $p_path = $real_path;
- }
-
- $exist_dir = self::getDirByPath($p_path);
-
- if (is_null($exist_dir)) {
- $temp_dir = new CcMusicDirs();
- $dir = new Application_Model_MusicDir($temp_dir);
- } else {
- $dir = $exist_dir;
- }
-
- $dir->setType($p_type);
- $p_path = Application_Common_OsPath::normpath($p_path) . '/';
-
- try {
- /* isPathValid() checks if path is a substring or a superstring of an
- * existing dir and if not, throws NestedDirectoryException */
- if (!$nestedWatch) {
- self::isPathValid($p_path);
- }
- if ($userAddedWatchedDir) {
- $dir->setWatchedFlag(true);
- } else {
- if ($nestedWatch) {
- $dir->setWatchedFlag(false);
- }
- $dir->setExistsFlag(true);
- }
- $dir->setDirectory($p_path);
-
- return ['code' => 0];
- } catch (NestedDirectoryException $nde) {
- $msg = $nde->getMessage();
-
- return ['code' => 1, 'error' => "{$msg}"];
- } catch (Exception $e) {
- return ['code' => 1,
- 'error' => sprintf(
- _('%s is already set as the current storage dir or in the' .
- ' watched folders list'),
- $p_path
- ),
- ];
- }
- }
-
- /** There are 2 cases where this function can be called.
- * 1. When watched dir was added
- * 2. When some dir was watched, but it was unmounted somehow, but gets mounted again.
- *
- * In case of 1, $userAddedWatchedDir should be true
- * In case of 2, $userAddedWatchedDir should be false
- *
- * When $userAddedWatchedDir is true, it will set "Watched" flag to true
- * otherwise, it will set "Exists" flag to true
- *
- * @param mixed $p_path
- * @param mixed $userAddedWatchedDir
- * @param mixed $nestedWatch
- */
- public static function addWatchedDir($p_path, $userAddedWatchedDir = true, $nestedWatch = false)
- {
- $res = self::addDir($p_path, 'watched', $userAddedWatchedDir, $nestedWatch);
-
- if ($res['code'] != 0) {
- return $res;
- }
-
- // convert "linked" files (Airtime <= 1.8.2) to watched files.
- $propel_link_dir = CcMusicDirsQuery::create()
- ->filterByType('link')
- ->findOne();
-
- // see if any linked files exist.
- if (isset($propel_link_dir)) {
- // newly added watched directory object
- $propel_new_watch = CcMusicDirsQuery::create()
- ->filterByDirectory(Application_Common_OsPath::normpath($p_path) . '/')
- ->findOne();
-
- // any files of the deprecated "link" type.
- $link_files = CcFilesQuery::create()
- ->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
- ->filterByDbDirectory($propel_link_dir->getId())
- ->find();
-
- $newly_watched_dir = $propel_new_watch->getDirectory();
-
- foreach ($link_files as $link_file) {
- $link_filepath = $link_file->getDbFilepath();
-
- // convert "link" file into a watched file.
- if ((strlen($newly_watched_dir) < strlen($link_filepath)) && (substr($link_filepath, 0, strlen($newly_watched_dir)) === $newly_watched_dir)) {
- // get the filepath path not including the watched directory.
- $sub_link_filepath = substr($link_filepath, strlen($newly_watched_dir));
-
- $link_file->setDbDirectory($propel_new_watch->getId());
- $link_file->setDbFilepath($sub_link_filepath);
- $link_file->save();
- }
- }
- }
-
- $data = [];
- $data['directory'] = $p_path;
- Application_Model_RabbitMq::SendMessageToMediaMonitor('new_watch', $data);
-
- return $res;
- }
-
- public static function getDirByPK($pk)
- {
- $dir = CcMusicDirsQuery::create()->findPK($pk);
- if (!$dir) {
- return null;
- }
-
- return new Application_Model_MusicDir($dir);
- }
-
- public static function getDirByPath($p_path)
- {
- $dir = CcMusicDirsQuery::create()
- ->filterByDirectory($p_path)
- ->findOne();
- if ($dir == null) {
- return null;
- }
-
- return new Application_Model_MusicDir($dir);
- }
-
- /**
- * Search and returns watched dirs.
- *
- * @param $exists search condition with exists flag
- * @param $watched search condition with watched flag
- */
- public static function getWatchedDirs($exists = true, $watched = true)
- {
- $result = [];
-
- $dirs = CcMusicDirsQuery::create()
- ->filterByType('watched');
- if ($exists !== null) {
- $dirs = $dirs->filterByExists($exists);
- }
- if ($watched !== null) {
- $dirs = $dirs->filterByWatched($watched);
- }
- $dirs = $dirs->find();
-
- foreach ($dirs as $dir) {
- $result[] = new Application_Model_MusicDir($dir);
- }
-
- return $result;
- }
-
- public static function getStorDir()
- {
- $dir = CcMusicDirsQuery::create()
- ->filterByType('stor')
- ->findOne();
-
- return new Application_Model_MusicDir($dir);
- }
-
- public static function setStorDir($p_dir)
- {
- // we want to be consistent when storing dir path.
- // path should always ends with trailing '/'
- $p_dir = Application_Common_OsPath::normpath($p_dir) . '/';
- if (!is_dir($p_dir)) {
- return ['code' => 2, 'error' => sprintf(_('%s is not a valid directory.'), $p_dir)];
- }
- if (Application_Model_Preference::GetImportTimestamp() + 10 > time()) {
- return ['code' => 3, 'error' => 'Airtime is currently importing files. Please wait until this is complete before changing the storage directory.'];
- }
- $dir = self::getStorDir();
- // if $p_dir doesn't exist in DB
- $exist = $dir->getDirByPath($p_dir);
- if ($exist == null) {
- $dir->setDirectory($p_dir);
- $dirId = $dir->getId();
- $data = [];
- $data['directory'] = $p_dir;
- $data['dir_id'] = $dirId;
- Application_Model_RabbitMq::SendMessageToMediaMonitor('change_stor', $data);
-
- return ['code' => 0];
- }
-
- return ['code' => 1,
- 'error' => sprintf(_('%s is already set as the current storage dir or in the watched folders list.'), $p_dir), ];
- }
-
- public static function getWatchedDirFromFilepath($p_filepath)
- {
- $dirs = CcMusicDirsQuery::create()
- ->filterByType(['watched', 'stor'])
- ->filterByExists(true)
- ->filterByWatched(true)
- ->find();
-
- foreach ($dirs as $dir) {
- $directory = $dir->getDirectory();
- if (substr($p_filepath, 0, strlen($directory)) === $directory) {
- return new Application_Model_MusicDir($dir);
- }
- }
-
- return null;
- }
-
- /** There are 2 cases where this function can be called.
- * 1. When watched dir was removed
- * 2. When some dir was watched, but it was unmounted.
- *
- * In case of 1, $userAddedWatchedDir should be true
- * In case of 2, $userAddedWatchedDir should be false
- *
- * When $userAddedWatchedDir is true, it will set "Watched" flag to false
- * otherwise, it will set "Exists" flag to true
- *
- * @param mixed $p_dir
- * @param mixed $userAddedWatchedDir
- */
- public static function removeWatchedDir($p_dir, $userAddedWatchedDir = true)
- {
- // make sure that $p_dir has a trailing "/"
- $real_path = Application_Common_OsPath::normpath($p_dir) . '/';
- if ($real_path != '/') {
- $p_dir = $real_path;
- }
- $dir = Application_Model_MusicDir::getDirByPath($p_dir);
- if (is_null($dir)) {
- return ['code' => 1, 'error' => sprintf(_("%s doesn't exist in the watched list."), $p_dir)];
- }
- $dir->remove($userAddedWatchedDir);
- $data = [];
- $data['directory'] = $p_dir;
- Application_Model_RabbitMq::SendMessageToMediaMonitor('remove_watch', $data);
-
- return ['code' => 0];
- }
-
- public static function splitFilePath($p_filepath)
- {
- $mus_dir = self::getWatchedDirFromFilepath($p_filepath);
-
- if (is_null($mus_dir)) {
- return null;
- }
-
- $length_dir = strlen($mus_dir->getDirectory());
- $fp = substr($p_filepath, $length_dir);
-
- return [$mus_dir->getDirectory(), trim($fp)];
- }
-
- public function unhideFiles()
- {
- $files = $this->_dir->getCcFiless();
- $hid = 0;
- foreach ($files as $file) {
- ++$hid;
- $file->setDbHidden(false);
- $file->save();
- }
- Logging::info("unhide '{$hid}' files");
- }
-}
diff --git a/legacy/application/models/StoredFile.php b/legacy/application/models/StoredFile.php
index 96734950f..8eb78e182 100644
--- a/legacy/application/models/StoredFile.php
+++ b/legacy/application/models/StoredFile.php
@@ -498,14 +498,11 @@ SQL;
*/
public function setFilePath($p_filepath)
{
- $path_info = Application_Model_MusicDir::splitFilePath($p_filepath);
+ $path_info = Application_Common_Storage::splitFilePath($p_filepath);
if (is_null($path_info)) {
return -1;
}
- $musicDir = Application_Model_MusicDir::getDirByPath($path_info[0]);
-
- $this->_file->setDbDirectory($musicDir->getId());
$this->_file->setDbFilepath($path_info[1]);
$this->_file->save($this->_con);
}
@@ -650,15 +647,13 @@ SQL;
*/
public static function RecallByFilepath($p_filepath, $con)
{
- $path_info = Application_Model_MusicDir::splitFilePath($p_filepath);
+ $path_info = Application_Common_Storage::splitFilePath($p_filepath);
if (is_null($path_info)) {
return null;
}
- $music_dir = Application_Model_MusicDir::getDirByPath($path_info[0]);
$file = CcFilesQuery::create()
- ->filterByDbDirectory($music_dir->getId())
->filterByDbFilepath($path_info[1])
->findOne($con);
@@ -667,15 +662,13 @@ SQL;
public static function RecallByPartialFilepath($partial_path, $con)
{
- $path_info = Application_Model_MusicDir::splitFilePath($partial_path);
+ $path_info = Application_Common_Storage::splitFilePath($partial_path);
if (is_null($path_info)) {
return null;
}
- $music_dir = Application_Model_MusicDir::getDirByPath($path_info[0]);
$files = CcFilesQuery::create()
- ->filterByDbDirectory($music_dir->getId())
->filterByDbFilepath("{$path_info[1]}%")
->find($con);
$res = [];
@@ -848,8 +841,7 @@ SQL;
$displayTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone());
$utcTimezone = new DateTimeZone('UTC');
- $storDir = Application_Model_MusicDir::getStorDir();
- $fp = $storDir->getDirectory();
+ $fp = Config::getStoragePath();
foreach ($results['aaData'] as &$row) {
$row['id'] = intval($row['id']);
@@ -951,8 +943,7 @@ SQL;
{
$audio_file = $tempFilePath;
- $storDir = Application_Model_MusicDir::getStorDir();
- $stor = $storDir->getDirectory();
+ $stor = Config::getStoragePath();
// check if "organize" dir exists and if not create one
if (!file_exists($stor . '/organize')) {
if (!mkdir($stor . '/organize', 0777)) {
diff --git a/legacy/application/models/Systemstatus.php b/legacy/application/models/Systemstatus.php
index 8e3d06617..a358220b2 100644
--- a/legacy/application/models/Systemstatus.php
+++ b/legacy/application/models/Systemstatus.php
@@ -205,21 +205,15 @@ class Application_Model_Systemstatus
public static function GetDiskInfo()
{
+ $storagePath = Config::getStoragePath();
+ $totalSpace = disk_total_space($storagePath);
+
$partitions = [];
- /* First lets get all the watched directories. Then we can group them
- * into the same partitions by comparing the partition sizes. */
- $musicDirs = Application_Model_MusicDir::getWatchedDirs();
- $musicDirs[] = Application_Model_MusicDir::getStorDir();
- foreach ($musicDirs as $md) {
- $totalSpace = disk_total_space($md->getDirectory());
- if (!isset($partitions[$totalSpace])) {
- $partitions[$totalSpace] = new stdClass();
- $partitions[$totalSpace]->totalSpace = $totalSpace;
- $partitions[$totalSpace]->totalFreeSpace = disk_free_space($md->getDirectory());
- $partitions[$totalSpace]->usedSpace = $totalSpace - $partitions[$totalSpace]->totalFreeSpace;
- }
- $partitions[$totalSpace]->dirs[] = $md->getDirectory();
- }
+ $partitions[$totalSpace] = new stdClass();
+ $partitions[$totalSpace]->totalSpace = $totalSpace;
+ $partitions[$totalSpace]->totalFreeSpace = disk_free_space($storagePath);
+ $partitions[$totalSpace]->usedSpace = $totalSpace - $partitions[$totalSpace]->totalFreeSpace;
+ $partitions[$totalSpace]->dirs[] = $storagePath;
return array_values($partitions);
}
diff --git a/legacy/application/models/airtime/CcFiles.php b/legacy/application/models/airtime/CcFiles.php
index a7f04017f..b36b88e6d 100644
--- a/legacy/application/models/airtime/CcFiles.php
+++ b/legacy/application/models/airtime/CcFiles.php
@@ -147,8 +147,7 @@ class CcFiles extends BaseCcFiles
self::validateFileArray($fileArray);
- $storDir = Application_Model_MusicDir::getStorDir();
- $importedStorageDir = $storDir->getDirectory() . 'imported/' . self::getOwnerId() . '/';
+ $importedStorageDir = Config::getStoragePath() . 'imported/' . self::getOwnerId() . '/';
$importedDbPath = 'imported/' . self::getOwnerId() . '/';
$artwork = FileDataHelper::saveArtworkData($filePath, $originalFilename, $importedStorageDir, $importedDbPath);
$trackType = FileDataHelper::saveTrackType();
@@ -221,9 +220,6 @@ class CcFiles extends BaseCcFiles
Application_Model_Preference::updateDiskUsage($fileSizeBytes);
} elseif ($file) {
- // Since we check for this value when deleting files, set it first
- $file->setDbDirectory(self::MUSIC_DIRS_STOR_PK);
-
$file->fromArray($fileArray, BasePeer::TYPE_FIELDNAME);
// Our RESTful API takes "full_path" as a field, which we then split and translate to match
@@ -237,7 +233,7 @@ class CcFiles extends BaseCcFiles
Application_Model_Preference::updateDiskUsage($fileSizeBytes);
$fullPath = $fileArray['full_path'];
- $storDir = Application_Model_MusicDir::getStorDir()->getDirectory();
+ $storDir = Config::getStoragePath();
$pos = strpos($fullPath, $storDir);
if ($pos !== false) {
@@ -409,11 +405,7 @@ class CcFiles extends BaseCcFiles
*/
public function getAbsoluteFilePath()
{
- $music_dir = Application_Model_MusicDir::getDirByPK($this->getDbDirectory());
- if (!$music_dir) {
- throw new Exception('Invalid music_dir for file ' . $this->getDbId() . ' in database.');
- }
- $directory = $music_dir->getDirectory();
+ $directory = Config::getStoragePath();
$filepath = $this->getDbFilepath();
return Application_Common_OsPath::join($directory, $filepath);
@@ -424,11 +416,7 @@ class CcFiles extends BaseCcFiles
*/
public function getAbsoluteArtworkPath()
{
- $music_dir = Application_Model_MusicDir::getDirByPK($this->getDbDirectory());
- if (!$music_dir) {
- throw new Exception('Invalid music_dir for file ' . $this->getDbId() . ' in database.');
- }
- $directory = $music_dir->getDirectory();
+ $directory = Config::getStoragePath();
$filepath = $this->getDbArtwork();
return Application_Common_OsPath::join($directory, $filepath);
diff --git a/legacy/application/models/airtime/CcMusicDirs.php b/legacy/application/models/airtime/CcMusicDirs.php
deleted file mode 100644
index c39a15d3a..000000000
--- a/legacy/application/models/airtime/CcMusicDirs.php
+++ /dev/null
@@ -1,12 +0,0 @@
-addColumn('name', 'DbName', 'VARCHAR', true, 255, '');
$this->addColumn('mime', 'DbMime', 'VARCHAR', true, 255, '');
$this->addColumn('ftype', 'DbFtype', 'VARCHAR', true, 128, '');
- $this->addForeignKey('directory', 'DbDirectory', 'INTEGER', 'cc_music_dirs', 'id', false, null, null);
$this->addColumn('filepath', 'DbFilepath', 'LONGVARCHAR', false, null, '');
$this->addColumn('import_status', 'DbImportStatus', 'INTEGER', true, null, 1);
$this->addColumn('currentlyaccessing', 'DbCurrentlyaccessing', 'INTEGER', true, null, 0);
@@ -118,7 +117,6 @@ class CcFilesTableMap extends TableMap
{
$this->addRelation('FkOwner', 'CcSubjs', RelationMap::MANY_TO_ONE, array('owner_id' => 'id', ), null, null);
$this->addRelation('CcSubjsRelatedByDbEditedby', 'CcSubjs', RelationMap::MANY_TO_ONE, array('editedby' => 'id', ), null, null);
- $this->addRelation('CcMusicDirs', 'CcMusicDirs', RelationMap::MANY_TO_ONE, array('directory' => 'id', ), null, null);
$this->addRelation('CloudFile', 'CloudFile', RelationMap::ONE_TO_MANY, array('id' => 'cc_file_id', ), 'CASCADE', null, 'CloudFiles');
$this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null, 'CcShowInstancess');
$this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null, 'CcPlaylistcontentss');
diff --git a/legacy/application/models/airtime/map/CcMusicDirsTableMap.php b/legacy/application/models/airtime/map/CcMusicDirsTableMap.php
deleted file mode 100644
index ca02ed7d9..000000000
--- a/legacy/application/models/airtime/map/CcMusicDirsTableMap.php
+++ /dev/null
@@ -1,58 +0,0 @@
-setName('cc_music_dirs');
- $this->setPhpName('CcMusicDirs');
- $this->setClassname('CcMusicDirs');
- $this->setPackage('airtime');
- $this->setUseIdGenerator(true);
- $this->setPrimaryKeyMethodInfo('cc_music_dirs_id_seq');
- // columns
- $this->addPrimaryKey('id', 'Id', 'INTEGER', true, null, null);
- $this->addColumn('directory', 'Directory', 'LONGVARCHAR', false, null, null);
- $this->addColumn('type', 'Type', 'VARCHAR', false, 255, null);
- $this->addColumn('exists', 'Exists', 'BOOLEAN', false, null, true);
- $this->addColumn('watched', 'Watched', 'BOOLEAN', false, null, true);
- // validators
- } // initialize()
-
- /**
- * Build the RelationMap objects for this table relationships
- */
- public function buildRelations()
- {
- $this->addRelation('CcFiles', 'CcFiles', RelationMap::ONE_TO_MANY, array('id' => 'directory', ), null, null, 'CcFiless');
- } // buildRelations()
-
-} // CcMusicDirsTableMap
diff --git a/legacy/application/models/airtime/om/BaseCcFiles.php b/legacy/application/models/airtime/om/BaseCcFiles.php
index d7c338e61..0e8ab96e2 100644
--- a/legacy/application/models/airtime/om/BaseCcFiles.php
+++ b/legacy/application/models/airtime/om/BaseCcFiles.php
@@ -56,12 +56,6 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
*/
protected $ftype;
- /**
- * The value for the directory field.
- * @var int
- */
- protected $directory;
-
/**
* The value for the filepath field.
* Note: this column has a database default value of: ''
@@ -468,11 +462,6 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
*/
protected $aCcSubjsRelatedByDbEditedby;
- /**
- * @var CcMusicDirs
- */
- protected $aCcMusicDirs;
-
/**
* @var PropelObjectCollection|CloudFile[] Collection to store aggregation of CloudFile objects.
*/
@@ -668,17 +657,6 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
return $this->ftype;
}
- /**
- * Get the [directory] column value.
- *
- * @return int
- */
- public function getDbDirectory()
- {
-
- return $this->directory;
- }
-
/**
* Get the [filepath] column value.
*
@@ -1539,31 +1517,6 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
return $this;
} // setDbFtype()
- /**
- * Set the value of [directory] column.
- *
- * @param int $v new value
- * @return CcFiles The current object (for fluent API support)
- */
- public function setDbDirectory($v)
- {
- if ($v !== null && is_numeric($v)) {
- $v = (int) $v;
- }
-
- if ($this->directory !== $v) {
- $this->directory = $v;
- $this->modifiedColumns[] = CcFilesPeer::DIRECTORY;
- }
-
- if ($this->aCcMusicDirs !== null && $this->aCcMusicDirs->getId() !== $v) {
- $this->aCcMusicDirs = null;
- }
-
-
- return $this;
- } // setDbDirectory()
-
/**
* Set the value of [filepath] column.
*
@@ -3058,71 +3011,70 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
$this->mime = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
$this->ftype = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
- $this->directory = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null;
- $this->filepath = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
- $this->import_status = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null;
- $this->currentlyaccessing = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null;
- $this->editedby = ($row[$startcol + 8] !== null) ? (int) $row[$startcol + 8] : null;
- $this->mtime = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null;
- $this->utime = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null;
- $this->lptime = ($row[$startcol + 11] !== null) ? (string) $row[$startcol + 11] : null;
- $this->md5 = ($row[$startcol + 12] !== null) ? (string) $row[$startcol + 12] : null;
- $this->track_title = ($row[$startcol + 13] !== null) ? (string) $row[$startcol + 13] : null;
- $this->artist_name = ($row[$startcol + 14] !== null) ? (string) $row[$startcol + 14] : null;
- $this->bit_rate = ($row[$startcol + 15] !== null) ? (int) $row[$startcol + 15] : null;
- $this->sample_rate = ($row[$startcol + 16] !== null) ? (int) $row[$startcol + 16] : null;
- $this->format = ($row[$startcol + 17] !== null) ? (string) $row[$startcol + 17] : null;
- $this->length = ($row[$startcol + 18] !== null) ? (string) $row[$startcol + 18] : null;
- $this->album_title = ($row[$startcol + 19] !== null) ? (string) $row[$startcol + 19] : null;
- $this->genre = ($row[$startcol + 20] !== null) ? (string) $row[$startcol + 20] : null;
- $this->comments = ($row[$startcol + 21] !== null) ? (string) $row[$startcol + 21] : null;
- $this->year = ($row[$startcol + 22] !== null) ? (string) $row[$startcol + 22] : null;
- $this->track_number = ($row[$startcol + 23] !== null) ? (int) $row[$startcol + 23] : null;
- $this->channels = ($row[$startcol + 24] !== null) ? (int) $row[$startcol + 24] : null;
- $this->url = ($row[$startcol + 25] !== null) ? (string) $row[$startcol + 25] : null;
- $this->bpm = ($row[$startcol + 26] !== null) ? (int) $row[$startcol + 26] : null;
- $this->rating = ($row[$startcol + 27] !== null) ? (string) $row[$startcol + 27] : null;
- $this->encoded_by = ($row[$startcol + 28] !== null) ? (string) $row[$startcol + 28] : null;
- $this->disc_number = ($row[$startcol + 29] !== null) ? (string) $row[$startcol + 29] : null;
- $this->mood = ($row[$startcol + 30] !== null) ? (string) $row[$startcol + 30] : null;
- $this->label = ($row[$startcol + 31] !== null) ? (string) $row[$startcol + 31] : null;
- $this->composer = ($row[$startcol + 32] !== null) ? (string) $row[$startcol + 32] : null;
- $this->encoder = ($row[$startcol + 33] !== null) ? (string) $row[$startcol + 33] : null;
- $this->checksum = ($row[$startcol + 34] !== null) ? (string) $row[$startcol + 34] : null;
- $this->lyrics = ($row[$startcol + 35] !== null) ? (string) $row[$startcol + 35] : null;
- $this->orchestra = ($row[$startcol + 36] !== null) ? (string) $row[$startcol + 36] : null;
- $this->conductor = ($row[$startcol + 37] !== null) ? (string) $row[$startcol + 37] : null;
- $this->lyricist = ($row[$startcol + 38] !== null) ? (string) $row[$startcol + 38] : null;
- $this->original_lyricist = ($row[$startcol + 39] !== null) ? (string) $row[$startcol + 39] : null;
- $this->radio_station_name = ($row[$startcol + 40] !== null) ? (string) $row[$startcol + 40] : null;
- $this->info_url = ($row[$startcol + 41] !== null) ? (string) $row[$startcol + 41] : null;
- $this->artist_url = ($row[$startcol + 42] !== null) ? (string) $row[$startcol + 42] : null;
- $this->audio_source_url = ($row[$startcol + 43] !== null) ? (string) $row[$startcol + 43] : null;
- $this->radio_station_url = ($row[$startcol + 44] !== null) ? (string) $row[$startcol + 44] : null;
- $this->buy_this_url = ($row[$startcol + 45] !== null) ? (string) $row[$startcol + 45] : null;
- $this->isrc_number = ($row[$startcol + 46] !== null) ? (string) $row[$startcol + 46] : null;
- $this->catalog_number = ($row[$startcol + 47] !== null) ? (string) $row[$startcol + 47] : null;
- $this->original_artist = ($row[$startcol + 48] !== null) ? (string) $row[$startcol + 48] : null;
- $this->copyright = ($row[$startcol + 49] !== null) ? (string) $row[$startcol + 49] : null;
- $this->report_datetime = ($row[$startcol + 50] !== null) ? (string) $row[$startcol + 50] : null;
- $this->report_location = ($row[$startcol + 51] !== null) ? (string) $row[$startcol + 51] : null;
- $this->report_organization = ($row[$startcol + 52] !== null) ? (string) $row[$startcol + 52] : null;
- $this->subject = ($row[$startcol + 53] !== null) ? (string) $row[$startcol + 53] : null;
- $this->contributor = ($row[$startcol + 54] !== null) ? (string) $row[$startcol + 54] : null;
- $this->language = ($row[$startcol + 55] !== null) ? (string) $row[$startcol + 55] : null;
- $this->file_exists = ($row[$startcol + 56] !== null) ? (boolean) $row[$startcol + 56] : null;
- $this->replay_gain = ($row[$startcol + 57] !== null) ? (string) $row[$startcol + 57] : null;
- $this->owner_id = ($row[$startcol + 58] !== null) ? (int) $row[$startcol + 58] : null;
- $this->cuein = ($row[$startcol + 59] !== null) ? (string) $row[$startcol + 59] : null;
- $this->cueout = ($row[$startcol + 60] !== null) ? (string) $row[$startcol + 60] : null;
- $this->silan_check = ($row[$startcol + 61] !== null) ? (boolean) $row[$startcol + 61] : null;
- $this->hidden = ($row[$startcol + 62] !== null) ? (boolean) $row[$startcol + 62] : null;
- $this->is_scheduled = ($row[$startcol + 63] !== null) ? (boolean) $row[$startcol + 63] : null;
- $this->is_playlist = ($row[$startcol + 64] !== null) ? (boolean) $row[$startcol + 64] : null;
- $this->filesize = ($row[$startcol + 65] !== null) ? (int) $row[$startcol + 65] : null;
- $this->description = ($row[$startcol + 66] !== null) ? (string) $row[$startcol + 66] : null;
- $this->artwork = ($row[$startcol + 67] !== null) ? (string) $row[$startcol + 67] : null;
- $this->track_type = ($row[$startcol + 68] !== null) ? (string) $row[$startcol + 68] : null;
+ $this->filepath = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
+ $this->import_status = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null;
+ $this->currentlyaccessing = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null;
+ $this->editedby = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null;
+ $this->mtime = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null;
+ $this->utime = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null;
+ $this->lptime = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null;
+ $this->md5 = ($row[$startcol + 11] !== null) ? (string) $row[$startcol + 11] : null;
+ $this->track_title = ($row[$startcol + 12] !== null) ? (string) $row[$startcol + 12] : null;
+ $this->artist_name = ($row[$startcol + 13] !== null) ? (string) $row[$startcol + 13] : null;
+ $this->bit_rate = ($row[$startcol + 14] !== null) ? (int) $row[$startcol + 14] : null;
+ $this->sample_rate = ($row[$startcol + 15] !== null) ? (int) $row[$startcol + 15] : null;
+ $this->format = ($row[$startcol + 16] !== null) ? (string) $row[$startcol + 16] : null;
+ $this->length = ($row[$startcol + 17] !== null) ? (string) $row[$startcol + 17] : null;
+ $this->album_title = ($row[$startcol + 18] !== null) ? (string) $row[$startcol + 18] : null;
+ $this->genre = ($row[$startcol + 19] !== null) ? (string) $row[$startcol + 19] : null;
+ $this->comments = ($row[$startcol + 20] !== null) ? (string) $row[$startcol + 20] : null;
+ $this->year = ($row[$startcol + 21] !== null) ? (string) $row[$startcol + 21] : null;
+ $this->track_number = ($row[$startcol + 22] !== null) ? (int) $row[$startcol + 22] : null;
+ $this->channels = ($row[$startcol + 23] !== null) ? (int) $row[$startcol + 23] : null;
+ $this->url = ($row[$startcol + 24] !== null) ? (string) $row[$startcol + 24] : null;
+ $this->bpm = ($row[$startcol + 25] !== null) ? (int) $row[$startcol + 25] : null;
+ $this->rating = ($row[$startcol + 26] !== null) ? (string) $row[$startcol + 26] : null;
+ $this->encoded_by = ($row[$startcol + 27] !== null) ? (string) $row[$startcol + 27] : null;
+ $this->disc_number = ($row[$startcol + 28] !== null) ? (string) $row[$startcol + 28] : null;
+ $this->mood = ($row[$startcol + 29] !== null) ? (string) $row[$startcol + 29] : null;
+ $this->label = ($row[$startcol + 30] !== null) ? (string) $row[$startcol + 30] : null;
+ $this->composer = ($row[$startcol + 31] !== null) ? (string) $row[$startcol + 31] : null;
+ $this->encoder = ($row[$startcol + 32] !== null) ? (string) $row[$startcol + 32] : null;
+ $this->checksum = ($row[$startcol + 33] !== null) ? (string) $row[$startcol + 33] : null;
+ $this->lyrics = ($row[$startcol + 34] !== null) ? (string) $row[$startcol + 34] : null;
+ $this->orchestra = ($row[$startcol + 35] !== null) ? (string) $row[$startcol + 35] : null;
+ $this->conductor = ($row[$startcol + 36] !== null) ? (string) $row[$startcol + 36] : null;
+ $this->lyricist = ($row[$startcol + 37] !== null) ? (string) $row[$startcol + 37] : null;
+ $this->original_lyricist = ($row[$startcol + 38] !== null) ? (string) $row[$startcol + 38] : null;
+ $this->radio_station_name = ($row[$startcol + 39] !== null) ? (string) $row[$startcol + 39] : null;
+ $this->info_url = ($row[$startcol + 40] !== null) ? (string) $row[$startcol + 40] : null;
+ $this->artist_url = ($row[$startcol + 41] !== null) ? (string) $row[$startcol + 41] : null;
+ $this->audio_source_url = ($row[$startcol + 42] !== null) ? (string) $row[$startcol + 42] : null;
+ $this->radio_station_url = ($row[$startcol + 43] !== null) ? (string) $row[$startcol + 43] : null;
+ $this->buy_this_url = ($row[$startcol + 44] !== null) ? (string) $row[$startcol + 44] : null;
+ $this->isrc_number = ($row[$startcol + 45] !== null) ? (string) $row[$startcol + 45] : null;
+ $this->catalog_number = ($row[$startcol + 46] !== null) ? (string) $row[$startcol + 46] : null;
+ $this->original_artist = ($row[$startcol + 47] !== null) ? (string) $row[$startcol + 47] : null;
+ $this->copyright = ($row[$startcol + 48] !== null) ? (string) $row[$startcol + 48] : null;
+ $this->report_datetime = ($row[$startcol + 49] !== null) ? (string) $row[$startcol + 49] : null;
+ $this->report_location = ($row[$startcol + 50] !== null) ? (string) $row[$startcol + 50] : null;
+ $this->report_organization = ($row[$startcol + 51] !== null) ? (string) $row[$startcol + 51] : null;
+ $this->subject = ($row[$startcol + 52] !== null) ? (string) $row[$startcol + 52] : null;
+ $this->contributor = ($row[$startcol + 53] !== null) ? (string) $row[$startcol + 53] : null;
+ $this->language = ($row[$startcol + 54] !== null) ? (string) $row[$startcol + 54] : null;
+ $this->file_exists = ($row[$startcol + 55] !== null) ? (boolean) $row[$startcol + 55] : null;
+ $this->replay_gain = ($row[$startcol + 56] !== null) ? (string) $row[$startcol + 56] : null;
+ $this->owner_id = ($row[$startcol + 57] !== null) ? (int) $row[$startcol + 57] : null;
+ $this->cuein = ($row[$startcol + 58] !== null) ? (string) $row[$startcol + 58] : null;
+ $this->cueout = ($row[$startcol + 59] !== null) ? (string) $row[$startcol + 59] : null;
+ $this->silan_check = ($row[$startcol + 60] !== null) ? (boolean) $row[$startcol + 60] : null;
+ $this->hidden = ($row[$startcol + 61] !== null) ? (boolean) $row[$startcol + 61] : null;
+ $this->is_scheduled = ($row[$startcol + 62] !== null) ? (boolean) $row[$startcol + 62] : null;
+ $this->is_playlist = ($row[$startcol + 63] !== null) ? (boolean) $row[$startcol + 63] : null;
+ $this->filesize = ($row[$startcol + 64] !== null) ? (int) $row[$startcol + 64] : null;
+ $this->description = ($row[$startcol + 65] !== null) ? (string) $row[$startcol + 65] : null;
+ $this->artwork = ($row[$startcol + 66] !== null) ? (string) $row[$startcol + 66] : null;
+ $this->track_type = ($row[$startcol + 67] !== null) ? (string) $row[$startcol + 67] : null;
$this->resetModified();
$this->setNew(false);
@@ -3132,7 +3084,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
}
$this->postHydrate($row, $startcol, $rehydrate);
- return $startcol + 69; // 69 = CcFilesPeer::NUM_HYDRATE_COLUMNS.
+ return $startcol + 68; // 68 = CcFilesPeer::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating CcFiles object", $e);
@@ -3155,9 +3107,6 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
public function ensureConsistency()
{
- if ($this->aCcMusicDirs !== null && $this->directory !== $this->aCcMusicDirs->getId()) {
- $this->aCcMusicDirs = null;
- }
if ($this->aCcSubjsRelatedByDbEditedby !== null && $this->editedby !== $this->aCcSubjsRelatedByDbEditedby->getDbId()) {
$this->aCcSubjsRelatedByDbEditedby = null;
}
@@ -3205,7 +3154,6 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->aFkOwner = null;
$this->aCcSubjsRelatedByDbEditedby = null;
- $this->aCcMusicDirs = null;
$this->collCloudFiles = null;
$this->collCcShowInstancess = null;
@@ -3354,13 +3302,6 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->setCcSubjsRelatedByDbEditedby($this->aCcSubjsRelatedByDbEditedby);
}
- if ($this->aCcMusicDirs !== null) {
- if ($this->aCcMusicDirs->isModified() || $this->aCcMusicDirs->isNew()) {
- $affectedRows += $this->aCcMusicDirs->save($con);
- }
- $this->setCcMusicDirs($this->aCcMusicDirs);
- }
-
if ($this->isNew() || $this->isModified()) {
// persist changes
if ($this->isNew()) {
@@ -3556,9 +3497,6 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
if ($this->isColumnModified(CcFilesPeer::FTYPE)) {
$modifiedColumns[':p' . $index++] = '"ftype"';
}
- if ($this->isColumnModified(CcFilesPeer::DIRECTORY)) {
- $modifiedColumns[':p' . $index++] = '"directory"';
- }
if ($this->isColumnModified(CcFilesPeer::FILEPATH)) {
$modifiedColumns[':p' . $index++] = '"filepath"';
}
@@ -3774,9 +3712,6 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
case '"ftype"':
$stmt->bindValue($identifier, $this->ftype, PDO::PARAM_STR);
break;
- case '"directory"':
- $stmt->bindValue($identifier, $this->directory, PDO::PARAM_INT);
- break;
case '"filepath"':
$stmt->bindValue($identifier, $this->filepath, PDO::PARAM_STR);
break;
@@ -4073,12 +4008,6 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
}
}
- if ($this->aCcMusicDirs !== null) {
- if (!$this->aCcMusicDirs->validate($columns)) {
- $failureMap = array_merge($failureMap, $this->aCcMusicDirs->getValidationFailures());
- }
- }
-
if (($retval = CcFilesPeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
@@ -4197,198 +4126,195 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
return $this->getDbFtype();
break;
case 4:
- return $this->getDbDirectory();
- break;
- case 5:
return $this->getDbFilepath();
break;
- case 6:
+ case 5:
return $this->getDbImportStatus();
break;
- case 7:
+ case 6:
return $this->getDbCurrentlyaccessing();
break;
- case 8:
+ case 7:
return $this->getDbEditedby();
break;
- case 9:
+ case 8:
return $this->getDbMtime();
break;
- case 10:
+ case 9:
return $this->getDbUtime();
break;
- case 11:
+ case 10:
return $this->getDbLPtime();
break;
- case 12:
+ case 11:
return $this->getDbMd5();
break;
- case 13:
+ case 12:
return $this->getDbTrackTitle();
break;
- case 14:
+ case 13:
return $this->getDbArtistName();
break;
- case 15:
+ case 14:
return $this->getDbBitRate();
break;
- case 16:
+ case 15:
return $this->getDbSampleRate();
break;
- case 17:
+ case 16:
return $this->getDbFormat();
break;
- case 18:
+ case 17:
return $this->getDbLength();
break;
- case 19:
+ case 18:
return $this->getDbAlbumTitle();
break;
- case 20:
+ case 19:
return $this->getDbGenre();
break;
- case 21:
+ case 20:
return $this->getDbComments();
break;
- case 22:
+ case 21:
return $this->getDbYear();
break;
- case 23:
+ case 22:
return $this->getDbTrackNumber();
break;
- case 24:
+ case 23:
return $this->getDbChannels();
break;
- case 25:
+ case 24:
return $this->getDbUrl();
break;
- case 26:
+ case 25:
return $this->getDbBpm();
break;
- case 27:
+ case 26:
return $this->getDbRating();
break;
- case 28:
+ case 27:
return $this->getDbEncodedBy();
break;
- case 29:
+ case 28:
return $this->getDbDiscNumber();
break;
- case 30:
+ case 29:
return $this->getDbMood();
break;
- case 31:
+ case 30:
return $this->getDbLabel();
break;
- case 32:
+ case 31:
return $this->getDbComposer();
break;
- case 33:
+ case 32:
return $this->getDbEncoder();
break;
- case 34:
+ case 33:
return $this->getDbChecksum();
break;
- case 35:
+ case 34:
return $this->getDbLyrics();
break;
- case 36:
+ case 35:
return $this->getDbOrchestra();
break;
- case 37:
+ case 36:
return $this->getDbConductor();
break;
- case 38:
+ case 37:
return $this->getDbLyricist();
break;
- case 39:
+ case 38:
return $this->getDbOriginalLyricist();
break;
- case 40:
+ case 39:
return $this->getDbRadioStationName();
break;
- case 41:
+ case 40:
return $this->getDbInfoUrl();
break;
- case 42:
+ case 41:
return $this->getDbArtistUrl();
break;
- case 43:
+ case 42:
return $this->getDbAudioSourceUrl();
break;
- case 44:
+ case 43:
return $this->getDbRadioStationUrl();
break;
- case 45:
+ case 44:
return $this->getDbBuyThisUrl();
break;
- case 46:
+ case 45:
return $this->getDbIsrcNumber();
break;
- case 47:
+ case 46:
return $this->getDbCatalogNumber();
break;
- case 48:
+ case 47:
return $this->getDbOriginalArtist();
break;
- case 49:
+ case 48:
return $this->getDbCopyright();
break;
- case 50:
+ case 49:
return $this->getDbReportDatetime();
break;
- case 51:
+ case 50:
return $this->getDbReportLocation();
break;
- case 52:
+ case 51:
return $this->getDbReportOrganization();
break;
- case 53:
+ case 52:
return $this->getDbSubject();
break;
- case 54:
+ case 53:
return $this->getDbContributor();
break;
- case 55:
+ case 54:
return $this->getDbLanguage();
break;
- case 56:
+ case 55:
return $this->getDbFileExists();
break;
- case 57:
+ case 56:
return $this->getDbReplayGain();
break;
- case 58:
+ case 57:
return $this->getDbOwnerId();
break;
- case 59:
+ case 58:
return $this->getDbCuein();
break;
- case 60:
+ case 59:
return $this->getDbCueout();
break;
- case 61:
+ case 60:
return $this->getDbSilanCheck();
break;
- case 62:
+ case 61:
return $this->getDbHidden();
break;
- case 63:
+ case 62:
return $this->getDbIsScheduled();
break;
- case 64:
+ case 63:
return $this->getDbIsPlaylist();
break;
- case 65:
+ case 64:
return $this->getDbFilesize();
break;
- case 66:
+ case 65:
return $this->getDbDescription();
break;
- case 67:
+ case 66:
return $this->getDbArtwork();
break;
- case 68:
+ case 67:
return $this->getDbTrackType();
break;
default:
@@ -4424,71 +4350,70 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$keys[1] => $this->getDbName(),
$keys[2] => $this->getDbMime(),
$keys[3] => $this->getDbFtype(),
- $keys[4] => $this->getDbDirectory(),
- $keys[5] => $this->getDbFilepath(),
- $keys[6] => $this->getDbImportStatus(),
- $keys[7] => $this->getDbCurrentlyaccessing(),
- $keys[8] => $this->getDbEditedby(),
- $keys[9] => $this->getDbMtime(),
- $keys[10] => $this->getDbUtime(),
- $keys[11] => $this->getDbLPtime(),
- $keys[12] => $this->getDbMd5(),
- $keys[13] => $this->getDbTrackTitle(),
- $keys[14] => $this->getDbArtistName(),
- $keys[15] => $this->getDbBitRate(),
- $keys[16] => $this->getDbSampleRate(),
- $keys[17] => $this->getDbFormat(),
- $keys[18] => $this->getDbLength(),
- $keys[19] => $this->getDbAlbumTitle(),
- $keys[20] => $this->getDbGenre(),
- $keys[21] => $this->getDbComments(),
- $keys[22] => $this->getDbYear(),
- $keys[23] => $this->getDbTrackNumber(),
- $keys[24] => $this->getDbChannels(),
- $keys[25] => $this->getDbUrl(),
- $keys[26] => $this->getDbBpm(),
- $keys[27] => $this->getDbRating(),
- $keys[28] => $this->getDbEncodedBy(),
- $keys[29] => $this->getDbDiscNumber(),
- $keys[30] => $this->getDbMood(),
- $keys[31] => $this->getDbLabel(),
- $keys[32] => $this->getDbComposer(),
- $keys[33] => $this->getDbEncoder(),
- $keys[34] => $this->getDbChecksum(),
- $keys[35] => $this->getDbLyrics(),
- $keys[36] => $this->getDbOrchestra(),
- $keys[37] => $this->getDbConductor(),
- $keys[38] => $this->getDbLyricist(),
- $keys[39] => $this->getDbOriginalLyricist(),
- $keys[40] => $this->getDbRadioStationName(),
- $keys[41] => $this->getDbInfoUrl(),
- $keys[42] => $this->getDbArtistUrl(),
- $keys[43] => $this->getDbAudioSourceUrl(),
- $keys[44] => $this->getDbRadioStationUrl(),
- $keys[45] => $this->getDbBuyThisUrl(),
- $keys[46] => $this->getDbIsrcNumber(),
- $keys[47] => $this->getDbCatalogNumber(),
- $keys[48] => $this->getDbOriginalArtist(),
- $keys[49] => $this->getDbCopyright(),
- $keys[50] => $this->getDbReportDatetime(),
- $keys[51] => $this->getDbReportLocation(),
- $keys[52] => $this->getDbReportOrganization(),
- $keys[53] => $this->getDbSubject(),
- $keys[54] => $this->getDbContributor(),
- $keys[55] => $this->getDbLanguage(),
- $keys[56] => $this->getDbFileExists(),
- $keys[57] => $this->getDbReplayGain(),
- $keys[58] => $this->getDbOwnerId(),
- $keys[59] => $this->getDbCuein(),
- $keys[60] => $this->getDbCueout(),
- $keys[61] => $this->getDbSilanCheck(),
- $keys[62] => $this->getDbHidden(),
- $keys[63] => $this->getDbIsScheduled(),
- $keys[64] => $this->getDbIsPlaylist(),
- $keys[65] => $this->getDbFilesize(),
- $keys[66] => $this->getDbDescription(),
- $keys[67] => $this->getDbArtwork(),
- $keys[68] => $this->getDbTrackType(),
+ $keys[4] => $this->getDbFilepath(),
+ $keys[5] => $this->getDbImportStatus(),
+ $keys[6] => $this->getDbCurrentlyaccessing(),
+ $keys[7] => $this->getDbEditedby(),
+ $keys[8] => $this->getDbMtime(),
+ $keys[9] => $this->getDbUtime(),
+ $keys[10] => $this->getDbLPtime(),
+ $keys[11] => $this->getDbMd5(),
+ $keys[12] => $this->getDbTrackTitle(),
+ $keys[13] => $this->getDbArtistName(),
+ $keys[14] => $this->getDbBitRate(),
+ $keys[15] => $this->getDbSampleRate(),
+ $keys[16] => $this->getDbFormat(),
+ $keys[17] => $this->getDbLength(),
+ $keys[18] => $this->getDbAlbumTitle(),
+ $keys[19] => $this->getDbGenre(),
+ $keys[20] => $this->getDbComments(),
+ $keys[21] => $this->getDbYear(),
+ $keys[22] => $this->getDbTrackNumber(),
+ $keys[23] => $this->getDbChannels(),
+ $keys[24] => $this->getDbUrl(),
+ $keys[25] => $this->getDbBpm(),
+ $keys[26] => $this->getDbRating(),
+ $keys[27] => $this->getDbEncodedBy(),
+ $keys[28] => $this->getDbDiscNumber(),
+ $keys[29] => $this->getDbMood(),
+ $keys[30] => $this->getDbLabel(),
+ $keys[31] => $this->getDbComposer(),
+ $keys[32] => $this->getDbEncoder(),
+ $keys[33] => $this->getDbChecksum(),
+ $keys[34] => $this->getDbLyrics(),
+ $keys[35] => $this->getDbOrchestra(),
+ $keys[36] => $this->getDbConductor(),
+ $keys[37] => $this->getDbLyricist(),
+ $keys[38] => $this->getDbOriginalLyricist(),
+ $keys[39] => $this->getDbRadioStationName(),
+ $keys[40] => $this->getDbInfoUrl(),
+ $keys[41] => $this->getDbArtistUrl(),
+ $keys[42] => $this->getDbAudioSourceUrl(),
+ $keys[43] => $this->getDbRadioStationUrl(),
+ $keys[44] => $this->getDbBuyThisUrl(),
+ $keys[45] => $this->getDbIsrcNumber(),
+ $keys[46] => $this->getDbCatalogNumber(),
+ $keys[47] => $this->getDbOriginalArtist(),
+ $keys[48] => $this->getDbCopyright(),
+ $keys[49] => $this->getDbReportDatetime(),
+ $keys[50] => $this->getDbReportLocation(),
+ $keys[51] => $this->getDbReportOrganization(),
+ $keys[52] => $this->getDbSubject(),
+ $keys[53] => $this->getDbContributor(),
+ $keys[54] => $this->getDbLanguage(),
+ $keys[55] => $this->getDbFileExists(),
+ $keys[56] => $this->getDbReplayGain(),
+ $keys[57] => $this->getDbOwnerId(),
+ $keys[58] => $this->getDbCuein(),
+ $keys[59] => $this->getDbCueout(),
+ $keys[60] => $this->getDbSilanCheck(),
+ $keys[61] => $this->getDbHidden(),
+ $keys[62] => $this->getDbIsScheduled(),
+ $keys[63] => $this->getDbIsPlaylist(),
+ $keys[64] => $this->getDbFilesize(),
+ $keys[65] => $this->getDbDescription(),
+ $keys[66] => $this->getDbArtwork(),
+ $keys[67] => $this->getDbTrackType(),
);
$virtualColumns = $this->virtualColumns;
foreach ($virtualColumns as $key => $virtualColumn) {
@@ -4502,9 +4427,6 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
if (null !== $this->aCcSubjsRelatedByDbEditedby) {
$result['CcSubjsRelatedByDbEditedby'] = $this->aCcSubjsRelatedByDbEditedby->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
- if (null !== $this->aCcMusicDirs) {
- $result['CcMusicDirs'] = $this->aCcMusicDirs->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
- }
if (null !== $this->collCloudFiles) {
$result['CloudFiles'] = $this->collCloudFiles->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
@@ -4576,198 +4498,195 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->setDbFtype($value);
break;
case 4:
- $this->setDbDirectory($value);
- break;
- case 5:
$this->setDbFilepath($value);
break;
- case 6:
+ case 5:
$this->setDbImportStatus($value);
break;
- case 7:
+ case 6:
$this->setDbCurrentlyaccessing($value);
break;
- case 8:
+ case 7:
$this->setDbEditedby($value);
break;
- case 9:
+ case 8:
$this->setDbMtime($value);
break;
- case 10:
+ case 9:
$this->setDbUtime($value);
break;
- case 11:
+ case 10:
$this->setDbLPtime($value);
break;
- case 12:
+ case 11:
$this->setDbMd5($value);
break;
- case 13:
+ case 12:
$this->setDbTrackTitle($value);
break;
- case 14:
+ case 13:
$this->setDbArtistName($value);
break;
- case 15:
+ case 14:
$this->setDbBitRate($value);
break;
- case 16:
+ case 15:
$this->setDbSampleRate($value);
break;
- case 17:
+ case 16:
$this->setDbFormat($value);
break;
- case 18:
+ case 17:
$this->setDbLength($value);
break;
- case 19:
+ case 18:
$this->setDbAlbumTitle($value);
break;
- case 20:
+ case 19:
$this->setDbGenre($value);
break;
- case 21:
+ case 20:
$this->setDbComments($value);
break;
- case 22:
+ case 21:
$this->setDbYear($value);
break;
- case 23:
+ case 22:
$this->setDbTrackNumber($value);
break;
- case 24:
+ case 23:
$this->setDbChannels($value);
break;
- case 25:
+ case 24:
$this->setDbUrl($value);
break;
- case 26:
+ case 25:
$this->setDbBpm($value);
break;
- case 27:
+ case 26:
$this->setDbRating($value);
break;
- case 28:
+ case 27:
$this->setDbEncodedBy($value);
break;
- case 29:
+ case 28:
$this->setDbDiscNumber($value);
break;
- case 30:
+ case 29:
$this->setDbMood($value);
break;
- case 31:
+ case 30:
$this->setDbLabel($value);
break;
- case 32:
+ case 31:
$this->setDbComposer($value);
break;
- case 33:
+ case 32:
$this->setDbEncoder($value);
break;
- case 34:
+ case 33:
$this->setDbChecksum($value);
break;
- case 35:
+ case 34:
$this->setDbLyrics($value);
break;
- case 36:
+ case 35:
$this->setDbOrchestra($value);
break;
- case 37:
+ case 36:
$this->setDbConductor($value);
break;
- case 38:
+ case 37:
$this->setDbLyricist($value);
break;
- case 39:
+ case 38:
$this->setDbOriginalLyricist($value);
break;
- case 40:
+ case 39:
$this->setDbRadioStationName($value);
break;
- case 41:
+ case 40:
$this->setDbInfoUrl($value);
break;
- case 42:
+ case 41:
$this->setDbArtistUrl($value);
break;
- case 43:
+ case 42:
$this->setDbAudioSourceUrl($value);
break;
- case 44:
+ case 43:
$this->setDbRadioStationUrl($value);
break;
- case 45:
+ case 44:
$this->setDbBuyThisUrl($value);
break;
- case 46:
+ case 45:
$this->setDbIsrcNumber($value);
break;
- case 47:
+ case 46:
$this->setDbCatalogNumber($value);
break;
- case 48:
+ case 47:
$this->setDbOriginalArtist($value);
break;
- case 49:
+ case 48:
$this->setDbCopyright($value);
break;
- case 50:
+ case 49:
$this->setDbReportDatetime($value);
break;
- case 51:
+ case 50:
$this->setDbReportLocation($value);
break;
- case 52:
+ case 51:
$this->setDbReportOrganization($value);
break;
- case 53:
+ case 52:
$this->setDbSubject($value);
break;
- case 54:
+ case 53:
$this->setDbContributor($value);
break;
- case 55:
+ case 54:
$this->setDbLanguage($value);
break;
- case 56:
+ case 55:
$this->setDbFileExists($value);
break;
- case 57:
+ case 56:
$this->setDbReplayGain($value);
break;
- case 58:
+ case 57:
$this->setDbOwnerId($value);
break;
- case 59:
+ case 58:
$this->setDbCuein($value);
break;
- case 60:
+ case 59:
$this->setDbCueout($value);
break;
- case 61:
+ case 60:
$this->setDbSilanCheck($value);
break;
- case 62:
+ case 61:
$this->setDbHidden($value);
break;
- case 63:
+ case 62:
$this->setDbIsScheduled($value);
break;
- case 64:
+ case 63:
$this->setDbIsPlaylist($value);
break;
- case 65:
+ case 64:
$this->setDbFilesize($value);
break;
- case 66:
+ case 65:
$this->setDbDescription($value);
break;
- case 67:
+ case 66:
$this->setDbArtwork($value);
break;
- case 68:
+ case 67:
$this->setDbTrackType($value);
break;
} // switch()
@@ -4798,71 +4717,70 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
if (array_key_exists($keys[1], $arr)) $this->setDbName($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setDbMime($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setDbFtype($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setDbDirectory($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setDbFilepath($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setDbImportStatus($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setDbCurrentlyaccessing($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setDbEditedby($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setDbMtime($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setDbUtime($arr[$keys[10]]);
- if (array_key_exists($keys[11], $arr)) $this->setDbLPtime($arr[$keys[11]]);
- if (array_key_exists($keys[12], $arr)) $this->setDbMd5($arr[$keys[12]]);
- if (array_key_exists($keys[13], $arr)) $this->setDbTrackTitle($arr[$keys[13]]);
- if (array_key_exists($keys[14], $arr)) $this->setDbArtistName($arr[$keys[14]]);
- if (array_key_exists($keys[15], $arr)) $this->setDbBitRate($arr[$keys[15]]);
- if (array_key_exists($keys[16], $arr)) $this->setDbSampleRate($arr[$keys[16]]);
- if (array_key_exists($keys[17], $arr)) $this->setDbFormat($arr[$keys[17]]);
- if (array_key_exists($keys[18], $arr)) $this->setDbLength($arr[$keys[18]]);
- if (array_key_exists($keys[19], $arr)) $this->setDbAlbumTitle($arr[$keys[19]]);
- if (array_key_exists($keys[20], $arr)) $this->setDbGenre($arr[$keys[20]]);
- if (array_key_exists($keys[21], $arr)) $this->setDbComments($arr[$keys[21]]);
- if (array_key_exists($keys[22], $arr)) $this->setDbYear($arr[$keys[22]]);
- if (array_key_exists($keys[23], $arr)) $this->setDbTrackNumber($arr[$keys[23]]);
- if (array_key_exists($keys[24], $arr)) $this->setDbChannels($arr[$keys[24]]);
- if (array_key_exists($keys[25], $arr)) $this->setDbUrl($arr[$keys[25]]);
- if (array_key_exists($keys[26], $arr)) $this->setDbBpm($arr[$keys[26]]);
- if (array_key_exists($keys[27], $arr)) $this->setDbRating($arr[$keys[27]]);
- if (array_key_exists($keys[28], $arr)) $this->setDbEncodedBy($arr[$keys[28]]);
- if (array_key_exists($keys[29], $arr)) $this->setDbDiscNumber($arr[$keys[29]]);
- if (array_key_exists($keys[30], $arr)) $this->setDbMood($arr[$keys[30]]);
- if (array_key_exists($keys[31], $arr)) $this->setDbLabel($arr[$keys[31]]);
- if (array_key_exists($keys[32], $arr)) $this->setDbComposer($arr[$keys[32]]);
- if (array_key_exists($keys[33], $arr)) $this->setDbEncoder($arr[$keys[33]]);
- if (array_key_exists($keys[34], $arr)) $this->setDbChecksum($arr[$keys[34]]);
- if (array_key_exists($keys[35], $arr)) $this->setDbLyrics($arr[$keys[35]]);
- if (array_key_exists($keys[36], $arr)) $this->setDbOrchestra($arr[$keys[36]]);
- if (array_key_exists($keys[37], $arr)) $this->setDbConductor($arr[$keys[37]]);
- if (array_key_exists($keys[38], $arr)) $this->setDbLyricist($arr[$keys[38]]);
- if (array_key_exists($keys[39], $arr)) $this->setDbOriginalLyricist($arr[$keys[39]]);
- if (array_key_exists($keys[40], $arr)) $this->setDbRadioStationName($arr[$keys[40]]);
- if (array_key_exists($keys[41], $arr)) $this->setDbInfoUrl($arr[$keys[41]]);
- if (array_key_exists($keys[42], $arr)) $this->setDbArtistUrl($arr[$keys[42]]);
- if (array_key_exists($keys[43], $arr)) $this->setDbAudioSourceUrl($arr[$keys[43]]);
- if (array_key_exists($keys[44], $arr)) $this->setDbRadioStationUrl($arr[$keys[44]]);
- if (array_key_exists($keys[45], $arr)) $this->setDbBuyThisUrl($arr[$keys[45]]);
- if (array_key_exists($keys[46], $arr)) $this->setDbIsrcNumber($arr[$keys[46]]);
- if (array_key_exists($keys[47], $arr)) $this->setDbCatalogNumber($arr[$keys[47]]);
- if (array_key_exists($keys[48], $arr)) $this->setDbOriginalArtist($arr[$keys[48]]);
- if (array_key_exists($keys[49], $arr)) $this->setDbCopyright($arr[$keys[49]]);
- if (array_key_exists($keys[50], $arr)) $this->setDbReportDatetime($arr[$keys[50]]);
- if (array_key_exists($keys[51], $arr)) $this->setDbReportLocation($arr[$keys[51]]);
- if (array_key_exists($keys[52], $arr)) $this->setDbReportOrganization($arr[$keys[52]]);
- if (array_key_exists($keys[53], $arr)) $this->setDbSubject($arr[$keys[53]]);
- if (array_key_exists($keys[54], $arr)) $this->setDbContributor($arr[$keys[54]]);
- if (array_key_exists($keys[55], $arr)) $this->setDbLanguage($arr[$keys[55]]);
- if (array_key_exists($keys[56], $arr)) $this->setDbFileExists($arr[$keys[56]]);
- if (array_key_exists($keys[57], $arr)) $this->setDbReplayGain($arr[$keys[57]]);
- if (array_key_exists($keys[58], $arr)) $this->setDbOwnerId($arr[$keys[58]]);
- if (array_key_exists($keys[59], $arr)) $this->setDbCuein($arr[$keys[59]]);
- if (array_key_exists($keys[60], $arr)) $this->setDbCueout($arr[$keys[60]]);
- if (array_key_exists($keys[61], $arr)) $this->setDbSilanCheck($arr[$keys[61]]);
- if (array_key_exists($keys[62], $arr)) $this->setDbHidden($arr[$keys[62]]);
- if (array_key_exists($keys[63], $arr)) $this->setDbIsScheduled($arr[$keys[63]]);
- if (array_key_exists($keys[64], $arr)) $this->setDbIsPlaylist($arr[$keys[64]]);
- if (array_key_exists($keys[65], $arr)) $this->setDbFilesize($arr[$keys[65]]);
- if (array_key_exists($keys[66], $arr)) $this->setDbDescription($arr[$keys[66]]);
- if (array_key_exists($keys[67], $arr)) $this->setDbArtwork($arr[$keys[67]]);
- if (array_key_exists($keys[68], $arr)) $this->setDbTrackType($arr[$keys[68]]);
+ if (array_key_exists($keys[4], $arr)) $this->setDbFilepath($arr[$keys[4]]);
+ if (array_key_exists($keys[5], $arr)) $this->setDbImportStatus($arr[$keys[5]]);
+ if (array_key_exists($keys[6], $arr)) $this->setDbCurrentlyaccessing($arr[$keys[6]]);
+ if (array_key_exists($keys[7], $arr)) $this->setDbEditedby($arr[$keys[7]]);
+ if (array_key_exists($keys[8], $arr)) $this->setDbMtime($arr[$keys[8]]);
+ if (array_key_exists($keys[9], $arr)) $this->setDbUtime($arr[$keys[9]]);
+ if (array_key_exists($keys[10], $arr)) $this->setDbLPtime($arr[$keys[10]]);
+ if (array_key_exists($keys[11], $arr)) $this->setDbMd5($arr[$keys[11]]);
+ if (array_key_exists($keys[12], $arr)) $this->setDbTrackTitle($arr[$keys[12]]);
+ if (array_key_exists($keys[13], $arr)) $this->setDbArtistName($arr[$keys[13]]);
+ if (array_key_exists($keys[14], $arr)) $this->setDbBitRate($arr[$keys[14]]);
+ if (array_key_exists($keys[15], $arr)) $this->setDbSampleRate($arr[$keys[15]]);
+ if (array_key_exists($keys[16], $arr)) $this->setDbFormat($arr[$keys[16]]);
+ if (array_key_exists($keys[17], $arr)) $this->setDbLength($arr[$keys[17]]);
+ if (array_key_exists($keys[18], $arr)) $this->setDbAlbumTitle($arr[$keys[18]]);
+ if (array_key_exists($keys[19], $arr)) $this->setDbGenre($arr[$keys[19]]);
+ if (array_key_exists($keys[20], $arr)) $this->setDbComments($arr[$keys[20]]);
+ if (array_key_exists($keys[21], $arr)) $this->setDbYear($arr[$keys[21]]);
+ if (array_key_exists($keys[22], $arr)) $this->setDbTrackNumber($arr[$keys[22]]);
+ if (array_key_exists($keys[23], $arr)) $this->setDbChannels($arr[$keys[23]]);
+ if (array_key_exists($keys[24], $arr)) $this->setDbUrl($arr[$keys[24]]);
+ if (array_key_exists($keys[25], $arr)) $this->setDbBpm($arr[$keys[25]]);
+ if (array_key_exists($keys[26], $arr)) $this->setDbRating($arr[$keys[26]]);
+ if (array_key_exists($keys[27], $arr)) $this->setDbEncodedBy($arr[$keys[27]]);
+ if (array_key_exists($keys[28], $arr)) $this->setDbDiscNumber($arr[$keys[28]]);
+ if (array_key_exists($keys[29], $arr)) $this->setDbMood($arr[$keys[29]]);
+ if (array_key_exists($keys[30], $arr)) $this->setDbLabel($arr[$keys[30]]);
+ if (array_key_exists($keys[31], $arr)) $this->setDbComposer($arr[$keys[31]]);
+ if (array_key_exists($keys[32], $arr)) $this->setDbEncoder($arr[$keys[32]]);
+ if (array_key_exists($keys[33], $arr)) $this->setDbChecksum($arr[$keys[33]]);
+ if (array_key_exists($keys[34], $arr)) $this->setDbLyrics($arr[$keys[34]]);
+ if (array_key_exists($keys[35], $arr)) $this->setDbOrchestra($arr[$keys[35]]);
+ if (array_key_exists($keys[36], $arr)) $this->setDbConductor($arr[$keys[36]]);
+ if (array_key_exists($keys[37], $arr)) $this->setDbLyricist($arr[$keys[37]]);
+ if (array_key_exists($keys[38], $arr)) $this->setDbOriginalLyricist($arr[$keys[38]]);
+ if (array_key_exists($keys[39], $arr)) $this->setDbRadioStationName($arr[$keys[39]]);
+ if (array_key_exists($keys[40], $arr)) $this->setDbInfoUrl($arr[$keys[40]]);
+ if (array_key_exists($keys[41], $arr)) $this->setDbArtistUrl($arr[$keys[41]]);
+ if (array_key_exists($keys[42], $arr)) $this->setDbAudioSourceUrl($arr[$keys[42]]);
+ if (array_key_exists($keys[43], $arr)) $this->setDbRadioStationUrl($arr[$keys[43]]);
+ if (array_key_exists($keys[44], $arr)) $this->setDbBuyThisUrl($arr[$keys[44]]);
+ if (array_key_exists($keys[45], $arr)) $this->setDbIsrcNumber($arr[$keys[45]]);
+ if (array_key_exists($keys[46], $arr)) $this->setDbCatalogNumber($arr[$keys[46]]);
+ if (array_key_exists($keys[47], $arr)) $this->setDbOriginalArtist($arr[$keys[47]]);
+ if (array_key_exists($keys[48], $arr)) $this->setDbCopyright($arr[$keys[48]]);
+ if (array_key_exists($keys[49], $arr)) $this->setDbReportDatetime($arr[$keys[49]]);
+ if (array_key_exists($keys[50], $arr)) $this->setDbReportLocation($arr[$keys[50]]);
+ if (array_key_exists($keys[51], $arr)) $this->setDbReportOrganization($arr[$keys[51]]);
+ if (array_key_exists($keys[52], $arr)) $this->setDbSubject($arr[$keys[52]]);
+ if (array_key_exists($keys[53], $arr)) $this->setDbContributor($arr[$keys[53]]);
+ if (array_key_exists($keys[54], $arr)) $this->setDbLanguage($arr[$keys[54]]);
+ if (array_key_exists($keys[55], $arr)) $this->setDbFileExists($arr[$keys[55]]);
+ if (array_key_exists($keys[56], $arr)) $this->setDbReplayGain($arr[$keys[56]]);
+ if (array_key_exists($keys[57], $arr)) $this->setDbOwnerId($arr[$keys[57]]);
+ if (array_key_exists($keys[58], $arr)) $this->setDbCuein($arr[$keys[58]]);
+ if (array_key_exists($keys[59], $arr)) $this->setDbCueout($arr[$keys[59]]);
+ if (array_key_exists($keys[60], $arr)) $this->setDbSilanCheck($arr[$keys[60]]);
+ if (array_key_exists($keys[61], $arr)) $this->setDbHidden($arr[$keys[61]]);
+ if (array_key_exists($keys[62], $arr)) $this->setDbIsScheduled($arr[$keys[62]]);
+ if (array_key_exists($keys[63], $arr)) $this->setDbIsPlaylist($arr[$keys[63]]);
+ if (array_key_exists($keys[64], $arr)) $this->setDbFilesize($arr[$keys[64]]);
+ if (array_key_exists($keys[65], $arr)) $this->setDbDescription($arr[$keys[65]]);
+ if (array_key_exists($keys[66], $arr)) $this->setDbArtwork($arr[$keys[66]]);
+ if (array_key_exists($keys[67], $arr)) $this->setDbTrackType($arr[$keys[67]]);
}
/**
@@ -4878,7 +4796,6 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
if ($this->isColumnModified(CcFilesPeer::NAME)) $criteria->add(CcFilesPeer::NAME, $this->name);
if ($this->isColumnModified(CcFilesPeer::MIME)) $criteria->add(CcFilesPeer::MIME, $this->mime);
if ($this->isColumnModified(CcFilesPeer::FTYPE)) $criteria->add(CcFilesPeer::FTYPE, $this->ftype);
- if ($this->isColumnModified(CcFilesPeer::DIRECTORY)) $criteria->add(CcFilesPeer::DIRECTORY, $this->directory);
if ($this->isColumnModified(CcFilesPeer::FILEPATH)) $criteria->add(CcFilesPeer::FILEPATH, $this->filepath);
if ($this->isColumnModified(CcFilesPeer::IMPORT_STATUS)) $criteria->add(CcFilesPeer::IMPORT_STATUS, $this->import_status);
if ($this->isColumnModified(CcFilesPeer::CURRENTLYACCESSING)) $criteria->add(CcFilesPeer::CURRENTLYACCESSING, $this->currentlyaccessing);
@@ -5009,7 +4926,6 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$copyObj->setDbName($this->getDbName());
$copyObj->setDbMime($this->getDbMime());
$copyObj->setDbFtype($this->getDbFtype());
- $copyObj->setDbDirectory($this->getDbDirectory());
$copyObj->setDbFilepath($this->getDbFilepath());
$copyObj->setDbImportStatus($this->getDbImportStatus());
$copyObj->setDbCurrentlyaccessing($this->getDbCurrentlyaccessing());
@@ -5284,58 +5200,6 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
return $this->aCcSubjsRelatedByDbEditedby;
}
- /**
- * Declares an association between this object and a CcMusicDirs object.
- *
- * @param CcMusicDirs $v
- * @return CcFiles The current object (for fluent API support)
- * @throws PropelException
- */
- public function setCcMusicDirs(CcMusicDirs $v = null)
- {
- if ($v === null) {
- $this->setDbDirectory(NULL);
- } else {
- $this->setDbDirectory($v->getId());
- }
-
- $this->aCcMusicDirs = $v;
-
- // Add binding for other direction of this n:n relationship.
- // If this object has already been added to the CcMusicDirs object, it will not be re-added.
- if ($v !== null) {
- $v->addCcFiles($this);
- }
-
-
- return $this;
- }
-
-
- /**
- * Get the associated CcMusicDirs object
- *
- * @param PropelPDO $con Optional Connection object.
- * @param $doQuery Executes a query to get the object if required
- * @return CcMusicDirs The associated CcMusicDirs object.
- * @throws PropelException
- */
- public function getCcMusicDirs(PropelPDO $con = null, $doQuery = true)
- {
- if ($this->aCcMusicDirs === null && ($this->directory !== null) && $doQuery) {
- $this->aCcMusicDirs = CcMusicDirsQuery::create()->findPk($this->directory, $con);
- /* The following can be used additionally to
- guarantee the related object contains a reference
- to this object. This level of coupling may, however, be
- undesirable since it could result in an only partially populated collection
- in the referenced object.
- $this->aCcMusicDirs->addCcFiless($this);
- */
- }
-
- return $this->aCcMusicDirs;
- }
-
/**
* Initializes a collection based on the name of a relation.
@@ -7407,7 +7271,6 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->name = null;
$this->mime = null;
$this->ftype = null;
- $this->directory = null;
$this->filepath = null;
$this->import_status = null;
$this->currentlyaccessing = null;
@@ -7541,9 +7404,6 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
if ($this->aCcSubjsRelatedByDbEditedby instanceof Persistent) {
$this->aCcSubjsRelatedByDbEditedby->clearAllReferences($deep);
}
- if ($this->aCcMusicDirs instanceof Persistent) {
- $this->aCcMusicDirs->clearAllReferences($deep);
- }
$this->alreadyInClearAllReferencesDeep = false;
} // if ($deep)
@@ -7582,7 +7442,6 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->collPodcastEpisodess = null;
$this->aFkOwner = null;
$this->aCcSubjsRelatedByDbEditedby = null;
- $this->aCcMusicDirs = null;
}
/**
diff --git a/legacy/application/models/airtime/om/BaseCcFilesPeer.php b/legacy/application/models/airtime/om/BaseCcFilesPeer.php
index cce7baef8..ec6b1aa9c 100644
--- a/legacy/application/models/airtime/om/BaseCcFilesPeer.php
+++ b/legacy/application/models/airtime/om/BaseCcFilesPeer.php
@@ -24,13 +24,13 @@ abstract class BaseCcFilesPeer
const TM_CLASS = 'CcFilesTableMap';
/** The total number of columns. */
- const NUM_COLUMNS = 69;
+ const NUM_COLUMNS = 68;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS) */
- const NUM_HYDRATE_COLUMNS = 69;
+ const NUM_HYDRATE_COLUMNS = 68;
/** the column name for the id field */
const ID = 'cc_files.id';
@@ -44,9 +44,6 @@ abstract class BaseCcFilesPeer
/** the column name for the ftype field */
const FTYPE = 'cc_files.ftype';
- /** the column name for the directory field */
- const DIRECTORY = 'cc_files.directory';
-
/** the column name for the filepath field */
const FILEPATH = 'cc_files.filepath';
@@ -258,12 +255,12 @@ abstract class BaseCcFilesPeer
* e.g. CcFilesPeer::$fieldNames[CcFilesPeer::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbMime', 'DbFtype', 'DbDirectory', 'DbFilepath', 'DbImportStatus', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbUtime', 'DbLPtime', 'DbMd5', 'DbTrackTitle', 'DbArtistName', 'DbBitRate', 'DbSampleRate', 'DbFormat', 'DbLength', 'DbAlbumTitle', 'DbGenre', 'DbComments', 'DbYear', 'DbTrackNumber', 'DbChannels', 'DbUrl', 'DbBpm', 'DbRating', 'DbEncodedBy', 'DbDiscNumber', 'DbMood', 'DbLabel', 'DbComposer', 'DbEncoder', 'DbChecksum', 'DbLyrics', 'DbOrchestra', 'DbConductor', 'DbLyricist', 'DbOriginalLyricist', 'DbRadioStationName', 'DbInfoUrl', 'DbArtistUrl', 'DbAudioSourceUrl', 'DbRadioStationUrl', 'DbBuyThisUrl', 'DbIsrcNumber', 'DbCatalogNumber', 'DbOriginalArtist', 'DbCopyright', 'DbReportDatetime', 'DbReportLocation', 'DbReportOrganization', 'DbSubject', 'DbContributor', 'DbLanguage', 'DbFileExists', 'DbReplayGain', 'DbOwnerId', 'DbCuein', 'DbCueout', 'DbSilanCheck', 'DbHidden', 'DbIsScheduled', 'DbIsPlaylist', 'DbFilesize', 'DbDescription', 'DbArtwork', 'DbTrackType', ),
- BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbMime', 'dbFtype', 'dbDirectory', 'dbFilepath', 'dbImportStatus', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbUtime', 'dbLPtime', 'dbMd5', 'dbTrackTitle', 'dbArtistName', 'dbBitRate', 'dbSampleRate', 'dbFormat', 'dbLength', 'dbAlbumTitle', 'dbGenre', 'dbComments', 'dbYear', 'dbTrackNumber', 'dbChannels', 'dbUrl', 'dbBpm', 'dbRating', 'dbEncodedBy', 'dbDiscNumber', 'dbMood', 'dbLabel', 'dbComposer', 'dbEncoder', 'dbChecksum', 'dbLyrics', 'dbOrchestra', 'dbConductor', 'dbLyricist', 'dbOriginalLyricist', 'dbRadioStationName', 'dbInfoUrl', 'dbArtistUrl', 'dbAudioSourceUrl', 'dbRadioStationUrl', 'dbBuyThisUrl', 'dbIsrcNumber', 'dbCatalogNumber', 'dbOriginalArtist', 'dbCopyright', 'dbReportDatetime', 'dbReportLocation', 'dbReportOrganization', 'dbSubject', 'dbContributor', 'dbLanguage', 'dbFileExists', 'dbReplayGain', 'dbOwnerId', 'dbCuein', 'dbCueout', 'dbSilanCheck', 'dbHidden', 'dbIsScheduled', 'dbIsPlaylist', 'dbFilesize', 'dbDescription', 'dbArtwork', 'dbTrackType', ),
- BasePeer::TYPE_COLNAME => array (CcFilesPeer::ID, CcFilesPeer::NAME, CcFilesPeer::MIME, CcFilesPeer::FTYPE, CcFilesPeer::DIRECTORY, CcFilesPeer::FILEPATH, CcFilesPeer::IMPORT_STATUS, CcFilesPeer::CURRENTLYACCESSING, CcFilesPeer::EDITEDBY, CcFilesPeer::MTIME, CcFilesPeer::UTIME, CcFilesPeer::LPTIME, CcFilesPeer::MD5, CcFilesPeer::TRACK_TITLE, CcFilesPeer::ARTIST_NAME, CcFilesPeer::BIT_RATE, CcFilesPeer::SAMPLE_RATE, CcFilesPeer::FORMAT, CcFilesPeer::LENGTH, CcFilesPeer::ALBUM_TITLE, CcFilesPeer::GENRE, CcFilesPeer::COMMENTS, CcFilesPeer::YEAR, CcFilesPeer::TRACK_NUMBER, CcFilesPeer::CHANNELS, CcFilesPeer::URL, CcFilesPeer::BPM, CcFilesPeer::RATING, CcFilesPeer::ENCODED_BY, CcFilesPeer::DISC_NUMBER, CcFilesPeer::MOOD, CcFilesPeer::LABEL, CcFilesPeer::COMPOSER, CcFilesPeer::ENCODER, CcFilesPeer::CHECKSUM, CcFilesPeer::LYRICS, CcFilesPeer::ORCHESTRA, CcFilesPeer::CONDUCTOR, CcFilesPeer::LYRICIST, CcFilesPeer::ORIGINAL_LYRICIST, CcFilesPeer::RADIO_STATION_NAME, CcFilesPeer::INFO_URL, CcFilesPeer::ARTIST_URL, CcFilesPeer::AUDIO_SOURCE_URL, CcFilesPeer::RADIO_STATION_URL, CcFilesPeer::BUY_THIS_URL, CcFilesPeer::ISRC_NUMBER, CcFilesPeer::CATALOG_NUMBER, CcFilesPeer::ORIGINAL_ARTIST, CcFilesPeer::COPYRIGHT, CcFilesPeer::REPORT_DATETIME, CcFilesPeer::REPORT_LOCATION, CcFilesPeer::REPORT_ORGANIZATION, CcFilesPeer::SUBJECT, CcFilesPeer::CONTRIBUTOR, CcFilesPeer::LANGUAGE, CcFilesPeer::FILE_EXISTS, CcFilesPeer::REPLAY_GAIN, CcFilesPeer::OWNER_ID, CcFilesPeer::CUEIN, CcFilesPeer::CUEOUT, CcFilesPeer::SILAN_CHECK, CcFilesPeer::HIDDEN, CcFilesPeer::IS_SCHEDULED, CcFilesPeer::IS_PLAYLIST, CcFilesPeer::FILESIZE, CcFilesPeer::DESCRIPTION, CcFilesPeer::ARTWORK, CcFilesPeer::TRACK_TYPE, ),
- BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'MIME', 'FTYPE', 'DIRECTORY', 'FILEPATH', 'IMPORT_STATUS', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'UTIME', 'LPTIME', 'MD5', 'TRACK_TITLE', 'ARTIST_NAME', 'BIT_RATE', 'SAMPLE_RATE', 'FORMAT', 'LENGTH', 'ALBUM_TITLE', 'GENRE', 'COMMENTS', 'YEAR', 'TRACK_NUMBER', 'CHANNELS', 'URL', 'BPM', 'RATING', 'ENCODED_BY', 'DISC_NUMBER', 'MOOD', 'LABEL', 'COMPOSER', 'ENCODER', 'CHECKSUM', 'LYRICS', 'ORCHESTRA', 'CONDUCTOR', 'LYRICIST', 'ORIGINAL_LYRICIST', 'RADIO_STATION_NAME', 'INFO_URL', 'ARTIST_URL', 'AUDIO_SOURCE_URL', 'RADIO_STATION_URL', 'BUY_THIS_URL', 'ISRC_NUMBER', 'CATALOG_NUMBER', 'ORIGINAL_ARTIST', 'COPYRIGHT', 'REPORT_DATETIME', 'REPORT_LOCATION', 'REPORT_ORGANIZATION', 'SUBJECT', 'CONTRIBUTOR', 'LANGUAGE', 'FILE_EXISTS', 'REPLAY_GAIN', 'OWNER_ID', 'CUEIN', 'CUEOUT', 'SILAN_CHECK', 'HIDDEN', 'IS_SCHEDULED', 'IS_PLAYLIST', 'FILESIZE', 'DESCRIPTION', 'ARTWORK', 'TRACK_TYPE', ),
- BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'mime', 'ftype', 'directory', 'filepath', 'import_status', 'currentlyaccessing', 'editedby', 'mtime', 'utime', 'lptime', 'md5', 'track_title', 'artist_name', 'bit_rate', 'sample_rate', 'format', 'length', 'album_title', 'genre', 'comments', 'year', 'track_number', 'channels', 'url', 'bpm', 'rating', 'encoded_by', 'disc_number', 'mood', 'label', 'composer', 'encoder', 'checksum', 'lyrics', 'orchestra', 'conductor', 'lyricist', 'original_lyricist', 'radio_station_name', 'info_url', 'artist_url', 'audio_source_url', 'radio_station_url', 'buy_this_url', 'isrc_number', 'catalog_number', 'original_artist', 'copyright', 'report_datetime', 'report_location', 'report_organization', 'subject', 'contributor', 'language', 'file_exists', 'replay_gain', 'owner_id', 'cuein', 'cueout', 'silan_check', 'hidden', 'is_scheduled', 'is_playlist', 'filesize', 'description', 'artwork', 'track_type', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, )
+ BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbMime', 'DbFtype', 'DbFilepath', 'DbImportStatus', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbUtime', 'DbLPtime', 'DbMd5', 'DbTrackTitle', 'DbArtistName', 'DbBitRate', 'DbSampleRate', 'DbFormat', 'DbLength', 'DbAlbumTitle', 'DbGenre', 'DbComments', 'DbYear', 'DbTrackNumber', 'DbChannels', 'DbUrl', 'DbBpm', 'DbRating', 'DbEncodedBy', 'DbDiscNumber', 'DbMood', 'DbLabel', 'DbComposer', 'DbEncoder', 'DbChecksum', 'DbLyrics', 'DbOrchestra', 'DbConductor', 'DbLyricist', 'DbOriginalLyricist', 'DbRadioStationName', 'DbInfoUrl', 'DbArtistUrl', 'DbAudioSourceUrl', 'DbRadioStationUrl', 'DbBuyThisUrl', 'DbIsrcNumber', 'DbCatalogNumber', 'DbOriginalArtist', 'DbCopyright', 'DbReportDatetime', 'DbReportLocation', 'DbReportOrganization', 'DbSubject', 'DbContributor', 'DbLanguage', 'DbFileExists', 'DbReplayGain', 'DbOwnerId', 'DbCuein', 'DbCueout', 'DbSilanCheck', 'DbHidden', 'DbIsScheduled', 'DbIsPlaylist', 'DbFilesize', 'DbDescription', 'DbArtwork', 'DbTrackType', ),
+ BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbMime', 'dbFtype', 'dbFilepath', 'dbImportStatus', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbUtime', 'dbLPtime', 'dbMd5', 'dbTrackTitle', 'dbArtistName', 'dbBitRate', 'dbSampleRate', 'dbFormat', 'dbLength', 'dbAlbumTitle', 'dbGenre', 'dbComments', 'dbYear', 'dbTrackNumber', 'dbChannels', 'dbUrl', 'dbBpm', 'dbRating', 'dbEncodedBy', 'dbDiscNumber', 'dbMood', 'dbLabel', 'dbComposer', 'dbEncoder', 'dbChecksum', 'dbLyrics', 'dbOrchestra', 'dbConductor', 'dbLyricist', 'dbOriginalLyricist', 'dbRadioStationName', 'dbInfoUrl', 'dbArtistUrl', 'dbAudioSourceUrl', 'dbRadioStationUrl', 'dbBuyThisUrl', 'dbIsrcNumber', 'dbCatalogNumber', 'dbOriginalArtist', 'dbCopyright', 'dbReportDatetime', 'dbReportLocation', 'dbReportOrganization', 'dbSubject', 'dbContributor', 'dbLanguage', 'dbFileExists', 'dbReplayGain', 'dbOwnerId', 'dbCuein', 'dbCueout', 'dbSilanCheck', 'dbHidden', 'dbIsScheduled', 'dbIsPlaylist', 'dbFilesize', 'dbDescription', 'dbArtwork', 'dbTrackType', ),
+ BasePeer::TYPE_COLNAME => array (CcFilesPeer::ID, CcFilesPeer::NAME, CcFilesPeer::MIME, CcFilesPeer::FTYPE, CcFilesPeer::FILEPATH, CcFilesPeer::IMPORT_STATUS, CcFilesPeer::CURRENTLYACCESSING, CcFilesPeer::EDITEDBY, CcFilesPeer::MTIME, CcFilesPeer::UTIME, CcFilesPeer::LPTIME, CcFilesPeer::MD5, CcFilesPeer::TRACK_TITLE, CcFilesPeer::ARTIST_NAME, CcFilesPeer::BIT_RATE, CcFilesPeer::SAMPLE_RATE, CcFilesPeer::FORMAT, CcFilesPeer::LENGTH, CcFilesPeer::ALBUM_TITLE, CcFilesPeer::GENRE, CcFilesPeer::COMMENTS, CcFilesPeer::YEAR, CcFilesPeer::TRACK_NUMBER, CcFilesPeer::CHANNELS, CcFilesPeer::URL, CcFilesPeer::BPM, CcFilesPeer::RATING, CcFilesPeer::ENCODED_BY, CcFilesPeer::DISC_NUMBER, CcFilesPeer::MOOD, CcFilesPeer::LABEL, CcFilesPeer::COMPOSER, CcFilesPeer::ENCODER, CcFilesPeer::CHECKSUM, CcFilesPeer::LYRICS, CcFilesPeer::ORCHESTRA, CcFilesPeer::CONDUCTOR, CcFilesPeer::LYRICIST, CcFilesPeer::ORIGINAL_LYRICIST, CcFilesPeer::RADIO_STATION_NAME, CcFilesPeer::INFO_URL, CcFilesPeer::ARTIST_URL, CcFilesPeer::AUDIO_SOURCE_URL, CcFilesPeer::RADIO_STATION_URL, CcFilesPeer::BUY_THIS_URL, CcFilesPeer::ISRC_NUMBER, CcFilesPeer::CATALOG_NUMBER, CcFilesPeer::ORIGINAL_ARTIST, CcFilesPeer::COPYRIGHT, CcFilesPeer::REPORT_DATETIME, CcFilesPeer::REPORT_LOCATION, CcFilesPeer::REPORT_ORGANIZATION, CcFilesPeer::SUBJECT, CcFilesPeer::CONTRIBUTOR, CcFilesPeer::LANGUAGE, CcFilesPeer::FILE_EXISTS, CcFilesPeer::REPLAY_GAIN, CcFilesPeer::OWNER_ID, CcFilesPeer::CUEIN, CcFilesPeer::CUEOUT, CcFilesPeer::SILAN_CHECK, CcFilesPeer::HIDDEN, CcFilesPeer::IS_SCHEDULED, CcFilesPeer::IS_PLAYLIST, CcFilesPeer::FILESIZE, CcFilesPeer::DESCRIPTION, CcFilesPeer::ARTWORK, CcFilesPeer::TRACK_TYPE, ),
+ BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'MIME', 'FTYPE', 'FILEPATH', 'IMPORT_STATUS', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'UTIME', 'LPTIME', 'MD5', 'TRACK_TITLE', 'ARTIST_NAME', 'BIT_RATE', 'SAMPLE_RATE', 'FORMAT', 'LENGTH', 'ALBUM_TITLE', 'GENRE', 'COMMENTS', 'YEAR', 'TRACK_NUMBER', 'CHANNELS', 'URL', 'BPM', 'RATING', 'ENCODED_BY', 'DISC_NUMBER', 'MOOD', 'LABEL', 'COMPOSER', 'ENCODER', 'CHECKSUM', 'LYRICS', 'ORCHESTRA', 'CONDUCTOR', 'LYRICIST', 'ORIGINAL_LYRICIST', 'RADIO_STATION_NAME', 'INFO_URL', 'ARTIST_URL', 'AUDIO_SOURCE_URL', 'RADIO_STATION_URL', 'BUY_THIS_URL', 'ISRC_NUMBER', 'CATALOG_NUMBER', 'ORIGINAL_ARTIST', 'COPYRIGHT', 'REPORT_DATETIME', 'REPORT_LOCATION', 'REPORT_ORGANIZATION', 'SUBJECT', 'CONTRIBUTOR', 'LANGUAGE', 'FILE_EXISTS', 'REPLAY_GAIN', 'OWNER_ID', 'CUEIN', 'CUEOUT', 'SILAN_CHECK', 'HIDDEN', 'IS_SCHEDULED', 'IS_PLAYLIST', 'FILESIZE', 'DESCRIPTION', 'ARTWORK', 'TRACK_TYPE', ),
+ BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'mime', 'ftype', 'filepath', 'import_status', 'currentlyaccessing', 'editedby', 'mtime', 'utime', 'lptime', 'md5', 'track_title', 'artist_name', 'bit_rate', 'sample_rate', 'format', 'length', 'album_title', 'genre', 'comments', 'year', 'track_number', 'channels', 'url', 'bpm', 'rating', 'encoded_by', 'disc_number', 'mood', 'label', 'composer', 'encoder', 'checksum', 'lyrics', 'orchestra', 'conductor', 'lyricist', 'original_lyricist', 'radio_station_name', 'info_url', 'artist_url', 'audio_source_url', 'radio_station_url', 'buy_this_url', 'isrc_number', 'catalog_number', 'original_artist', 'copyright', 'report_datetime', 'report_location', 'report_organization', 'subject', 'contributor', 'language', 'file_exists', 'replay_gain', 'owner_id', 'cuein', 'cueout', 'silan_check', 'hidden', 'is_scheduled', 'is_playlist', 'filesize', 'description', 'artwork', 'track_type', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, )
);
/**
@@ -273,12 +270,12 @@ abstract class BaseCcFilesPeer
* e.g. CcFilesPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbMime' => 2, 'DbFtype' => 3, 'DbDirectory' => 4, 'DbFilepath' => 5, 'DbImportStatus' => 6, 'DbCurrentlyaccessing' => 7, 'DbEditedby' => 8, 'DbMtime' => 9, 'DbUtime' => 10, 'DbLPtime' => 11, 'DbMd5' => 12, 'DbTrackTitle' => 13, 'DbArtistName' => 14, 'DbBitRate' => 15, 'DbSampleRate' => 16, 'DbFormat' => 17, 'DbLength' => 18, 'DbAlbumTitle' => 19, 'DbGenre' => 20, 'DbComments' => 21, 'DbYear' => 22, 'DbTrackNumber' => 23, 'DbChannels' => 24, 'DbUrl' => 25, 'DbBpm' => 26, 'DbRating' => 27, 'DbEncodedBy' => 28, 'DbDiscNumber' => 29, 'DbMood' => 30, 'DbLabel' => 31, 'DbComposer' => 32, 'DbEncoder' => 33, 'DbChecksum' => 34, 'DbLyrics' => 35, 'DbOrchestra' => 36, 'DbConductor' => 37, 'DbLyricist' => 38, 'DbOriginalLyricist' => 39, 'DbRadioStationName' => 40, 'DbInfoUrl' => 41, 'DbArtistUrl' => 42, 'DbAudioSourceUrl' => 43, 'DbRadioStationUrl' => 44, 'DbBuyThisUrl' => 45, 'DbIsrcNumber' => 46, 'DbCatalogNumber' => 47, 'DbOriginalArtist' => 48, 'DbCopyright' => 49, 'DbReportDatetime' => 50, 'DbReportLocation' => 51, 'DbReportOrganization' => 52, 'DbSubject' => 53, 'DbContributor' => 54, 'DbLanguage' => 55, 'DbFileExists' => 56, 'DbReplayGain' => 57, 'DbOwnerId' => 58, 'DbCuein' => 59, 'DbCueout' => 60, 'DbSilanCheck' => 61, 'DbHidden' => 62, 'DbIsScheduled' => 63, 'DbIsPlaylist' => 64, 'DbFilesize' => 65, 'DbDescription' => 66, 'DbArtwork' => 67, 'DbTrackType' => 68, ),
- BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbMime' => 2, 'dbFtype' => 3, 'dbDirectory' => 4, 'dbFilepath' => 5, 'dbImportStatus' => 6, 'dbCurrentlyaccessing' => 7, 'dbEditedby' => 8, 'dbMtime' => 9, 'dbUtime' => 10, 'dbLPtime' => 11, 'dbMd5' => 12, 'dbTrackTitle' => 13, 'dbArtistName' => 14, 'dbBitRate' => 15, 'dbSampleRate' => 16, 'dbFormat' => 17, 'dbLength' => 18, 'dbAlbumTitle' => 19, 'dbGenre' => 20, 'dbComments' => 21, 'dbYear' => 22, 'dbTrackNumber' => 23, 'dbChannels' => 24, 'dbUrl' => 25, 'dbBpm' => 26, 'dbRating' => 27, 'dbEncodedBy' => 28, 'dbDiscNumber' => 29, 'dbMood' => 30, 'dbLabel' => 31, 'dbComposer' => 32, 'dbEncoder' => 33, 'dbChecksum' => 34, 'dbLyrics' => 35, 'dbOrchestra' => 36, 'dbConductor' => 37, 'dbLyricist' => 38, 'dbOriginalLyricist' => 39, 'dbRadioStationName' => 40, 'dbInfoUrl' => 41, 'dbArtistUrl' => 42, 'dbAudioSourceUrl' => 43, 'dbRadioStationUrl' => 44, 'dbBuyThisUrl' => 45, 'dbIsrcNumber' => 46, 'dbCatalogNumber' => 47, 'dbOriginalArtist' => 48, 'dbCopyright' => 49, 'dbReportDatetime' => 50, 'dbReportLocation' => 51, 'dbReportOrganization' => 52, 'dbSubject' => 53, 'dbContributor' => 54, 'dbLanguage' => 55, 'dbFileExists' => 56, 'dbReplayGain' => 57, 'dbOwnerId' => 58, 'dbCuein' => 59, 'dbCueout' => 60, 'dbSilanCheck' => 61, 'dbHidden' => 62, 'dbIsScheduled' => 63, 'dbIsPlaylist' => 64, 'dbFilesize' => 65, 'dbDescription' => 66, 'dbArtwork' => 67, 'dbTrackType' => 68, ),
- BasePeer::TYPE_COLNAME => array (CcFilesPeer::ID => 0, CcFilesPeer::NAME => 1, CcFilesPeer::MIME => 2, CcFilesPeer::FTYPE => 3, CcFilesPeer::DIRECTORY => 4, CcFilesPeer::FILEPATH => 5, CcFilesPeer::IMPORT_STATUS => 6, CcFilesPeer::CURRENTLYACCESSING => 7, CcFilesPeer::EDITEDBY => 8, CcFilesPeer::MTIME => 9, CcFilesPeer::UTIME => 10, CcFilesPeer::LPTIME => 11, CcFilesPeer::MD5 => 12, CcFilesPeer::TRACK_TITLE => 13, CcFilesPeer::ARTIST_NAME => 14, CcFilesPeer::BIT_RATE => 15, CcFilesPeer::SAMPLE_RATE => 16, CcFilesPeer::FORMAT => 17, CcFilesPeer::LENGTH => 18, CcFilesPeer::ALBUM_TITLE => 19, CcFilesPeer::GENRE => 20, CcFilesPeer::COMMENTS => 21, CcFilesPeer::YEAR => 22, CcFilesPeer::TRACK_NUMBER => 23, CcFilesPeer::CHANNELS => 24, CcFilesPeer::URL => 25, CcFilesPeer::BPM => 26, CcFilesPeer::RATING => 27, CcFilesPeer::ENCODED_BY => 28, CcFilesPeer::DISC_NUMBER => 29, CcFilesPeer::MOOD => 30, CcFilesPeer::LABEL => 31, CcFilesPeer::COMPOSER => 32, CcFilesPeer::ENCODER => 33, CcFilesPeer::CHECKSUM => 34, CcFilesPeer::LYRICS => 35, CcFilesPeer::ORCHESTRA => 36, CcFilesPeer::CONDUCTOR => 37, CcFilesPeer::LYRICIST => 38, CcFilesPeer::ORIGINAL_LYRICIST => 39, CcFilesPeer::RADIO_STATION_NAME => 40, CcFilesPeer::INFO_URL => 41, CcFilesPeer::ARTIST_URL => 42, CcFilesPeer::AUDIO_SOURCE_URL => 43, CcFilesPeer::RADIO_STATION_URL => 44, CcFilesPeer::BUY_THIS_URL => 45, CcFilesPeer::ISRC_NUMBER => 46, CcFilesPeer::CATALOG_NUMBER => 47, CcFilesPeer::ORIGINAL_ARTIST => 48, CcFilesPeer::COPYRIGHT => 49, CcFilesPeer::REPORT_DATETIME => 50, CcFilesPeer::REPORT_LOCATION => 51, CcFilesPeer::REPORT_ORGANIZATION => 52, CcFilesPeer::SUBJECT => 53, CcFilesPeer::CONTRIBUTOR => 54, CcFilesPeer::LANGUAGE => 55, CcFilesPeer::FILE_EXISTS => 56, CcFilesPeer::REPLAY_GAIN => 57, CcFilesPeer::OWNER_ID => 58, CcFilesPeer::CUEIN => 59, CcFilesPeer::CUEOUT => 60, CcFilesPeer::SILAN_CHECK => 61, CcFilesPeer::HIDDEN => 62, CcFilesPeer::IS_SCHEDULED => 63, CcFilesPeer::IS_PLAYLIST => 64, CcFilesPeer::FILESIZE => 65, CcFilesPeer::DESCRIPTION => 66, CcFilesPeer::ARTWORK => 67, CcFilesPeer::TRACK_TYPE => 68, ),
- BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'MIME' => 2, 'FTYPE' => 3, 'DIRECTORY' => 4, 'FILEPATH' => 5, 'IMPORT_STATUS' => 6, 'CURRENTLYACCESSING' => 7, 'EDITEDBY' => 8, 'MTIME' => 9, 'UTIME' => 10, 'LPTIME' => 11, 'MD5' => 12, 'TRACK_TITLE' => 13, 'ARTIST_NAME' => 14, 'BIT_RATE' => 15, 'SAMPLE_RATE' => 16, 'FORMAT' => 17, 'LENGTH' => 18, 'ALBUM_TITLE' => 19, 'GENRE' => 20, 'COMMENTS' => 21, 'YEAR' => 22, 'TRACK_NUMBER' => 23, 'CHANNELS' => 24, 'URL' => 25, 'BPM' => 26, 'RATING' => 27, 'ENCODED_BY' => 28, 'DISC_NUMBER' => 29, 'MOOD' => 30, 'LABEL' => 31, 'COMPOSER' => 32, 'ENCODER' => 33, 'CHECKSUM' => 34, 'LYRICS' => 35, 'ORCHESTRA' => 36, 'CONDUCTOR' => 37, 'LYRICIST' => 38, 'ORIGINAL_LYRICIST' => 39, 'RADIO_STATION_NAME' => 40, 'INFO_URL' => 41, 'ARTIST_URL' => 42, 'AUDIO_SOURCE_URL' => 43, 'RADIO_STATION_URL' => 44, 'BUY_THIS_URL' => 45, 'ISRC_NUMBER' => 46, 'CATALOG_NUMBER' => 47, 'ORIGINAL_ARTIST' => 48, 'COPYRIGHT' => 49, 'REPORT_DATETIME' => 50, 'REPORT_LOCATION' => 51, 'REPORT_ORGANIZATION' => 52, 'SUBJECT' => 53, 'CONTRIBUTOR' => 54, 'LANGUAGE' => 55, 'FILE_EXISTS' => 56, 'REPLAY_GAIN' => 57, 'OWNER_ID' => 58, 'CUEIN' => 59, 'CUEOUT' => 60, 'SILAN_CHECK' => 61, 'HIDDEN' => 62, 'IS_SCHEDULED' => 63, 'IS_PLAYLIST' => 64, 'FILESIZE' => 65, 'DESCRIPTION' => 66, 'ARTWORK' => 67, 'TRACK_TYPE' => 68, ),
- BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'mime' => 2, 'ftype' => 3, 'directory' => 4, 'filepath' => 5, 'import_status' => 6, 'currentlyaccessing' => 7, 'editedby' => 8, 'mtime' => 9, 'utime' => 10, 'lptime' => 11, 'md5' => 12, 'track_title' => 13, 'artist_name' => 14, 'bit_rate' => 15, 'sample_rate' => 16, 'format' => 17, 'length' => 18, 'album_title' => 19, 'genre' => 20, 'comments' => 21, 'year' => 22, 'track_number' => 23, 'channels' => 24, 'url' => 25, 'bpm' => 26, 'rating' => 27, 'encoded_by' => 28, 'disc_number' => 29, 'mood' => 30, 'label' => 31, 'composer' => 32, 'encoder' => 33, 'checksum' => 34, 'lyrics' => 35, 'orchestra' => 36, 'conductor' => 37, 'lyricist' => 38, 'original_lyricist' => 39, 'radio_station_name' => 40, 'info_url' => 41, 'artist_url' => 42, 'audio_source_url' => 43, 'radio_station_url' => 44, 'buy_this_url' => 45, 'isrc_number' => 46, 'catalog_number' => 47, 'original_artist' => 48, 'copyright' => 49, 'report_datetime' => 50, 'report_location' => 51, 'report_organization' => 52, 'subject' => 53, 'contributor' => 54, 'language' => 55, 'file_exists' => 56, 'replay_gain' => 57, 'owner_id' => 58, 'cuein' => 59, 'cueout' => 60, 'silan_check' => 61, 'hidden' => 62, 'is_scheduled' => 63, 'is_playlist' => 64, 'filesize' => 65, 'description' => 66, 'artwork' => 67, 'track_type' => 68, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, )
+ BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbMime' => 2, 'DbFtype' => 3, 'DbFilepath' => 4, 'DbImportStatus' => 5, 'DbCurrentlyaccessing' => 6, 'DbEditedby' => 7, 'DbMtime' => 8, 'DbUtime' => 9, 'DbLPtime' => 10, 'DbMd5' => 11, 'DbTrackTitle' => 12, 'DbArtistName' => 13, 'DbBitRate' => 14, 'DbSampleRate' => 15, 'DbFormat' => 16, 'DbLength' => 17, 'DbAlbumTitle' => 18, 'DbGenre' => 19, 'DbComments' => 20, 'DbYear' => 21, 'DbTrackNumber' => 22, 'DbChannels' => 23, 'DbUrl' => 24, 'DbBpm' => 25, 'DbRating' => 26, 'DbEncodedBy' => 27, 'DbDiscNumber' => 28, 'DbMood' => 29, 'DbLabel' => 30, 'DbComposer' => 31, 'DbEncoder' => 32, 'DbChecksum' => 33, 'DbLyrics' => 34, 'DbOrchestra' => 35, 'DbConductor' => 36, 'DbLyricist' => 37, 'DbOriginalLyricist' => 38, 'DbRadioStationName' => 39, 'DbInfoUrl' => 40, 'DbArtistUrl' => 41, 'DbAudioSourceUrl' => 42, 'DbRadioStationUrl' => 43, 'DbBuyThisUrl' => 44, 'DbIsrcNumber' => 45, 'DbCatalogNumber' => 46, 'DbOriginalArtist' => 47, 'DbCopyright' => 48, 'DbReportDatetime' => 49, 'DbReportLocation' => 50, 'DbReportOrganization' => 51, 'DbSubject' => 52, 'DbContributor' => 53, 'DbLanguage' => 54, 'DbFileExists' => 55, 'DbReplayGain' => 56, 'DbOwnerId' => 57, 'DbCuein' => 58, 'DbCueout' => 59, 'DbSilanCheck' => 60, 'DbHidden' => 61, 'DbIsScheduled' => 62, 'DbIsPlaylist' => 63, 'DbFilesize' => 64, 'DbDescription' => 65, 'DbArtwork' => 66, 'DbTrackType' => 67, ),
+ BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbMime' => 2, 'dbFtype' => 3, 'dbFilepath' => 4, 'dbImportStatus' => 5, 'dbCurrentlyaccessing' => 6, 'dbEditedby' => 7, 'dbMtime' => 8, 'dbUtime' => 9, 'dbLPtime' => 10, 'dbMd5' => 11, 'dbTrackTitle' => 12, 'dbArtistName' => 13, 'dbBitRate' => 14, 'dbSampleRate' => 15, 'dbFormat' => 16, 'dbLength' => 17, 'dbAlbumTitle' => 18, 'dbGenre' => 19, 'dbComments' => 20, 'dbYear' => 21, 'dbTrackNumber' => 22, 'dbChannels' => 23, 'dbUrl' => 24, 'dbBpm' => 25, 'dbRating' => 26, 'dbEncodedBy' => 27, 'dbDiscNumber' => 28, 'dbMood' => 29, 'dbLabel' => 30, 'dbComposer' => 31, 'dbEncoder' => 32, 'dbChecksum' => 33, 'dbLyrics' => 34, 'dbOrchestra' => 35, 'dbConductor' => 36, 'dbLyricist' => 37, 'dbOriginalLyricist' => 38, 'dbRadioStationName' => 39, 'dbInfoUrl' => 40, 'dbArtistUrl' => 41, 'dbAudioSourceUrl' => 42, 'dbRadioStationUrl' => 43, 'dbBuyThisUrl' => 44, 'dbIsrcNumber' => 45, 'dbCatalogNumber' => 46, 'dbOriginalArtist' => 47, 'dbCopyright' => 48, 'dbReportDatetime' => 49, 'dbReportLocation' => 50, 'dbReportOrganization' => 51, 'dbSubject' => 52, 'dbContributor' => 53, 'dbLanguage' => 54, 'dbFileExists' => 55, 'dbReplayGain' => 56, 'dbOwnerId' => 57, 'dbCuein' => 58, 'dbCueout' => 59, 'dbSilanCheck' => 60, 'dbHidden' => 61, 'dbIsScheduled' => 62, 'dbIsPlaylist' => 63, 'dbFilesize' => 64, 'dbDescription' => 65, 'dbArtwork' => 66, 'dbTrackType' => 67, ),
+ BasePeer::TYPE_COLNAME => array (CcFilesPeer::ID => 0, CcFilesPeer::NAME => 1, CcFilesPeer::MIME => 2, CcFilesPeer::FTYPE => 3, CcFilesPeer::FILEPATH => 4, CcFilesPeer::IMPORT_STATUS => 5, CcFilesPeer::CURRENTLYACCESSING => 6, CcFilesPeer::EDITEDBY => 7, CcFilesPeer::MTIME => 8, CcFilesPeer::UTIME => 9, CcFilesPeer::LPTIME => 10, CcFilesPeer::MD5 => 11, CcFilesPeer::TRACK_TITLE => 12, CcFilesPeer::ARTIST_NAME => 13, CcFilesPeer::BIT_RATE => 14, CcFilesPeer::SAMPLE_RATE => 15, CcFilesPeer::FORMAT => 16, CcFilesPeer::LENGTH => 17, CcFilesPeer::ALBUM_TITLE => 18, CcFilesPeer::GENRE => 19, CcFilesPeer::COMMENTS => 20, CcFilesPeer::YEAR => 21, CcFilesPeer::TRACK_NUMBER => 22, CcFilesPeer::CHANNELS => 23, CcFilesPeer::URL => 24, CcFilesPeer::BPM => 25, CcFilesPeer::RATING => 26, CcFilesPeer::ENCODED_BY => 27, CcFilesPeer::DISC_NUMBER => 28, CcFilesPeer::MOOD => 29, CcFilesPeer::LABEL => 30, CcFilesPeer::COMPOSER => 31, CcFilesPeer::ENCODER => 32, CcFilesPeer::CHECKSUM => 33, CcFilesPeer::LYRICS => 34, CcFilesPeer::ORCHESTRA => 35, CcFilesPeer::CONDUCTOR => 36, CcFilesPeer::LYRICIST => 37, CcFilesPeer::ORIGINAL_LYRICIST => 38, CcFilesPeer::RADIO_STATION_NAME => 39, CcFilesPeer::INFO_URL => 40, CcFilesPeer::ARTIST_URL => 41, CcFilesPeer::AUDIO_SOURCE_URL => 42, CcFilesPeer::RADIO_STATION_URL => 43, CcFilesPeer::BUY_THIS_URL => 44, CcFilesPeer::ISRC_NUMBER => 45, CcFilesPeer::CATALOG_NUMBER => 46, CcFilesPeer::ORIGINAL_ARTIST => 47, CcFilesPeer::COPYRIGHT => 48, CcFilesPeer::REPORT_DATETIME => 49, CcFilesPeer::REPORT_LOCATION => 50, CcFilesPeer::REPORT_ORGANIZATION => 51, CcFilesPeer::SUBJECT => 52, CcFilesPeer::CONTRIBUTOR => 53, CcFilesPeer::LANGUAGE => 54, CcFilesPeer::FILE_EXISTS => 55, CcFilesPeer::REPLAY_GAIN => 56, CcFilesPeer::OWNER_ID => 57, CcFilesPeer::CUEIN => 58, CcFilesPeer::CUEOUT => 59, CcFilesPeer::SILAN_CHECK => 60, CcFilesPeer::HIDDEN => 61, CcFilesPeer::IS_SCHEDULED => 62, CcFilesPeer::IS_PLAYLIST => 63, CcFilesPeer::FILESIZE => 64, CcFilesPeer::DESCRIPTION => 65, CcFilesPeer::ARTWORK => 66, CcFilesPeer::TRACK_TYPE => 67, ),
+ BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'MIME' => 2, 'FTYPE' => 3, 'FILEPATH' => 4, 'IMPORT_STATUS' => 5, 'CURRENTLYACCESSING' => 6, 'EDITEDBY' => 7, 'MTIME' => 8, 'UTIME' => 9, 'LPTIME' => 10, 'MD5' => 11, 'TRACK_TITLE' => 12, 'ARTIST_NAME' => 13, 'BIT_RATE' => 14, 'SAMPLE_RATE' => 15, 'FORMAT' => 16, 'LENGTH' => 17, 'ALBUM_TITLE' => 18, 'GENRE' => 19, 'COMMENTS' => 20, 'YEAR' => 21, 'TRACK_NUMBER' => 22, 'CHANNELS' => 23, 'URL' => 24, 'BPM' => 25, 'RATING' => 26, 'ENCODED_BY' => 27, 'DISC_NUMBER' => 28, 'MOOD' => 29, 'LABEL' => 30, 'COMPOSER' => 31, 'ENCODER' => 32, 'CHECKSUM' => 33, 'LYRICS' => 34, 'ORCHESTRA' => 35, 'CONDUCTOR' => 36, 'LYRICIST' => 37, 'ORIGINAL_LYRICIST' => 38, 'RADIO_STATION_NAME' => 39, 'INFO_URL' => 40, 'ARTIST_URL' => 41, 'AUDIO_SOURCE_URL' => 42, 'RADIO_STATION_URL' => 43, 'BUY_THIS_URL' => 44, 'ISRC_NUMBER' => 45, 'CATALOG_NUMBER' => 46, 'ORIGINAL_ARTIST' => 47, 'COPYRIGHT' => 48, 'REPORT_DATETIME' => 49, 'REPORT_LOCATION' => 50, 'REPORT_ORGANIZATION' => 51, 'SUBJECT' => 52, 'CONTRIBUTOR' => 53, 'LANGUAGE' => 54, 'FILE_EXISTS' => 55, 'REPLAY_GAIN' => 56, 'OWNER_ID' => 57, 'CUEIN' => 58, 'CUEOUT' => 59, 'SILAN_CHECK' => 60, 'HIDDEN' => 61, 'IS_SCHEDULED' => 62, 'IS_PLAYLIST' => 63, 'FILESIZE' => 64, 'DESCRIPTION' => 65, 'ARTWORK' => 66, 'TRACK_TYPE' => 67, ),
+ BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'mime' => 2, 'ftype' => 3, 'filepath' => 4, 'import_status' => 5, 'currentlyaccessing' => 6, 'editedby' => 7, 'mtime' => 8, 'utime' => 9, 'lptime' => 10, 'md5' => 11, 'track_title' => 12, 'artist_name' => 13, 'bit_rate' => 14, 'sample_rate' => 15, 'format' => 16, 'length' => 17, 'album_title' => 18, 'genre' => 19, 'comments' => 20, 'year' => 21, 'track_number' => 22, 'channels' => 23, 'url' => 24, 'bpm' => 25, 'rating' => 26, 'encoded_by' => 27, 'disc_number' => 28, 'mood' => 29, 'label' => 30, 'composer' => 31, 'encoder' => 32, 'checksum' => 33, 'lyrics' => 34, 'orchestra' => 35, 'conductor' => 36, 'lyricist' => 37, 'original_lyricist' => 38, 'radio_station_name' => 39, 'info_url' => 40, 'artist_url' => 41, 'audio_source_url' => 42, 'radio_station_url' => 43, 'buy_this_url' => 44, 'isrc_number' => 45, 'catalog_number' => 46, 'original_artist' => 47, 'copyright' => 48, 'report_datetime' => 49, 'report_location' => 50, 'report_organization' => 51, 'subject' => 52, 'contributor' => 53, 'language' => 54, 'file_exists' => 55, 'replay_gain' => 56, 'owner_id' => 57, 'cuein' => 58, 'cueout' => 59, 'silan_check' => 60, 'hidden' => 61, 'is_scheduled' => 62, 'is_playlist' => 63, 'filesize' => 64, 'description' => 65, 'artwork' => 66, 'track_type' => 67, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, )
);
/**
@@ -356,7 +353,6 @@ abstract class BaseCcFilesPeer
$criteria->addSelectColumn(CcFilesPeer::NAME);
$criteria->addSelectColumn(CcFilesPeer::MIME);
$criteria->addSelectColumn(CcFilesPeer::FTYPE);
- $criteria->addSelectColumn(CcFilesPeer::DIRECTORY);
$criteria->addSelectColumn(CcFilesPeer::FILEPATH);
$criteria->addSelectColumn(CcFilesPeer::IMPORT_STATUS);
$criteria->addSelectColumn(CcFilesPeer::CURRENTLYACCESSING);
@@ -426,7 +422,6 @@ abstract class BaseCcFilesPeer
$criteria->addSelectColumn($alias . '.name');
$criteria->addSelectColumn($alias . '.mime');
$criteria->addSelectColumn($alias . '.ftype');
- $criteria->addSelectColumn($alias . '.directory');
$criteria->addSelectColumn($alias . '.filepath');
$criteria->addSelectColumn($alias . '.import_status');
$criteria->addSelectColumn($alias . '.currentlyaccessing');
@@ -918,57 +913,6 @@ abstract class BaseCcFilesPeer
}
- /**
- * Returns the number of rows matching criteria, joining the related CcMusicDirs table
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
- * @param PropelPDO $con
- * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
- * @return int Number of matching rows.
- */
- public static function doCountJoinCcMusicDirs(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // We need to set the primary table name, since in the case that there are no WHERE columns
- // it will be impossible for the BasePeer::createSelectSql() method to determine which
- // tables go into the FROM clause.
- $criteria->setPrimaryTableName(CcFilesPeer::TABLE_NAME);
-
- if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->setDistinct();
- }
-
- if (!$criteria->hasSelectClause()) {
- CcFilesPeer::addSelectColumns($criteria);
- }
-
- $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
-
- // Set the correct dbName
- $criteria->setDbName(CcFilesPeer::DATABASE_NAME);
-
- if ($con === null) {
- $con = Propel::getConnection(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ);
- }
-
- $criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::ID, $join_behavior);
-
- $stmt = BasePeer::doCount($criteria, $con);
-
- if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
- $count = (int) $row[0];
- } else {
- $count = 0; // no rows returned; we infer that means 0 matches.
- }
- $stmt->closeCursor();
-
- return $count;
- }
-
-
/**
* Selects a collection of CcFiles objects pre-filled with their CcSubjs objects.
* @param Criteria $criteria
@@ -1103,73 +1047,6 @@ abstract class BaseCcFilesPeer
}
- /**
- * Selects a collection of CcFiles objects pre-filled with their CcMusicDirs objects.
- * @param Criteria $criteria
- * @param PropelPDO $con
- * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
- * @return array Array of CcFiles objects.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectJoinCcMusicDirs(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
- {
- $criteria = clone $criteria;
-
- // Set the correct dbName if it has not been overridden
- if ($criteria->getDbName() == Propel::getDefaultDB()) {
- $criteria->setDbName(CcFilesPeer::DATABASE_NAME);
- }
-
- CcFilesPeer::addSelectColumns($criteria);
- $startcol = CcFilesPeer::NUM_HYDRATE_COLUMNS;
- CcMusicDirsPeer::addSelectColumns($criteria);
-
- $criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::ID, $join_behavior);
-
- $stmt = BasePeer::doSelect($criteria, $con);
- $results = array();
-
- while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
- $key1 = CcFilesPeer::getPrimaryKeyHashFromRow($row, 0);
- if (null !== ($obj1 = CcFilesPeer::getInstanceFromPool($key1))) {
- // We no longer rehydrate the object, since this can cause data loss.
- // See http://www.propelorm.org/ticket/509
- // $obj1->hydrate($row, 0, true); // rehydrate
- } else {
-
- $cls = CcFilesPeer::getOMClass();
-
- $obj1 = new $cls();
- $obj1->hydrate($row);
- CcFilesPeer::addInstanceToPool($obj1, $key1);
- } // if $obj1 already loaded
-
- $key2 = CcMusicDirsPeer::getPrimaryKeyHashFromRow($row, $startcol);
- if ($key2 !== null) {
- $obj2 = CcMusicDirsPeer::getInstanceFromPool($key2);
- if (!$obj2) {
-
- $cls = CcMusicDirsPeer::getOMClass();
-
- $obj2 = new $cls();
- $obj2->hydrate($row, $startcol);
- CcMusicDirsPeer::addInstanceToPool($obj2, $key2);
- } // if obj2 already loaded
-
- // Add the $obj1 (CcFiles) to $obj2 (CcMusicDirs)
- $obj2->addCcFiles($obj1);
-
- } // if joined row was not null
-
- $results[] = $obj1;
- }
- $stmt->closeCursor();
-
- return $results;
- }
-
-
/**
* Returns the number of rows matching criteria, joining all related tables
*
@@ -1210,8 +1087,6 @@ abstract class BaseCcFilesPeer
$criteria->addJoin(CcFilesPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior);
- $criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::ID, $join_behavior);
-
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
@@ -1252,15 +1127,10 @@ abstract class BaseCcFilesPeer
CcSubjsPeer::addSelectColumns($criteria);
$startcol4 = $startcol3 + CcSubjsPeer::NUM_HYDRATE_COLUMNS;
- CcMusicDirsPeer::addSelectColumns($criteria);
- $startcol5 = $startcol4 + CcMusicDirsPeer::NUM_HYDRATE_COLUMNS;
-
$criteria->addJoin(CcFilesPeer::OWNER_ID, CcSubjsPeer::ID, $join_behavior);
$criteria->addJoin(CcFilesPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior);
- $criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::ID, $join_behavior);
-
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
@@ -1314,24 +1184,6 @@ abstract class BaseCcFilesPeer
$obj3->addCcFilesRelatedByDbEditedby($obj1);
} // if joined row not null
- // Add objects for joined CcMusicDirs rows
-
- $key4 = CcMusicDirsPeer::getPrimaryKeyHashFromRow($row, $startcol4);
- if ($key4 !== null) {
- $obj4 = CcMusicDirsPeer::getInstanceFromPool($key4);
- if (!$obj4) {
-
- $cls = CcMusicDirsPeer::getOMClass();
-
- $obj4 = new $cls();
- $obj4->hydrate($row, $startcol4);
- CcMusicDirsPeer::addInstanceToPool($obj4, $key4);
- } // if obj4 loaded
-
- // Add the $obj1 (CcFiles) to the collection in $obj4 (CcMusicDirs)
- $obj4->addCcFiles($obj1);
- } // if joined row not null
-
$results[] = $obj1;
}
$stmt->closeCursor();
@@ -1376,8 +1228,6 @@ abstract class BaseCcFilesPeer
$con = Propel::getConnection(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
- $criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::ID, $join_behavior);
-
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
@@ -1427,61 +1277,6 @@ abstract class BaseCcFilesPeer
$con = Propel::getConnection(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
- $criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::ID, $join_behavior);
-
- $stmt = BasePeer::doCount($criteria, $con);
-
- if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
- $count = (int) $row[0];
- } else {
- $count = 0; // no rows returned; we infer that means 0 matches.
- }
- $stmt->closeCursor();
-
- return $count;
- }
-
-
- /**
- * Returns the number of rows matching criteria, joining the related CcMusicDirs table
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
- * @param PropelPDO $con
- * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
- * @return int Number of matching rows.
- */
- public static function doCountJoinAllExceptCcMusicDirs(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // We need to set the primary table name, since in the case that there are no WHERE columns
- // it will be impossible for the BasePeer::createSelectSql() method to determine which
- // tables go into the FROM clause.
- $criteria->setPrimaryTableName(CcFilesPeer::TABLE_NAME);
-
- if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->setDistinct();
- }
-
- if (!$criteria->hasSelectClause()) {
- CcFilesPeer::addSelectColumns($criteria);
- }
-
- $criteria->clearOrderByColumns(); // ORDER BY should not affect count
-
- // Set the correct dbName
- $criteria->setDbName(CcFilesPeer::DATABASE_NAME);
-
- if ($con === null) {
- $con = Propel::getConnection(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ);
- }
-
- $criteria->addJoin(CcFilesPeer::OWNER_ID, CcSubjsPeer::ID, $join_behavior);
-
- $criteria->addJoin(CcFilesPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior);
-
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
@@ -1519,11 +1314,6 @@ abstract class BaseCcFilesPeer
CcFilesPeer::addSelectColumns($criteria);
$startcol2 = CcFilesPeer::NUM_HYDRATE_COLUMNS;
- CcMusicDirsPeer::addSelectColumns($criteria);
- $startcol3 = $startcol2 + CcMusicDirsPeer::NUM_HYDRATE_COLUMNS;
-
- $criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::ID, $join_behavior);
-
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
@@ -1542,25 +1332,6 @@ abstract class BaseCcFilesPeer
CcFilesPeer::addInstanceToPool($obj1, $key1);
} // if obj1 already loaded
- // Add objects for joined CcMusicDirs rows
-
- $key2 = CcMusicDirsPeer::getPrimaryKeyHashFromRow($row, $startcol2);
- if ($key2 !== null) {
- $obj2 = CcMusicDirsPeer::getInstanceFromPool($key2);
- if (!$obj2) {
-
- $cls = CcMusicDirsPeer::getOMClass();
-
- $obj2 = new $cls();
- $obj2->hydrate($row, $startcol2);
- CcMusicDirsPeer::addInstanceToPool($obj2, $key2);
- } // if $obj2 already loaded
-
- // Add the $obj1 (CcFiles) to the collection in $obj2 (CcMusicDirs)
- $obj2->addCcFiles($obj1);
-
- } // if joined row is not null
-
$results[] = $obj1;
}
$stmt->closeCursor();
@@ -1593,11 +1364,6 @@ abstract class BaseCcFilesPeer
CcFilesPeer::addSelectColumns($criteria);
$startcol2 = CcFilesPeer::NUM_HYDRATE_COLUMNS;
- CcMusicDirsPeer::addSelectColumns($criteria);
- $startcol3 = $startcol2 + CcMusicDirsPeer::NUM_HYDRATE_COLUMNS;
-
- $criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::ID, $join_behavior);
-
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
@@ -1616,123 +1382,6 @@ abstract class BaseCcFilesPeer
CcFilesPeer::addInstanceToPool($obj1, $key1);
} // if obj1 already loaded
- // Add objects for joined CcMusicDirs rows
-
- $key2 = CcMusicDirsPeer::getPrimaryKeyHashFromRow($row, $startcol2);
- if ($key2 !== null) {
- $obj2 = CcMusicDirsPeer::getInstanceFromPool($key2);
- if (!$obj2) {
-
- $cls = CcMusicDirsPeer::getOMClass();
-
- $obj2 = new $cls();
- $obj2->hydrate($row, $startcol2);
- CcMusicDirsPeer::addInstanceToPool($obj2, $key2);
- } // if $obj2 already loaded
-
- // Add the $obj1 (CcFiles) to the collection in $obj2 (CcMusicDirs)
- $obj2->addCcFiles($obj1);
-
- } // if joined row is not null
-
- $results[] = $obj1;
- }
- $stmt->closeCursor();
-
- return $results;
- }
-
-
- /**
- * Selects a collection of CcFiles objects pre-filled with all related objects except CcMusicDirs.
- *
- * @param Criteria $criteria
- * @param PropelPDO $con
- * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
- * @return array Array of CcFiles objects.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectJoinAllExceptCcMusicDirs(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
- {
- $criteria = clone $criteria;
-
- // Set the correct dbName if it has not been overridden
- // $criteria->getDbName() will return the same object if not set to another value
- // so == check is okay and faster
- if ($criteria->getDbName() == Propel::getDefaultDB()) {
- $criteria->setDbName(CcFilesPeer::DATABASE_NAME);
- }
-
- CcFilesPeer::addSelectColumns($criteria);
- $startcol2 = CcFilesPeer::NUM_HYDRATE_COLUMNS;
-
- CcSubjsPeer::addSelectColumns($criteria);
- $startcol3 = $startcol2 + CcSubjsPeer::NUM_HYDRATE_COLUMNS;
-
- CcSubjsPeer::addSelectColumns($criteria);
- $startcol4 = $startcol3 + CcSubjsPeer::NUM_HYDRATE_COLUMNS;
-
- $criteria->addJoin(CcFilesPeer::OWNER_ID, CcSubjsPeer::ID, $join_behavior);
-
- $criteria->addJoin(CcFilesPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior);
-
-
- $stmt = BasePeer::doSelect($criteria, $con);
- $results = array();
-
- while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
- $key1 = CcFilesPeer::getPrimaryKeyHashFromRow($row, 0);
- if (null !== ($obj1 = CcFilesPeer::getInstanceFromPool($key1))) {
- // We no longer rehydrate the object, since this can cause data loss.
- // See http://www.propelorm.org/ticket/509
- // $obj1->hydrate($row, 0, true); // rehydrate
- } else {
- $cls = CcFilesPeer::getOMClass();
-
- $obj1 = new $cls();
- $obj1->hydrate($row);
- CcFilesPeer::addInstanceToPool($obj1, $key1);
- } // if obj1 already loaded
-
- // Add objects for joined CcSubjs rows
-
- $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2);
- if ($key2 !== null) {
- $obj2 = CcSubjsPeer::getInstanceFromPool($key2);
- if (!$obj2) {
-
- $cls = CcSubjsPeer::getOMClass();
-
- $obj2 = new $cls();
- $obj2->hydrate($row, $startcol2);
- CcSubjsPeer::addInstanceToPool($obj2, $key2);
- } // if $obj2 already loaded
-
- // Add the $obj1 (CcFiles) to the collection in $obj2 (CcSubjs)
- $obj2->addCcFilesRelatedByDbOwnerId($obj1);
-
- } // if joined row is not null
-
- // Add objects for joined CcSubjs rows
-
- $key3 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol3);
- if ($key3 !== null) {
- $obj3 = CcSubjsPeer::getInstanceFromPool($key3);
- if (!$obj3) {
-
- $cls = CcSubjsPeer::getOMClass();
-
- $obj3 = new $cls();
- $obj3->hydrate($row, $startcol3);
- CcSubjsPeer::addInstanceToPool($obj3, $key3);
- } // if $obj3 already loaded
-
- // Add the $obj1 (CcFiles) to the collection in $obj3 (CcSubjs)
- $obj3->addCcFilesRelatedByDbEditedby($obj1);
-
- } // if joined row is not null
-
$results[] = $obj1;
}
$stmt->closeCursor();
diff --git a/legacy/application/models/airtime/om/BaseCcFilesQuery.php b/legacy/application/models/airtime/om/BaseCcFilesQuery.php
index f10d96d03..37e5ac6eb 100644
--- a/legacy/application/models/airtime/om/BaseCcFilesQuery.php
+++ b/legacy/application/models/airtime/om/BaseCcFilesQuery.php
@@ -10,7 +10,6 @@
* @method CcFilesQuery orderByDbName($order = Criteria::ASC) Order by the name column
* @method CcFilesQuery orderByDbMime($order = Criteria::ASC) Order by the mime column
* @method CcFilesQuery orderByDbFtype($order = Criteria::ASC) Order by the ftype column
- * @method CcFilesQuery orderByDbDirectory($order = Criteria::ASC) Order by the directory column
* @method CcFilesQuery orderByDbFilepath($order = Criteria::ASC) Order by the filepath column
* @method CcFilesQuery orderByDbImportStatus($order = Criteria::ASC) Order by the import_status column
* @method CcFilesQuery orderByDbCurrentlyaccessing($order = Criteria::ASC) Order by the currentlyaccessing column
@@ -80,7 +79,6 @@
* @method CcFilesQuery groupByDbName() Group by the name column
* @method CcFilesQuery groupByDbMime() Group by the mime column
* @method CcFilesQuery groupByDbFtype() Group by the ftype column
- * @method CcFilesQuery groupByDbDirectory() Group by the directory column
* @method CcFilesQuery groupByDbFilepath() Group by the filepath column
* @method CcFilesQuery groupByDbImportStatus() Group by the import_status column
* @method CcFilesQuery groupByDbCurrentlyaccessing() Group by the currentlyaccessing column
@@ -158,10 +156,6 @@
* @method CcFilesQuery rightJoinCcSubjsRelatedByDbEditedby($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcSubjsRelatedByDbEditedby relation
* @method CcFilesQuery innerJoinCcSubjsRelatedByDbEditedby($relationAlias = null) Adds a INNER JOIN clause to the query using the CcSubjsRelatedByDbEditedby relation
*
- * @method CcFilesQuery leftJoinCcMusicDirs($relationAlias = null) Adds a LEFT JOIN clause to the query using the CcMusicDirs relation
- * @method CcFilesQuery rightJoinCcMusicDirs($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcMusicDirs relation
- * @method CcFilesQuery innerJoinCcMusicDirs($relationAlias = null) Adds a INNER JOIN clause to the query using the CcMusicDirs relation
- *
* @method CcFilesQuery leftJoinCloudFile($relationAlias = null) Adds a LEFT JOIN clause to the query using the CloudFile relation
* @method CcFilesQuery rightJoinCloudFile($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CloudFile relation
* @method CcFilesQuery innerJoinCloudFile($relationAlias = null) Adds a INNER JOIN clause to the query using the CloudFile relation
@@ -200,7 +194,6 @@
* @method CcFiles findOneByDbName(string $name) Return the first CcFiles filtered by the name column
* @method CcFiles findOneByDbMime(string $mime) Return the first CcFiles filtered by the mime column
* @method CcFiles findOneByDbFtype(string $ftype) Return the first CcFiles filtered by the ftype column
- * @method CcFiles findOneByDbDirectory(int $directory) Return the first CcFiles filtered by the directory column
* @method CcFiles findOneByDbFilepath(string $filepath) Return the first CcFiles filtered by the filepath column
* @method CcFiles findOneByDbImportStatus(int $import_status) Return the first CcFiles filtered by the import_status column
* @method CcFiles findOneByDbCurrentlyaccessing(int $currentlyaccessing) Return the first CcFiles filtered by the currentlyaccessing column
@@ -270,7 +263,6 @@
* @method array findByDbName(string $name) Return CcFiles objects filtered by the name column
* @method array findByDbMime(string $mime) Return CcFiles objects filtered by the mime column
* @method array findByDbFtype(string $ftype) Return CcFiles objects filtered by the ftype column
- * @method array findByDbDirectory(int $directory) Return CcFiles objects filtered by the directory column
* @method array findByDbFilepath(string $filepath) Return CcFiles objects filtered by the filepath column
* @method array findByDbImportStatus(int $import_status) Return CcFiles objects filtered by the import_status column
* @method array findByDbCurrentlyaccessing(int $currentlyaccessing) Return CcFiles objects filtered by the currentlyaccessing column
@@ -442,7 +434,7 @@ abstract class BaseCcFilesQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
- $sql = 'SELECT "id", "name", "mime", "ftype", "directory", "filepath", "import_status", "currentlyaccessing", "editedby", "mtime", "utime", "lptime", "md5", "track_title", "artist_name", "bit_rate", "sample_rate", "format", "length", "album_title", "genre", "comments", "year", "track_number", "channels", "url", "bpm", "rating", "encoded_by", "disc_number", "mood", "label", "composer", "encoder", "checksum", "lyrics", "orchestra", "conductor", "lyricist", "original_lyricist", "radio_station_name", "info_url", "artist_url", "audio_source_url", "radio_station_url", "buy_this_url", "isrc_number", "catalog_number", "original_artist", "copyright", "report_datetime", "report_location", "report_organization", "subject", "contributor", "language", "file_exists", "replay_gain", "owner_id", "cuein", "cueout", "silan_check", "hidden", "is_scheduled", "is_playlist", "filesize", "description", "artwork", "track_type" FROM "cc_files" WHERE "id" = :p0';
+ $sql = 'SELECT "id", "name", "mime", "ftype", "filepath", "import_status", "currentlyaccessing", "editedby", "mtime", "utime", "lptime", "md5", "track_title", "artist_name", "bit_rate", "sample_rate", "format", "length", "album_title", "genre", "comments", "year", "track_number", "channels", "url", "bpm", "rating", "encoded_by", "disc_number", "mood", "label", "composer", "encoder", "checksum", "lyrics", "orchestra", "conductor", "lyricist", "original_lyricist", "radio_station_name", "info_url", "artist_url", "audio_source_url", "radio_station_url", "buy_this_url", "isrc_number", "catalog_number", "original_artist", "copyright", "report_datetime", "report_location", "report_organization", "subject", "contributor", "language", "file_exists", "replay_gain", "owner_id", "cuein", "cueout", "silan_check", "hidden", "is_scheduled", "is_playlist", "filesize", "description", "artwork", "track_type" FROM "cc_files" WHERE "id" = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -660,50 +652,6 @@ abstract class BaseCcFilesQuery extends ModelCriteria
return $this->addUsingAlias(CcFilesPeer::FTYPE, $dbFtype, $comparison);
}
- /**
- * Filter the query on the directory column
- *
- * Example usage:
- *
- * $query->filterByDbDirectory(1234); // WHERE directory = 1234
- * $query->filterByDbDirectory(array(12, 34)); // WHERE directory IN (12, 34)
- * $query->filterByDbDirectory(array('min' => 12)); // WHERE directory >= 12
- * $query->filterByDbDirectory(array('max' => 12)); // WHERE directory <= 12
- *
- *
- * @see filterByCcMusicDirs()
- *
- * @param mixed $dbDirectory The value to use as filter.
- * Use scalar values for equality.
- * Use array values for in_array() equivalent.
- * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return CcFilesQuery The current query, for fluid interface
- */
- public function filterByDbDirectory($dbDirectory = null, $comparison = null)
- {
- if (is_array($dbDirectory)) {
- $useMinMax = false;
- if (isset($dbDirectory['min'])) {
- $this->addUsingAlias(CcFilesPeer::DIRECTORY, $dbDirectory['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($dbDirectory['max'])) {
- $this->addUsingAlias(CcFilesPeer::DIRECTORY, $dbDirectory['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(CcFilesPeer::DIRECTORY, $dbDirectory, $comparison);
- }
-
/**
* Filter the query on the filepath column
*
@@ -2891,82 +2839,6 @@ abstract class BaseCcFilesQuery extends ModelCriteria
->useQuery($relationAlias ? $relationAlias : 'CcSubjsRelatedByDbEditedby', 'CcSubjsQuery');
}
- /**
- * Filter the query by a related CcMusicDirs object
- *
- * @param CcMusicDirs|PropelObjectCollection $ccMusicDirs The related object(s) to use as filter
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return CcFilesQuery The current query, for fluid interface
- * @throws PropelException - if the provided filter is invalid.
- */
- public function filterByCcMusicDirs($ccMusicDirs, $comparison = null)
- {
- if ($ccMusicDirs instanceof CcMusicDirs) {
- return $this
- ->addUsingAlias(CcFilesPeer::DIRECTORY, $ccMusicDirs->getId(), $comparison);
- } elseif ($ccMusicDirs instanceof PropelObjectCollection) {
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
-
- return $this
- ->addUsingAlias(CcFilesPeer::DIRECTORY, $ccMusicDirs->toKeyValue('PrimaryKey', 'Id'), $comparison);
- } else {
- throw new PropelException('filterByCcMusicDirs() only accepts arguments of type CcMusicDirs or PropelCollection');
- }
- }
-
- /**
- * Adds a JOIN clause to the query using the CcMusicDirs relation
- *
- * @param string $relationAlias optional alias for the relation
- * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
- *
- * @return CcFilesQuery The current query, for fluid interface
- */
- public function joinCcMusicDirs($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
- {
- $tableMap = $this->getTableMap();
- $relationMap = $tableMap->getRelation('CcMusicDirs');
-
- // create a ModelJoin object for this join
- $join = new ModelJoin();
- $join->setJoinType($joinType);
- $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
- if ($previousJoin = $this->getPreviousJoin()) {
- $join->setPreviousJoin($previousJoin);
- }
-
- // add the ModelJoin to the current object
- if ($relationAlias) {
- $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
- $this->addJoinObject($join, $relationAlias);
- } else {
- $this->addJoinObject($join, 'CcMusicDirs');
- }
-
- return $this;
- }
-
- /**
- * Use the CcMusicDirs relation CcMusicDirs object
- *
- * @see useQuery()
- *
- * @param string $relationAlias optional alias for the relation,
- * to be used as main alias in the secondary query
- * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
- *
- * @return CcMusicDirsQuery A secondary query class using the current class as primary query
- */
- public function useCcMusicDirsQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
- {
- return $this
- ->joinCcMusicDirs($relationAlias, $joinType)
- ->useQuery($relationAlias ? $relationAlias : 'CcMusicDirs', 'CcMusicDirsQuery');
- }
-
/**
* Filter the query by a related CloudFile object
*
diff --git a/legacy/application/models/airtime/om/BaseCcMusicDirs.php b/legacy/application/models/airtime/om/BaseCcMusicDirs.php
deleted file mode 100644
index 2a34925b7..000000000
--- a/legacy/application/models/airtime/om/BaseCcMusicDirs.php
+++ /dev/null
@@ -1,1409 +0,0 @@
-exists = true;
- $this->watched = true;
- }
-
- /**
- * Initializes internal state of BaseCcMusicDirs object.
- * @see applyDefaults()
- */
- public function __construct()
- {
- parent::__construct();
- $this->applyDefaultValues();
- }
-
- /**
- * Get the [id] column value.
- *
- * @return int
- */
- public function getId()
- {
-
- return $this->id;
- }
-
- /**
- * Get the [directory] column value.
- *
- * @return string
- */
- public function getDirectory()
- {
-
- return $this->directory;
- }
-
- /**
- * Get the [type] column value.
- *
- * @return string
- */
- public function getType()
- {
-
- return $this->type;
- }
-
- /**
- * Get the [exists] column value.
- *
- * @return boolean
- */
- public function getExists()
- {
-
- return $this->exists;
- }
-
- /**
- * Get the [watched] column value.
- *
- * @return boolean
- */
- public function getWatched()
- {
-
- return $this->watched;
- }
-
- /**
- * Set the value of [id] column.
- *
- * @param int $v new value
- * @return CcMusicDirs The current object (for fluent API support)
- */
- public function setId($v)
- {
- if ($v !== null && is_numeric($v)) {
- $v = (int) $v;
- }
-
- if ($this->id !== $v) {
- $this->id = $v;
- $this->modifiedColumns[] = CcMusicDirsPeer::ID;
- }
-
-
- return $this;
- } // setId()
-
- /**
- * Set the value of [directory] column.
- *
- * @param string $v new value
- * @return CcMusicDirs The current object (for fluent API support)
- */
- public function setDirectory($v)
- {
- if ($v !== null) {
- $v = (string) $v;
- }
-
- if ($this->directory !== $v) {
- $this->directory = $v;
- $this->modifiedColumns[] = CcMusicDirsPeer::DIRECTORY;
- }
-
-
- return $this;
- } // setDirectory()
-
- /**
- * Set the value of [type] column.
- *
- * @param string $v new value
- * @return CcMusicDirs The current object (for fluent API support)
- */
- public function setType($v)
- {
- if ($v !== null) {
- $v = (string) $v;
- }
-
- if ($this->type !== $v) {
- $this->type = $v;
- $this->modifiedColumns[] = CcMusicDirsPeer::TYPE;
- }
-
-
- return $this;
- } // setType()
-
- /**
- * Sets the value of the [exists] column.
- * Non-boolean arguments are converted using the following rules:
- * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
- * * 0, '0', 'false', 'off', and 'no' are converted to boolean false
- * Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
- *
- * @param boolean|integer|string $v The new value
- * @return CcMusicDirs The current object (for fluent API support)
- */
- public function setExists($v)
- {
- if ($v !== null) {
- if (is_string($v)) {
- $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
- } else {
- $v = (boolean) $v;
- }
- }
-
- if ($this->exists !== $v) {
- $this->exists = $v;
- $this->modifiedColumns[] = CcMusicDirsPeer::EXISTS;
- }
-
-
- return $this;
- } // setExists()
-
- /**
- * Sets the value of the [watched] column.
- * Non-boolean arguments are converted using the following rules:
- * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
- * * 0, '0', 'false', 'off', and 'no' are converted to boolean false
- * Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
- *
- * @param boolean|integer|string $v The new value
- * @return CcMusicDirs The current object (for fluent API support)
- */
- public function setWatched($v)
- {
- if ($v !== null) {
- if (is_string($v)) {
- $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
- } else {
- $v = (boolean) $v;
- }
- }
-
- if ($this->watched !== $v) {
- $this->watched = $v;
- $this->modifiedColumns[] = CcMusicDirsPeer::WATCHED;
- }
-
-
- return $this;
- } // setWatched()
-
- /**
- * Indicates whether the columns in this object are only set to default values.
- *
- * This method can be used in conjunction with isModified() to indicate whether an object is both
- * modified _and_ has some values set which are non-default.
- *
- * @return boolean Whether the columns in this object are only been set with default values.
- */
- public function hasOnlyDefaultValues()
- {
- if ($this->exists !== true) {
- return false;
- }
-
- if ($this->watched !== true) {
- return false;
- }
-
- // otherwise, everything was equal, so return true
- return true;
- } // hasOnlyDefaultValues()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (0-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
- * @param int $startcol 0-based offset column which indicates which resultset column to start with.
- * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate($row, $startcol = 0, $rehydrate = false)
- {
- try {
-
- $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
- $this->directory = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
- $this->type = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
- $this->exists = ($row[$startcol + 3] !== null) ? (boolean) $row[$startcol + 3] : null;
- $this->watched = ($row[$startcol + 4] !== null) ? (boolean) $row[$startcol + 4] : null;
- $this->resetModified();
-
- $this->setNew(false);
-
- if ($rehydrate) {
- $this->ensureConsistency();
- }
- $this->postHydrate($row, $startcol, $rehydrate);
-
- return $startcol + 5; // 5 = CcMusicDirsPeer::NUM_HYDRATE_COLUMNS.
-
- } catch (Exception $e) {
- throw new PropelException("Error populating CcMusicDirs object", $e);
- }
- }
-
- /**
- * Checks and repairs the internal consistency of the object.
- *
- * This method is executed after an already-instantiated object is re-hydrated
- * from the database. It exists to check any foreign keys to make sure that
- * the objects related to the current object are correct based on foreign key.
- *
- * You can override this method in the stub class, but you should always invoke
- * the base method from the overridden method (i.e. parent::ensureConsistency()),
- * in case your model changes.
- *
- * @throws PropelException
- */
- public function ensureConsistency()
- {
-
- } // ensureConsistency
-
- /**
- * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
- *
- * This will only work if the object has been saved and has a valid primary key set.
- *
- * @param boolean $deep (optional) Whether to also de-associated any related objects.
- * @param PropelPDO $con (optional) The PropelPDO connection to use.
- * @return void
- * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
- */
- public function reload($deep = false, PropelPDO $con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("Cannot reload a deleted object.");
- }
-
- if ($this->isNew()) {
- throw new PropelException("Cannot reload an unsaved object.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
- }
-
- // We don't need to alter the object instance pool; we're just modifying this instance
- // already in the pool.
-
- $stmt = CcMusicDirsPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
- $row = $stmt->fetch(PDO::FETCH_NUM);
- $stmt->closeCursor();
- if (!$row) {
- throw new PropelException('Cannot find matching row in the database to reload object values.');
- }
- $this->hydrate($row, 0, true); // rehydrate
-
- if ($deep) { // also de-associate any related objects?
-
- $this->collCcFiless = null;
-
- } // if (deep)
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param PropelPDO $con
- * @return void
- * @throws PropelException
- * @throws Exception
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete(PropelPDO $con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
- }
-
- $con->beginTransaction();
- try {
- $deleteQuery = CcMusicDirsQuery::create()
- ->filterByPrimaryKey($this->getPrimaryKey());
- $ret = $this->preDelete($con);
- if ($ret) {
- $deleteQuery->delete($con);
- $this->postDelete($con);
- $con->commit();
- $this->setDeleted(true);
- } else {
- $con->commit();
- }
- } catch (Exception $e) {
- $con->rollBack();
- throw $e;
- }
- }
-
- /**
- * Persists this object to the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All modified related objects will also be persisted in the doSave()
- * method. This method wraps all precipitate database operations in a
- * single transaction.
- *
- * @param PropelPDO $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @throws Exception
- * @see doSave()
- */
- public function save(PropelPDO $con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
- }
-
- $con->beginTransaction();
- $isInsert = $this->isNew();
- try {
- $ret = $this->preSave($con);
- if ($isInsert) {
- $ret = $ret && $this->preInsert($con);
- } else {
- $ret = $ret && $this->preUpdate($con);
- }
- if ($ret) {
- $affectedRows = $this->doSave($con);
- if ($isInsert) {
- $this->postInsert($con);
- } else {
- $this->postUpdate($con);
- }
- $this->postSave($con);
- CcMusicDirsPeer::addInstanceToPool($this);
- } else {
- $affectedRows = 0;
- }
- $con->commit();
-
- return $affectedRows;
- } catch (Exception $e) {
- $con->rollBack();
- throw $e;
- }
- }
-
- /**
- * Performs the work of inserting or updating the row in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param PropelPDO $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave(PropelPDO $con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
- if ($this->isNew() || $this->isModified()) {
- // persist changes
- if ($this->isNew()) {
- $this->doInsert($con);
- } else {
- $this->doUpdate($con);
- }
- $affectedRows += 1;
- $this->resetModified();
- }
-
- if ($this->ccFilessScheduledForDeletion !== null) {
- if (!$this->ccFilessScheduledForDeletion->isEmpty()) {
- foreach ($this->ccFilessScheduledForDeletion as $ccFiles) {
- // need to save related object because we set the relation to null
- $ccFiles->save($con);
- }
- $this->ccFilessScheduledForDeletion = null;
- }
- }
-
- if ($this->collCcFiless !== null) {
- foreach ($this->collCcFiless as $referrerFK) {
- if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
- $affectedRows += $referrerFK->save($con);
- }
- }
- }
-
- $this->alreadyInSave = false;
-
- }
-
- return $affectedRows;
- } // doSave()
-
- /**
- * Insert the row in the database.
- *
- * @param PropelPDO $con
- *
- * @throws PropelException
- * @see doSave()
- */
- protected function doInsert(PropelPDO $con)
- {
- $modifiedColumns = array();
- $index = 0;
-
- $this->modifiedColumns[] = CcMusicDirsPeer::ID;
- if (null !== $this->id) {
- throw new PropelException('Cannot insert a value for auto-increment primary key (' . CcMusicDirsPeer::ID . ')');
- }
- if (null === $this->id) {
- try {
- $stmt = $con->query("SELECT nextval('cc_music_dirs_id_seq')");
- $row = $stmt->fetch(PDO::FETCH_NUM);
- $this->id = $row[0];
- } catch (Exception $e) {
- throw new PropelException('Unable to get sequence id.', $e);
- }
- }
-
-
- // check the columns in natural order for more readable SQL queries
- if ($this->isColumnModified(CcMusicDirsPeer::ID)) {
- $modifiedColumns[':p' . $index++] = '"id"';
- }
- if ($this->isColumnModified(CcMusicDirsPeer::DIRECTORY)) {
- $modifiedColumns[':p' . $index++] = '"directory"';
- }
- if ($this->isColumnModified(CcMusicDirsPeer::TYPE)) {
- $modifiedColumns[':p' . $index++] = '"type"';
- }
- if ($this->isColumnModified(CcMusicDirsPeer::EXISTS)) {
- $modifiedColumns[':p' . $index++] = '"exists"';
- }
- if ($this->isColumnModified(CcMusicDirsPeer::WATCHED)) {
- $modifiedColumns[':p' . $index++] = '"watched"';
- }
-
- $sql = sprintf(
- 'INSERT INTO "cc_music_dirs" (%s) VALUES (%s)',
- implode(', ', $modifiedColumns),
- implode(', ', array_keys($modifiedColumns))
- );
-
- try {
- $stmt = $con->prepare($sql);
- foreach ($modifiedColumns as $identifier => $columnName) {
- switch ($columnName) {
- case '"id"':
- $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
- break;
- case '"directory"':
- $stmt->bindValue($identifier, $this->directory, PDO::PARAM_STR);
- break;
- case '"type"':
- $stmt->bindValue($identifier, $this->type, PDO::PARAM_STR);
- break;
- case '"exists"':
- $stmt->bindValue($identifier, $this->exists, PDO::PARAM_BOOL);
- break;
- case '"watched"':
- $stmt->bindValue($identifier, $this->watched, PDO::PARAM_BOOL);
- break;
- }
- }
- $stmt->execute();
- } catch (Exception $e) {
- Propel::log($e->getMessage(), Propel::LOG_ERR);
- throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
- }
-
- $this->setNew(false);
- }
-
- /**
- * Update the row in the database.
- *
- * @param PropelPDO $con
- *
- * @see doSave()
- */
- protected function doUpdate(PropelPDO $con)
- {
- $selectCriteria = $this->buildPkeyCriteria();
- $valuesCriteria = $this->buildCriteria();
- BasePeer::doUpdate($selectCriteria, $valuesCriteria, $con);
- }
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
-
- return true;
- }
-
- $this->validationFailures = $res;
-
- return false;
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true
is returned; otherwise
- * an aggregated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true
if all validations pass; array of ValidationFailed
objects otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = CcMusicDirsPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
- if ($this->collCcFiless !== null) {
- foreach ($this->collCcFiless as $referrerFK) {
- if (!$referrerFK->validate($columns)) {
- $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
- }
- }
- }
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
- * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
- * Defaults to BasePeer::TYPE_PHPNAME
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = CcMusicDirsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- $field = $this->getByPosition($pos);
-
- return $field;
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch ($pos) {
- case 0:
- return $this->getId();
- break;
- case 1:
- return $this->getDirectory();
- break;
- case 2:
- return $this->getType();
- break;
- case 3:
- return $this->getExists();
- break;
- case 4:
- return $this->getWatched();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
- * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
- * Defaults to BasePeer::TYPE_PHPNAME.
- * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to true.
- * @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
- * @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
- *
- * @return array an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
- {
- if (isset($alreadyDumpedObjects['CcMusicDirs'][$this->getPrimaryKey()])) {
- return '*RECURSION*';
- }
- $alreadyDumpedObjects['CcMusicDirs'][$this->getPrimaryKey()] = true;
- $keys = CcMusicDirsPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getId(),
- $keys[1] => $this->getDirectory(),
- $keys[2] => $this->getType(),
- $keys[3] => $this->getExists(),
- $keys[4] => $this->getWatched(),
- );
- $virtualColumns = $this->virtualColumns;
- foreach ($virtualColumns as $key => $virtualColumn) {
- $result[$key] = $virtualColumn;
- }
-
- if ($includeForeignObjects) {
- if (null !== $this->collCcFiless) {
- $result['CcFiless'] = $this->collCcFiless->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
- }
- }
-
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
- * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
- * Defaults to BasePeer::TYPE_PHPNAME
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = CcMusicDirsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
-
- $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch ($pos) {
- case 0:
- $this->setId($value);
- break;
- case 1:
- $this->setDirectory($value);
- break;
- case 2:
- $this->setType($value);
- break;
- case 3:
- $this->setExists($value);
- break;
- case 4:
- $this->setWatched($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
- * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
- * The default key type is the column's BasePeer::TYPE_PHPNAME
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = CcMusicDirsPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setDirectory($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setType($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setExists($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setWatched($arr[$keys[4]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(CcMusicDirsPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(CcMusicDirsPeer::ID)) $criteria->add(CcMusicDirsPeer::ID, $this->id);
- if ($this->isColumnModified(CcMusicDirsPeer::DIRECTORY)) $criteria->add(CcMusicDirsPeer::DIRECTORY, $this->directory);
- if ($this->isColumnModified(CcMusicDirsPeer::TYPE)) $criteria->add(CcMusicDirsPeer::TYPE, $this->type);
- if ($this->isColumnModified(CcMusicDirsPeer::EXISTS)) $criteria->add(CcMusicDirsPeer::EXISTS, $this->exists);
- if ($this->isColumnModified(CcMusicDirsPeer::WATCHED)) $criteria->add(CcMusicDirsPeer::WATCHED, $this->watched);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(CcMusicDirsPeer::DATABASE_NAME);
- $criteria->add(CcMusicDirsPeer::ID, $this->id);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return int
- */
- public function getPrimaryKey()
- {
- return $this->getId();
- }
-
- /**
- * Generic method to set the primary key (id column).
- *
- * @param int $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setId($key);
- }
-
- /**
- * Returns true if the primary key for this object is null.
- * @return boolean
- */
- public function isPrimaryKeyNull()
- {
-
- return null === $this->getId();
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of CcMusicDirs (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
- {
- $copyObj->setDirectory($this->getDirectory());
- $copyObj->setType($this->getType());
- $copyObj->setExists($this->getExists());
- $copyObj->setWatched($this->getWatched());
-
- if ($deepCopy && !$this->startCopy) {
- // important: temporarily setNew(false) because this affects the behavior of
- // the getter/setter methods for fkey referrer objects.
- $copyObj->setNew(false);
- // store object hash to prevent cycle
- $this->startCopy = true;
-
- foreach ($this->getCcFiless() as $relObj) {
- if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
- $copyObj->addCcFiles($relObj->copy($deepCopy));
- }
- }
-
- //unflag object copy
- $this->startCopy = false;
- } // if ($deepCopy)
-
- if ($makeNew) {
- $copyObj->setNew(true);
- $copyObj->setId(NULL); // this is a auto-increment column, so set to default value
- }
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return CcMusicDirs Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
-
- return $copyObj;
- }
-
- /**
- * 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 CcMusicDirsPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new CcMusicDirsPeer();
- }
-
- return self::$peer;
- }
-
-
- /**
- * Initializes a collection based on the name of a relation.
- * Avoids crafting an 'init[$relationName]s' method name
- * that wouldn't work when StandardEnglishPluralizer is used.
- *
- * @param string $relationName The name of the relation to initialize
- * @return void
- */
- public function initRelation($relationName)
- {
- if ('CcFiles' == $relationName) {
- $this->initCcFiless();
- }
- }
-
- /**
- * Clears out the collCcFiless collection
- *
- * This does not modify the database; however, it will remove any associated objects, causing
- * them to be refetched by subsequent calls to accessor method.
- *
- * @return CcMusicDirs The current object (for fluent API support)
- * @see addCcFiless()
- */
- public function clearCcFiless()
- {
- $this->collCcFiless = null; // important to set this to null since that means it is uninitialized
- $this->collCcFilessPartial = null;
-
- return $this;
- }
-
- /**
- * reset is the collCcFiless collection loaded partially
- *
- * @return void
- */
- public function resetPartialCcFiless($v = true)
- {
- $this->collCcFilessPartial = $v;
- }
-
- /**
- * Initializes the collCcFiless collection.
- *
- * By default this just sets the collCcFiless collection to an empty array (like clearcollCcFiless());
- * however, you may wish to override this method in your stub class to provide setting appropriate
- * to your application -- for example, setting the initial array to the values stored in database.
- *
- * @param boolean $overrideExisting If set to true, the method call initializes
- * the collection even if it is not empty
- *
- * @return void
- */
- public function initCcFiless($overrideExisting = true)
- {
- if (null !== $this->collCcFiless && !$overrideExisting) {
- return;
- }
- $this->collCcFiless = new PropelObjectCollection();
- $this->collCcFiless->setModel('CcFiles');
- }
-
- /**
- * Gets an array of CcFiles objects which contain a foreign key that references this object.
- *
- * If the $criteria is not null, it is used to always fetch the results from the database.
- * Otherwise the results are fetched from the database the first time, then cached.
- * Next time the same method is called without $criteria, the cached collection is returned.
- * If this CcMusicDirs is new, it will return
- * an empty collection or the current collection; the criteria is ignored on a new object.
- *
- * @param Criteria $criteria optional Criteria object to narrow the query
- * @param PropelPDO $con optional connection object
- * @return PropelObjectCollection|CcFiles[] List of CcFiles objects
- * @throws PropelException
- */
- public function getCcFiless($criteria = null, PropelPDO $con = null)
- {
- $partial = $this->collCcFilessPartial && !$this->isNew();
- if (null === $this->collCcFiless || null !== $criteria || $partial) {
- if ($this->isNew() && null === $this->collCcFiless) {
- // return empty collection
- $this->initCcFiless();
- } else {
- $collCcFiless = CcFilesQuery::create(null, $criteria)
- ->filterByCcMusicDirs($this)
- ->find($con);
- if (null !== $criteria) {
- if (false !== $this->collCcFilessPartial && count($collCcFiless)) {
- $this->initCcFiless(false);
-
- foreach ($collCcFiless as $obj) {
- if (false == $this->collCcFiless->contains($obj)) {
- $this->collCcFiless->append($obj);
- }
- }
-
- $this->collCcFilessPartial = true;
- }
-
- $collCcFiless->getInternalIterator()->rewind();
-
- return $collCcFiless;
- }
-
- if ($partial && $this->collCcFiless) {
- foreach ($this->collCcFiless as $obj) {
- if ($obj->isNew()) {
- $collCcFiless[] = $obj;
- }
- }
- }
-
- $this->collCcFiless = $collCcFiless;
- $this->collCcFilessPartial = false;
- }
- }
-
- return $this->collCcFiless;
- }
-
- /**
- * Sets a collection of CcFiles objects related by a one-to-many relationship
- * to the current object.
- * It will also schedule objects for deletion based on a diff between old objects (aka persisted)
- * and new objects from the given Propel collection.
- *
- * @param PropelCollection $ccFiless A Propel collection.
- * @param PropelPDO $con Optional connection object
- * @return CcMusicDirs The current object (for fluent API support)
- */
- public function setCcFiless(PropelCollection $ccFiless, PropelPDO $con = null)
- {
- $ccFilessToDelete = $this->getCcFiless(new Criteria(), $con)->diff($ccFiless);
-
-
- $this->ccFilessScheduledForDeletion = $ccFilessToDelete;
-
- foreach ($ccFilessToDelete as $ccFilesRemoved) {
- $ccFilesRemoved->setCcMusicDirs(null);
- }
-
- $this->collCcFiless = null;
- foreach ($ccFiless as $ccFiles) {
- $this->addCcFiles($ccFiles);
- }
-
- $this->collCcFiless = $ccFiless;
- $this->collCcFilessPartial = false;
-
- return $this;
- }
-
- /**
- * Returns the number of related CcFiles objects.
- *
- * @param Criteria $criteria
- * @param boolean $distinct
- * @param PropelPDO $con
- * @return int Count of related CcFiles objects.
- * @throws PropelException
- */
- public function countCcFiless(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
- {
- $partial = $this->collCcFilessPartial && !$this->isNew();
- if (null === $this->collCcFiless || null !== $criteria || $partial) {
- if ($this->isNew() && null === $this->collCcFiless) {
- return 0;
- }
-
- if ($partial && !$criteria) {
- return count($this->getCcFiless());
- }
- $query = CcFilesQuery::create(null, $criteria);
- if ($distinct) {
- $query->distinct();
- }
-
- return $query
- ->filterByCcMusicDirs($this)
- ->count($con);
- }
-
- return count($this->collCcFiless);
- }
-
- /**
- * Method called to associate a CcFiles object to this object
- * through the CcFiles foreign key attribute.
- *
- * @param CcFiles $l CcFiles
- * @return CcMusicDirs The current object (for fluent API support)
- */
- public function addCcFiles(CcFiles $l)
- {
- if ($this->collCcFiless === null) {
- $this->initCcFiless();
- $this->collCcFilessPartial = true;
- }
-
- if (!in_array($l, $this->collCcFiless->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
- $this->doAddCcFiles($l);
-
- if ($this->ccFilessScheduledForDeletion and $this->ccFilessScheduledForDeletion->contains($l)) {
- $this->ccFilessScheduledForDeletion->remove($this->ccFilessScheduledForDeletion->search($l));
- }
- }
-
- return $this;
- }
-
- /**
- * @param CcFiles $ccFiles The ccFiles object to add.
- */
- protected function doAddCcFiles($ccFiles)
- {
- $this->collCcFiless[]= $ccFiles;
- $ccFiles->setCcMusicDirs($this);
- }
-
- /**
- * @param CcFiles $ccFiles The ccFiles object to remove.
- * @return CcMusicDirs The current object (for fluent API support)
- */
- public function removeCcFiles($ccFiles)
- {
- if ($this->getCcFiless()->contains($ccFiles)) {
- $this->collCcFiless->remove($this->collCcFiless->search($ccFiles));
- if (null === $this->ccFilessScheduledForDeletion) {
- $this->ccFilessScheduledForDeletion = clone $this->collCcFiless;
- $this->ccFilessScheduledForDeletion->clear();
- }
- $this->ccFilessScheduledForDeletion[]= $ccFiles;
- $ccFiles->setCcMusicDirs(null);
- }
-
- return $this;
- }
-
-
- /**
- * If this collection has already been initialized with
- * an identical criteria, it returns the collection.
- * Otherwise if this CcMusicDirs is new, it will return
- * an empty collection; or if this CcMusicDirs has previously
- * been saved, it will retrieve related CcFiless from storage.
- *
- * This method is protected by default in order to keep the public
- * api reasonable. You can provide public methods for those you
- * actually need in CcMusicDirs.
- *
- * @param Criteria $criteria optional Criteria object to narrow the query
- * @param PropelPDO $con optional connection object
- * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
- * @return PropelObjectCollection|CcFiles[] List of CcFiles objects
- */
- public function getCcFilessJoinFkOwner($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
- {
- $query = CcFilesQuery::create(null, $criteria);
- $query->joinWith('FkOwner', $join_behavior);
-
- return $this->getCcFiless($query, $con);
- }
-
-
- /**
- * If this collection has already been initialized with
- * an identical criteria, it returns the collection.
- * Otherwise if this CcMusicDirs is new, it will return
- * an empty collection; or if this CcMusicDirs has previously
- * been saved, it will retrieve related CcFiless from storage.
- *
- * This method is protected by default in order to keep the public
- * api reasonable. You can provide public methods for those you
- * actually need in CcMusicDirs.
- *
- * @param Criteria $criteria optional Criteria object to narrow the query
- * @param PropelPDO $con optional connection object
- * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
- * @return PropelObjectCollection|CcFiles[] List of CcFiles objects
- */
- public function getCcFilessJoinCcSubjsRelatedByDbEditedby($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
- {
- $query = CcFilesQuery::create(null, $criteria);
- $query->joinWith('CcSubjsRelatedByDbEditedby', $join_behavior);
-
- return $this->getCcFiless($query, $con);
- }
-
- /**
- * Clears the current object and sets all attributes to their default values
- */
- public function clear()
- {
- $this->id = null;
- $this->directory = null;
- $this->type = null;
- $this->exists = null;
- $this->watched = null;
- $this->alreadyInSave = false;
- $this->alreadyInValidation = false;
- $this->alreadyInClearAllReferencesDeep = false;
- $this->clearAllReferences();
- $this->applyDefaultValues();
- $this->resetModified();
- $this->setNew(true);
- $this->setDeleted(false);
- }
-
- /**
- * Resets all references to other model objects or collections of model objects.
- *
- * This method is a user-space workaround for PHP's inability to garbage collect
- * objects with circular references (even in PHP 5.3). This is currently necessary
- * when using Propel in certain daemon or large-volume/high-memory operations.
- *
- * @param boolean $deep Whether to also clear the references on all referrer objects.
- */
- public function clearAllReferences($deep = false)
- {
- if ($deep && !$this->alreadyInClearAllReferencesDeep) {
- $this->alreadyInClearAllReferencesDeep = true;
- if ($this->collCcFiless) {
- foreach ($this->collCcFiless as $o) {
- $o->clearAllReferences($deep);
- }
- }
-
- $this->alreadyInClearAllReferencesDeep = false;
- } // if ($deep)
-
- if ($this->collCcFiless instanceof PropelCollection) {
- $this->collCcFiless->clearIterator();
- }
- $this->collCcFiless = null;
- }
-
- /**
- * return the string representation of this object
- *
- * @return string
- */
- public function __toString()
- {
- return (string) $this->exportTo(CcMusicDirsPeer::DEFAULT_STRING_FORMAT);
- }
-
- /**
- * return true is the object is in saving state
- *
- * @return boolean
- */
- public function isAlreadyInSave()
- {
- return $this->alreadyInSave;
- }
-
-}
diff --git a/legacy/application/models/airtime/om/BaseCcMusicDirsPeer.php b/legacy/application/models/airtime/om/BaseCcMusicDirsPeer.php
deleted file mode 100644
index edd85f475..000000000
--- a/legacy/application/models/airtime/om/BaseCcMusicDirsPeer.php
+++ /dev/null
@@ -1,775 +0,0 @@
- array ('Id', 'Directory', 'Type', 'Exists', 'Watched', ),
- BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'directory', 'type', 'exists', 'watched', ),
- BasePeer::TYPE_COLNAME => array (CcMusicDirsPeer::ID, CcMusicDirsPeer::DIRECTORY, CcMusicDirsPeer::TYPE, CcMusicDirsPeer::EXISTS, CcMusicDirsPeer::WATCHED, ),
- BasePeer::TYPE_RAW_COLNAME => array ('ID', 'DIRECTORY', 'TYPE', 'EXISTS', 'WATCHED', ),
- BasePeer::TYPE_FIELDNAME => array ('id', 'directory', 'type', 'exists', 'watched', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. CcMusicDirsPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- protected static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Directory' => 1, 'Type' => 2, 'Exists' => 3, 'Watched' => 4, ),
- BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'directory' => 1, 'type' => 2, 'exists' => 3, 'watched' => 4, ),
- BasePeer::TYPE_COLNAME => array (CcMusicDirsPeer::ID => 0, CcMusicDirsPeer::DIRECTORY => 1, CcMusicDirsPeer::TYPE => 2, CcMusicDirsPeer::EXISTS => 3, CcMusicDirsPeer::WATCHED => 4, ),
- BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'DIRECTORY' => 1, 'TYPE' => 2, 'EXISTS' => 3, 'WATCHED' => 4, ),
- BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'directory' => 1, 'type' => 2, 'exists' => 3, 'watched' => 4, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
- * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- * @throws PropelException - if the specified name could not be found in the fieldname mappings.
- */
- public static function translateFieldName($name, $fromType, $toType)
- {
- $toNames = CcMusicDirsPeer::getFieldNames($toType);
- $key = isset(CcMusicDirsPeer::$fieldKeys[$fromType][$name]) ? CcMusicDirsPeer::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(CcMusicDirsPeer::$fieldKeys[$fromType], true));
- }
-
- return $toNames[$key];
- }
-
- /**
- * Returns an array of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
- * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
- * @return array A list of field names
- * @throws PropelException - if the type is not valid.
- */
- public static function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, CcMusicDirsPeer::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. ' . $type . ' was given.');
- }
-
- return CcMusicDirsPeer::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. CcMusicDirsPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(CcMusicDirsPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param Criteria $criteria object containing the columns to add.
- * @param string $alias optional table alias
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria, $alias = null)
- {
- if (null === $alias) {
- $criteria->addSelectColumn(CcMusicDirsPeer::ID);
- $criteria->addSelectColumn(CcMusicDirsPeer::DIRECTORY);
- $criteria->addSelectColumn(CcMusicDirsPeer::TYPE);
- $criteria->addSelectColumn(CcMusicDirsPeer::EXISTS);
- $criteria->addSelectColumn(CcMusicDirsPeer::WATCHED);
- } else {
- $criteria->addSelectColumn($alias . '.id');
- $criteria->addSelectColumn($alias . '.directory');
- $criteria->addSelectColumn($alias . '.type');
- $criteria->addSelectColumn($alias . '.exists');
- $criteria->addSelectColumn($alias . '.watched');
- }
- }
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
- * @param PropelPDO $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, PropelPDO $con = null)
- {
- // we may modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // We need to set the primary table name, since in the case that there are no WHERE columns
- // it will be impossible for the BasePeer::createSelectSql() method to determine which
- // tables go into the FROM clause.
- $criteria->setPrimaryTableName(CcMusicDirsPeer::TABLE_NAME);
-
- if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->setDistinct();
- }
-
- if (!$criteria->hasSelectClause()) {
- CcMusicDirsPeer::addSelectColumns($criteria);
- }
-
- $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
- $criteria->setDbName(CcMusicDirsPeer::DATABASE_NAME); // Set the correct dbName
-
- if ($con === null) {
- $con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
- }
- // BasePeer returns a PDOStatement
- $stmt = BasePeer::doCount($criteria, $con);
-
- if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
- $count = (int) $row[0];
- } else {
- $count = 0; // no rows returned; we infer that means 0 matches.
- }
- $stmt->closeCursor();
-
- return $count;
- }
- /**
- * Selects one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param PropelPDO $con
- * @return CcMusicDirs
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, PropelPDO $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = CcMusicDirsPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
-
- return null;
- }
- /**
- * Selects several row from the DB.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param PropelPDO $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, PropelPDO $con = null)
- {
- return CcMusicDirsPeer::populateObjects(CcMusicDirsPeer::doSelectStmt($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect() method to execute a PDOStatement.
- *
- * Use this method directly if you want to work with an executed statement directly (for example
- * to perform your own object hydration).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param PropelPDO $con The connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return PDOStatement The executed PDOStatement object.
- * @see BasePeer::doSelect()
- */
- public static function doSelectStmt(Criteria $criteria, PropelPDO $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
- }
-
- if (!$criteria->hasSelectClause()) {
- $criteria = clone $criteria;
- CcMusicDirsPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(CcMusicDirsPeer::DATABASE_NAME);
-
- // BasePeer returns a PDOStatement
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * Adds an object to the instance pool.
- *
- * Propel keeps cached copies of objects in an instance pool when they are retrieved
- * from the database. In some cases -- especially when you override doSelect*()
- * methods in your stub classes -- you may need to explicitly add objects
- * to the cache in order to ensure that the same objects are always returned by doSelect*()
- * and retrieveByPK*() calls.
- *
- * @param CcMusicDirs $obj A CcMusicDirs object.
- * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
- */
- public static function addInstanceToPool($obj, $key = null)
- {
- if (Propel::isInstancePoolingEnabled()) {
- if ($key === null) {
- $key = (string) $obj->getId();
- } // if key === null
- CcMusicDirsPeer::$instances[$key] = $obj;
- }
- }
-
- /**
- * Removes an object from the instance pool.
- *
- * Propel keeps cached copies of objects in an instance pool when they are retrieved
- * from the database. In some cases -- especially when you override doDelete
- * methods in your stub classes -- you may need to explicitly remove objects
- * from the cache in order to prevent returning objects that no longer exist.
- *
- * @param mixed $value A CcMusicDirs object or a primary key value.
- *
- * @return void
- * @throws PropelException - if the value is invalid.
- */
- public static function removeInstanceFromPool($value)
- {
- if (Propel::isInstancePoolingEnabled() && $value !== null) {
- if (is_object($value) && $value instanceof CcMusicDirs) {
- $key = (string) $value->getId();
- } elseif (is_scalar($value)) {
- // assume we've been passed a primary key
- $key = (string) $value;
- } else {
- $e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or CcMusicDirs object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true)));
- throw $e;
- }
-
- unset(CcMusicDirsPeer::$instances[$key]);
- }
- } // removeInstanceFromPool()
-
- /**
- * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
- *
- * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
- * a multi-column primary key, a serialize()d version of the primary key will be returned.
- *
- * @param string $key The key (@see getPrimaryKeyHash()) for this instance.
- * @return CcMusicDirs Found object or null if 1) no instance exists for specified key or 2) instance pooling has been disabled.
- * @see getPrimaryKeyHash()
- */
- public static function getInstanceFromPool($key)
- {
- if (Propel::isInstancePoolingEnabled()) {
- if (isset(CcMusicDirsPeer::$instances[$key])) {
- return CcMusicDirsPeer::$instances[$key];
- }
- }
-
- return null; // just to be explicit
- }
-
- /**
- * Clear the instance pool.
- *
- * @return void
- */
- public static function clearInstancePool($and_clear_all_references = false)
- {
- if ($and_clear_all_references) {
- foreach (CcMusicDirsPeer::$instances as $instance) {
- $instance->clearAllReferences(true);
- }
- }
- CcMusicDirsPeer::$instances = array();
- }
-
- /**
- * Method to invalidate the instance pool of all tables related to cc_music_dirs
- * by a foreign key with ON DELETE CASCADE
- */
- public static function clearRelatedInstancePool()
- {
- }
-
- /**
- * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
- *
- * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
- * a multi-column primary key, a serialize()d version of the primary key will be returned.
- *
- * @param array $row PropelPDO resultset row.
- * @param int $startcol The 0-based offset for reading from the resultset row.
- * @return string A string version of PK or null if the components of primary key in result array are all null.
- */
- public static function getPrimaryKeyHashFromRow($row, $startcol = 0)
- {
- // If the PK cannot be derived from the row, return null.
- if ($row[$startcol] === null) {
- return null;
- }
-
- return (string) $row[$startcol];
- }
-
- /**
- * Retrieves the primary key from the DB resultset row
- * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
- * a multi-column primary key, an array of the primary key columns will be returned.
- *
- * @param array $row PropelPDO resultset row.
- * @param int $startcol The 0-based offset for reading from the resultset row.
- * @return mixed The primary key of the row
- */
- public static function getPrimaryKeyFromRow($row, $startcol = 0)
- {
-
- return (int) $row[$startcol];
- }
-
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(PDOStatement $stmt)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = CcMusicDirsPeer::getOMClass();
- // populate the object(s)
- while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
- $key = CcMusicDirsPeer::getPrimaryKeyHashFromRow($row, 0);
- if (null !== ($obj = CcMusicDirsPeer::getInstanceFromPool($key))) {
- // We no longer rehydrate the object, since this can cause data loss.
- // See http://www.propelorm.org/ticket/509
- // $obj->hydrate($row, 0, true); // rehydrate
- $results[] = $obj;
- } else {
- $obj = new $cls();
- $obj->hydrate($row);
- $results[] = $obj;
- CcMusicDirsPeer::addInstanceToPool($obj, $key);
- } // if key exists
- }
- $stmt->closeCursor();
-
- return $results;
- }
- /**
- * Populates an object of the default type or an object that inherit from the default.
- *
- * @param array $row PropelPDO resultset row.
- * @param int $startcol The 0-based offset for reading from the resultset row.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return array (CcMusicDirs object, last column rank)
- */
- public static function populateObject($row, $startcol = 0)
- {
- $key = CcMusicDirsPeer::getPrimaryKeyHashFromRow($row, $startcol);
- if (null !== ($obj = CcMusicDirsPeer::getInstanceFromPool($key))) {
- // We no longer rehydrate the object, since this can cause data loss.
- // See http://www.propelorm.org/ticket/509
- // $obj->hydrate($row, $startcol, true); // rehydrate
- $col = $startcol + CcMusicDirsPeer::NUM_HYDRATE_COLUMNS;
- } else {
- $cls = CcMusicDirsPeer::OM_CLASS;
- $obj = new $cls();
- $col = $obj->hydrate($row, $startcol);
- CcMusicDirsPeer::addInstanceToPool($obj, $key);
- }
-
- return array($obj, $col);
- }
-
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(CcMusicDirsPeer::DATABASE_NAME)->getTable(CcMusicDirsPeer::TABLE_NAME);
- }
-
- /**
- * Add a TableMap instance to the database for this peer class.
- */
- public static function buildTableMap()
- {
- $dbMap = Propel::getDatabaseMap(BaseCcMusicDirsPeer::DATABASE_NAME);
- if (!$dbMap->hasTable(BaseCcMusicDirsPeer::TABLE_NAME)) {
- $dbMap->addTableObject(new \CcMusicDirsTableMap());
- }
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- *
- * @return string ClassName
- */
- public static function getOMClass($row = 0, $colnum = 0)
- {
- return CcMusicDirsPeer::OM_CLASS;
- }
-
- /**
- * Performs an INSERT on the database, given a CcMusicDirs or Criteria object.
- *
- * @param mixed $values Criteria or CcMusicDirs object containing data that is used to create the INSERT statement.
- * @param PropelPDO $con the PropelPDO connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, PropelPDO $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from CcMusicDirs object
- }
-
- if ($criteria->containsKey(CcMusicDirsPeer::ID) && $criteria->keyContainsValue(CcMusicDirsPeer::ID) ) {
- throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcMusicDirsPeer::ID.')');
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(CcMusicDirsPeer::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->beginTransaction();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch (Exception $e) {
- $con->rollBack();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Performs an UPDATE on the database, given a CcMusicDirs or Criteria object.
- *
- * @param mixed $values Criteria or CcMusicDirs object containing data that is used to create the UPDATE statement.
- * @param PropelPDO $con The connection to use (specify PropelPDO connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, PropelPDO $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
- }
-
- $selectCriteria = new Criteria(CcMusicDirsPeer::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(CcMusicDirsPeer::ID);
- $value = $criteria->remove(CcMusicDirsPeer::ID);
- if ($value) {
- $selectCriteria->add(CcMusicDirsPeer::ID, $value, $comparison);
- } else {
- $selectCriteria->setPrimaryTableName(CcMusicDirsPeer::TABLE_NAME);
- }
-
- } else { // $values is CcMusicDirs object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(CcMusicDirsPeer::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Deletes all rows from the cc_music_dirs table.
- *
- * @param PropelPDO $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException
- */
- public static function doDeleteAll(PropelPDO $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->beginTransaction();
- $affectedRows += BasePeer::doDeleteAll(CcMusicDirsPeer::TABLE_NAME, $con, CcMusicDirsPeer::DATABASE_NAME);
- // Because this db requires some delete cascade/set null emulation, we have to
- // clear the cached instance *after* the emulation has happened (since
- // instances get re-added by the select statement contained therein).
- CcMusicDirsPeer::clearInstancePool();
- CcMusicDirsPeer::clearRelatedInstancePool();
- $con->commit();
-
- return $affectedRows;
- } catch (Exception $e) {
- $con->rollBack();
- throw $e;
- }
- }
-
- /**
- * Performs a DELETE on the database, given a CcMusicDirs or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or CcMusicDirs object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param PropelPDO $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, PropelPDO $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
- }
-
- if ($values instanceof Criteria) {
- // invalidate the cache for all objects of this type, since we have no
- // way of knowing (without running a query) what objects should be invalidated
- // from the cache based on this Criteria.
- CcMusicDirsPeer::clearInstancePool();
- // rename for clarity
- $criteria = clone $values;
- } elseif ($values instanceof CcMusicDirs) { // it's a model object
- // invalidate the cache for this single object
- CcMusicDirsPeer::removeInstanceFromPool($values);
- // create criteria based on pk values
- $criteria = $values->buildPkeyCriteria();
- } else { // it's a primary key, or an array of pks
- $criteria = new Criteria(CcMusicDirsPeer::DATABASE_NAME);
- $criteria->add(CcMusicDirsPeer::ID, (array) $values, Criteria::IN);
- // invalidate the cache for this object(s)
- foreach ((array) $values as $singleval) {
- CcMusicDirsPeer::removeInstanceFromPool($singleval);
- }
- }
-
- // Set the correct dbName
- $criteria->setDbName(CcMusicDirsPeer::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->beginTransaction();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- CcMusicDirsPeer::clearRelatedInstancePool();
- $con->commit();
-
- return $affectedRows;
- } catch (Exception $e) {
- $con->rollBack();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given CcMusicDirs object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param CcMusicDirs $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate($obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(CcMusicDirsPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(CcMusicDirsPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach ($cols as $colName) {
- if ($tableMap->hasColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(CcMusicDirsPeer::DATABASE_NAME, CcMusicDirsPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param int $pk the primary key.
- * @param PropelPDO $con the connection to use
- * @return CcMusicDirs
- */
- public static function retrieveByPK($pk, PropelPDO $con = null)
- {
-
- if (null !== ($obj = CcMusicDirsPeer::getInstanceFromPool((string) $pk))) {
- return $obj;
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
- }
-
- $criteria = new Criteria(CcMusicDirsPeer::DATABASE_NAME);
- $criteria->add(CcMusicDirsPeer::ID, $pk);
-
- $v = CcMusicDirsPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param PropelPDO $con the connection to use
- * @return CcMusicDirs[]
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, PropelPDO $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria(CcMusicDirsPeer::DATABASE_NAME);
- $criteria->add(CcMusicDirsPeer::ID, $pks, Criteria::IN);
- $objs = CcMusicDirsPeer::doSelect($criteria, $con);
- }
-
- return $objs;
- }
-
-} // BaseCcMusicDirsPeer
-
-// This is the static code needed to register the TableMap for this table with the main Propel class.
-//
-BaseCcMusicDirsPeer::buildTableMap();
diff --git a/legacy/application/models/airtime/om/BaseCcMusicDirsQuery.php b/legacy/application/models/airtime/om/BaseCcMusicDirsQuery.php
deleted file mode 100644
index 016ba51e0..000000000
--- a/legacy/application/models/airtime/om/BaseCcMusicDirsQuery.php
+++ /dev/null
@@ -1,482 +0,0 @@
-mergeWith($criteria);
- }
-
- return $query;
- }
-
- /**
- * Find object by primary key.
- * Propel uses the instance pool to skip the database if the object exists.
- * Go fast if the query is untouched.
- *
- *
- * $obj = $c->findPk(12, $con);
- *
- *
- * @param mixed $key Primary key to use for the query
- * @param PropelPDO $con an optional connection object
- *
- * @return CcMusicDirs|CcMusicDirs[]|mixed the result, formatted by the current formatter
- */
- public function findPk($key, $con = null)
- {
- if ($key === null) {
- return null;
- }
- if ((null !== ($obj = CcMusicDirsPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
- // the object is already in the instance pool
- return $obj;
- }
- if ($con === null) {
- $con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
- }
- $this->basePreSelect($con);
- if ($this->formatter || $this->modelAlias || $this->with || $this->select
- || $this->selectColumns || $this->asColumns || $this->selectModifiers
- || $this->map || $this->having || $this->joins) {
- return $this->findPkComplex($key, $con);
- } else {
- return $this->findPkSimple($key, $con);
- }
- }
-
- /**
- * Alias of findPk to use instance pooling
- *
- * @param mixed $key Primary key to use for the query
- * @param PropelPDO $con A connection object
- *
- * @return CcMusicDirs A model object, or null if the key is not found
- * @throws PropelException
- */
- public function findOneById($key, $con = null)
- {
- return $this->findPk($key, $con);
- }
-
- /**
- * Find object by primary key using raw SQL to go fast.
- * Bypass doSelect() and the object formatter by using generated code.
- *
- * @param mixed $key Primary key to use for the query
- * @param PropelPDO $con A connection object
- *
- * @return CcMusicDirs A model object, or null if the key is not found
- * @throws PropelException
- */
- protected function findPkSimple($key, $con)
- {
- $sql = 'SELECT "id", "directory", "type", "exists", "watched" FROM "cc_music_dirs" WHERE "id" = :p0';
- try {
- $stmt = $con->prepare($sql);
- $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
- $stmt->execute();
- } catch (Exception $e) {
- Propel::log($e->getMessage(), Propel::LOG_ERR);
- throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
- }
- $obj = null;
- if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
- $obj = new CcMusicDirs();
- $obj->hydrate($row);
- CcMusicDirsPeer::addInstanceToPool($obj, (string) $key);
- }
- $stmt->closeCursor();
-
- return $obj;
- }
-
- /**
- * Find object by primary key.
- *
- * @param mixed $key Primary key to use for the query
- * @param PropelPDO $con A connection object
- *
- * @return CcMusicDirs|CcMusicDirs[]|mixed the result, formatted by the current formatter
- */
- protected function findPkComplex($key, $con)
- {
- // As the query uses a PK condition, no limit(1) is necessary.
- $criteria = $this->isKeepQuery() ? clone $this : $this;
- $stmt = $criteria
- ->filterByPrimaryKey($key)
- ->doSelect($con);
-
- return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
- }
-
- /**
- * Find objects by primary key
- *
- * $objs = $c->findPks(array(12, 56, 832), $con);
- *
- * @param array $keys Primary keys to use for the query
- * @param PropelPDO $con an optional connection object
- *
- * @return PropelObjectCollection|CcMusicDirs[]|mixed the list of results, formatted by the current formatter
- */
- public function findPks($keys, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
- }
- $this->basePreSelect($con);
- $criteria = $this->isKeepQuery() ? clone $this : $this;
- $stmt = $criteria
- ->filterByPrimaryKeys($keys)
- ->doSelect($con);
-
- return $criteria->getFormatter()->init($criteria)->format($stmt);
- }
-
- /**
- * Filter the query by primary key
- *
- * @param mixed $key Primary key to use for the query
- *
- * @return CcMusicDirsQuery The current query, for fluid interface
- */
- public function filterByPrimaryKey($key)
- {
-
- return $this->addUsingAlias(CcMusicDirsPeer::ID, $key, Criteria::EQUAL);
- }
-
- /**
- * Filter the query by a list of primary keys
- *
- * @param array $keys The list of primary key to use for the query
- *
- * @return CcMusicDirsQuery The current query, for fluid interface
- */
- public function filterByPrimaryKeys($keys)
- {
-
- return $this->addUsingAlias(CcMusicDirsPeer::ID, $keys, Criteria::IN);
- }
-
- /**
- * Filter the query on the id column
- *
- * Example usage:
- *
- * $query->filterById(1234); // WHERE id = 1234
- * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
- * $query->filterById(array('min' => 12)); // WHERE id >= 12
- * $query->filterById(array('max' => 12)); // WHERE id <= 12
- *
- *
- * @param mixed $id The value to use as filter.
- * Use scalar values for equality.
- * Use array values for in_array() equivalent.
- * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return CcMusicDirsQuery The current query, for fluid interface
- */
- public function filterById($id = null, $comparison = null)
- {
- if (is_array($id)) {
- $useMinMax = false;
- if (isset($id['min'])) {
- $this->addUsingAlias(CcMusicDirsPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($id['max'])) {
- $this->addUsingAlias(CcMusicDirsPeer::ID, $id['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(CcMusicDirsPeer::ID, $id, $comparison);
- }
-
- /**
- * Filter the query on the directory column
- *
- * Example usage:
- *
- * $query->filterByDirectory('fooValue'); // WHERE directory = 'fooValue'
- * $query->filterByDirectory('%fooValue%'); // WHERE directory LIKE '%fooValue%'
- *
- *
- * @param string $directory The value to use as filter.
- * Accepts wildcards (* and % trigger a LIKE)
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return CcMusicDirsQuery The current query, for fluid interface
- */
- public function filterByDirectory($directory = null, $comparison = null)
- {
- if (null === $comparison) {
- if (is_array($directory)) {
- $comparison = Criteria::IN;
- } elseif (preg_match('/[\%\*]/', $directory)) {
- $directory = str_replace('*', '%', $directory);
- $comparison = Criteria::LIKE;
- }
- }
-
- return $this->addUsingAlias(CcMusicDirsPeer::DIRECTORY, $directory, $comparison);
- }
-
- /**
- * Filter the query on the type column
- *
- * Example usage:
- *
- * $query->filterByType('fooValue'); // WHERE type = 'fooValue'
- * $query->filterByType('%fooValue%'); // WHERE type LIKE '%fooValue%'
- *
- *
- * @param string $type The value to use as filter.
- * Accepts wildcards (* and % trigger a LIKE)
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return CcMusicDirsQuery The current query, for fluid interface
- */
- public function filterByType($type = null, $comparison = null)
- {
- if (null === $comparison) {
- if (is_array($type)) {
- $comparison = Criteria::IN;
- } elseif (preg_match('/[\%\*]/', $type)) {
- $type = str_replace('*', '%', $type);
- $comparison = Criteria::LIKE;
- }
- }
-
- return $this->addUsingAlias(CcMusicDirsPeer::TYPE, $type, $comparison);
- }
-
- /**
- * Filter the query on the exists column
- *
- * Example usage:
- *
- * $query->filterByExists(true); // WHERE exists = true
- * $query->filterByExists('yes'); // WHERE exists = true
- *
- *
- * @param boolean|string $exists The value to use as filter.
- * Non-boolean arguments are converted using the following rules:
- * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
- * * 0, '0', 'false', 'off', and 'no' are converted to boolean false
- * Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return CcMusicDirsQuery The current query, for fluid interface
- */
- public function filterByExists($exists = null, $comparison = null)
- {
- if (is_string($exists)) {
- $exists = in_array(strtolower($exists), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
- }
-
- return $this->addUsingAlias(CcMusicDirsPeer::EXISTS, $exists, $comparison);
- }
-
- /**
- * Filter the query on the watched column
- *
- * Example usage:
- *
- * $query->filterByWatched(true); // WHERE watched = true
- * $query->filterByWatched('yes'); // WHERE watched = true
- *
- *
- * @param boolean|string $watched The value to use as filter.
- * Non-boolean arguments are converted using the following rules:
- * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
- * * 0, '0', 'false', 'off', and 'no' are converted to boolean false
- * Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return CcMusicDirsQuery The current query, for fluid interface
- */
- public function filterByWatched($watched = null, $comparison = null)
- {
- if (is_string($watched)) {
- $watched = in_array(strtolower($watched), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
- }
-
- return $this->addUsingAlias(CcMusicDirsPeer::WATCHED, $watched, $comparison);
- }
-
- /**
- * Filter the query by a related CcFiles object
- *
- * @param CcFiles|PropelObjectCollection $ccFiles the related object to use as filter
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return CcMusicDirsQuery The current query, for fluid interface
- * @throws PropelException - if the provided filter is invalid.
- */
- public function filterByCcFiles($ccFiles, $comparison = null)
- {
- if ($ccFiles instanceof CcFiles) {
- return $this
- ->addUsingAlias(CcMusicDirsPeer::ID, $ccFiles->getDbDirectory(), $comparison);
- } elseif ($ccFiles instanceof PropelObjectCollection) {
- return $this
- ->useCcFilesQuery()
- ->filterByPrimaryKeys($ccFiles->getPrimaryKeys())
- ->endUse();
- } else {
- throw new PropelException('filterByCcFiles() only accepts arguments of type CcFiles or PropelCollection');
- }
- }
-
- /**
- * Adds a JOIN clause to the query using the CcFiles relation
- *
- * @param string $relationAlias optional alias for the relation
- * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
- *
- * @return CcMusicDirsQuery The current query, for fluid interface
- */
- public function joinCcFiles($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
- {
- $tableMap = $this->getTableMap();
- $relationMap = $tableMap->getRelation('CcFiles');
-
- // create a ModelJoin object for this join
- $join = new ModelJoin();
- $join->setJoinType($joinType);
- $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
- if ($previousJoin = $this->getPreviousJoin()) {
- $join->setPreviousJoin($previousJoin);
- }
-
- // add the ModelJoin to the current object
- if ($relationAlias) {
- $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
- $this->addJoinObject($join, $relationAlias);
- } else {
- $this->addJoinObject($join, 'CcFiles');
- }
-
- return $this;
- }
-
- /**
- * Use the CcFiles relation CcFiles object
- *
- * @see useQuery()
- *
- * @param string $relationAlias optional alias for the relation,
- * to be used as main alias in the secondary query
- * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
- *
- * @return CcFilesQuery A secondary query class using the current class as primary query
- */
- public function useCcFilesQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
- {
- return $this
- ->joinCcFiles($relationAlias, $joinType)
- ->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery');
- }
-
- /**
- * Exclude object from result
- *
- * @param CcMusicDirs $ccMusicDirs Object to remove from the list of results
- *
- * @return CcMusicDirsQuery The current query, for fluid interface
- */
- public function prune($ccMusicDirs = null)
- {
- if ($ccMusicDirs) {
- $this->addUsingAlias(CcMusicDirsPeer::ID, $ccMusicDirs->getId(), Criteria::NOT_EQUAL);
- }
-
- return $this;
- }
-
-}
diff --git a/legacy/application/models/airtime/om/BaseCcSubjs.php b/legacy/application/models/airtime/om/BaseCcSubjs.php
index b7d08899b..42046aa66 100644
--- a/legacy/application/models/airtime/om/BaseCcSubjs.php
+++ b/legacy/application/models/airtime/om/BaseCcSubjs.php
@@ -2248,31 +2248,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
return $this;
}
-
- /**
- * If this collection has already been initialized with
- * an identical criteria, it returns the collection.
- * Otherwise if this CcSubjs is new, it will return
- * an empty collection; or if this CcSubjs has previously
- * been saved, it will retrieve related CcFilessRelatedByDbOwnerId from storage.
- *
- * This method is protected by default in order to keep the public
- * api reasonable. You can provide public methods for those you
- * actually need in CcSubjs.
- *
- * @param Criteria $criteria optional Criteria object to narrow the query
- * @param PropelPDO $con optional connection object
- * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
- * @return PropelObjectCollection|CcFiles[] List of CcFiles objects
- */
- public function getCcFilessRelatedByDbOwnerIdJoinCcMusicDirs($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
- {
- $query = CcFilesQuery::create(null, $criteria);
- $query->joinWith('CcMusicDirs', $join_behavior);
-
- return $this->getCcFilessRelatedByDbOwnerId($query, $con);
- }
-
/**
* Clears out the collCcFilessRelatedByDbEditedby collection
*
@@ -2498,31 +2473,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
return $this;
}
-
- /**
- * If this collection has already been initialized with
- * an identical criteria, it returns the collection.
- * Otherwise if this CcSubjs is new, it will return
- * an empty collection; or if this CcSubjs has previously
- * been saved, it will retrieve related CcFilessRelatedByDbEditedby from storage.
- *
- * This method is protected by default in order to keep the public
- * api reasonable. You can provide public methods for those you
- * actually need in CcSubjs.
- *
- * @param Criteria $criteria optional Criteria object to narrow the query
- * @param PropelPDO $con optional connection object
- * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
- * @return PropelObjectCollection|CcFiles[] List of CcFiles objects
- */
- public function getCcFilessRelatedByDbEditedbyJoinCcMusicDirs($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
- {
- $query = CcFilesQuery::create(null, $criteria);
- $query->joinWith('CcMusicDirs', $join_behavior);
-
- return $this->getCcFilessRelatedByDbEditedby($query, $con);
- }
-
/**
* Clears out the collCcPermss collection
*
diff --git a/legacy/application/modules/rest/controllers/ShowImageController.php b/legacy/application/modules/rest/controllers/ShowImageController.php
index 5d714861c..30a046505 100644
--- a/legacy/application/modules/rest/controllers/ShowImageController.php
+++ b/legacy/application/modules/rest/controllers/ShowImageController.php
@@ -165,8 +165,7 @@ class Rest_ShowImageController extends Zend_Rest_Controller
throw new Exception('Bad file extension.');
}
- $storDir = Application_Model_MusicDir::getStorDir();
- $importedStorageDirectory = $storDir->getDirectory() . 'imported/' . $ownerId . '/show-images/' . $showId;
+ $importedStorageDirectory = Config::getStoragePath() . 'imported/' . $ownerId . '/show-images/' . $showId;
try {
$importedStorageDirectory = $this->copyFileToStor($tempFilePath, $importedStorageDirectory, $fileExtension);
@@ -276,8 +275,7 @@ class Rest_ShowImageController extends Zend_Rest_Controller
{
$ownerId = RestAuth::getOwnerId();
- $storDir = Application_Model_MusicDir::getStorDir();
- $importedStorageDirectory = $storDir->getDirectory() . 'imported/' . $ownerId . '/show-images/' . $showId;
+ $importedStorageDirectory = Config::getStoragePath() . 'imported/' . $ownerId . '/show-images/' . $showId;
Logging::info('Deleting images from ' . $importedStorageDirectory);
diff --git a/legacy/application/services/MediaService.php b/legacy/application/services/MediaService.php
index eeac3e7cc..3a4ae0d37 100644
--- a/legacy/application/services/MediaService.php
+++ b/legacy/application/services/MediaService.php
@@ -28,11 +28,7 @@ class Application_Service_MediaService
$CC_CONFIG = Config::getConfig();
$apiKey = $CC_CONFIG['apiKey'][0];
- $importedStorageDirectory = '';
- if ($CC_CONFIG['current_backend'] == 'file') {
- $storDir = Application_Model_MusicDir::getStorDir();
- $importedStorageDirectory = $storDir->getDirectory() . '/imported/' . $ownerId;
- }
+ $importedStorageDirectory = Config::getStoragePath() . '/imported/' . $ownerId;
// Copy the temporary file over to the "organize" folder so that it's off our webserver
// and accessible by libretime-analyzer which could be running on a different machine.
@@ -40,15 +36,14 @@ class Application_Service_MediaService
// Dispatch a message to libretime-analyzer through RabbitMQ,
// notifying it that there's a new upload to process!
- $storageBackend = new ProxyStorageBackend($CC_CONFIG['current_backend']);
Application_Model_RabbitMq::SendMessageToAnalyzer(
$newTempFilePath,
$importedStorageDirectory,
basename($originalFilename),
$callbackUrl,
$apiKey,
- $CC_CONFIG['current_backend'],
- $storageBackend->getFilePrefix()
+ '',
+ '',
);
return $newTempFilePath;
diff --git a/legacy/build/schema.xml b/legacy/build/schema.xml
index 23c99abe0..86cf863e3 100644
--- a/legacy/build/schema.xml
+++ b/legacy/build/schema.xml
@@ -1,22 +1,11 @@
-
-
@@ -87,9 +76,6 @@
-
-
-
diff --git a/legacy/tests/application/helpers/TestHelper.php b/legacy/tests/application/helpers/TestHelper.php
index e47ce4bef..549d65fb9 100644
--- a/legacy/tests/application/helpers/TestHelper.php
+++ b/legacy/tests/application/helpers/TestHelper.php
@@ -49,84 +49,8 @@ class TestHelper
$dbuser = $CC_CONFIG['dsn']['username'];
$dbpasswd = $CC_CONFIG['dsn']['password'];
- $databaseAlreadyExists = AirtimeInstall::createDatabase();
- if ($databaseAlreadyExists) {
- // Truncate all the tables
- $con = Propel::getConnection();
- $sql = "select * from pg_tables where tableowner = '{$dbuser}'";
-
- try {
- $rows = $con->query($sql)->fetchAll();
- } catch (Exception $e) {
- $rows = [];
- }
-
- // Add any tables that shouldn't be cleared here.
- // cc_subjs - Most of Airtime requires an admin account to work, which has id=1,
- // so don't clear it.
- // cc_music_dirs - Has foreign key constraints against cc_files, so we clear cc_files
- // first and clear cc_music_dirs after
- $tablesToNotClear = ['cc_subjs', 'cc_music_dirs'];
-
- $con->beginTransaction();
- foreach ($rows as $row) {
- $tablename = $row['tablename'];
- if (in_array($tablename, $tablesToNotClear)) {
- continue;
- }
- // echo " * Clearing database table $tablename...";
-
- // TRUNCATE is actually slower than DELETE in many cases:
- // http://stackoverflow.com/questions/11419536/postgresql-truncation-speed
- // $sql = "TRUNCATE TABLE $tablename CASCADE";
- $sql = "DELETE FROM {$tablename}";
- AirtimeInstall::InstallQuery($sql, false);
- }
-
- // Now that cc_files is empty, clearing cc_music_dirs should work
- $sql = 'DELETE FROM cc_music_dirs';
- AirtimeInstall::InstallQuery($sql, false);
-
- // Because files are stored relative to their watch directory,
- // we need to set the "stor" path before we can successfully
- // create a fake file in the database.
- // Copy paste from airtime-db-install.php:
- $stor_dir = '/tmp';
- $con = Propel::getConnection();
- $sql = "INSERT INTO cc_music_dirs (directory, type) VALUES ('{$stor_dir}', 'stor')";
-
- try {
- $con->exec($sql);
- } catch (Exception $e) {
- echo " * Failed inserting {$stor_dir} in cc_music_dirs" . PHP_EOL;
- echo " * Message {$e->getMessage()}" . PHP_EOL;
-
- return false;
- }
-
- $con->commit();
-
- // Because we're DELETEing all the rows instead of using TRUNCATE (for speed),
- // we have to reset the sequences so the auto-increment columns (like primary keys)
- // all start at 1 again. This is hacky but it still lets all of this execute fast.
- $sql = "SELECT c.relname FROM pg_class c WHERE c.relkind = 'S'";
-
- try {
- $rows = $con->query($sql)->fetchAll();
- } catch (Exception $e) {
- $rows = [];
- }
- $con->beginTransaction();
- foreach ($rows as $row) {
- $seqrelname = $row['relname'];
- $sql = "ALTER SEQUENCE {$seqrelname} RESTART WITH 1";
- AirtimeInstall::InstallQuery($sql, false);
- }
- $con->commit();
- } else {
- // Create all the database tables
- AirtimeInstall::CreateDatabaseTables($dbuser, $dbpasswd, $dbname, $dbhost, $dbport);
- }
+ AirtimeInstall::createDatabase();
+ AirtimeInstall::CreateDatabaseTables($dbuser, $dbpasswd, $dbname, $dbhost, $dbport);
}
public static function setupZendBootstrap()
diff --git a/legacy/tests/application/models/database/datasets/seed_files.yml b/legacy/tests/application/models/database/datasets/seed_files.yml
index 12e8b287b..053ad0c70 100644
--- a/legacy/tests/application/models/database/datasets/seed_files.yml
+++ b/legacy/tests/application/models/database/datasets/seed_files.yml
@@ -1,15 +1,7 @@
-cc_music_dirs:
- - id: "1"
- directory: "/tmp/libretime-test"
- type: "stor"
- exists: "t"
- watched: "t"
-
cc_files:
- id: "1"
mime: "audio/mp3"
ftype: "audioclip"
- directory: "1"
filepath: "imported/1/oneminute.mp3"
mtime: "2017-08-06 04:27:36"
utime: "2017-08-06 04:26:47"
@@ -31,7 +23,6 @@ cc_files:
- id: "2"
mime: "audio/mp3"
ftype: "audioclip"
- directory: "1"
filepath: "imported/1/fiveminute.mp3"
mtime: "2017-08-06 04:28:36"
utime: "2017-08-06 04:27:47"
@@ -53,7 +44,6 @@ cc_files:
- id: "3"
mime: "audio/mp3"
ftype: "audioclip"
- directory: "1"
filepath: "imported/1/track1.mp3"
mtime: "2017-08-06 04:28:36"
utime: "2017-08-06 04:27:47"
@@ -76,7 +66,6 @@ cc_files:
- id: "4"
mime: "audio/mp3"
ftype: "audioclip"
- directory: "1"
filepath: "imported/1/track2.mp3"
mtime: "2017-08-06 04:28:36"
utime: "2017-08-06 04:27:47"
@@ -99,7 +88,6 @@ cc_files:
- id: "5"
mime: "audio/mp3"
ftype: "audioclip"
- directory: "1"
filepath: "imported/1/track3.mp3"
mtime: "2017-08-06 04:28:36"
utime: "2017-08-06 04:27:47"
@@ -122,7 +110,6 @@ cc_files:
- id: "6"
mime: "audio/mp3"
ftype: "audioclip"
- directory: "1"
filepath: "imported/1/track1-2.mp3"
mtime: "2017-08-06 05:28:36"
utime: "2017-08-16 04:27:47"
@@ -145,7 +132,6 @@ cc_files:
- id: "7"
mime: "audio/mp3"
ftype: "audioclip"
- directory: "1"
filepath: "imported/1/track2-2.mp3"
mtime: "2017-08-06 04:28:36"
utime: "2017-08-06 04:27:47"
diff --git a/legacy/tests/config/config.yml b/legacy/tests/config/config.yml
index 64b6121e8..04130cff0 100644
--- a/legacy/tests/config/config.yml
+++ b/legacy/tests/config/config.yml
@@ -3,9 +3,5 @@ general:
public_url: http://localhost
api_key: H2NRICX6CM8F50CU123C
-database:
- host: localhost
- port: 5432
- name: libretime_test
- user: libretime
- password: libretime
+storage:
+ path: /tmp
diff --git a/shared/libretime_shared/config.py b/shared/libretime_shared/config.py
index 5dd2fefc9..c1a2c6cc3 100644
--- a/shared/libretime_shared/config.py
+++ b/shared/libretime_shared/config.py
@@ -109,6 +109,11 @@ class GeneralConfig(BaseModel):
api_key: str
+# pylint: disable=too-few-public-methods
+class StorageConfig(BaseModel):
+ path: str = "/srv/libretime"
+
+
# pylint: disable=too-few-public-methods
class DatabaseConfig(BaseModel):
host: str = "localhost"