From 79de1ad49170de0ecdd6f7c822447e96cc7d3ae6 Mon Sep 17 00:00:00 2001 From: Josh Perez Date: Thu, 10 Feb 2011 10:52:22 -0500 Subject: [PATCH] initial import, making this open source for anyone to build, setup and contribute. Really old code base :(, last updated on June 6th of 2009 -- many bugs that were fixed are not being included in this commit --- apps/backend/config/app.yml | 2 + apps/backend/config/cache.yml | 4 + apps/backend/config/config.php | 8 + apps/backend/config/factories.yml | 35 + apps/backend/config/filters.yml | 10 + apps/backend/config/i18n.yml | 7 + apps/backend/config/logging.yml | 22 + apps/backend/config/routing.yml | 15 + apps/backend/config/security.yml | 3 + apps/backend/config/settings.yml | 102 ++ apps/backend/config/view.yml | 16 + apps/backend/lib/myUser.class.php | 5 + .../modules/bank/actions/actions.class.php | 13 + .../backend/modules/bank/config/generator.yml | 9 + .../modules/comment/actions/actions.class.php | 18 + .../modules/comment/config/generator.yml | 12 + .../instrument/actions/actions.class.php | 13 + .../modules/instrument/config/generator.yml | 17 + .../modules/tags/actions/actions.class.php | 13 + .../backend/modules/tags/config/generator.yml | 9 + .../modules/user/actions/actions.class.php | 18 + .../backend/modules/user/config/generator.yml | 12 + apps/backend/templates/layout.php | 30 + apps/frontend/config/app.yml | 19 + apps/frontend/config/cache.yml | 4 + apps/frontend/config/config.php | 13 + apps/frontend/config/factories.yml | 35 + apps/frontend/config/filters.yml | 13 + apps/frontend/config/i18n.yml | 7 + apps/frontend/config/logging.yml | 22 + apps/frontend/config/routing.yml | 96 ++ apps/frontend/config/security.yml | 2 + apps/frontend/config/settings.yml | 102 ++ apps/frontend/config/view.yml | 17 + apps/frontend/lib/XML2LSDJ.class.php | 22 + apps/frontend/lib/helper/GlobalHelper.php | 51 + apps/frontend/lib/myUser.class.php | 36 + apps/frontend/lib/universeFilter.class.php | 40 + apps/frontend/lib/validateLogin.class.php | 84 + .../modules/bank/actions/actions.class.php | 87 + .../frontend/modules/bank/config/security.yml | 10 + .../modules/bank/templates/editSuccess.php | 44 + .../modules/bank/templates/listSuccess.php | 24 + .../modules/bank/templates/showSuccess.php | 34 + .../default/templates/disabledSuccess.php | 0 .../default/templates/error404Success.php | 1 + .../default/templates/loginSuccess.php | 2 + .../default/templates/secureSuccess.php | 1 + .../default/templates/unavailableSuccess.php | 0 .../modules/feed/actions/actions.class.php | 93 ++ apps/frontend/modules/feed/config/view.yml | 3 + .../modules/feed/templates/feedSuccess.php | 1 + .../modules/feed/templates/indexSuccess.php | 0 .../instrument/actions/actions.class.php | 394 +++++ .../modules/instrument/config/security.yml | 10 + .../instrument/templates/_FamiTracker.php | 28 + .../modules/instrument/templates/_LSDJ.php | 107 ++ .../instrument/templates/_comments.php | 15 + .../templates/_edit_FamiTracker.php | 19 + .../instrument/templates/_edit_LSDJ.php | 109 ++ .../instrument/templates/_goattracker.php | 0 .../instrument/templates/_instrument_list.php | 7 + .../modules/instrument/templates/_list.php | 15 + .../modules/instrument/templates/_search.php | 4 + .../instrument/templates/editSuccess.php | 68 + .../instrument/templates/exportSuccess.php | 7 + .../instrument/templates/importSuccess.php | 9 + .../instrument/templates/listSuccess.php | 12 + .../instrument/templates/popularSuccess.php | 4 + .../instrument/templates/searchSuccess.php | 19 + .../instrument/templates/showSuccess.php | 90 ++ .../modules/instrument/validate/update.yml | 7 + .../modules/instrument/validate/upload.yml | 19 + .../tag/actions/.actions.class.php.swp | Bin 0 -> 12288 bytes .../modules/tag/actions/actions.class.php | 42 + apps/frontend/modules/tag/config/view.yml | 3 + apps/frontend/modules/tag/templates/_tags.php | 3 + .../modules/tag/templates/indexSuccess.php | 0 .../modules/tag/templates/popularSuccess.php | 7 + .../modules/tag/templates/showSuccess.php | 4 + .../modules/user/actions/actions.class.php | 81 + apps/frontend/modules/user/config/cache.yml | 10 + .../modules/user/templates/_login.php | 34 + .../modules/user/templates/_userHeader.php | 10 + .../modules/user/templates/authorSuccess.php | 15 + .../modules/user/templates/indexSuccess.php | 0 .../modules/user/templates/loginSuccess.php | 6 + .../user/templates/popularAuthorSuccess.php | 7 + .../user/templates/popularUserSuccess.php | 7 + .../modules/user/templates/showSuccess.php | 27 + apps/frontend/modules/user/validate/login.yml | 18 + apps/frontend/templates/layout.php | 64 + batch/load_data.php | 16 + batch/reload-symfony-project.sh | 6 + config/generated-schema-transformed.xml | 2 + config/propel.ini | 43 + config/properties.ini | 2 + config/rsync_exclude.txt | 4 + config/schema.yml | 71 + data/fixtures/test_data.yml | 243 +++ data/lsdj2xml/lsdj2xml.c | 290 ++++ data/lsdj2xml/lview.h | 70 + data/lsdj2xml/xml2lsdj.c | 105 ++ data/psd/header.psd | Bin 0 -> 65941 bytes data/sql/lib.model.schema.sql | 200 +++ data/sql/sqldb.map | 2 + lib/FamiTracker.class.php | 11 + lib/Goattracker.class.php | 19 + lib/LSDJ_Noise.class.php | 35 + lib/LSDJ_Pulse.class.php | 43 + lib/LSDJ_Wave.class.php | 60 + lib/PorterStemmer.class.php | 410 +++++ lib/Tag.class.php | 43 + lib/editInstrument.php | 102 ++ lib/model/Bank.php | 16 + lib/model/BankPeer.php | 12 + lib/model/Comment.php | 12 + lib/model/CommentPeer.php | 12 + lib/model/Instrument.php | 183 +++ lib/model/InstrumentBank.php | 12 + lib/model/InstrumentBankPeer.php | 30 + lib/model/InstrumentPeer.php | 204 +++ lib/model/Search.php | 12 + lib/model/SearchPeer.php | 12 + lib/model/Tags.php | 38 + lib/model/TagsPeer.php | 42 + lib/model/User.php | 22 + lib/model/UserPeer.php | 30 + lib/model/Ware.php | 12 + lib/model/WarePeer.php | 15 + lib/model/map/BankMapBuilder.php | 48 + lib/model/map/CommentMapBuilder.php | 46 + lib/model/map/InstrumentBankMapBuilder.php | 42 + lib/model/map/InstrumentMapBuilder.php | 64 + lib/model/map/SearchMapBuilder.php | 44 + lib/model/map/TagsMapBuilder.php | 46 + lib/model/map/UserMapBuilder.php | 50 + lib/model/map/WareMapBuilder.php | 40 + lib/model/om/BaseBank.php | 736 +++++++++ lib/model/om/BaseBankPeer.php | 824 ++++++++++ lib/model/om/BaseComment.php | 566 +++++++ lib/model/om/BaseCommentPeer.php | 819 ++++++++++ lib/model/om/BaseInstrument.php | 1414 +++++++++++++++++ lib/model/om/BaseInstrumentBank.php | 465 ++++++ lib/model/om/BaseInstrumentBankPeer.php | 809 ++++++++++ lib/model/om/BaseInstrumentPeer.php | 898 +++++++++++ lib/model/om/BaseSearch.php | 456 ++++++ lib/model/om/BaseSearchPeer.php | 539 +++++++ lib/model/om/BaseTags.php | 579 +++++++ lib/model/om/BaseTagsPeer.php | 817 ++++++++++ lib/model/om/BaseUser.php | 1045 ++++++++++++ lib/model/om/BaseUserPeer.php | 392 +++++ lib/model/om/BaseWare.php | 589 +++++++ lib/model/om/BaseWarePeer.php | 367 +++++ lib/myTools.class.php | 204 +++ plugins/.channels/.alias/pear.txt | 1 + plugins/.channels/.alias/pecl.txt | 1 + plugins/.channels/.alias/symfony.txt | 1 + plugins/.channels/__uri.reg | 1 + plugins/.channels/pear.php.net.reg | 1 + .../.channels/pear.symfony-project.com.reg | 1 + plugins/.channels/pecl.php.net.reg | 1 + plugins/.depdb | 1 + plugins/.depdblock | 0 plugins/.filemap | 1 + plugins/.lock | 0 plugins/.pearrc | 2 + .../sffeedplugin.reg | 1 + .../symfony.reg | 3 + plugins/sfFeedPlugin/LICENSE | 7 + plugins/sfFeedPlugin/README | 19 + .../sfFeedPlugin/lib/sfAtom1Feed.class.php | 181 +++ plugins/sfFeedPlugin/lib/sfFeed.class.php | 490 ++++++ .../lib/sfFeedEnclosure.class.php | 56 + plugins/sfFeedPlugin/lib/sfFeedItem.class.php | 144 ++ .../lib/sfRss201rev2Feed.class.php | 78 + plugins/sfFeedPlugin/lib/sfRssFeed.class.php | 47 + .../lib/sfRssUserland091Feed.class.php | 44 + symfony | 0 test/bootstrap/functional.php | 29 + test/bootstrap/unit.php | 17 + test/functional/frontend/bankActionsTest.php | 15 + test/functional/frontend/feedActionsTest.php | 15 + .../frontend/instrumentActionsTest.php | 15 + test/functional/frontend/tagActionsTest.php | 15 + test/functional/frontend/userActionsTest.php | 15 + web/.htaccess | 26 + web/admin.php | 10 + web/backend_dev.php | 10 + web/bin/blank.sav | Bin 0 -> 131072 bytes web/bin/lsdj2xml | Bin 0 -> 11790 bytes web/css/FamiTracker.css | 74 + web/css/LSDJ.css | 21 + web/css/main.css | 423 +++++ web/errors/error500.php | 0 web/errors/unavailable.php | 0 web/frontend_dev.php | 10 + web/images/bg.gif | Bin 0 -> 503 bytes web/images/feed.png | Bin 0 -> 1074 bytes web/images/ft-header.png | Bin 0 -> 3899 bytes web/images/ft.gif | Bin 0 -> 495 bytes web/images/header.png | Bin 0 -> 3356 bytes web/images/indicator.gif | Bin 0 -> 1553 bytes web/index.php | 10 + web/js/FamiTracker.js | 123 ++ web/js/LSDJ.js | 49 + web/js/main.js | 19 + web/js/swfobject.js | 8 + web/js/turbov110.js | 1 + web/robots.txt | 2 + web/swf/player.swf | Bin 0 -> 42566 bytes 211 files changed, 18865 insertions(+) create mode 100644 apps/backend/config/app.yml create mode 100644 apps/backend/config/cache.yml create mode 100644 apps/backend/config/config.php create mode 100644 apps/backend/config/factories.yml create mode 100644 apps/backend/config/filters.yml create mode 100644 apps/backend/config/i18n.yml create mode 100644 apps/backend/config/logging.yml create mode 100644 apps/backend/config/routing.yml create mode 100644 apps/backend/config/security.yml create mode 100644 apps/backend/config/settings.yml create mode 100644 apps/backend/config/view.yml create mode 100644 apps/backend/lib/myUser.class.php create mode 100644 apps/backend/modules/bank/actions/actions.class.php create mode 100644 apps/backend/modules/bank/config/generator.yml create mode 100644 apps/backend/modules/comment/actions/actions.class.php create mode 100644 apps/backend/modules/comment/config/generator.yml create mode 100644 apps/backend/modules/instrument/actions/actions.class.php create mode 100644 apps/backend/modules/instrument/config/generator.yml create mode 100644 apps/backend/modules/tags/actions/actions.class.php create mode 100644 apps/backend/modules/tags/config/generator.yml create mode 100644 apps/backend/modules/user/actions/actions.class.php create mode 100644 apps/backend/modules/user/config/generator.yml create mode 100644 apps/backend/templates/layout.php create mode 100644 apps/frontend/config/app.yml create mode 100644 apps/frontend/config/cache.yml create mode 100644 apps/frontend/config/config.php create mode 100644 apps/frontend/config/factories.yml create mode 100644 apps/frontend/config/filters.yml create mode 100644 apps/frontend/config/i18n.yml create mode 100644 apps/frontend/config/logging.yml create mode 100644 apps/frontend/config/routing.yml create mode 100644 apps/frontend/config/security.yml create mode 100644 apps/frontend/config/settings.yml create mode 100644 apps/frontend/config/view.yml create mode 100644 apps/frontend/lib/XML2LSDJ.class.php create mode 100644 apps/frontend/lib/helper/GlobalHelper.php create mode 100644 apps/frontend/lib/myUser.class.php create mode 100644 apps/frontend/lib/universeFilter.class.php create mode 100644 apps/frontend/lib/validateLogin.class.php create mode 100644 apps/frontend/modules/bank/actions/actions.class.php create mode 100644 apps/frontend/modules/bank/config/security.yml create mode 100644 apps/frontend/modules/bank/templates/editSuccess.php create mode 100644 apps/frontend/modules/bank/templates/listSuccess.php create mode 100644 apps/frontend/modules/bank/templates/showSuccess.php create mode 100644 apps/frontend/modules/default/templates/disabledSuccess.php create mode 100644 apps/frontend/modules/default/templates/error404Success.php create mode 100644 apps/frontend/modules/default/templates/loginSuccess.php create mode 100644 apps/frontend/modules/default/templates/secureSuccess.php create mode 100644 apps/frontend/modules/default/templates/unavailableSuccess.php create mode 100644 apps/frontend/modules/feed/actions/actions.class.php create mode 100644 apps/frontend/modules/feed/config/view.yml create mode 100644 apps/frontend/modules/feed/templates/feedSuccess.php create mode 100644 apps/frontend/modules/feed/templates/indexSuccess.php create mode 100644 apps/frontend/modules/instrument/actions/actions.class.php create mode 100644 apps/frontend/modules/instrument/config/security.yml create mode 100644 apps/frontend/modules/instrument/templates/_FamiTracker.php create mode 100644 apps/frontend/modules/instrument/templates/_LSDJ.php create mode 100644 apps/frontend/modules/instrument/templates/_comments.php create mode 100644 apps/frontend/modules/instrument/templates/_edit_FamiTracker.php create mode 100644 apps/frontend/modules/instrument/templates/_edit_LSDJ.php create mode 100644 apps/frontend/modules/instrument/templates/_goattracker.php create mode 100644 apps/frontend/modules/instrument/templates/_instrument_list.php create mode 100644 apps/frontend/modules/instrument/templates/_list.php create mode 100644 apps/frontend/modules/instrument/templates/_search.php create mode 100644 apps/frontend/modules/instrument/templates/editSuccess.php create mode 100644 apps/frontend/modules/instrument/templates/exportSuccess.php create mode 100644 apps/frontend/modules/instrument/templates/importSuccess.php create mode 100644 apps/frontend/modules/instrument/templates/listSuccess.php create mode 100644 apps/frontend/modules/instrument/templates/popularSuccess.php create mode 100644 apps/frontend/modules/instrument/templates/searchSuccess.php create mode 100644 apps/frontend/modules/instrument/templates/showSuccess.php create mode 100644 apps/frontend/modules/instrument/validate/update.yml create mode 100644 apps/frontend/modules/instrument/validate/upload.yml create mode 100644 apps/frontend/modules/tag/actions/.actions.class.php.swp create mode 100644 apps/frontend/modules/tag/actions/actions.class.php create mode 100644 apps/frontend/modules/tag/config/view.yml create mode 100644 apps/frontend/modules/tag/templates/_tags.php create mode 100644 apps/frontend/modules/tag/templates/indexSuccess.php create mode 100644 apps/frontend/modules/tag/templates/popularSuccess.php create mode 100644 apps/frontend/modules/tag/templates/showSuccess.php create mode 100644 apps/frontend/modules/user/actions/actions.class.php create mode 100644 apps/frontend/modules/user/config/cache.yml create mode 100644 apps/frontend/modules/user/templates/_login.php create mode 100644 apps/frontend/modules/user/templates/_userHeader.php create mode 100644 apps/frontend/modules/user/templates/authorSuccess.php create mode 100644 apps/frontend/modules/user/templates/indexSuccess.php create mode 100644 apps/frontend/modules/user/templates/loginSuccess.php create mode 100644 apps/frontend/modules/user/templates/popularAuthorSuccess.php create mode 100644 apps/frontend/modules/user/templates/popularUserSuccess.php create mode 100644 apps/frontend/modules/user/templates/showSuccess.php create mode 100644 apps/frontend/modules/user/validate/login.yml create mode 100644 apps/frontend/templates/layout.php create mode 100644 batch/load_data.php create mode 100755 batch/reload-symfony-project.sh create mode 100644 config/generated-schema-transformed.xml create mode 100644 config/propel.ini create mode 100644 config/properties.ini create mode 100644 config/rsync_exclude.txt create mode 100644 config/schema.yml create mode 100644 data/fixtures/test_data.yml create mode 100644 data/lsdj2xml/lsdj2xml.c create mode 100644 data/lsdj2xml/lview.h create mode 100644 data/lsdj2xml/xml2lsdj.c create mode 100644 data/psd/header.psd create mode 100644 data/sql/lib.model.schema.sql create mode 100644 data/sql/sqldb.map create mode 100644 lib/FamiTracker.class.php create mode 100644 lib/Goattracker.class.php create mode 100644 lib/LSDJ_Noise.class.php create mode 100644 lib/LSDJ_Pulse.class.php create mode 100644 lib/LSDJ_Wave.class.php create mode 100644 lib/PorterStemmer.class.php create mode 100644 lib/Tag.class.php create mode 100644 lib/editInstrument.php create mode 100644 lib/model/Bank.php create mode 100644 lib/model/BankPeer.php create mode 100644 lib/model/Comment.php create mode 100644 lib/model/CommentPeer.php create mode 100644 lib/model/Instrument.php create mode 100644 lib/model/InstrumentBank.php create mode 100644 lib/model/InstrumentBankPeer.php create mode 100644 lib/model/InstrumentPeer.php create mode 100644 lib/model/Search.php create mode 100644 lib/model/SearchPeer.php create mode 100644 lib/model/Tags.php create mode 100644 lib/model/TagsPeer.php create mode 100644 lib/model/User.php create mode 100644 lib/model/UserPeer.php create mode 100644 lib/model/Ware.php create mode 100644 lib/model/WarePeer.php create mode 100644 lib/model/map/BankMapBuilder.php create mode 100644 lib/model/map/CommentMapBuilder.php create mode 100644 lib/model/map/InstrumentBankMapBuilder.php create mode 100644 lib/model/map/InstrumentMapBuilder.php create mode 100644 lib/model/map/SearchMapBuilder.php create mode 100644 lib/model/map/TagsMapBuilder.php create mode 100644 lib/model/map/UserMapBuilder.php create mode 100644 lib/model/map/WareMapBuilder.php create mode 100644 lib/model/om/BaseBank.php create mode 100644 lib/model/om/BaseBankPeer.php create mode 100644 lib/model/om/BaseComment.php create mode 100644 lib/model/om/BaseCommentPeer.php create mode 100644 lib/model/om/BaseInstrument.php create mode 100644 lib/model/om/BaseInstrumentBank.php create mode 100644 lib/model/om/BaseInstrumentBankPeer.php create mode 100644 lib/model/om/BaseInstrumentPeer.php create mode 100644 lib/model/om/BaseSearch.php create mode 100644 lib/model/om/BaseSearchPeer.php create mode 100644 lib/model/om/BaseTags.php create mode 100644 lib/model/om/BaseTagsPeer.php create mode 100644 lib/model/om/BaseUser.php create mode 100644 lib/model/om/BaseUserPeer.php create mode 100644 lib/model/om/BaseWare.php create mode 100644 lib/model/om/BaseWarePeer.php create mode 100644 lib/myTools.class.php create mode 100644 plugins/.channels/.alias/pear.txt create mode 100644 plugins/.channels/.alias/pecl.txt create mode 100644 plugins/.channels/.alias/symfony.txt create mode 100644 plugins/.channels/__uri.reg create mode 100644 plugins/.channels/pear.php.net.reg create mode 100644 plugins/.channels/pear.symfony-project.com.reg create mode 100644 plugins/.channels/pecl.php.net.reg create mode 100644 plugins/.depdb create mode 100644 plugins/.depdblock create mode 100644 plugins/.filemap create mode 100644 plugins/.lock create mode 100644 plugins/.pearrc create mode 100644 plugins/.registry/.channel.pear.symfony-project.com/sffeedplugin.reg create mode 100644 plugins/.registry/.channel.pear.symfony-project.com/symfony.reg create mode 100644 plugins/sfFeedPlugin/LICENSE create mode 100644 plugins/sfFeedPlugin/README create mode 100644 plugins/sfFeedPlugin/lib/sfAtom1Feed.class.php create mode 100644 plugins/sfFeedPlugin/lib/sfFeed.class.php create mode 100644 plugins/sfFeedPlugin/lib/sfFeedEnclosure.class.php create mode 100644 plugins/sfFeedPlugin/lib/sfFeedItem.class.php create mode 100644 plugins/sfFeedPlugin/lib/sfRss201rev2Feed.class.php create mode 100644 plugins/sfFeedPlugin/lib/sfRssFeed.class.php create mode 100644 plugins/sfFeedPlugin/lib/sfRssUserland091Feed.class.php create mode 100755 symfony create mode 100644 test/bootstrap/functional.php create mode 100644 test/bootstrap/unit.php create mode 100644 test/functional/frontend/bankActionsTest.php create mode 100644 test/functional/frontend/feedActionsTest.php create mode 100644 test/functional/frontend/instrumentActionsTest.php create mode 100644 test/functional/frontend/tagActionsTest.php create mode 100644 test/functional/frontend/userActionsTest.php create mode 100644 web/.htaccess create mode 100644 web/admin.php create mode 100644 web/backend_dev.php create mode 100644 web/bin/blank.sav create mode 100755 web/bin/lsdj2xml create mode 100644 web/css/FamiTracker.css create mode 100644 web/css/LSDJ.css create mode 100644 web/css/main.css create mode 100644 web/errors/error500.php create mode 100644 web/errors/unavailable.php create mode 100644 web/frontend_dev.php create mode 100644 web/images/bg.gif create mode 100644 web/images/feed.png create mode 100644 web/images/ft-header.png create mode 100644 web/images/ft.gif create mode 100644 web/images/header.png create mode 100644 web/images/indicator.gif create mode 100644 web/index.php create mode 100644 web/js/FamiTracker.js create mode 100644 web/js/LSDJ.js create mode 100644 web/js/main.js create mode 100644 web/js/swfobject.js create mode 100644 web/js/turbov110.js create mode 100644 web/robots.txt create mode 100644 web/swf/player.swf diff --git a/apps/backend/config/app.yml b/apps/backend/config/app.yml new file mode 100644 index 0000000..1899f5f --- /dev/null +++ b/apps/backend/config/app.yml @@ -0,0 +1,2 @@ +# default values +#all: diff --git a/apps/backend/config/cache.yml b/apps/backend/config/cache.yml new file mode 100644 index 0000000..9a80ccb --- /dev/null +++ b/apps/backend/config/cache.yml @@ -0,0 +1,4 @@ +default: + enabled: off + with_layout: false + lifetime: 86400 diff --git a/apps/backend/config/config.php b/apps/backend/config/config.php new file mode 100644 index 0000000..4038d49 --- /dev/null +++ b/apps/backend/config/config.php @@ -0,0 +1,8 @@ + + web_debug: on + cache: off + no_script_name: off + etag: off + +test: + .settings: + error_reporting: + cache: off + web_debug: off + no_script_name: off + etag: off + +#all: +# .actions: +# default_module: default # Default module and action to be called when +# default_action: index # A routing rule doesn't set it +# +# error_404_module: default # To be called when a 404 error is raised +# error_404_action: error404 # Or when the requested URL doesn't match any route +# +# login_module: default # To be called when a non-authenticated user +# login_action: login # Tries to access a secure page +# +# secure_module: default # To be called when a user doesn't have +# secure_action: secure # The credentials required for an action +# +# module_disabled_module: default # To be called when a user requests +# module_disabled_action: disabled # A module disabled in the module.yml +# +# unavailable_module: default # To be called when a user requests a page +# unavailable_action: unavailable # From an application disabled via the available setting below +# +# .settings: +# available: on # Enable the whole application. Switch to off to redirect all requests to the unavailable module and action. +# +# # Optional features. Deactivating unused features boots performance a bit. +# use_database: on # Enable database manager. Set to off if you don't use a database. +# use_security: on # Enable security features (login and credentials). Set to off for public applications. +# use_flash: on # Enable flash parameter feature. Set to off if you never use the set_flash() method in actions. +# i18n: off # Enable interface translation. Set to off if your application should not be translated. +# check_symfony_version: off # Enable check of symfony version for every request. Set to on to have symfony clear the cache automatically when the framework is upgraded. Set to off if you always clear the cache after an upgrade. +# use_process_cache: on # Enable symfony optimizations based on PHP accelerators. Set to off for tests or when you have enabled a PHP accelerator in your server but don't want symfony to use it internally. +# compressed: off # Enable PHP response compression. Set to on to compress the outgoing HTML via the PHP handler. +# check_lock: off # Enable the application lock system triggered by the clear-cache task. Set to on to have all requests redirected to the $sf_symfony_data_dir/web/arrors/unavailable.php page during the clear-cache process. +# +# # Output escaping settings +# escaping_strategy: bc # Determines how variables are made available to templates. Accepted values: bc, both, on, off. The value off deactivates escaping completely and gives a slight boost. +# escaping_method: ESC_ENTITIES # Function or helper used for escaping. Accepted values: ESC_RAW, ESC_ENTITIES, ESC_JS, ESC_JS_NO_ENTITIES. +# +# # Routing settings +# relative_url_root: # Default URL prefix. Use this when your symfony project is installed in a sub directory of the apache document root. +# suffix: . # Default suffix for generated URLs. If set to a single dot (.), no suffix is added. Possible values: .html, .php, and so on. +# no_script_name: off # Enable the front controller name in generated URLs +# +# # Validation settings, used for error generation by the Validation helper +# validation_error_prefix: ' ↓ ' +# validation_error_suffix: '  ↓' +# validation_error_class: form_error +# validation_error_id_prefix: error_for_ +# +# # Cache settings +# cache: off # Enable the template cache +# etag: on # Enable etag handling +# +# # Logging and debugging settings +# web_debug: off # Enable the web debug toolbar +# error_reporting: # Determines which events are logged. The default value is E_PARSE | E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR | E_USER_ERROR = 341 +# +# # Assets paths +# rich_text_js_dir: js/tiny_mce +# prototype_web_dir: /sf/prototype +# admin_web_dir: /sf/sf_admin +# web_debug_web_dir: /sf/sf_web_debug +# +# # Helpers included in all templates by default +# standard_helpers: [Partial, Cache, Form] +# +# # Activated modules from plugins or from the symfony core +# enabled_modules: [default] +# +# # Charset used for the response +# charset: utf-8 +# +# # Miscellaneous +# strip_comments: on # Remove comments in core framework classes as defined in the core_compile.yml +# autoloading_functions: ~ # Functions called when a class is requested and this it is not already loaded. Expects an array of callables. Used by the framework bridges. +# timeout: 1800 # Session timeout, in seconds +# max_forwards: 5 +# path_info_array: SERVER +# path_info_key: PATH_INFO +# url_format: PATH +# +# # ORM +# orm: propel diff --git a/apps/backend/config/view.yml b/apps/backend/config/view.yml new file mode 100644 index 0000000..b6b72f9 --- /dev/null +++ b/apps/backend/config/view.yml @@ -0,0 +1,16 @@ +default: + http_metas: + content-type: text/html + + metas: + title: LSDJ Patch Book - Admin Panel + robots: index, nofollow + keywords: lsdj + language: en + + stylesheets: [main] + + javascripts: [] + + has_layout: on + layout: layout diff --git a/apps/backend/lib/myUser.class.php b/apps/backend/lib/myUser.class.php new file mode 100644 index 0000000..4c79302 --- /dev/null +++ b/apps/backend/lib/myUser.class.php @@ -0,0 +1,5 @@ +forward404Unless(false); +} + +} diff --git a/apps/backend/modules/comment/config/generator.yml b/apps/backend/modules/comment/config/generator.yml new file mode 100644 index 0000000..1354416 --- /dev/null +++ b/apps/backend/modules/comment/config/generator.yml @@ -0,0 +1,12 @@ +generator: + class: sfPropelAdminGenerator + param: + model_class: Comment + theme: default + list: + display: [instrument, author, comment, created_at] + object_actions: + _delete: ~ + + edit: + display: [] diff --git a/apps/backend/modules/instrument/actions/actions.class.php b/apps/backend/modules/instrument/actions/actions.class.php new file mode 100644 index 0000000..c0a308f --- /dev/null +++ b/apps/backend/modules/instrument/actions/actions.class.php @@ -0,0 +1,13 @@ +forward404Unless(false); +} + +} diff --git a/apps/backend/modules/user/config/generator.yml b/apps/backend/modules/user/config/generator.yml new file mode 100644 index 0000000..adbde34 --- /dev/null +++ b/apps/backend/modules/user/config/generator.yml @@ -0,0 +1,12 @@ +generator: + class: sfPropelAdminGenerator + param: + model_class: User + theme: default + + list: + display: [username, realname, location, is_admin] + object_actions: + _delete: ~ + fields: + realname: { name: Name } diff --git a/apps/backend/templates/layout.php b/apps/backend/templates/layout.php new file mode 100644 index 0000000..85c6dc3 --- /dev/null +++ b/apps/backend/templates/layout.php @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + +
+ + +getRaw('sf_content') ?> +
+ + diff --git a/apps/frontend/config/app.yml b/apps/frontend/config/app.yml new file mode 100644 index 0000000..e283918 --- /dev/null +++ b/apps/frontend/config/app.yml @@ -0,0 +1,19 @@ +all: + maintenance: off + universe: on + #tag: lsdj + pager: + homepage_max: 10 + feed: + max: 10 + tag: + cloud_max: 40 + search: + tag_weight: 1 + desc_weight: 2 + title_weight: 5 + results_max: 10 + upload: + dir: samples + .settings: + timeout: false diff --git a/apps/frontend/config/cache.yml b/apps/frontend/config/cache.yml new file mode 100644 index 0000000..9a80ccb --- /dev/null +++ b/apps/frontend/config/cache.yml @@ -0,0 +1,4 @@ +default: + enabled: off + with_layout: false + lifetime: 86400 diff --git a/apps/frontend/config/config.php b/apps/frontend/config/config.php new file mode 100644 index 0000000..3d3f638 --- /dev/null +++ b/apps/frontend/config/config.php @@ -0,0 +1,13 @@ + $sf_upload_dir_name = 'samples', + 'sf_upload_dir' => sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.sfConfig::get('sf_web_dir_name').DIRECTORY_SEPARATOR.$sf_upload_dir_name, +)); diff --git a/apps/frontend/config/factories.yml b/apps/frontend/config/factories.yml new file mode 100644 index 0000000..2af1c2e --- /dev/null +++ b/apps/frontend/config/factories.yml @@ -0,0 +1,35 @@ +cli: + controller: + class: sfConsoleController + request: + class: sfConsoleRequest + response: + class: sfConsoleResponse + +test: + storage: + class: sfSessionTestStorage + +all: +# controller: +# class: sfFrontWebController +# +# request: +# class: sfWebRequest +# +# response: +# class: sfWebResponse +# +# user: +# class: myUser +# + storage: + class: sfSessionStorage + param: + session_name: lsdjie +# +# view_cache: +# class: sfFileCache +# param: +# automaticCleaningFactor: 0 +# cacheDir: %SF_TEMPLATE_CACHE_DIR% diff --git a/apps/frontend/config/filters.yml b/apps/frontend/config/filters.yml new file mode 100644 index 0000000..206d7fe --- /dev/null +++ b/apps/frontend/config/filters.yml @@ -0,0 +1,13 @@ +rendering: ~ +web_debug: ~ +security: ~ + +universeFilter: + class: universeFilter + param: + host_exclude_regex: /^(www|2x26)/ + +cache: ~ +common: ~ +flash: ~ +execution: ~ diff --git a/apps/frontend/config/i18n.yml b/apps/frontend/config/i18n.yml new file mode 100644 index 0000000..a3b0f2f --- /dev/null +++ b/apps/frontend/config/i18n.yml @@ -0,0 +1,7 @@ +#all: +# default_culture: en +# source: XLIFF +# debug: off +# cache: on +# untranslated_prefix: "[T]" +# untranslated_suffix: "[/T]" diff --git a/apps/frontend/config/logging.yml b/apps/frontend/config/logging.yml new file mode 100644 index 0000000..13a4956 --- /dev/null +++ b/apps/frontend/config/logging.yml @@ -0,0 +1,22 @@ +prod: + enabled: off + level: err + rotate: on + purge: off + +all: + enabled: on + level: debug + rotate: on + period: 7 + history: 10 + purge: on +# loggers: +# sf_web_debug: +# class: sfWebDebugLogger +# param: +# condition: %SF_WEB_DEBUG% +# sf_file_debug: +# class: sfFileLogger +# param: +# file: %SF_LOG_DIR%/%SF_APP%_%SF_ENVIRONMENT%.log diff --git a/apps/frontend/config/routing.yml b/apps/frontend/config/routing.yml new file mode 100644 index 0000000..7cfdb29 --- /dev/null +++ b/apps/frontend/config/routing.yml @@ -0,0 +1,96 @@ +# default rules + +instrument: + url: /patch/:author/:name + param: { module: instrument, action: show } + +bank: + url: /bank/id/:id + param: { module: bank, action: show } + +instrumentFeed: + url: /patch/:authorStrip/:stripped + param: { module: instrument, action: show } + +homepage: + url: / + param: { module: instrument, action: list } + +feed_popular: + url: /feed/top + param: { module: feed, action: popular } + +search: + url: /search/* + param: { module: instrument, action: search } + +type: + url: /type/:type/:page + param: { module: instrument, action: type } + +tag: + url: /tag/:tag/:page + param: { module: tag, action: show, page: 1 } + +tag_add: + url: /tag_add + param: { module: tag, action: add } + +iLike: + url: /iLikeThisVeryMuch + param: { module: instrument, action: iLike } + +comment_add: + url: /comment_add + param: { module: instrument, action: postComment } + +popular_tags: + url: /tag_cloud + param: { module: tag, action: popular } + +login: + url: /login + param: { module: user, action: login } + +author: + url: /author/:author + param: { module: user, action: author } + +user: + url: /user/:username + param: { module: user, action: show } + +logout: + url: /logout + param: { module: user, action: logout } + +pagination: + url: /page/:page + param: { module: instrument, action: list, page: 1 } + +search_instrument: + url: /search/* + param: { module: instrument, action: search } + +top_authors: + url: /top/authors/ + param: { module: user, action: popularAuthor } + +top_users: + url: /top/users/ + param: { module: user, action: popularUser } + +popular: + url: /top/instruments/:page + param: { module: instrument, action: popular, page: 1 } + +default_symfony: + url: /symfony/:action/* + param: { module: default } + +default_index: + url: /:module + param: { action: index } + +default: + url: /:module/:action/* diff --git a/apps/frontend/config/security.yml b/apps/frontend/config/security.yml new file mode 100644 index 0000000..225dd93 --- /dev/null +++ b/apps/frontend/config/security.yml @@ -0,0 +1,2 @@ +default: + is_secure: off diff --git a/apps/frontend/config/settings.yml b/apps/frontend/config/settings.yml new file mode 100644 index 0000000..d5dd0de --- /dev/null +++ b/apps/frontend/config/settings.yml @@ -0,0 +1,102 @@ +prod: + .settings: + no_script_name: on + +dev: + .settings: + error_reporting: + web_debug: on + cache: off + no_script_name: off + etag: off + +test: + .settings: + error_reporting: + cache: off + web_debug: off + no_script_name: off + etag: off + +all: +# .actions: +# default_module: default # Default module and action to be called when +# default_action: index # A routing rule doesn't set it +# +# error_404_module: errors # To be called when a 404 error is raised +# error_404_action: error404 # Or when the requested URL doesn't match any route +# +# login_module: default # To be called when a non-authenticated user +# login_action: login # Tries to access a secure page +# +# secure_module: default # To be called when a user doesn't have +# secure_action: secure # The credentials required for an action +# +# module_disabled_module: default # To be called when a user requests +# module_disabled_action: disabled # A module disabled in the module.yml +# +# unavailable_module: default # To be called when a user requests a page +# unavailable_action: unavailable # From an application disabled via the available setting below +# + .settings: + available: on # Enable the whole application. Switch to off to redirect all requests to the unavailable module and action. +# +# # Optional features. Deactivating unused features boots performance a bit. +# use_database: on # Enable database manager. Set to off if you don't use a database. +# use_security: on # Enable security features (login and credentials). Set to off for public applications. +# use_flash: on # Enable flash parameter feature. Set to off if you never use the set_flash() method in actions. +# i18n: off # Enable interface translation. Set to off if your application should not be translated. +# check_symfony_version: off # Enable check of symfony version for every request. Set to on to have symfony clear the cache automatically when the framework is upgraded. Set to off if you always clear the cache after an upgrade. +# use_process_cache: on # Enable symfony optimizations based on PHP accelerators. Set to off for tests or when you have enabled a PHP accelerator in your server but don't want symfony to use it internally. +# compressed: off # Enable PHP response compression. Set to on to compress the outgoing HTML via the PHP handler. +# check_lock: off # Enable the application lock system triggered by the clear-cache task. Set to on to have all requests redirected to the $sf_symfony_data_dir/web/arrors/unavailable.php page during the clear-cache process. +# +# # Output escaping settings +# escaping_strategy: bc # Determines how variables are made available to templates. Accepted values: bc, both, on, off. The value off deactivates escaping completely and gives a slight boost. +# escaping_method: ESC_ENTITIES # Function or helper used for escaping. Accepted values: ESC_RAW, ESC_ENTITIES, ESC_JS, ESC_JS_NO_ENTITIES. +# +# # Routing settings +# relative_url_root: # Default URL prefix. Use this when your symfony project is installed in a sub directory of the apache document root. +# suffix: . # Default suffix for generated URLs. If set to a single dot (.), no suffix is added. Possible values: .html, .php, and so on. +# no_script_name: off # Enable the front controller name in generated URLs +# +# # Validation settings, used for error generation by the Validation helper +# validation_error_prefix: ' ↓ ' +# validation_error_suffix: '  ↓' +# validation_error_class: form_error +# validation_error_id_prefix: error_for_ +# +# # Cache settings +# cache: off # Enable the template cache +# etag: on # Enable etag handling +# +# # Logging and debugging settings +# web_debug: off # Enable the web debug toolbar +# error_reporting: # Determines which events are logged. The default value is E_PARSE | E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR | E_USER_ERROR = 341 +# +# # Assets paths +# rich_text_js_dir: js/tiny_mce +# prototype_web_dir: /sf/prototype +# admin_web_dir: /sf/sf_admin +# web_debug_web_dir: /sf/sf_web_debug +# +# # Helpers included in all templates by default +# standard_helpers: [Partial, Cache, Form] +# +# # Activated modules from plugins or from the symfony core +# enabled_modules: [default] +# +# # Charset used for the response +# charset: utf-8 +# +# # Miscellaneous +# strip_comments: on # Remove comments in core framework classes as defined in the core_compile.yml +# autoloading_functions: ~ # Functions called when a class is requested and this it is not already loaded. Expects an array of callables. Used by the framework bridges. + timeout: 2246400 # Session timeout, in seconds +# max_forwards: 5 +# path_info_array: SERVER +# path_info_key: PATH_INFO +# url_format: PATH +# +# # ORM +# orm: propel diff --git a/apps/frontend/config/view.yml b/apps/frontend/config/view.yml new file mode 100644 index 0000000..6b8508e --- /dev/null +++ b/apps/frontend/config/view.yml @@ -0,0 +1,17 @@ +default: + http_metas: + content-type: text/html + + metas: + title: Chip Patch Book + robots: index, follow + description: Chip music patch cookbook website. Find instrument patches for various 8-bit related software. + keywords: lsdj, 8-bit, chipmusic, chiptune + language: en + + stylesheets: [main] + + javascripts: [main, turbov110] + + has_layout: on + layout: layout diff --git a/apps/frontend/lib/XML2LSDJ.class.php b/apps/frontend/lib/XML2LSDJ.class.php new file mode 100644 index 0000000..2e46843 --- /dev/null +++ b/apps/frontend/lib/XML2LSDJ.class.php @@ -0,0 +1,22 @@ + diff --git a/apps/frontend/lib/helper/GlobalHelper.php b/apps/frontend/lib/helper/GlobalHelper.php new file mode 100644 index 0000000..98d9326 --- /dev/null +++ b/apps/frontend/lib/helper/GlobalHelper.php @@ -0,0 +1,51 @@ + 'text', 'name' => $name, 'id' => get_id_from_name($name, $value), 'value' => $value, 'onfocus' => 'this.title=this.value', 'onblur' => 'this.value=hex_check(this)'), _convert_options($options))); +} + +function hex1input_tag($name, $value = null, $options = array()) { // validates all special ones. + return tag('input', array_merge(array('type' => 'text', 'name' => $name, 'id' => get_id_from_name($name, $value), 'value' => $value, 'onfocus' => 'this.title=this.value', 'onblur' => 'this.value=special_hex_check(this)'), _convert_options($options))); +} + +function link_to_feed($name, $uri) +{ + return link_to(image_tag('feed.png', array('alt' => 'RSS', 'title' => $name, 'align' => 'absmiddle')), $uri); +} + +function pager_navigation($pager, $uri) +{ + $navigation = ''; + + if ($pager->haveToPaginate()) + { + $uri .= (preg_match('/\?/', $uri) ? '&' : '?').'page='; + + // First and previous page + if ($pager->getPage() != 1) + { + $navigation .= link_to('«', '?page=1')." "; + $navigation .= link_to('<', $uri.$pager->getPreviousPage()) . " "; + + } + + // Pages one by one + $links = array(); + foreach ($pager->getLinks() as $page) + { + $links[] = link_to_unless($page == $pager->getPage(), $page, $uri.$page); + } + $navigation .= join('  ', $links); + + // Next and last page + if ($pager->getPage() != $pager->getCurrentMaxLink()) + { + $navigation .= " ". link_to('»', $uri.$pager->getLastPage()); + $navigation .= " ". link_to('>', $uri.$pager->getNextPage()); + + } + + } + + return $navigation; +} diff --git a/apps/frontend/lib/myUser.class.php b/apps/frontend/lib/myUser.class.php new file mode 100644 index 0000000..5ca2e95 --- /dev/null +++ b/apps/frontend/lib/myUser.class.php @@ -0,0 +1,36 @@ +setAttribute('subscriber_id', $user->getUsername(), 'subscriber'); + $this->setAuthenticated(true); + $this->addCredential('subscriber'); + if ($user->getIsAdmin()) $this->addCredential('admin'); + $this->setAttribute('username', $user->getUsername(), 'subscriber'); +} + +public function signOut() +{ + $this->getAttributeHolder()->removeNamespace('subscriber'); + $this->getAttributeHolder()->removeNamespace('admin'); + + $this->setAuthenticated(false); + $this->clearCredentials(); +} +public function getSubscriberId() +{ + return $this->getAttribute('subscriber_id', '', 'subscriber'); +} + +public function getSubscriber() +{ + return UserPeer::retrieveByPk($this->getSubscriberId()); +} + +public function getUsername() +{ + return $this->getAttribute('username', '', 'subscriber'); +} +} diff --git a/apps/frontend/lib/universeFilter.class.php b/apps/frontend/lib/universeFilter.class.php new file mode 100644 index 0000000..be1e141 --- /dev/null +++ b/apps/frontend/lib/universeFilter.class.php @@ -0,0 +1,40 @@ +isFirstCall()) { + die("The Patch Book is currently undergoing maintenance. Please check back at a later time."); + } + // execute this filter only once + if (sfConfig::get('app_universe') && $this->isFirstCall()) + { + // is there a tag in the hostname? + $hostname = $this->getContext()->getRequest()->getHost(); + if (!preg_match($this->getParameter('host_exclude_regex'), $hostname) && $pos = strpos($hostname, '.')) + { + $tag = Tag::normalize(substr($hostname, 0, $pos)); + + // add a permanent tag custom configuration parameter + if ($tag == "lsdj") $tag = "LSDJ"; + else if ($tag == "famitracker" || $tag == "ft") $tag = "FamiTracker"; + else if ($tag == "goattracker") $tag = "goattracker"; + + sfConfig::set('app_tag', $tag); + + // add a custom stylesheet/javascript + $this->getContext()->getResponse()->addStylesheet($tag); + $this->getContext()->getResponse()->addJavascript($tag); + } + } + + // execute next filter + $filterChain->execute(); + } +} + +?> diff --git a/apps/frontend/lib/validateLogin.class.php b/apps/frontend/lib/validateLogin.class.php new file mode 100644 index 0000000..bd0f4da --- /dev/null +++ b/apps/frontend/lib/validateLogin.class.php @@ -0,0 +1,84 @@ +setParameter('login_error', 'Invalid input'); + + $this->getParameterHolder()->add($parameters); + + return true; + } + + public function execute(&$value, &$error) + { + $password_param = $this->getParameter('password'); + $password = $this->getContext()->getRequest()->getParameter($password_param); + + $login = $value; + + // anonymous is not a real user + if ($login == 'anonymous') + { + $error = $this->getParameter('login_error'); + return false; + } + + // + + $error = $this->getParameter('login_error'); + return false; + } +} diff --git a/apps/frontend/modules/bank/actions/actions.class.php b/apps/frontend/modules/bank/actions/actions.class.php new file mode 100644 index 0000000..cda3407 --- /dev/null +++ b/apps/frontend/modules/bank/actions/actions.class.php @@ -0,0 +1,87 @@ + +forward('bank', 'list'); + } + + public function executeList() + { + $this->banks = BankPeer::doSelect(new Criteria()); + } + + public function executeShow() + { + $this->bank = BankPeer::retrieveByPk($this->getRequestParameter('id')); + $this->instruments = InstrumentPeer::getByBank($this->getRequestParameter('id')); + $this->forward404Unless($this->bank); + } + + public function executeCreate() + { + $this->bank = new Bank(); + + $this->setTemplate('edit'); + } + + public function executeEdit() + { + $this->bank = BankPeer::retrieveByPk($this->getRequestParameter('id')); + $this->user = $this->getUser()->getSubscriber(); + $this->forward404Unless($this->bank); + } + + public function executeUpdate() + { + if (!$this->getRequestParameter('id')) + { + $bank = new Bank(); + } + else + { + $bank = BankPeer::retrieveByPk($this->getRequestParameter('id')); + $this->forward404Unless($bank); + } + + $bank->setId($this->getRequestParameter('id')); + $bank->setName($this->getRequestParameter('name')); + $bank->setOwner($this->getUser()->getSubscriber()); + $bank->save(); + + $bank_id = $bank->getId() ? $bank->getId() : $this->getRequestParameter('id'); + InstrumentBankPeer::Clear($bank_id); + foreach ($this->getRequestParameter('instruments') as $instrument): + $instrumentBank = new InstrumentBank(); + $instrumentBank->setBankId($bank_id); + $instrumentBank->setInstrumentId($instrument); + if ($instrumentBank->getInstrumentId() != 0) $instrumentBank->save(); + endforeach; + + return $this->redirect('@bank?owner='.$bank->getOwner().'&id='.$bank->getId()); + } + + public function executeDelete() + { + $bank = BankPeer::retrieveByPk($this->getRequestParameter('id')); + + $this->forward404Unless($bank); + + $bank->delete(); + + return $this->redirect('bank/list'); + } +} diff --git a/apps/frontend/modules/bank/config/security.yml b/apps/frontend/modules/bank/config/security.yml new file mode 100644 index 0000000..88e3113 --- /dev/null +++ b/apps/frontend/modules/bank/config/security.yml @@ -0,0 +1,10 @@ +edit: + is_secure: on + credentials: subscriber + +create: + is_secure: on + credentials: subscriber + +all: + is_secure: off diff --git a/apps/frontend/modules/bank/templates/editSuccess.php b/apps/frontend/modules/bank/templates/editSuccess.php new file mode 100644 index 0000000..63d2436 --- /dev/null +++ b/apps/frontend/modules/bank/templates/editSuccess.php @@ -0,0 +1,44 @@ + + + +

getActionName() == 'create')? "Create":"Edit" ?> Bank

+ + + + + + + + + + + + + + + + + + + + +
Name: 10, +)) ?>
Instruments: + 'Instrument', + 'multiple' => 'multiple', +)) ?> +
Share: What's this?
+
+ +getId()): ?> +  getId(), 'post=true&confirm=Are you sure?') ?> +  getId()) ?> + +   + + diff --git a/apps/frontend/modules/bank/templates/listSuccess.php b/apps/frontend/modules/bank/templates/listSuccess.php new file mode 100644 index 0000000..2fff39d --- /dev/null +++ b/apps/frontend/modules/bank/templates/listSuccess.php @@ -0,0 +1,24 @@ + +

Latest Banks

+
+ +
+ + +
+ +
+ + + diff --git a/apps/frontend/modules/bank/templates/showSuccess.php b/apps/frontend/modules/bank/templates/showSuccess.php new file mode 100644 index 0000000..e5d0a6c --- /dev/null +++ b/apps/frontend/modules/bank/templates/showSuccess.php @@ -0,0 +1,34 @@ +getSubscriber() == $bank->getOwner()) { + echo link_to('[Edit Bank]', 'bank/edit?id='.$bank->getId()); + } +?> +

getName()?>

+
Owner: getOwner() ?>
+
+ +
+ + + +getId()); ?> + +
+
+ +

Instruments in getName()?>

+
+ +
+ + $instrument)) ?> + + +
diff --git a/apps/frontend/modules/default/templates/disabledSuccess.php b/apps/frontend/modules/default/templates/disabledSuccess.php new file mode 100644 index 0000000..e69de29 diff --git a/apps/frontend/modules/default/templates/error404Success.php b/apps/frontend/modules/default/templates/error404Success.php new file mode 100644 index 0000000..ffa6f66 --- /dev/null +++ b/apps/frontend/modules/default/templates/error404Success.php @@ -0,0 +1 @@ +

404

diff --git a/apps/frontend/modules/default/templates/loginSuccess.php b/apps/frontend/modules/default/templates/loginSuccess.php new file mode 100644 index 0000000..bb7b687 --- /dev/null +++ b/apps/frontend/modules/default/templates/loginSuccess.php @@ -0,0 +1,2 @@ +

Login Required

+ \ No newline at end of file diff --git a/apps/frontend/modules/default/templates/secureSuccess.php b/apps/frontend/modules/default/templates/secureSuccess.php new file mode 100644 index 0000000..3a98563 --- /dev/null +++ b/apps/frontend/modules/default/templates/secureSuccess.php @@ -0,0 +1 @@ +

Secure page

diff --git a/apps/frontend/modules/default/templates/unavailableSuccess.php b/apps/frontend/modules/default/templates/unavailableSuccess.php new file mode 100644 index 0000000..e69de29 diff --git a/apps/frontend/modules/feed/actions/actions.class.php b/apps/frontend/modules/feed/actions/actions.class.php new file mode 100644 index 0000000..5f6f41b --- /dev/null +++ b/apps/frontend/modules/feed/actions/actions.class.php @@ -0,0 +1,93 @@ +forward('default', 'module'); + } +public function executeNew() { + // instruments + $c = new Criteria(); + $c->setLimit(sfConfig::get('app_feed_max')); + $c->add(InstrumentPeer::SHARE, '1'); + $c->addDescendingOrderByColumn(InstrumentPeer::UPDATED_AT); + $instruments = InstrumentPeer::doSelect($c); + + $feed = sfFeed::newInstance('rss201rev2'); + + // channel + $feed->setTitle('New instruments on lsdjie'); + $feed->setLink('@homepage'); + $feed->setDescription('Latest instruments on LSDJIE.'); + + // items + $feed->setFeedItemsRouteName('@instrumentFeed'); + $feed->setItems($instruments); + + $this->feed = $feed; +} + +public function executeUser() { + // instruments + $c = new Criteria(); + $c->setLimit(sfConfig::get('app_feed_max')); + $USER = $this->getRequestParameter('username'); + $c1 = $c->getNewCriterion(InstrumentPeer::OWNER, $USER); + $c2 = $c->getNewCriterion(InstrumentPeer::AUTHOR, $USER); + $c1->addOr($c2); + $c->add($c1); + $c->addAnd(InstrumentPeer::SHARE, '1'); + $c->addDescendingOrderByColumn(InstrumentPeer::UPDATED_AT); + $instruments = InstrumentPeer::doSelect($c); + + $feed = sfFeed::newInstance('rss201rev2'); + + // channel + $feed->setTitle($USER. '\'s Instrument Patches'); + $feed->setLink('@homepage'); + $feed->setDescription($USER. '\'s Latest contributions to the patch book.'); + + // items + $feed->setFeedItemsRouteName('@instrumentFeed'); + $feed->setItems($instruments); + + $this->feed = $feed; +} + +public function executePopular() +{ + // instruments + $c = new Criteria(); + $c->setLimit(sfConfig::get('app_feed_max')); + $c->add(InstrumentPeer::SHARE, '1'); + $c->addDescendingOrderByColumn(InstrumentPeer::POPULARITY); + $instruments = InstrumentPeer::doSelect($c); + + $feed = sfFeed::newInstance('rss201rev2'); + + // channel + $feed->setTitle('Popular instruments on lsdjie'); + $feed->setLink('@homepage'); + $feed->setDescription('Most popular instruments on LSDJIE.'); + + // items + $feed->setFeedItemsRouteName('@instrument'); + $feed->setItems($instruments); + + $this->feed = $feed; +} + +} diff --git a/apps/frontend/modules/feed/config/view.yml b/apps/frontend/modules/feed/config/view.yml new file mode 100644 index 0000000..6ffe441 --- /dev/null +++ b/apps/frontend/modules/feed/config/view.yml @@ -0,0 +1,3 @@ +all: + has_layout: off + template: feed diff --git a/apps/frontend/modules/feed/templates/feedSuccess.php b/apps/frontend/modules/feed/templates/feedSuccess.php new file mode 100644 index 0000000..5147e71 --- /dev/null +++ b/apps/frontend/modules/feed/templates/feedSuccess.php @@ -0,0 +1 @@ +getFeed() ?> diff --git a/apps/frontend/modules/feed/templates/indexSuccess.php b/apps/frontend/modules/feed/templates/indexSuccess.php new file mode 100644 index 0000000..e69de29 diff --git a/apps/frontend/modules/instrument/actions/actions.class.php b/apps/frontend/modules/instrument/actions/actions.class.php new file mode 100644 index 0000000..3c2cff2 --- /dev/null +++ b/apps/frontend/modules/instrument/actions/actions.class.php @@ -0,0 +1,394 @@ + +getRequestParameter('search')) + { + $this->instruments = InstrumentPeer::search($this->getRequestParameter('search'), $this->getRequestParameter('search_all', false), ($this->getRequestParameter('page', 1) - 1) * sfConfig::get('app_search_results_max'), sfConfig::get('app_search_results_max')); + } + else + { + $this->redirect('@homepage'); + } +} + public function executeIndex() + { + return $this->forward('instrument', 'list'); + } +public function executeList () +{ + $this->getResponse()->setTitle(sfConfig::get('app_tag') . " Patch Book"); + $this->instrument_pager = InstrumentPeer::getHomepagePager($this->getRequestParameter('page', 1)); +} + public function executeShow() + { + $this->instrument = InstrumentPeer::retrieveByName($this->getRequestParameter('name'),$this->getRequestParameter('author')); + if ($this->instrument->getSoftware() != sfConfig::get('app_tag')) $this->forward404(); + $this->forward404Unless($this->instrument); + $this->getResponse()->setTitle("Patch Book - ". $this->instrument->getAuthor() . " - " . $this->instrument->getName()); + } + + public function executeCreate() + { + $this->instrument = new Instrument(); + $this->setTemplate('edit'); + } + + public function executeEdit() + { + $this->instrument = InstrumentPeer::retrieveByPk($this->getRequestParameter('id')); + $this->forward404Unless($this->instrument); + } + + public function executeUpdate() + { + if (!$this->getRequestParameter('id')) + { + $instrument = new Instrument(); + } + else + { + $instrument = InstrumentPeer::retrieveByPk($this->getRequestParameter('id')); + $this->forward404Unless($instrument); + } + + if ($instrument->getAuthor() == '') { + $_editing = false; + } else { + $_editing = true; + $_validUser = ($this->getUser()->getSubscriberId() == $instrument->getOwner() || $this->getUser()->getSubscriberId() == $instrument->getAuthor())? true:false; + } + + if ($_editing == false || ($_editing == true && $_validUser == true)) { + $instrument->setSoftware(sfConfig::get('app_tag')); + $instrument->setId($this->getRequestParameter('id')); + $instrument->setName($this->getRequestParameter('name')); + $instrument->setType($this->getRequestParameter('type')); + $instrument->setAuthor($this->getRequestParameter('author')); + $instrument->setDescription($this->getRequestParameter('description')); + + switch (sfConfig::get('app_tag')) { + case "FamiTracker": + $OB = editInstrument::FamiTracker($this); + break; + default: + $OB = editInstrument::LSDJ($this); + } + + $instrument->setObject(serialize($OB)); + $instrument->setOwner($this->getUser()->getSubscriber()); + if ($instrument->getAuthor() == $instrument->getUser()) $instrument->setShare($this->getRequestParameter('share')); + $instrument->save(); + } + + return $this->redirect("@instrument?author=".$instrument->getAuthorStrip()."&name=".$instrument->getStripped()); + } + + public function executeDelete() + { + $instrument = InstrumentPeer::retrieveByPk($this->getRequestParameter('id')); + + $this->forward404Unless($instrument); + + $instrument->delete(); + + return $this->redirect('instrument/list'); + } + + public function executeType() { + $this->instrument_pager = InstrumentPeer::getByType($this->getRequestParameter('type'),$this->getRequestParameter('page')); + $this->forward404Unless($this->instrument_pager); + + $this->setTemplate('list'); + } + +public function executePostComment() { + $this->instrument = InstrumentPeer::retrieveByPk($this->getRequestParameter('instrument_id')); + $this->forward404Unless($this->instrument); + + $comment = new Comment(); + $comment->setInstrumentId($this->getRequestParameter('instrument_id')); + $comment->setAuthor($this->getUser()->getSubscriber()); + $comment->setComment($this->getRequestParameter('comment')); + $comment->save(); + + return $this->redirect($this->getRequestParameter('referer')); +} + +public function executePopular() +{ + $this->instrument_pager = InstrumentPeer::getPopularPager($this->getRequestParameter('page', 1)); +} + +public function handleErrorUpdate() +{ + $this->forward('instrument','create'); + return sfView::SUCCESS; +} + +public function handleErrorUpload() +{ + $this->forward('instrument','show'); + return sfView::SUCCESS; +} + +public function executeUpload() { + $this->instrument = InstrumentPeer::retrieveByPk($this->getRequestParameter('instrument_id')); + $this->forward404Unless($this->instrument); + $fileName = md5($this->getRequest()->getFileName('file').time()).".mp3"; + + $this->instrument->setSample($fileName); + + $this->getRequest()->moveFile('file', sfConfig::get('sf_upload_dir').'/'.$fileName); + $this->instrument->save(); + + $this->setTemplate('show'); + return $this->redirect($_SERVER['HTTP_REFERER']); +} + +public function executeILike() { + $this->instrument = InstrumentPeer::retrieveByPk($this->getRequestParameter('instrument_id')); + $this->forward404Unless($this->instrument); + + InstrumentPeer::addLike($this->instrument); + + return $this->redirect($_SERVER['HTTP_REFERER']); +} + +public function executeImport() { + if ($this->getRequest()->getMethod() != sfRequest::POST) { + // display the form + return sfView::SUCCESS; + } else { + exec("/var/www/lsdj-patches/web/bin/lsdj2xml {$_FILES['file']['tmp_name']}", $lsdj2xml); + $xml = implode($lsdj2xml); + $this->xml = myTools::Xml2Array($xml); + } +} + +public function executeExport() { +/* LSDJ SAV Binary Data + + type envelope synth/pu2_tune length shape/sweep vib_type/automate table output/duty_cycle/pu_fine + Pulse/Noise: + 0 ffffffa8 0 0 ffffffff 0 0 3 0 0 ffffffd0 0 0 0 fffffff3 0 + + type volume synth/repeat x x vib_type/automate table output x play x x x x length/speed + Wave: + 1 a8 07 0 ffffffff 0 0 3 0 0 ffffffd0 0 0 0 ffffff80 0 + + wave filter q dist phase start_vol cutoff phase vshift end_vol cutoff phase vshift + Synth: + 0 1 5 0 0 10 ffffffff 0 0 10 ffffffff 0 0 0 0 0 +*/ + + $this->bank = BankPeer::retrieveByPk($this->getRequestParameter('bank')); + + $this->forward404Unless($this->bank); + + $aType = array("PULSE","WAVE","KIT","NOISE"); + $aVib_type = array("HF","","SAW","","TRI","","SQR"); + $aOutput = array("--","L-","-R","LR"); + $aWave = array(0 => "12.5", 4 => "25", 8 => "50", "C" => "75"); + $aVol = array("00", "20", "40", "A8"); + $aPlay = array("ONCE","LOOP","PINGPONG","MANUAL"); + $aWAV = array("SAW","SQR","TRI"); + $aFilter = array("LOWP","HIGHP","BANDP","ALLP"); + $aDist = array("CLIP","WRAP"); + $aPhase = array("NORMAL","RESYNC","RESYN2"); + $aFX = array(1=>"A",2=>"C",4=>"E",5=>"F",6=>"G",7=>"H",8=>"K",'a'=>"L",'b'=>"M",'c'=>"P",'d'=>"R",'e'=>"S",'f'=>"T",10=>"V",11=>"W"); + + $this->data = ''; // instrument data output + $this->softsynth = array(); // synth data ouput + $this->tables = array(); + + $this->instruments = $this->bank->getInstruments(); + + foreach ($this->instruments as $ins) { + $instrument = unserialize($ins->getObject()); + $type = array_keys($aType, $ins->getType()); + $pos = array(); + + $vib_type = ($ins->getType() == "PULSE") ? array_keys($aVib_type, $instrument->vib_type) : array(0); // bug with Noise's automate? + $vib_type_automate = ($instrument->automate == "ON")? $vib_type[0] * 2 : $vib_type[0]; + $table = ($instrument->table == "ON") ? dechex(count($this->tables)+0x20) : '00'; + $output = array_keys($aOutput, $instrument->output); + + if ($ins->getType() == "PULSE") { + $pos[] = "0".$type[0]; + $pos[] = $instrument->envelope; + $pos[] = $instrument->pu2_tune; + $pos[] = XML2LSDJ::length($instrument->length); + $pos[] = $instrument->sweep; + $pos[] = "0".$vib_type_automate; + $pos[] = $table; + + $wave1 = ''; + $wave = array_keys($aWave, $instrument->wave); + $wave1 = ($wave[0] != "0")? $wave[0] : ''; + $output_wave = $wave1 . $output[0]; + $pu_fine = (hexdec($instrument->pu_fine) * 4); + + $pos[] = str_pad(dechex((hexdec($output_wave) + $pu_fine)), 2, "0", STR_PAD_LEFT); + $pos[] = "00 00 d0 00 00 00 f3 00 "; + + } elseif ($ins->getType() == "NOISE") { + $pos[] = "0".$type[0]; + $pos[] = $instrument->envelope; + $pos[] = "00"; + $pos[] = XML2LSDJ::length($instrument->length); + $pos[] = $instrument->shape; + $pos[] = "0".$vib_type_automate; + $pos[] = $table; + $pos[] = "0".$output[0]; + $pos[] = "00 00 d0 00 00 00 f3 00 "; + + } elseif ($ins->getType() == "WAVE" && (count($this->softsynth) < 17)) { + $pos[] = "0".$type[0]; + $pos[] = $aVol[$instrument->volume]; + + $synth = str_pad(dechex(count($this->softsynth)), 2, "0", STR_PAD_LEFT); + + $pos[] = $synth . $instrument->repeat; + $pos[] = "00"; + $pos[] = "FF"; + $pos[] = "0".$vib_type_automate; + $pos[] = $table; + $pos[] = "0".$output[0]; + $pos[] = "00"; + $play = array_keys($aPlay, $instrument->play); + $pos[] = "0".$play[0]; + $pos[] = "d0 00 00 00"; + $length = $instrument->length; + $speed = ($instrument->speed > 0) ? ($instrument->speed - 1) : 0; + $pos[] = $length . $speed; + $pos[] = "00"; + + // soft synth params. + $this->softsynth[$synth] = ''; + + $wav = array_keys($aWAV, $instrument->s_wave); + $filter = array_keys($aFilter, $instrument->s_filter); + $dist = array_keys($aDist, $instrument->s_dist); + $phase = array_keys($aPhase, $instrument->s_phase); + + $this->softsynth[$synth] .= '0'.$wav[0] .' ' + . '0'.$filter[0] .' ' + . '0'.$instrument->s_q .' ' + . '0'.$dist[0] .' ' + . '0'.$phase[0] .' ' + . $instrument->s_start_volume .' ' + . $instrument->s_start_cutoff .' ' + . $instrument->s_start_phase .' ' + . $instrument->s_start_vshift .' ' + . $instrument->s_end_volume .' ' + . $instrument->s_end_cutoff .' ' + . $instrument->s_end_phase .' ' + . $instrument->s_end_vshift .' 00 00 00'; + } + + if ($instrument->table == "ON") { // tables here. + foreach ($instrument->_table as $_table) { // loop through all rows + @$this->tables['vol'][$table] .= $_table[0] .' '; + @$this->tables['tsp'][$table] .= $_table[1] .' '; + + $fx = array_keys($aFX, substr($_table[2], 0, 1)); + $fx2 = array_keys($aFX, substr($_table[3], 0, 1)); + + @$this->tables['fx'][$table] .= str_pad($fx[0], 2, "0", STR_PAD_LEFT) .' '; + @$this->tables['fxval'][$table] .= substr($_table[2], 1, 2) .' '; + @$this->tables['fx2'][$table] .= str_pad($fx2[0], 2, "0", STR_PAD_LEFT) .' '; + @$this->tables['fxval2'][$table] .= substr($_table[3], 1, 2) .' '; + } + } + + foreach ($pos as $item) { + $this->data .= $item . " "; + } + } + + for ($i = count($this->instruments); $i < 64; $i++) { // default instrument filler data; + $this->data .= "00 a8 00 00 ff 00 00 03 00 00 d0 00 00 00 f3 00 "; + } + + for ($i = count($this->softsynth); $i < 16; $i++) { // default synth filler data; + $this->softsynth[] = "00 00 00 00 00 10 FF 00 00 10 FF 00 00 00 00 00"; + } + + $this->data = strtolower($this->data); // lowercase everything, why? I have no clue... + + + + // encode to binary + $this->data = XML2LSDJ::hex2bin($this->data); + $this->softsynth = XML2LSDJ::hex2bin(implode($this->softsynth)); + $this->table_vol = XML2LSDJ::hex2bin(str_pad(implode($this->tables['vol']), 1536, "00 ", STR_PAD_RIGHT)); + $this->table_tsp = XML2LSDJ::hex2bin(str_pad(implode($this->tables['tsp']), 1536, "00 ", STR_PAD_RIGHT)); + $this->table_fx = XML2LSDJ::hex2bin(str_pad(implode($this->tables['fx']), 1536, "00 ", STR_PAD_RIGHT)); + $this->table_fxval = XML2LSDJ::hex2bin(str_pad(implode($this->tables['fxval']), 1536, "00 ", STR_PAD_RIGHT)); + $this->table_fx2 = XML2LSDJ::hex2bin(str_pad(implode($this->tables['fx2']), 1536, "00 ", STR_PAD_RIGHT)); + $this->table_fxval2 = XML2LSDJ::hex2bin(str_pad(implode($this->tables['fxval2']), 1536, "00 ", STR_PAD_RIGHT)); + + + // file read + $this->filename = "/var/www/lsdj-patches/web/bin/blank.sav"; + $fh = fopen($this->filename, "rb"); + $whole = fread($fh, filesize($this->filename)); + fclose($fh); + + $fh = tmpfile(); + + fseek($fh, 0x0000); + fwrite($fh, $whole); + + fseek($fh, 0x3080); + fwrite($fh, $this->data); + + fseek($fh, 0x3EB2); + fwrite($fh, $this->softsynth); + + fseek($fh, 0x1690); + fwrite($fh, $this->table_vol); + + fseek($fh, 0x3480); + fwrite($fh, $this->table_tsp); + + fseek($fh, 0x3680); + fwrite($fh, $this->table_fx); + + fseek($fh, 0x3880); + fwrite($fh, $this->table_fxval); + + fseek($fh, 0x3A80); + fwrite($fh, $this->table_fx2); + + fseek($fh, 0x3C80); + fwrite($fh, $this->table_fxval2); + + $this->sav = fread($fh, 131072); // output + + fclose($fh); + + $this->setLayout(false); + $this->getResponse()->setContentType('application/octet-stream'); + $this->getResponse()->addHttpMeta('Accept-Ranges: bytes'); + $this->getResponse()->addHttpMeta('Content-Transfer-Encoding: binary'); + $this->getResponse()->addHttpMeta('Content-Length: 131072'); +} + +} diff --git a/apps/frontend/modules/instrument/config/security.yml b/apps/frontend/modules/instrument/config/security.yml new file mode 100644 index 0000000..88e3113 --- /dev/null +++ b/apps/frontend/modules/instrument/config/security.yml @@ -0,0 +1,10 @@ +edit: + is_secure: on + credentials: subscriber + +create: + is_secure: on + credentials: subscriber + +all: + is_secure: off diff --git a/apps/frontend/modules/instrument/templates/_FamiTracker.php b/apps/frontend/modules/instrument/templates/_FamiTracker.php new file mode 100644 index 0000000..28ed236 --- /dev/null +++ b/apps/frontend/modules/instrument/templates/_FamiTracker.php @@ -0,0 +1,28 @@ +getObject()); + +function is_checked($data) { + if ($data) { + return array("checked"=>"checked"); + } +} +?> +
+ +
+

Instrument Settings

+ volume,"",is_checked($FT->volume)); ?> Volume
+ arpeggio,"",is_checked($FT->arpeggio)); ?> Arpeggio
+ pitch,"",is_checked($FT->pitch)); ?> Pitch
+ hi_pitch,"",is_checked($FT->hi_pitch)); ?> Hi-Pitch
+ duty_noise,"",is_checked($FT->duty_noise)); ?> Duty / Noise
+

+
+ +
+
    +
+ MML
+
+
+
+ diff --git a/apps/frontend/modules/instrument/templates/_LSDJ.php b/apps/frontend/modules/instrument/templates/_LSDJ.php new file mode 100644 index 0000000..6036762 --- /dev/null +++ b/apps/frontend/modules/instrument/templates/_LSDJ.php @@ -0,0 +1,107 @@ +getObject()); + +switch ($instrument->getType()) { + + case "NOISE": +?> +

+ NAMEname?> + TYPEgetType()?> +
+ ENVELOPEenvelope?> + OUTPUToutput?> + LENGTHlength?> + SHAPEshape?> +
+ AUTOMATEautomate?> + TABLEtable?> +

+ + +

+ NAMEname?> + TYPEgetType()?> +
+ ENVELOPEenvelope?> + WAVEwave?> + OUTPUToutput?> + LENGTHlength?> + SWEEPsweep?> + VIB.TYPEvib_type?> +
+ PU2 TUNEpu2_tune?> + PU FINEpu_fine?> +
+ AUTOMATEautomate?> + TABLEtable?> +

+ +

+ NAMEname?> + TYPEgetType()?> +
+ VOLUMEvolume?> + OUTPUToutput?> + VIB.TYPEvib_type?> +
+ SYNTHsynth?> + PLAYplay?> + LENGTHlength?> + REPEATrepeat?> + SPEEDspeed?> +
+ AUTOMATEautomate?> + TABLEtable?> +

+ +

SYNTH
+ WAVEs_wave?> + FILTERs_filter?> + Qs_q?> + DISTs_dist?> + PHASEs_phase?> +
+ START: + VOLUMEs_start_volume?> + CUTOFFs_start_cutoff?> + PHASEs_start_phase?> + VSHIFTs_start_vshift?> +
+ END: + VOLUMEs_end_volume?> + CUTOFFs_end_cutoff?> + PHASEs_end_phase?> + VSHIFTs_end_vshift?> +

+table == "ON") { ?> +

TABLE
+ + + + 8)? chr(88+$a) : $a; ?> + + + + + + + + +
VOLTSPCMDCMD
_table[$a][0]?>_table[$a][1]?>_table[$a][2]?>_table[$a][3]?>
+

+ diff --git a/apps/frontend/modules/instrument/templates/_comments.php b/apps/frontend/modules/instrument/templates/_comments.php new file mode 100644 index 0000000..97afb57 --- /dev/null +++ b/apps/frontend/modules/instrument/templates/_comments.php @@ -0,0 +1,15 @@ + + +

Comments

+ + + diff --git a/apps/frontend/modules/instrument/templates/_edit_FamiTracker.php b/apps/frontend/modules/instrument/templates/_edit_FamiTracker.php new file mode 100644 index 0000000..007b2ec --- /dev/null +++ b/apps/frontend/modules/instrument/templates/_edit_FamiTracker.php @@ -0,0 +1,19 @@ + +
+
+

Instrument Settings

+ volume,""); ?> Volume
+ arpeggio,""); ?> Arpeggio
+ pitch,""); ?> Pitch
+ hi_pitch,""); ?> Hi-Pitch
+ duty_noise,""); ?> Duty / Noise
+

+
+ +
+
    +
+ MML
+
+
+
diff --git a/apps/frontend/modules/instrument/templates/_edit_LSDJ.php b/apps/frontend/modules/instrument/templates/_edit_LSDJ.php new file mode 100644 index 0000000..ebaa815 --- /dev/null +++ b/apps/frontend/modules/instrument/templates/_edit_LSDJ.php @@ -0,0 +1,109 @@ + +

+ NAMEname, array ('maxlength'=>'5', 'size'=>'5')) ?> + TYPEget('type'))? $sf_params->get('type'):$type?> +
+ ENVELOPEenvelope,array('size'=>'2','maxlength'=>'2'))?> + OUTPUT'LR','L'=>'L','R'=>'R'),$T->output))?> + LENGTHlength,array('size'=>'4','maxlength'=>'5'))?> + SHAPEshape,array('size'=>'2','maxlength'=>'2'))?> +
+ AUTOMATE'ON','OFF'=>'OFF'),$T->automate))?> + TABLE'ON','OFF'=>'OFF'),$T->table),array('onchange'=>'if (this.options[this.selectedIndex].value == "ON") { $("INST_Table").style.display="block"; } else { $("INST_Table").style.display="none"; }'))?> +

+ +

+ NAMEname, array ('maxlength'=>'5', 'size'=>'5')) ?> + TYPEget('type'))? $sf_params->get('type'):$type?> +
+ VOLUME'0','1'=>'1','2'=>'2','3'=>'3'),$T->volume))?> + OUTPUT'LR','L'=>'L','R'=>'R'),$T->output))?> + VIB.TYPE'HF','SIN'=>'SIN','TRI'=>'TRI','SQR'=>'SQR'),$T->vib_type))?> +
+ SYNTHsynth?> + PLAY'ONCE','LOOP'=>'LOOP','PINGPONG'=>'PINGPONG','MANUAL'=>'MANUAL'),$T->play))?> + LENGTHlength,array('size'=>'1','maxlength'=>'1'))?> + REPEATrepeat,array('size'=>'1','maxlength'=>'1'))?> + SPEEDspeed,array('size'=>'1','maxlength'=>'1'))?> +
+ AUTOMATE'ON','OFF'=>'OFF'),$T->automate))?> + TABLE'ON','OFF'=>'OFF'),$T->table),array('onchange'=>'if (this.options[this.selectedIndex].value == "ON") { $("INST_Table").style.display="block"; } else { $("INST_Table").style.display="none"; }'))?> +

+ +

SYNTH
+ WAVE'SIN','SQR'=>'SQR','TRI'=>'TRI'),$T->s_wave))?> + FILTER'LOWP','HIGHP'=>'HIGHP','BANDP'=>'BANDP','ALLP'=>'ALLP'),$T->s_filter))?> + Qs_q,array('size'=>'1','maxlength'=>'1'))?> + DIST'CLIP','WRAP'=>'WRAP'),$T->s_dist))?> + PHASE'NORMAL','RESYNC'=>'RESYNC','RESYN2'=>'RESYN2'),$T->s_phase))?> +
+ START: + VOLUMEs_start_volume,array('size'=>'2','maxlength'=>'2'))?> + CUTOFFs_start_cutoff,array('size'=>'2','maxlength'=>'2'))?> + PHASEs_start_phase,array('size'=>'2','maxlength'=>'2'))?> + VSHIFTs_start_vshift,array('size'=>'2','maxlength'=>'2'))?> +
+ END: + VOLUMEs_end_volume,array('size'=>'2','maxlength'=>'2'))?> + CUTOFFs_end_cutoff,array('size'=>'2','maxlength'=>'2'))?> + PHASEs_end_phase,array('size'=>'2','maxlength'=>'2'))?> + VSHIFTs_end_vshift,array('size'=>'2','maxlength'=>'2'))?> +

+ +

+ NAMEname, array ('maxlength'=>'5', 'size'=>'5')) ?> + TYPEget('type'))? $sf_params->get('type'):$type?> +
+ ENVELOPEenvelope,array('size'=>'2','maxlength'=>'2'))?> + WAVE'12.5%','25'=>'25%','50'=>'50%','75'=>'75%'),$T->wave))?> + OUTPUT'LR','L'=>'L','R'=>'R'),$T->output))?> + LENGTHlength,array('size'=>'4','maxlength'=>'5'))?> + SWEEPsweep,array('size'=>'2','maxlength'=>'2'))?> + VIB.TYPE'HF','SIN'=>'SIN','TRI'=>'TRI','SQR'=>'SQR'),$T->vib_type))?> +
+ PU2 TUNEpu2_tune,array('size'=>'2','maxlength'=>'2'))?> + PU FINEpu_fine,array('size'=>'1','maxlength'=>'1'))?> +
+ AUTOMATE'ON','OFF'=>'OFF'),$T->automate))?> + TABLE'ON','OFF'=>'OFF'),$T->table),array('onchange'=>'if (this.options[this.selectedIndex].value == "ON") { $("INST_Table").style.display="block"; } else { $("INST_Table").style.display="none"; }'))?> +

+ + +

TABLE
+ + + + 8)? chr(88+$a) : $a; ?> + + + + + + + + +
VOLTSPCMDCMD
_table[$a][0]?$T->_table[$a][0]:'00')?>_table[$a][1]?$T->_table[$a][1]:'00')?>_table[$a][2]?$T->_table[$a][2]:'-00',array('onfocus'=>'this.title=this.value','onchange'=>'validateLsdjTable(this)','onkeyup'=>'lsdj_table(event,this)','maxlength'=>'3'))?>_table[$a][3]?$T->_table[$a][3]:'-00',array('onfocus'=>'this.title=this.value','onchange'=>'validateLsdjTable(this)','onkeyup'=>'lsdj_table(event,this)','maxlength'=>'3'))?>
+

+ + +table == "ON") { + echo ""; +} +?> diff --git a/apps/frontend/modules/instrument/templates/_goattracker.php b/apps/frontend/modules/instrument/templates/_goattracker.php new file mode 100644 index 0000000..e69de29 diff --git a/apps/frontend/modules/instrument/templates/_instrument_list.php b/apps/frontend/modules/instrument/templates/_instrument_list.php new file mode 100644 index 0000000..47dee52 --- /dev/null +++ b/apps/frontend/modules/instrument/templates/_instrument_list.php @@ -0,0 +1,7 @@ +
+ +
diff --git a/apps/frontend/modules/instrument/templates/_list.php b/apps/frontend/modules/instrument/templates/_list.php new file mode 100644 index 0000000..7bd29f5 --- /dev/null +++ b/apps/frontend/modules/instrument/templates/_list.php @@ -0,0 +1,15 @@ +
+ +
+ +getResults() as $instrument): ?> + $instrument)) ?> + + +
+ +
diff --git a/apps/frontend/modules/instrument/templates/_search.php b/apps/frontend/modules/instrument/templates/_search.php new file mode 100644 index 0000000..c1cc3d0 --- /dev/null +++ b/apps/frontend/modules/instrument/templates/_search.php @@ -0,0 +1,4 @@ + +
get('search')), array('style' => 'width: 200px')) ?>
+
+ diff --git a/apps/frontend/modules/instrument/templates/editSuccess.php b/apps/frontend/modules/instrument/templates/editSuccess.php new file mode 100644 index 0000000..b352bfa --- /dev/null +++ b/apps/frontend/modules/instrument/templates/editSuccess.php @@ -0,0 +1,68 @@ + + + +

getActionName() == 'create')? "Create":"Edit" ?> Instrument

+ + + + +get('type')) { + $type = $sf_params->get('type'); + $INS = ($instrument->getType() == $type)? unserialize($instrument->getObject()):false; +} else { + $INS = ($instrument)? unserialize($instrument->getObject()):false; + $type = ($INS)? $instrument->getType():'PULSE'; +} +} else { + $INS = ($instrument)? unserialize($instrument->getObject()):false; + $type = "NOISE"; +} +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Type:'NOISE','PULSE'=>'PULSE','WAVE'=>'WAVE'),$type),array('onchange'=>'changeINStype(this.options[this.selectedIndex].value)'))?>
Type:'SQR','TRI'=>'TRI','NOISE'=>'NOISE','ARP'=>'ARP'),$type))?>
Author:
Name:
Instrument:$type,'INS'=>$INS)); ?>
Description:'width: 500px; height: 100px;' +)) ?>
Share: What's this?
+
+ + diff --git a/apps/frontend/modules/instrument/templates/exportSuccess.php b/apps/frontend/modules/instrument/templates/exportSuccess.php new file mode 100644 index 0000000..7faa07d --- /dev/null +++ b/apps/frontend/modules/instrument/templates/exportSuccess.php @@ -0,0 +1,7 @@ + diff --git a/apps/frontend/modules/instrument/templates/importSuccess.php b/apps/frontend/modules/instrument/templates/importSuccess.php new file mode 100644 index 0000000..824225f --- /dev/null +++ b/apps/frontend/modules/instrument/templates/importSuccess.php @@ -0,0 +1,9 @@ +

Import SAV

+

This tool uses LSDJ2XML II.

+ +
+ '12')) ?>
+ + +Data: + diff --git a/apps/frontend/modules/instrument/templates/listSuccess.php b/apps/frontend/modules/instrument/templates/listSuccess.php new file mode 100644 index 0000000..9e31179 --- /dev/null +++ b/apps/frontend/modules/instrument/templates/listSuccess.php @@ -0,0 +1,12 @@ + + + +

The Patch Book

+The Patch Book is an online repository for synth patches.
+Explore & experiment. +

+

Recently Added Instruments

+ $instrument_pager, 'rule' => 'instrument/list')) ?> diff --git a/apps/frontend/modules/instrument/templates/popularSuccess.php b/apps/frontend/modules/instrument/templates/popularSuccess.php new file mode 100644 index 0000000..eaa19f2 --- /dev/null +++ b/apps/frontend/modules/instrument/templates/popularSuccess.php @@ -0,0 +1,4 @@ + + +

Top Instruments

+ $instrument_pager, 'rule' => 'instrument/popular')) ?> diff --git a/apps/frontend/modules/instrument/templates/searchSuccess.php b/apps/frontend/modules/instrument/templates/searchSuccess.php new file mode 100644 index 0000000..c350663 --- /dev/null +++ b/apps/frontend/modules/instrument/templates/searchSuccess.php @@ -0,0 +1,19 @@ + + +

instruments matching "get('search')) ?>"

+ + + $instrument)) ?> + + +get('page') > 1 && !count($instruments)): ?> +
There is no more result for your search.
+ +
Sorry, there are no instruments matching your search terms.
+ + + +
+ get('search').'&page='.($sf_params->get('page', 1) + 1)) ?> +
+ diff --git a/apps/frontend/modules/instrument/templates/showSuccess.php b/apps/frontend/modules/instrument/templates/showSuccess.php new file mode 100644 index 0000000..5161459 --- /dev/null +++ b/apps/frontend/modules/instrument/templates/showSuccess.php @@ -0,0 +1,90 @@ + +getSubscriber(); + if ($USER == $instrument->getOwner() || $USER == $instrument->getAuthor()) { + echo link_to('[Edit Instrument]', 'instrument/edit?id='.$instrument->getId()); + } +?> + + +

getName() ?>

+
getUpdatedAt() ?>
+
Submitted by: getOwner(),'@user?username='.$instrument->getOwner()) ?>
+
Original Author: getAuthor(),'@author?author='.$instrument->getAuthorStrip()) ?>
+ +$instrument)); ?> + +
+

Description

+ getDescription() ?> +
+ + $instrument, 'comments' => $instrument->getComments())) ?> + + isAuthenticated()): ?> + +
Post Comment + + getId()) ?> + + + + +
+ + 'postComment')) ?> + + +
diff --git a/apps/frontend/modules/instrument/validate/update.yml b/apps/frontend/modules/instrument/validate/update.yml new file mode 100644 index 0000000..ebb0c7b --- /dev/null +++ b/apps/frontend/modules/instrument/validate/update.yml @@ -0,0 +1,7 @@ +methods: + post: [name] + +names: + name: + required: Yes + required_msg: You must name your patch diff --git a/apps/frontend/modules/instrument/validate/upload.yml b/apps/frontend/modules/instrument/validate/upload.yml new file mode 100644 index 0000000..b7e8a58 --- /dev/null +++ b/apps/frontend/modules/instrument/validate/upload.yml @@ -0,0 +1,19 @@ +methods: + post: [file] + +names: + file: + required: Yes + required_msg: Please upload a file + validators: myFileValidator + file: true + +myFileValidator: + class: sfFileValidator + param: +# mime_types: +# - 'audio/mpeg' +# - 'audio/mpeg3' +# mime_types_error: Only MP3 format is allowed + max_size: 64000 + max_size_error: Max size is 64Kb diff --git a/apps/frontend/modules/tag/actions/.actions.class.php.swp b/apps/frontend/modules/tag/actions/.actions.class.php.swp new file mode 100644 index 0000000000000000000000000000000000000000..958b8a6e115d2b5cd0fc89153e43e6799be8d6d8 GIT binary patch literal 12288 zcmeI2y>Amq7>6fN@r|IO8^FSLgtN9GAj~%iBp0BF5D+xhcz4#j#NJ(IX5&O5qM)Qh zG^Z;N5+wzQ3Q@n|;3WP85Fn(x-)z>&U19n)g$$5^l?Jx31NB;U@1EU! z=Z>kBjr2|i$N(8217v^>sRg9T){8Ie1VZ17v^u9Q+9`fF{@n3Sd1L z0nfHF_7vO)_dpG-2P5F^7RDZeKY$CG;Ol0_K7o(mHFyQ)Kp$KKSHWM1>m7Ik9)mmJ zHn8#D0#wKV86X2>fDDiUGC&5%z%OH9fpKo(ykLS*S5Ek`>I>zSik|dE+BL=fyttSV zTPz<%$9a&X?QZCDKaH}qST1L!n;O}SJULq`Gdo^BS{P}g(w>Y=D-j*3_;KD`s+y2e zH5wghCgLRR3Uy}gvgnlZFHwC--b|%76GDleG*Xp{NXadh_YVdi+Qm*&EF;u;_Kh$n zgSekZsia9&G#F1wFI3VsYlfhtFO^hQ%c&sl$))+07mX-27P?A7q|bFxi8wG#M#M46R8PeWe4Ne;#Bbn umyrj!16iw1+lg?eap`PqS=HbjAJ{DW&~~&9XkUtgIivWQf9#~qr2iN8qQtZS literal 0 HcmV?d00001 diff --git a/apps/frontend/modules/tag/actions/actions.class.php b/apps/frontend/modules/tag/actions/actions.class.php new file mode 100644 index 0000000..29f54ea --- /dev/null +++ b/apps/frontend/modules/tag/actions/actions.class.php @@ -0,0 +1,42 @@ +tags = TagsPeer::getPopularTags(sfConfig::get('app_tag_cloud_max')); +} +public function executeAdd() +{ + $this->instrument = InstrumentPeer::retrieveByPk($this->getRequestParameter('instrument_id')); + $this->forward404Unless($this->instrument); + + $userId = $this->getUser()->getSubscriberId(); + $phrase = $this->getRequestParameter('tag'); + try { + $this->instrument->addTagsForUser($phrase, $userId); + } catch(Exception $e) { + return $this->redirect($this->getRequestParameter('referer', '@homepage')); + } + + $this->tags = $this->instrument->getTags(); + + return $this->redirect($this->getRequestParameter('referer', '@homepage')); +} +public function executeShow() +{ + $this->instrument_pager = InstrumentPeer::getPopularByTag($this->getRequestParameter('tag'), $this->getRequestParameter('page')); +} + public function executeIndex() + { + $this->forward('default', 'module'); + } +} diff --git a/apps/frontend/modules/tag/config/view.yml b/apps/frontend/modules/tag/config/view.yml new file mode 100644 index 0000000..569158f --- /dev/null +++ b/apps/frontend/modules/tag/config/view.yml @@ -0,0 +1,3 @@ +addSuccess: + has_layout: off + components: [] diff --git a/apps/frontend/modules/tag/templates/_tags.php b/apps/frontend/modules/tag/templates/_tags.php new file mode 100644 index 0000000..2775e64 --- /dev/null +++ b/apps/frontend/modules/tag/templates/_tags.php @@ -0,0 +1,3 @@ + +
  • + diff --git a/apps/frontend/modules/tag/templates/indexSuccess.php b/apps/frontend/modules/tag/templates/indexSuccess.php new file mode 100644 index 0000000..e69de29 diff --git a/apps/frontend/modules/tag/templates/popularSuccess.php b/apps/frontend/modules/tag/templates/popularSuccess.php new file mode 100644 index 0000000..a12c99e --- /dev/null +++ b/apps/frontend/modules/tag/templates/popularSuccess.php @@ -0,0 +1,7 @@ +

    popular tags

    + +
      + $count): ?> +
    • + +
    diff --git a/apps/frontend/modules/tag/templates/showSuccess.php b/apps/frontend/modules/tag/templates/showSuccess.php new file mode 100644 index 0000000..53e86fd --- /dev/null +++ b/apps/frontend/modules/tag/templates/showSuccess.php @@ -0,0 +1,4 @@ + + +

    Instruments tagged as "get('tag') ?>"

    + $instrument_pager, 'rule' => '@tag?tag='.$sf_params->get('tag'))) ?> diff --git a/apps/frontend/modules/user/actions/actions.class.php b/apps/frontend/modules/user/actions/actions.class.php new file mode 100644 index 0000000..c3548a5 --- /dev/null +++ b/apps/frontend/modules/user/actions/actions.class.php @@ -0,0 +1,81 @@ +getRequest()->getMethod() != sfRequest::POST) + { + // display the form + $this->getRequest()->getParameterHolder()->set('referer', $this->getRequest()->getReferer()); + + return sfView::SUCCESS; + } + else + { + // handle the form submission + // redirect to last page + return $this->redirect($this->getRequestParameter('referer', '@homepage')); + } +} + +public function executeLogout() +{ + $this->getUser()->signOut(); + $this->redirect($_SERVER['HTTP_REFERER']); +} + +public function handleErrorLogin() +{ + return sfView::SUCCESS; +} + + /** + * Executes index action + * + */ + +public function executeShow() +{ + $this->subscriber = UserPeer::retrieveByStripped($this->getRequestParameter('username', $this->getUser()->getSubscriberId())); + $this->forward404Unless($this->subscriber); + + $this->instruments = $this->subscriber->getInstruments(); + + $this->authored_instruments = InstrumentPeer::getByAuthorNoStrip($this->subscriber); + $this->getResponse()->setTitle("Patch Book - ". $this->subscriber); +} + +public function executeAuthor() +{ + $this->author = $this->getRequestParameter('author'); + $user_exists = UserPeer::retrieveByStripped($this->author); + if ($user_exists) $this->redirect('user/show?username='.$this->author); + $this->instruments = InstrumentPeer::getByAuthor($this->author); + $this->forward404Unless($this->instruments); + $this->getResponse()->setTitle("Patch Book - ". $this->author); +} + +public function executePopularUser() +{ + $this->popular = UserPeer::getPopularUser(); +} + +public function executePopularAuthor() +{ + $this->popular = InstrumentPeer::getPopularAuthor(); +} + + public function executeIndex() + { + $this->forward('default', 'module'); + } +} diff --git a/apps/frontend/modules/user/config/cache.yml b/apps/frontend/modules/user/config/cache.yml new file mode 100644 index 0000000..054a7f3 --- /dev/null +++ b/apps/frontend/modules/user/config/cache.yml @@ -0,0 +1,10 @@ +#popularUser: +# activate: on +# type: slot + +#popularAuthor: +# activate: on +# type: slot + +#all: +# lifeTime: 600 diff --git a/apps/frontend/modules/user/templates/_login.php b/apps/frontend/modules/user/templates/_login.php new file mode 100644 index 0000000..a6f7e7c --- /dev/null +++ b/apps/frontend/modules/user/templates/_login.php @@ -0,0 +1,34 @@ +
    + +
    + + + + + + + + + + + + + + + + + + +
    get('username')) ?>
    + +
    + + getReferer()) ?> +
    + +
    + +
    +

    8bc Connect

    +

    In order to use this application you will need an account at 8bitcollective.com. Registration is free and grants you access to the Patch Book and the 8bitcollective community; Click here to register.

    +
    diff --git a/apps/frontend/modules/user/templates/_userHeader.php b/apps/frontend/modules/user/templates/_userHeader.php new file mode 100644 index 0000000..ba6ceed --- /dev/null +++ b/apps/frontend/modules/user/templates/_userHeader.php @@ -0,0 +1,10 @@ + + +getAvatar()): ?> + <?=$subscriber?> + +

    'color: #000;')) ?>

    +

    getLocation()?>

    +

    getDescription()?>

    + +
    diff --git a/apps/frontend/modules/user/templates/authorSuccess.php b/apps/frontend/modules/user/templates/authorSuccess.php new file mode 100644 index 0000000..0c18c1a --- /dev/null +++ b/apps/frontend/modules/user/templates/authorSuccess.php @@ -0,0 +1,15 @@ + +

    getAuthor()?> getAuthor())?>

    + +

    Authored

    + +
    +
      +
    • Name
    • +
    • Type
    • +
    • Author
    • +
    +
    + + $instrument)) ?> + diff --git a/apps/frontend/modules/user/templates/indexSuccess.php b/apps/frontend/modules/user/templates/indexSuccess.php new file mode 100644 index 0000000..e69de29 diff --git a/apps/frontend/modules/user/templates/loginSuccess.php b/apps/frontend/modules/user/templates/loginSuccess.php new file mode 100644 index 0000000..9e13be5 --- /dev/null +++ b/apps/frontend/modules/user/templates/loginSuccess.php @@ -0,0 +1,6 @@ +isAuthenticated()): ?> +

    Login

    + + +

    You're already logged in. o_0

    + diff --git a/apps/frontend/modules/user/templates/popularAuthorSuccess.php b/apps/frontend/modules/user/templates/popularAuthorSuccess.php new file mode 100644 index 0000000..ad403fa --- /dev/null +++ b/apps/frontend/modules/user/templates/popularAuthorSuccess.php @@ -0,0 +1,7 @@ +

    Top Authors

    + +
      + +
    1. getAuthor(),'@author?author='.$author->getAuthorStrip()) ?>
    2. + +
    diff --git a/apps/frontend/modules/user/templates/popularUserSuccess.php b/apps/frontend/modules/user/templates/popularUserSuccess.php new file mode 100644 index 0000000..8f9901e --- /dev/null +++ b/apps/frontend/modules/user/templates/popularUserSuccess.php @@ -0,0 +1,7 @@ +

    Top Contributors

    + +
      + +
    1. getUsername(),'@user?username='.$user->getStripped()) ?>
    2. + +
    diff --git a/apps/frontend/modules/user/templates/showSuccess.php b/apps/frontend/modules/user/templates/showSuccess.php new file mode 100644 index 0000000..7c53bb7 --- /dev/null +++ b/apps/frontend/modules/user/templates/showSuccess.php @@ -0,0 +1,27 @@ + $subscriber)) ?> + +

    Authored

    + +
    +
      +
    • Name
    • +
    • Type
    • +
    • Author
    • +
    +
    + + $instrument)) ?> + + +

    Submissions

    + +
    +
      +
    • Name
    • +
    • Type
    • +
    • Author
    • +
    +
    + + $instrument)) ?> + diff --git a/apps/frontend/modules/user/validate/login.yml b/apps/frontend/modules/user/validate/login.yml new file mode 100644 index 0000000..f9a0a29 --- /dev/null +++ b/apps/frontend/modules/user/validate/login.yml @@ -0,0 +1,18 @@ +methods: + post: [username, password] + +names: + username: + required: true + required_msg: username is required + validators: validateUser + + password: + required: true + required_msg: password is required + +validateUser: + class: validateLogin + param: + password: password + login_error: account does not exist or incorrect password diff --git a/apps/frontend/templates/layout.php b/apps/frontend/templates/layout.php new file mode 100644 index 0000000..0e09988 --- /dev/null +++ b/apps/frontend/templates/layout.php @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + +
    + +
    + + + + getRaw('sf_content') ?> + +
    + +
    + 'newInstrument')) ?> +
    Creative Commons License
    +
    +
    +
    + + diff --git a/batch/load_data.php b/batch/load_data.php new file mode 100644 index 0000000..f5bdcdc --- /dev/null +++ b/batch/load_data.php @@ -0,0 +1,16 @@ +initialize(); + +$data = new sfPropelData(); +$data->loadData(sfConfig::get('sf_data_dir').DIRECTORY_SEPARATOR.'fixtures'); +?> diff --git a/batch/reload-symfony-project.sh b/batch/reload-symfony-project.sh new file mode 100755 index 0000000..6fac46a --- /dev/null +++ b/batch/reload-symfony-project.sh @@ -0,0 +1,6 @@ +symfony propel-dump-data frontend test_data.yml +symfony propel-build-model +symfony propel-build-sql +mysql -u goatslak -D lsdjie -p < data/sql/lib.model.schema.sql +symfony clear-cache +php batch/load_data.php diff --git a/config/generated-schema-transformed.xml b/config/generated-schema-transformed.xml new file mode 100644 index 0000000..40cc501 --- /dev/null +++ b/config/generated-schema-transformed.xml @@ -0,0 +1,2 @@ + +
    diff --git a/config/propel.ini b/config/propel.ini new file mode 100644 index 0000000..a51cf4e --- /dev/null +++ b/config/propel.ini @@ -0,0 +1,43 @@ +propel.targetPackage = lib.model +propel.packageObjectModel = true +propel.project = lsdjie +propel.database = mysql +propel.database.createUrl = mysql://tony@localhost/ +propel.database.url = mysql://tony@localhost/lsdjie +propel.addGenericAccessors = true +propel.addGenericMutators = true +propel.addTimeStamp = false + +propel.schema.validate = false + +; directories +propel.home = . +propel.output.dir = /var/www/lsdj-patches +propel.schema.dir = ${propel.output.dir}/config +propel.conf.dir = ${propel.output.dir}/config +propel.phpconf.dir = ${propel.output.dir}/config +propel.sql.dir = ${propel.output.dir}/data/sql +propel.runtime.conf.file = runtime-conf.xml +propel.php.dir = ${propel.output.dir} +propel.default.schema.basename = schema +propel.datadump.mapper.from = *schema.xml +propel.datadump.mapper.to = *data.xml + +; builder settings +propel.builder.peer.class = addon.propel.builder.SfPeerBuilder +propel.builder.object.class = addon.propel.builder.SfObjectBuilder + +propel.builder.objectstub.class = addon.propel.builder.SfExtensionObjectBuilder +propel.builder.peerstub.class = addon.propel.builder.SfExtensionPeerBuilder +propel.builder.objectmultiextend.class = addon.propel.builder.SfMultiExtendObjectBuilder +propel.builder.mapbuilder.class = addon.propel.builder.SfMapBuilderBuilder +propel.builder.interface.class = propel.engine.builder.om.php5.PHP5InterfaceBuilder +propel.builder.node.class = propel.engine.builder.om.php5.PHP5NodeBuilder +propel.builder.nodepeer.class = propel.engine.builder.om.php5.PHP5NodePeerBuilder +propel.builder.nodestub.class = propel.engine.builder.om.php5.PHP5ExtensionNodeBuilder +propel.builder.nodepeerstub.class = propel.engine.builder.om.php5.PHP5ExtensionNodePeerBuilder + +propel.builder.addIncludes = false +propel.builder.addComments = false + +propel.builder.addBehaviors = false diff --git a/config/properties.ini b/config/properties.ini new file mode 100644 index 0000000..89badcf --- /dev/null +++ b/config/properties.ini @@ -0,0 +1,2 @@ +[symfony] + name=lsdj-patches diff --git a/config/rsync_exclude.txt b/config/rsync_exclude.txt new file mode 100644 index 0000000..4b76ea8 --- /dev/null +++ b/config/rsync_exclude.txt @@ -0,0 +1,4 @@ +.svn +/web/uploads/* +/cache/* +/log/* diff --git a/config/schema.yml b/config/schema.yml new file mode 100644 index 0000000..c66de0f --- /dev/null +++ b/config/schema.yml @@ -0,0 +1,71 @@ +propel: + _attributes: { noXsd: false, defaultIdMethod: none, package: lib.model } + + Instrument: + _attributes: { phpName: Instrument, idMethod: native } + id: { type: integer, required: true, primaryKey: true, autoIncrement: true } + name: { type: varchar(255), required: true } + stripped: { type: varchar(255), index: true, required: true } + software: { type: varchar(25), default: LSDJ, index: true, required: true, foreignTable: Ware, foreignReference: soft } + type: { type: varchar(5), index: true, required: true } + description: { type: longvarchar } + object: { type: longvarchar } + owner: { type: varchar(255), foreignTable: User, foreignReference: username } + author: { type: varchar(255) } + author_strip:{ type: varchar(255), index: true } + share: { type: boolean, default: true } + popularity: { type: integer, size: 3, default: 0 } + sample: { type: varchar(36) } + updated_at: ~ + + User: + _attributes: { phpName: User, idMethod: native } + username: { type: varchar, size: 255, required: true, primaryKey: true } + stripped: { type: varchar(255), index: true } + realname: { type: varchar(255) } + description: { type: longvarchar } + avatar: { type: varchar(255) } + location: { type: varchar(255) } + is_admin: { type: boolean, default: false } + + Tags: + _attributes: { phpName: Tags, idMethod: native } + instrument_id: { type: integer, primaryKey: true, foreignTable: Instrument, foreignReference: id } + user_id: { type: varchar(255), primaryKey: true, foreignTable: User, foreignReference: username } + tag: { type: varchar(100) } + normalized: { type: varchar(100), primaryKey: true } + created_at: ~ + + Search: + _attributes: { phpName: Search, idMethod: native } + instrument_id: { type: integer, foreignTable: Instrument, foreignReference: id, onDelete: cascade } + word: { type: varchar(255), index: true } + weight: { type: integer, size: 3, default: 0 } + + Comment: + _attributes: { phpName: Comment, idMethod: native } + id: { type: integer, primaryKey: true, autoIncrement: true } + instrument_id: { type: integer, foreignTable: Instrument, foreignReference: id, onDelete: cascade } + author: { type: varchar(255), default: anonymous, foreignTable: User, foreignReference: username } + comment: { type: longvarchar } + created_at: ~ + + Bank: + _attributes: { phpName: Bank, idMethod: native } + id: { type: integer, primaryKey: true, autoIncrement: true } + name: { type: varchar(255) } + owner: { type: varchar(255), foreignTable: User, foreignReference: username } + software: { type: varchar(25), default: LSDJ, index: true, required: true, foreignTable: Ware, foreignReference: soft } + share: { type: boolean, default: true } + updated_at: ~ + + InstrumentBank: + _attributes: { phpName: InstrumentBank, idMethod: native } + id: { type: integer, primaryKey: true, autoIncrement: true } + bank_id: { type: integer, foreignTable: Bank, foreignReference: id, required: true } + instrument_id: { type: integer, foreignTable: Instrument, foreignReference: id, onDelete: cascade, required: true } + + Ware: + _attributes: { phpName: Ware, idMethod: native } + soft: { type: varchar(25), primaryKey: true } + hard: { type: varchar(25) } diff --git a/data/fixtures/test_data.yml b/data/fixtures/test_data.yml new file mode 100644 index 0000000..c56c318 --- /dev/null +++ b/data/fixtures/test_data.yml @@ -0,0 +1,243 @@ +--- +Ware: + Ware_lsdj: + soft: LSDJ + hard: Game Boy + Ware_Goattracker: + soft: Goattracker + hard: Commodore 64 +User: + User_Note!: + username: Note! + stripped: note + is_admin: 0 + User_goatslacker: + username: goatslacker + stripped: goatslacker + realname: Josh + description: > + goatslacker, born Joshua Perez, is a + chipmusic composer residing in Miami + Florida. Although style and genre always + varies, goatslacker’s sound can be + classified as nostalgic, or 8-bit. + Musically, his influences are scattered + like pieces from different puzzles. + These pieces are then forged together to + form a new puzzle with a different feel. + goatslacker beams into battle armed with + dual 1989 Nintendo Game Boys and his + custom keyboard. The mission is clear: + galactic domination. + avatar: > + http://8bitcollective.com/forums/img/avatars/1610.png + location: Miami, FL + is_admin: 1 +Instrument: + Instrument_1: + name: Hardcore Kick + stripped: hardcore-kick + software: Ware_lsdj + type: WAVE + description: > + Ok so while I was lurking (playing) + around in the wave channel trying to get + a whistle-esque lead as featured in + Trash Can Man's song I can't grow up I + happened to stumble across an amazing + sounding kick in the wave channel. + Thought I might share it with the forum + [...] Now use C 6 on a phrase and your + good to go. + object: > + O:9:"LSDJ_Wave":24:{s:4:"name";s:4:"HKIK";s:6:"volume";s:1:"3";s:6:"output";s:2:"LR";s:8:"vib_type";s:2:"HF";s:5:"synth";s:1:"0";s:4:"play";s:4:"ONCE";s:6:"length";s:1:"F";s:6:"repeat";s:1:"0";s:5:"speed";s:1:"4";s:8:"automate";s:3:"OFF";s:5:"table";s:3:"OFF";s:6:"s_wave";s:3:"SIN";s:8:"s_filter";s:4:"LOWP";s:3:"s_q";s:1:"0";s:6:"s_dist";s:4:"CLIP";s:7:"s_phase";s:6:"NORMAL";s:14:"s_start_volume";s:2:"10";s:14:"s_start_cutoff";s:2:"FF";s:13:"s_start_phase";s:2:"00";s:14:"s_start_vshift";s:2:"00";s:12:"s_end_volume";s:2:"10";s:12:"s_end_cutoff";s:2:"FF";s:11:"s_end_phase";s:2:"00";s:12:"s_end_vshift";s:2:"00";} + owner: User_goatslacker + author: n0dl + author_strip: n0dl + share: 1 + popularity: 1 + updated_at: 2009-03-22 23:48:38 + Instrument_2: + name: Triangle wrap Wave test + stripped: triangle-wrap-wave-test + software: Ware_lsdj + type: WAVE + description: testing instruments + object: > + O:9:"LSDJ_Wave":24:{s:4:"name";s:5:"TEST1";s:6:"volume";s:1:"3";s:6:"output";s:2:"LR";s:8:"vib_type";s:2:"HF";s:5:"synth";s:1:"0";s:4:"play";s:4:"ONCE";s:6:"length";s:1:"F";s:6:"repeat";s:1:"0";s:5:"speed";s:1:"4";s:8:"automate";s:3:"OFF";s:5:"table";s:3:"OFF";s:6:"s_wave";s:3:"SIN";s:8:"s_filter";s:4:"LOWP";s:3:"s_q";s:1:"0";s:6:"s_dist";s:4:"CLIP";s:7:"s_phase";s:6:"NORMAL";s:14:"s_start_volume";s:2:"10";s:14:"s_start_cutoff";s:2:"FF";s:13:"s_start_phase";s:2:"00";s:14:"s_start_vshift";s:2:"00";s:12:"s_end_volume";s:2:"10";s:12:"s_end_cutoff";s:2:"FF";s:11:"s_end_phase";s:2:"00";s:12:"s_end_vshift";s:2:"00";} + owner: User_goatslacker + author: goatslacker + author_strip: goatslacker + share: 1 + popularity: 2 + updated_at: 2009-03-22 23:48:38 + Instrument_3: + name: Wave kick nrgiga + stripped: wave-kick-nrgiga + software: Ware_lsdj + type: WAVE + description: > + Note used: E5 or G5 ; Usually i use 2 gb + both with lsdj and splitted channel so i + have 4 mono OUT: 1 wav channel only for + KICK drum + synth bass (take a look to + the track i have uploaded here. 4/4 Kick + Drum and bass synth notes in the free + steps); the other wav channel is for + drum kit samples or synth bass/effects + (in this case i use NOISE channel for + hihat and snare) + object: > + O:9:"LSDJ_Wave":24:{s:4:"name";s:4:"WKIK";s:6:"volume";s:1:"3";s:6:"output";s:2:"LR";s:8:"vib_type";s:2:"HF";s:5:"synth";s:1:"0";s:4:"play";s:4:"ONCE";s:6:"length";s:1:"F";s:6:"repeat";s:1:"0";s:5:"speed";s:1:"4";s:8:"automate";s:3:"OFF";s:5:"table";s:3:"OFF";s:6:"s_wave";s:3:"SIN";s:8:"s_filter";s:4:"LOWP";s:3:"s_q";s:1:"0";s:6:"s_dist";s:4:"CLIP";s:7:"s_phase";s:6:"NORMAL";s:14:"s_start_volume";s:2:"10";s:14:"s_start_cutoff";s:2:"FF";s:13:"s_start_phase";s:2:"00";s:14:"s_start_vshift";s:2:"00";s:12:"s_end_volume";s:2:"10";s:12:"s_end_cutoff";s:2:"FF";s:11:"s_end_phase";s:2:"00";s:12:"s_end_vshift";s:2:"00";} + owner: User_goatslacker + author: nrgiga + author_strip: nrgiga + share: 1 + popularity: 2 + updated_at: 2009-03-22 23:48:38 + Instrument_4: + name: Snare + stripped: snare + software: Ware_lsdj + type: NOISE + object: > + O:10:"LSDJ_Noise":7:{s:4:"name";s:4:"NSNR";s:8:"envelope";s:2:"A8";s:6:"output";s:2:"LR";s:6:"length";s:5:"UNLIM";s:5:"shape";s:2:"FF";s:8:"automate";s:3:"OFF";s:5:"table";s:3:"OFF";} + owner: User_goatslacker + author: SoundMatrix + author_strip: soundmatrix + share: 1 + popularity: 1 + updated_at: 2009-03-22 23:48:38 +Comment: + Comment_1: + instrument_id: Instrument_1 + author: User_goatslacker + comment: sweeeeeet + created_at: 2009-03-08 19:38:49 +Tags: + Tags_2_goatslacker_lead: + instrument_id: Instrument_2 + user_id: User_goatslacker + normalized: lead + tag: lead + created_at: 2009-03-07 17:20:48 + Tags_2_goatslacker_triangle: + instrument_id: Instrument_2 + user_id: User_goatslacker + normalized: triangle + tag: triangle + created_at: 2009-03-07 17:20:48 + Tags_2_goatslacker_wrap: + instrument_id: Instrument_2 + user_id: User_goatslacker + normalized: wrap + tag: wrap + created_at: 2009-03-07 17:20:48 + Tags_2_goatslacker_wave: + instrument_id: Instrument_2 + user_id: User_goatslacker + normalized: wave + tag: wave + created_at: 2009-03-07 17:20:48 + Tags_2_goatslacker_harsh: + instrument_id: Instrument_2 + user_id: User_goatslacker + normalized: harsh + tag: harsh + created_at: 2009-03-07 17:20:48 + Tags_1_goatslacker_kick: + instrument_id: Instrument_1 + user_id: User_goatslacker + normalized: kick + tag: kick + created_at: 2009-03-08 19:42:50 + Tags_3_goatslacker_wave: + instrument_id: Instrument_3 + user_id: User_goatslacker + normalized: wave + tag: wave + created_at: 2009-03-09 01:16:40 + Tags_3_goatslacker_kick: + instrument_id: Instrument_3 + user_id: User_goatslacker + normalized: kick + tag: kick + created_at: 2009-03-09 01:16:40 +Bank: + Bank_1: + name: glitch + owner: User_goatslacker + share: 1 + updated_at: 2009-03-17 20:28:17 +InstrumentBank: + InstrumentBank_1: + bank_id: Bank_1 + instrument_id: Instrument_1 + InstrumentBank_2: + bank_id: Bank_1 + instrument_id: Instrument_2 +Search: + Search_95: + instrument_id: Instrument_3 + word: wkik + weight: 5 + Search_94: + instrument_id: Instrument_3 + word: nrgiga + weight: 3 + Search_93: + instrument_id: Instrument_3 + word: kick + weight: 4 + Search_92: + instrument_id: Instrument_3 + word: wave + weight: 4 + Search_97: + instrument_id: Instrument_4 + word: nsnr + weight: 5 + Search_96: + instrument_id: Instrument_4 + word: snare + weight: 3 + Search_91: + instrument_id: Instrument_2 + word: harsh + weight: 1 + Search_90: + instrument_id: Instrument_2 + word: lead + weight: 1 + Search_89: + instrument_id: Instrument_2 + word: test1 + weight: 5 + Search_88: + instrument_id: Instrument_2 + word: test + weight: 3 + Search_84: + instrument_id: Instrument_1 + word: hkik + weight: 5 + Search_83: + instrument_id: Instrument_1 + word: kick + weight: 4 + Search_87: + instrument_id: Instrument_2 + word: wave + weight: 4 + Search_86: + instrument_id: Instrument_2 + word: wrap + weight: 4 + Search_85: + instrument_id: Instrument_2 + word: triangl + weight: 4 + Search_82: + instrument_id: Instrument_1 + word: hardcor + weight: 3 diff --git a/data/lsdj2xml/lsdj2xml.c b/data/lsdj2xml/lsdj2xml.c new file mode 100644 index 0000000..94a4da6 --- /dev/null +++ b/data/lsdj2xml/lsdj2xml.c @@ -0,0 +1,290 @@ +/* + LSDJ2XML - Converts Instrument data to XML + + Author: Josh Perez + Email: josh AT goatslacker DOT com + Mad Credits to: Georg Wiltschek + Awesome program: lview + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include +#include "lview.h" + +FILE *fp; + +int main(int argc, char **args) { + + /* open .sav file */ + if ((fp = fopen(args[1], "r")) == NULL) { + bailOut("Error opening .sav File\n"); + } + + /* DO IT */ + parseInstruments(); + + /* close .sav file */ + if (fclose(fp) != 0) { + bailOut("Couldn't close .sav File\n"); + } + + return 0; +} + +void bailOut(char* szMessage) { + printf("%s", szMessage); + exit(0); // exit status false +} + +void parseInstruments() { + + int i, j, pu_fine; + int count = 0; + char byte; + char instr[16]; + char synth[16]; + char *name[64][5]; + unsigned long int mask_envelope = 0x000000FF; + unsigned long int mask_wave = 0x000000F0; + unsigned long int mask_output = 0x0000000F; + unsigned long int mask_table = 0x000000DF; + unsigned long int mask_length = 0x0000007F; + unsigned long int mask_synth = 0x000000F; + + +/* + fseek(fp, 0x3A80, SEEK_SET); + for(i=0; i<32; i++) { + for (j=0; j<16; j++) { + fread(&table_vol[j],1,1,fp); + printf("%x", table_vol[j]); + } + } + + printf("\n\n"); +*/ + + /* get instrument names */ + fseek(fp, 0x1E7A, SEEK_SET); + for(i=0; i<64; i++) { + fread(&name[i],1,5,fp); + // printf("%s\n", name[i]); + } + + printf("\n"); + printf("\n"); + /* get the instrument data */ + /* fseek 3080 = SAV */ + /* fseek 995 = LSDSNG? */ + // 64 = total instruments + fseek(fp, 0x3080, SEEK_SET); + for(j=0; j<64; j++) { + for(i=0; i<16; i++) { + fread(&instr[i],1,1,fp); + //printf("%x ", instr[i]); + } + + /* if blank_instrument then, do nothing. */ + if (instr[0] == 0 + && (instr[1] & mask_envelope) == 0xA8 + && (instr[2] == 0) + && (~instr[3] & mask_length) == 0x7F + && (instr[4] & mask_envelope) == 0xFF + && instr[5] == 0 + && (instr[6] & mask_table) == 0 + && instr[7] == 3) { + //break; + } + + printf("\t\n", j); + if (name[j]) printf("\t\t%s\n", name[j]); + else printf("\t\t%s%d\n", channel[instr[0]]); + printf("\t\t%s\n", channel[instr[0]]); + + if (instr[0] != 1) { + // envelope + printf("\t\t%X\n", (instr[1] & mask_envelope)); + } else if (instr[0] == 1) { + // volume + printf("\t\t"); + switch ((instr[1] & mask_envelope)) { + case 0xA8: + printf("3"); + break; + case 0x40: + printf("2"); + break; + case 0x20: + printf("1"); + break; + default: + printf("0"); + } + printf("\n"); + } + + if (instr[0] != 1) { + // wave, output and pu fine: + int wo = (instr[7] & mask_envelope); // wo = wave/output + for(pu_fine=0; pu_fine<16; pu_fine++) { + if ( + wo < 0x04 || + (wo > 0x3F && wo < 0x44) || + (wo > 0x7F && wo < 0x84) || + (wo > 0xBF && wo < 0xC4) + ) { + break; + } + wo = wo - 4; + } + instr[7] = wo; // set the result back to instr[7] (wave+output) + + // wave + if (instr[0] == 0) { + printf("\t\t"); + switch ((instr[7] & mask_wave)) { + case 0x40: + printf("25%%"); + break; + case 0x80: + printf("50%%"); + break; + case 0xC0: + printf("75%%"); + break; + default: + printf("12.5%%"); + } + printf("\n"); + } + } + + // output + printf("\t\t"); + switch ((instr[7] & mask_output)) { + case 0x01: + printf("L-"); + break; + case 0x02: + printf("-R"); + break; + case 0x03: + printf("LR"); + break; + default: + printf("--"); + } + printf("\n"); + + if (instr[0] != 1) { + // length + printf("\t\t"); + switch ((~instr[3] & mask_length)) { + case 0x7F: + printf("UNLIM"); + break; + default: + printf("%X", (~instr[3] & mask_length)); + } + printf("\n"); + + // sweep & shape + printf("\t\t%X\n", (instr[4] & mask_envelope)); + + if (instr[0] == 0) { + // vib type + printf("\t\t%s\n", vibtype[instr[5]]); + // pu2 tune + printf("\t\t%X\n", instr[2]); + // pu fine + printf("\t\t%X\n", pu_fine); + } + + } else if (instr[0] == 1) { + // wave instrument + // vib type + printf("\t\t%s\n", vibtype[instr[5]]); + // synth + printf("\t\t%X\n", (instr[2] & mask_synth)); + // play + printf("\t\t%s\n", play[instr[9]]); + // length + printf("\t\t%X\n", (instr[14] & mask_wave)); + // repeat + printf("\t\t%X\n", (instr[2] & mask_output)); + // Speed + printf("\t\t%X\n", (instr[14] & mask_output) + 1); + } + + // automate + if (instr[5] > 6) printf("\t\tON"); + else printf("\t\tOFF"); + + // table + if (instr[6] != 0) printf("\n\t\t%X
    \n", (instr[6] & mask_table)); + else printf("\n\t\tOFF
    \n"); + + printf("\t
    \n"); + } + + fseek(fp, 0x3EB2, SEEK_SET); + for(j=0; j<16; j++) { + for(i=0; i<16; i++) { + fread(&synth[i],1,1,fp); + } + + if (synth[0] == 0 + && synth[1] == 0 + && synth[2] == 0 + && synth[3] == 0 + && synth[4] == 0 + && (synth[5] & mask_envelope) == 0x10 + && (synth[6] & mask_envelope) == 0xFF + && synth[7] == 0 + && synth[8] == 0 + && (synth[9] & mask_envelope) == 0x10 + && (synth[10] & mask_envelope) == 0xFF + && synth[11] == 0 + && synth[12] == 0) { + break; + } + + printf("\t\n", j); + printf("\t\t%s\n", wave[synth[0]]); + printf("\t\t%s\n", filter[synth[1]]); + printf("\t\t%X\n", synth[2]); + printf("\t\t%s\n", dist[synth[3]]); + printf("\t\t%s\n", phase[synth[4]]); + + printf("\t\t\n"); + printf("\t\t\t%X\n", (synth[5] & mask_envelope)); + printf("\t\t\t%X\n", (synth[6] & mask_envelope)); + printf("\t\t\t%X\n", synth[7]); + printf("\t\t\t%X\n", synth[8]); + printf("\t\t\n"); + + printf("\t\t\n"); + printf("\t\t\t%X\n", (synth[9] & mask_envelope)); + printf("\t\t\t%X\n", (synth[10] & mask_envelope)); + printf("\t\t\t%X\n", synth[11]); + printf("\t\t\t%X\n", synth[12]); + printf("\t\t\n"); + + printf("\t\n"); + } + printf("
    "); + exit(1); // exit status true +} diff --git a/data/lsdj2xml/lview.h b/data/lsdj2xml/lview.h new file mode 100644 index 0000000..c56a722 --- /dev/null +++ b/data/lsdj2xml/lview.h @@ -0,0 +1,70 @@ +/* + * lview - A .sav file viewer for LSDJ + * Author: Georg Wiltschek + * Email: georg.wiltschek AT gmail DOT com + * Version: 0.1 (23/03/09) + * + * Modified by: Josh Perez + * Email: josh AT goatslacker DOT com + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +void bailOut(char* szMessage); +void parseInstruments(); + +char *notes[] = {\ +"---",\ +"C-3","C#3","D-3","D#3","E-3","F-3","F#3","G-3","G#3","A-3","A#3","B-3",\ +"C-4","C#4","D-4","D#4","E-4","F-4","F#4","G-4","G#4","A-4","A#4","B-4",\ +"C-5","C#5","D-5","D#5","E-5","F-5","F#5","G-5","G#5","A-5","A#5","B-5",\ +"C-6","C#6","D-6","D#6","E-6","F-6","F#6","G-6","G#6","A-6","A#6","B-6",\ +"C-7","C#7","D-7","D#7","E-7","F-7","F#7","G-7","G#7","A-7","A#7","B-7",\ +"C-8","C#8","D-8","D#8","E-8","F-8","F#8","G-8","G#8","A-8","A#8","B-8",\ +"C-9","C#9","D-9","D#9","E-9","F-9","F#9","G-9","G#9","A-9","A#9","B-9",\ +"C-A","C#A","D-A","D#A","E-A","F-A","F#A","G-A","G#A","A-A","A#A","B-A",\ +"C-B","C#B","D-B","D#B","E-B","F-B","F#B","G-B","G#B","A-B","A#B","B-B",\ +}; + +char *channel[] = {\ +"PULSE","WAVE","KIT","NOISE"\ +}; + +char *play[] = {\ +"ONCE","LOOP","PINGPONG","MANUAL"\ +}; + +char *wave[] = {\ +"SAW","SQR","TRI"\ +}; + +char *filter[] = {\ +"LOW","HIGHP","BANDP","ALLP"\ +}; + +char *dist[] = {\ +"CLIP","WRAP","PINGPONG","MANUAL"\ +}; + +char *phase[] = {\ +"NORMAL","RESYNC","RESYN2"\ +}; + +char *vibtype[] = {\ +"HF","","SAW","","TRI","","SQR","","HF","","SAW","","TRI","","SQR"\ +}; + +char commands[] = {\ +'-','A','C','D','E','?','G','H','K','L','M','O','P','R','S','T','V','W','Z','-'\ +}; diff --git a/data/lsdj2xml/xml2lsdj.c b/data/lsdj2xml/xml2lsdj.c new file mode 100644 index 0000000..3d7255e --- /dev/null +++ b/data/lsdj2xml/xml2lsdj.c @@ -0,0 +1,105 @@ +/* + XML2LSDJ - Converts XML data into an LSDJ Sav + + Author: Josh Perez + Email: josh AT goatslacker DOT com + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +void bailOut(char* szMessage); +void parseInstruments(); +FILE *fr; +FILE *fp; + +int main(int argc, char **args) { +/* + * Program goals: + * + * read from file 1 + * convert char from file 1 into binary + * overwrite file 2's sav structure data at the FSEEK point with file 1's data + * save the file + * + * perhaps write into a temporary file ? + * use blank lsdj sav structure by default ? + */ + + + /* open .sav file */ + if ((fp = fopen(args[2], "w")) == NULL || + (fr = fopen(args[1], "r")) == NULL) { + bailOut("Error opening .sav File\n"); + } + + /* DO IT */ + parseInstruments(); + + /* close .sav file */ + if (fclose(fp) != 0 || fclose(fr) != 0) { + bailOut("Couldn't close .sav File\n"); + } + + return 0; +} + +void bailOut(char* szMessage) { + printf("%s", szMessage); + exit(0); // exit status false +} + +void parseInstruments() { + + int i, j, pu_fine; + int count = 0; + char byte; + char instr[16]; + char synth[16]; + char name[64]; + unsigned long int mask_envelope = 0x000000FF; + unsigned long int mask_wave = 0x000000F0; + unsigned long int mask_output = 0x0000000F; + unsigned long int mask_table = 0x000000DF; + unsigned long int mask_length = 0x0000007F; + unsigned long int mask_synth = 0x000000F; + + char *buffer; + int n; + + /* get the instrument data */ + /* fseek 3080 = SAV */ + /* fseek 995 = LSDSNG? */ + // 64 = total instruments + fseek(fp, 0x3080, SEEK_SET); + for(j=0; j<64; j++) { + //for(i=0; i<16; i++) { + n = fread(buffer, 1, 16, fr); + fwrite(buffer,1,n,fp); + //} + } + +/* + fseek(fp, 0x3EB2, SEEK_SET); + for(j=0; j<16; j++) { + for(i=0; i<16; i++) { + fread(&synth[i],1,1,fp); + } + } +*/ + + exit(1); // exit status true +} diff --git a/data/psd/header.psd b/data/psd/header.psd new file mode 100644 index 0000000000000000000000000000000000000000..a4a6836ad7cdad7a9536b9df3f40ce2609933b82 GIT binary patch literal 65941 zcmeHw34D~r`Ty*a1SB9<{k8RI)iw&)YOC1(O0nYE)7BP5YpqaQ5d=9DP|lb)A!Kuq zKobbzkejeE>p>6@56W#40tCXDn}iUSKnS^av-|$P&&>P2`|f6U6GGa*_P3eO?9BVj z_nG6FdEa^7XJ+#L?D0PiX9gzzdLZ~CW5z$TUX0@Ockj<0|IP1vT;%Z^*sl>9;FOTk zf_M@$GDP+~0{?T?Q;_(t$S+8i8SAl&DELKr_%+fmse?JxhV?CdKdB*5B z?|g{TU!OMdHPCN{@5!EKFS8kJG<%cX$sXe9e)!FWzYjJ49pfeS9LZCz@RnVnlGqhj zNp#7ceWeaCIkpoK1oo zkMt1uGw^7+@mHes>(=0!8F)MKi{cEP?R=OJ^cVWe$A15tXNNuZ#P6OOrYre&N@Blc zkFnpg-=GG=5PO3Cjy;7KXT#4EiXSIRH7=xtkmJYnQdUsILgMLeTkTF@7Pa@Mh;3vYTh?08qUb^i@D(TiL zD(SXAc2LqFza^n1D5(u4d<*_L_%}pJJ#Ivt^?r>?!Y@kdz06e-rLjl(FMj&`@#QH~ zN566>AELO{l}P>8hmVvg7%QXME9_3)h&8a@Uu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R2%Pg@#> z4M|#rak225>JPOK& z%uj_}QXv-}qU~A;x#;MWF47>E)S^^za+FSxioWzT+d(EGYr&>wZ%d_Y1&u;A+xk>Y zND7@WYTTMyxI}b82M16SmY^N*_3$<&Zd-!F6q-sG*Cv3U$PXgZEYzMrL zW5a@D{xa)w)xMya?UwsGJ}fOK7r)%P+?&}BY@Wx61w$+tyqWF5;BlN-;A6A`Jk56C z&>t%n@aW~%6`C2v<9P83_v6LV3UW~^tSi(;w>xgywgMw~1 zb{N&UQoY;SR_c!%ODlzwS6YGaX0}_YneA4tgxL<<>cL}`*Rir%@N(mfcAPcXveM0L zw-RPMaH|K9Rc`yrs#S{FPInM_mAlz)70h<4#6e_fm2j=ADmfq7bhHD>t8}Bc2@EQ@ zdDR&X)@(e%mQ`+MJ0;T#tI9Y|Gur{BGutVsi>pe2Qq6WeBfZ&9LDjA*TCG}xLM^Mk znC(_e+|{i<4WKaFtp={0*-pcqTn)3`YVT${4V1su$9R+03Rkx_f1S?}Can{$Ze9L5 zA7e=eS?_Jkz#z6>xVrU+1j2n}=mB{g0JELe`TEpco~r9&ePT9G)Vfrkv|kjfneDXt W>`hlY4)Ap0>e6?Es+sLH>i+|Dvf9M} literal 0 HcmV?d00001 diff --git a/data/sql/lib.model.schema.sql b/data/sql/lib.model.schema.sql new file mode 100644 index 0000000..e821af1 --- /dev/null +++ b/data/sql/lib.model.schema.sql @@ -0,0 +1,200 @@ + +# This is a fix for InnoDB in MySQL >= 4.1.x +# It "suspends judgement" for fkey relationships until are tables are set. +SET FOREIGN_KEY_CHECKS = 0; + +#----------------------------------------------------------------------------- +#-- Instrument +#----------------------------------------------------------------------------- + +DROP TABLE IF EXISTS `Instrument`; + + +CREATE TABLE `Instrument` +( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `name` VARCHAR(255) NOT NULL, + `stripped` VARCHAR(255) NOT NULL, + `software` VARCHAR(25) default 'LSDJ' NOT NULL, + `type` VARCHAR(5) NOT NULL, + `description` TEXT, + `object` TEXT, + `owner` VARCHAR(255), + `author` VARCHAR(255), + `author_strip` VARCHAR(255), + `share` BOOLEAN default 1, + `popularity` INTEGER(3) default 0, + `sample` VARCHAR(36), + `updated_at` DATETIME, + PRIMARY KEY (`id`), + KEY `Instrument_stripped_index`(`stripped`), + KEY `Instrument_software_index`(`software`), + KEY `Instrument_type_index`(`type`), + KEY `Instrument_author_strip_index`(`author_strip`), + CONSTRAINT `Instrument_FK_1` + FOREIGN KEY (`software`) + REFERENCES `Ware` (`soft`), + INDEX `Instrument_FI_2` (`owner`), + CONSTRAINT `Instrument_FK_2` + FOREIGN KEY (`owner`) + REFERENCES `User` (`username`) +)Type=MyISAM; + +#----------------------------------------------------------------------------- +#-- User +#----------------------------------------------------------------------------- + +DROP TABLE IF EXISTS `User`; + + +CREATE TABLE `User` +( + `username` VARCHAR(255) NOT NULL, + `stripped` VARCHAR(255), + `realname` VARCHAR(255), + `description` TEXT, + `avatar` VARCHAR(255), + `location` VARCHAR(255), + `is_admin` BOOLEAN default 0, + PRIMARY KEY (`username`), + KEY `User_stripped_index`(`stripped`) +)Type=MyISAM; + +#----------------------------------------------------------------------------- +#-- Tags +#----------------------------------------------------------------------------- + +DROP TABLE IF EXISTS `Tags`; + + +CREATE TABLE `Tags` +( + `instrument_id` INTEGER NOT NULL, + `user_id` VARCHAR(255) NOT NULL, + `tag` VARCHAR(100), + `normalized` VARCHAR(100) NOT NULL, + `created_at` DATETIME, + PRIMARY KEY (`instrument_id`,`user_id`,`normalized`), + CONSTRAINT `Tags_FK_1` + FOREIGN KEY (`instrument_id`) + REFERENCES `Instrument` (`id`), + INDEX `Tags_FI_2` (`user_id`), + CONSTRAINT `Tags_FK_2` + FOREIGN KEY (`user_id`) + REFERENCES `User` (`username`) +)Type=MyISAM; + +#----------------------------------------------------------------------------- +#-- Search +#----------------------------------------------------------------------------- + +DROP TABLE IF EXISTS `Search`; + + +CREATE TABLE `Search` +( + `instrument_id` INTEGER, + `word` VARCHAR(255), + `weight` INTEGER(3) default 0, + `id` INTEGER NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`), + KEY `Search_word_index`(`word`), + INDEX `Search_FI_1` (`instrument_id`), + CONSTRAINT `Search_FK_1` + FOREIGN KEY (`instrument_id`) + REFERENCES `Instrument` (`id`) + ON DELETE CASCADE +)Type=MyISAM; + +#----------------------------------------------------------------------------- +#-- Comment +#----------------------------------------------------------------------------- + +DROP TABLE IF EXISTS `Comment`; + + +CREATE TABLE `Comment` +( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `instrument_id` INTEGER, + `author` VARCHAR(255) default 'anonymous', + `comment` TEXT, + `created_at` DATETIME, + PRIMARY KEY (`id`), + INDEX `Comment_FI_1` (`instrument_id`), + CONSTRAINT `Comment_FK_1` + FOREIGN KEY (`instrument_id`) + REFERENCES `Instrument` (`id`) + ON DELETE CASCADE, + INDEX `Comment_FI_2` (`author`), + CONSTRAINT `Comment_FK_2` + FOREIGN KEY (`author`) + REFERENCES `User` (`username`) +)Type=MyISAM; + +#----------------------------------------------------------------------------- +#-- Bank +#----------------------------------------------------------------------------- + +DROP TABLE IF EXISTS `Bank`; + + +CREATE TABLE `Bank` +( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `name` VARCHAR(255), + `owner` VARCHAR(255), + `software` VARCHAR(25) default 'LSDJ' NOT NULL, + `share` BOOLEAN default 1, + `updated_at` DATETIME, + PRIMARY KEY (`id`), + KEY `Bank_software_index`(`software`), + INDEX `Bank_FI_1` (`owner`), + CONSTRAINT `Bank_FK_1` + FOREIGN KEY (`owner`) + REFERENCES `User` (`username`), + CONSTRAINT `Bank_FK_2` + FOREIGN KEY (`software`) + REFERENCES `Ware` (`soft`) +)Type=MyISAM; + +#----------------------------------------------------------------------------- +#-- InstrumentBank +#----------------------------------------------------------------------------- + +DROP TABLE IF EXISTS `InstrumentBank`; + + +CREATE TABLE `InstrumentBank` +( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `bank_id` INTEGER NOT NULL, + `instrument_id` INTEGER NOT NULL, + PRIMARY KEY (`id`), + INDEX `InstrumentBank_FI_1` (`bank_id`), + CONSTRAINT `InstrumentBank_FK_1` + FOREIGN KEY (`bank_id`) + REFERENCES `Bank` (`id`), + INDEX `InstrumentBank_FI_2` (`instrument_id`), + CONSTRAINT `InstrumentBank_FK_2` + FOREIGN KEY (`instrument_id`) + REFERENCES `Instrument` (`id`) + ON DELETE CASCADE +)Type=MyISAM; + +#----------------------------------------------------------------------------- +#-- Ware +#----------------------------------------------------------------------------- + +DROP TABLE IF EXISTS `Ware`; + + +CREATE TABLE `Ware` +( + `soft` VARCHAR(25) NOT NULL, + `hard` VARCHAR(25), + PRIMARY KEY (`soft`) +)Type=MyISAM; + +# This restores the fkey checks, after having unset them earlier +SET FOREIGN_KEY_CHECKS = 1; diff --git a/data/sql/sqldb.map b/data/sql/sqldb.map new file mode 100644 index 0000000..83d47c5 --- /dev/null +++ b/data/sql/sqldb.map @@ -0,0 +1,2 @@ +# Sqlfile -> Database map +lib.model.schema.sql=propel diff --git a/lib/FamiTracker.class.php b/lib/FamiTracker.class.php new file mode 100644 index 0000000..3e4afa6 --- /dev/null +++ b/lib/FamiTracker.class.php @@ -0,0 +1,11 @@ + diff --git a/lib/Goattracker.class.php b/lib/Goattracker.class.php new file mode 100644 index 0000000..404f7ef --- /dev/null +++ b/lib/Goattracker.class.php @@ -0,0 +1,19 @@ + diff --git a/lib/LSDJ_Noise.class.php b/lib/LSDJ_Noise.class.php new file mode 100644 index 0000000..043c593 --- /dev/null +++ b/lib/LSDJ_Noise.class.php @@ -0,0 +1,35 @@ +table = "ON"; + + $this->_table = array( + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00") + ); + } +} +?> diff --git a/lib/LSDJ_Pulse.class.php b/lib/LSDJ_Pulse.class.php new file mode 100644 index 0000000..c8d6e06 --- /dev/null +++ b/lib/LSDJ_Pulse.class.php @@ -0,0 +1,43 @@ +table = "ON"; + + $this->_table = array( + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00") + ); + } + +} +?> diff --git a/lib/LSDJ_Wave.class.php b/lib/LSDJ_Wave.class.php new file mode 100644 index 0000000..0b9c660 --- /dev/null +++ b/lib/LSDJ_Wave.class.php @@ -0,0 +1,60 @@ +table = "ON"; + + $this->_table = array( + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00"), + array("00","00","-00","-00") + ); + + } + +} +?> diff --git a/lib/PorterStemmer.class.php b/lib/PorterStemmer.class.php new file mode 100644 index 0000000..accab00 --- /dev/null +++ b/lib/PorterStemmer.class.php @@ -0,0 +1,410 @@ + 1) { + self::replace($word, 'e', ''); + + } else if (self::m(substr($word, 0, -1)) == 1) { + + if (!self::cvc(substr($word, 0, -1))) { + self::replace($word, 'e', ''); + } + } + } + + // Part b + if (self::m($word) > 1 AND self::doubleConsonant($word) AND substr($word, -1) == 'l') { + $word = substr($word, 0, -1); + } + + return $word; + } + + + /** + * Replaces the first string with the second, at the end of the string. If third + * arg is given, then the preceding string must match that m count at least. + * + * @param string $str String to check + * @param string $check Ending to check for + * @param string $repl Replacement string + * @param int $m Optional minimum number of m() to meet + * @return bool Whether the $check string was at the end + * of the $str string. True does not necessarily mean + * that it was replaced. + */ + private static function replace(&$str, $check, $repl, $m = null) + { + $len = 0 - strlen($check); + + if (substr($str, $len) == $check) { + $substr = substr($str, 0, $len); + if (is_null($m) OR self::m($substr) > $m) { + $str = $substr . $repl; + } + + return true; + } + + return false; + } + + + /** + * What, you mean it's not obvious from the name? + * + * m() measures the number of consonant sequences in $str. if c is + * a consonant sequence and v a vowel sequence, and <..> indicates arbitrary + * presence, + * + * gives 0 + * vc gives 1 + * vcvc gives 2 + * vcvcvc gives 3 + * + * @param string $str The string to return the m count for + * @return int The m count + */ + private static function m($str) + { + $c = self::$regex_consonant; + $v = self::$regex_vowel; + + $str = preg_replace("#^$c+#", '', $str); + $str = preg_replace("#$v+$#", '', $str); + + preg_match_all("#($v+$c+)#", $str, $matches); + + return count($matches[1]); + } + + + /** + * Returns true/false as to whether the given string contains two + * of the same consonant next to each other at the end of the string. + * + * @param string $str String to check + * @return bool Result + */ + private static function doubleConsonant($str) + { + $c = self::$regex_consonant; + + return preg_match("#$c{2}$#", $str, $matches) AND $matches[0]{0} == $matches[0]{1}; + } + + + /** + * Checks for ending CVC sequence where second C is not W, X or Y + * + * @param string $str String to check + * @return bool Result + */ + private static function cvc($str) + { + $c = self::$regex_consonant; + $v = self::$regex_vowel; + + return preg_match("#($c$v$c)$#", $str, $matches) + AND strlen($matches[1]) == 3 + AND $matches[1]{2} != 'w' + AND $matches[1]{2} != 'x' + AND $matches[1]{2} != 'y'; + } + } +?> diff --git a/lib/Tag.class.php b/lib/Tag.class.php new file mode 100644 index 0000000..ad6a890 --- /dev/null +++ b/lib/Tag.class.php @@ -0,0 +1,43 @@ + $word) + { + if ($word == '"') + { + $delim++; + continue; + } + if (($delim % 2 == 1) && $words[$key - 1] == '"') + { + $tags[] = trim($word); + } + else + { + $tags = array_merge($tags, preg_split('/\s+/', trim($word), -1, PREG_SPLIT_NO_EMPTY)); + } + } + + return $tags; + } +} + +?> diff --git a/lib/editInstrument.php b/lib/editInstrument.php new file mode 100644 index 0000000..d30748b --- /dev/null +++ b/lib/editInstrument.php @@ -0,0 +1,102 @@ +getRequestParameter('type')) { + case "PULSE": + $OB = new LSDJ_Pulse; + + $OB->envelope = $_this->getRequestParameter('envelope'); + $OB->wave = $_this->getRequestParameter('wave'); + $OB->output = $_this->getRequestParameter('output'); + $OB->length = $_this->getRequestParameter('length'); + $OB->sweep = $_this->getRequestParameter('sweep'); + $OB->vib_type = $_this->getRequestParameter('vib_type'); + + $OB->pu2_tune = $_this->getRequestParameter('pu2_tune'); + $OB->pu_fine = $_this->getRequestParameter('pu_fine'); + + $OB->automate = $_this->getRequestParameter('automate'); + $OB->table = $_this->getRequestParameter('table'); + break; + case "NOISE": + $OB = new LSDJ_Noise; + + $OB->envelope = $_this->getRequestParameter('envelope'); + $OB->output = $_this->getRequestParameter('output'); + $OB->length = $_this->getRequestParameter('length'); + $OB->shape = $_this->getRequestParameter('shape'); + + $OB->automate = $_this->getRequestParameter('automate'); + $OB->table = $_this->getRequestParameter('table'); + break; + case "WAVE": + $OB = new LSDJ_Wave; + + $OB->volume = $_this->getRequestParameter('volume'); + $OB->output = $_this->getRequestParameter('output'); + $OB->vib_type = $_this->getRequestParameter('vib_type'); + + $OB->synth = $_this->getRequestParameter('synth'); + $OB->play = $_this->getRequestParameter('play'); + $OB->length = $_this->getRequestParameter('length'); + $OB->repeat = $_this->getRequestParameter('repeat'); + $OB->speed = $_this->getRequestParameter('speed'); + + $OB->automate = $_this->getRequestParameter('automate'); + $OB->table = $_this->getRequestParameter('table'); + + $OB->s_wave = $_this->getRequestParameter('wave'); + $OB->s_filter = $_this->getRequestParameter('filter'); + $OB->s_q = $_this->getRequestParameter('q'); + $OB->s_dist = $_this->getRequestParameter('dist'); + $OB->s_phase = $_this->getRequestParameter('phase'); + + $OB->s_start_volume = $_this->getRequestParameter('start_volume'); + $OB->s_start_cutoff = $_this->getRequestParameter('start_cutoff'); + $OB->s_start_phase = $_this->getRequestParameter('start_phase'); + $OB->s_start_vshift = $_this->getRequestParameter('start_vshift'); + + $OB->s_end_volume = $_this->getRequestParameter('end_volume'); + $OB->s_end_cutoff = $_this->getRequestParameter('end_cutoff'); + $OB->s_end_phase = $_this->getRequestParameter('end_phase'); + $OB->s_end_vshift = $_this->getRequestParameter('end_vshift'); + break; + } + if ($OB->table == "ON") { + $OB->setTable(); +$OB->_table[0]=array($_this->getRequestParameter('t00'),$_this->getRequestParameter('t01'),$_this->getRequestParameter('t02'),$_this->getRequestParameter('t03')); +$OB->_table[1]=array($_this->getRequestParameter('t10'),$_this->getRequestParameter('t11'),$_this->getRequestParameter('t12'),$_this->getRequestParameter('t13')); +$OB->_table[2]=array($_this->getRequestParameter('t20'),$_this->getRequestParameter('t21'),$_this->getRequestParameter('t22'),$_this->getRequestParameter('t23')); +$OB->_table[3]=array($_this->getRequestParameter('t30'),$_this->getRequestParameter('t31'),$_this->getRequestParameter('t32'),$_this->getRequestParameter('t33')); +$OB->_table[4]=array($_this->getRequestParameter('t40'),$_this->getRequestParameter('t41'),$_this->getRequestParameter('t42'),$_this->getRequestParameter('t43')); +$OB->_table[5]=array($_this->getRequestParameter('t50'),$_this->getRequestParameter('t51'),$_this->getRequestParameter('t52'),$_this->getRequestParameter('t53')); +$OB->_table[6]=array($_this->getRequestParameter('t60'),$_this->getRequestParameter('t61'),$_this->getRequestParameter('t62'),$_this->getRequestParameter('t63')); +$OB->_table[7]=array($_this->getRequestParameter('t70'),$_this->getRequestParameter('t71'),$_this->getRequestParameter('t72'),$_this->getRequestParameter('t73')); +$OB->_table[8]=array($_this->getRequestParameter('t80'),$_this->getRequestParameter('t81'),$_this->getRequestParameter('t82'),$_this->getRequestParameter('t83')); +$OB->_table[9]=array($_this->getRequestParameter('ta0'),$_this->getRequestParameter('ta1'),$_this->getRequestParameter('ta2'),$_this->getRequestParameter('ta3')); +$OB->_table[10]=array($_this->getRequestParameter('tb0'),$_this->getRequestParameter('tb1'),$_this->getRequestParameter('tb2'),$_this->getRequestParameter('tb3')); +$OB->_table[11]=array($_this->getRequestParameter('tc0'),$_this->getRequestParameter('tc1'),$_this->getRequestParameter('tc2'),$_this->getRequestParameter('tc3')); +$OB->_table[12]=array($_this->getRequestParameter('td0'),$_this->getRequestParameter('td1'),$_this->getRequestParameter('td2'),$_this->getRequestParameter('td3')); +$OB->_table[13]=array($_this->getRequestParameter('te0'),$_this->getRequestParameter('te1'),$_this->getRequestParameter('te2'),$_this->getRequestParameter('te3')); +$OB->_table[14]=array($_this->getRequestParameter('tf0'),$_this->getRequestParameter('tf1'),$_this->getRequestParameter('tf2'),$_this->getRequestParameter('tf3')); + } + + return $OB; + } + + public static function FamiTracker($_this) { + $OB = new FamiTracker; + $OB->volume = str_replace(","," ",$_this->getRequestParameter('volume')); + $OB->arpeggio = str_replace(","," ",$_this->getRequestParameter('arpeggio')); + $OB->pitch = str_replace(","," ",$_this->getRequestParameter('pitch')); + $OB->hi_pitch = str_replace(","," ",$_this->getRequestParameter('hi_pitch')); + $OB->duty_noise = str_replace(","," ",$_this->getRequestParameter('duty_noise')); + + return $OB; + } +} + +?> diff --git a/lib/model/Bank.php b/lib/model/Bank.php new file mode 100644 index 0000000..992ef57 --- /dev/null +++ b/lib/model/Bank.php @@ -0,0 +1,16 @@ +getId()); +} +} diff --git a/lib/model/BankPeer.php b/lib/model/BankPeer.php new file mode 100644 index 0000000..e8b1a03 --- /dev/null +++ b/lib/model/BankPeer.php @@ -0,0 +1,12 @@ +getName(); +} + +public function getAuthor() { + return htmlentities(parent::getAuthor()); +} + +public function save($con = null) +{ + $con = sfContext::getInstance()->getDatabaseConnection('propel'); + try + { + $con->begin(); + + $ret = parent::save($con); + $this->updateSearchIndex(); + + $con->commit(); + + return $ret; + } + catch (Exception $e) + { + $con->rollback(); + throw $e; + } +} + +public function updateSearchIndex() +{ + // delete existing Search entries + $c = new Criteria(); + $c->add(SearchPeer::INSTRUMENT_ID, $this->getId()); + SearchPeer::doDelete($c); + + // create a new entry for each of the words of the question + foreach ($this->getWords() as $word => $weight) + { + $index = new Search(); + $index->setInstrumentId($this->getId()); + $index->setWord($word); + $index->setWeight($weight); + $index->save(); + } +} + +public function getWords() +{ + // add weight + $raw_text = str_repeat(' '.strip_tags($this->getDescription()), sfConfig::get('app_search_body_weight')); + $raw_text .= str_repeat(' '.$this->getName(), sfConfig::get('app_search_title_weight')); + + // title and body stemming + $stemmed_words = myTools::stemPhrase($raw_text); + + // unique words with weight + $words = array_count_values($stemmed_words); + + // add tags + $max = 0; + foreach ($this->getPopularTags(20) as $tag => $count) + { + if (!$max) + { + $max = $count; + } + + $stemmed_tag = PorterStemmer::stem($tag); + + if (!isset($words[$stemmed_tag])) + { + $words[$stemmed_tag] = 0; + } + $words[$stemmed_tag] += ceil(($count / $max) * sfConfig::get('app_search_tag_weight')); + } + + return $words; +} + +public function setOwner($v) +{ + $author = ($this->getAuthor() == "") ? $v : $this->getAuthor(); + parent::setOwner($v); + $this->setAuthor($author); +} + +public function setName($v) +{ + parent::setName($v); + $stripped = myTools::url_encode($v); + $this->setStripped($stripped); +} + +public function setAuthor($v) { + parent::setAuthor($v); + $stripped = myTools::url_encode($v); + $this->setAuthorStrip($stripped); +} + +public function addTagsForUser($phrase, $userId) +{ + // split phrase into individual tags + $tags = Tag::splitPhrase($phrase); + + // add tags + foreach ($tags as $tag) + { + $instrumentTag = new Tags(); + $instrumentTag->setInstrumentId($this->getId()); + $instrumentTag->setUserId($userId); + $instrumentTag->setTag($tag); + $instrumentTag->save(); + } +} +public function getPopularTags($max = 5) +{ //gets most popular tags to display on homepage while listing instruments + $tags = array(); + + $con = Propel::getConnection(); + $query = ' + SELECT %s AS tag, COUNT(%s) AS count + FROM %s + WHERE %s = ? + GROUP BY %s + ORDER BY count DESC + '; + + $query = sprintf($query, + TagsPeer::NORMALIZED, + TagsPeer::NORMALIZED, + TagsPeer::TABLE_NAME, + TagsPeer::INSTRUMENT_ID, + TagsPeer::NORMALIZED + ); + + $stmt = $con->prepareStatement($query); + $stmt->setInt(1, $this->getId()); + $stmt->setLimit($max); + $rs = $stmt->executeQuery(); + while ($rs->next()) + { + $tags[$rs->getString('tag')] = $rs->getInt('count'); + } + + return $tags; +} +public function getTags() +{ + $c = new Criteria(); + $c->clearSelectColumns(); + $c->addSelectColumn(TagsPeer::NORMALIZED); + $c->add(TagsPeer::INSTRUMENT_ID, $this->getId()); + $c->setDistinct(); + $c->addAscendingOrderByColumn(TagsPeer::NORMALIZED); + + $tags = array(); + $rs = TagsPeer::doSelectRS($c); + while ($rs->next()) + { + $tags[] = $rs->getString(1); + } + + return $tags; +} + +public function getLink() { + return link_to(substr(parent::getName(),0,32),'@instrument?author='.parent::getAuthorStrip().'&name='.parent::getStripped()); +} +} diff --git a/lib/model/InstrumentBank.php b/lib/model/InstrumentBank.php new file mode 100644 index 0000000..cda07aa --- /dev/null +++ b/lib/model/InstrumentBank.php @@ -0,0 +1,12 @@ +add(InstrumentBankPeer::BANK_ID,$bank_id); + $bank = InstrumentBankPeer::doDelete($c); + + return $bank ? true : false; + } + + public static function getAllInstruments($bank_id) { + $c = new Criteria(); + $c->add(InstrumentBankPeer::BANK_ID,$bank_id); + $instruments = self::doSelect($c); + $where = array(); + foreach ($instruments as $instrument) { + $where[] = $instrument->getInstrumentId(); + } + return InstrumentPeer::retrieveWhereIn($where); + } +} diff --git a/lib/model/InstrumentPeer.php b/lib/model/InstrumentPeer.php new file mode 100644 index 0000000..e8cf86e --- /dev/null +++ b/lib/model/InstrumentPeer.php @@ -0,0 +1,204 @@ +add(InstrumentPeer::AUTHOR_STRIP,$author); + if (sfConfig::get('app_universe')) $c->add(InstrumentPeer::SOFTWARE,sfConfig::get('app_tag')); + $c->addAnd(InstrumentPeer::SHARE,'1'); + $instruments = InstrumentPeer::doSelect($c); + + return $instruments; + } + + public static function getByAuthorNoStrip($author) + { + $c = new Criteria(); + $c->add(InstrumentPeer::AUTHOR,$author); + if (sfConfig::get('app_universe')) $c->add(InstrumentPeer::SOFTWARE,sfConfig::get('app_tag')); + $c->addAnd(InstrumentPeer::SHARE,'1'); + $instruments = InstrumentPeer::doSelect($c); + + return $instruments; + } + + public static function getByBank($bank_id) { + $c = new Criteria(); + $c->addJoin(InstrumentBankPeer::INSTRUMENT_ID, InstrumentPeer::ID); + $c->add(InstrumentBankPeer::BANK_ID,$bank_id); + $c->addAnd(InstrumentPeer::SHARE,'1'); + $instruments = InstrumentPeer::doSelect($c); + + return $instruments; + } + + public static function getByType($type,$page=1) { + $pager = new sfPropelPager('Instrument', sfConfig::get('app_pager_homepage_max')); + $c = new Criteria(); + $c->add(InstrumentPeer::TYPE,$type); + $c->addAnd(InstrumentPeer::SHARE,'1'); + $pager->setCriteria($c); + $pager->setPage($page); + $pager->init(); + + return $pager; + } + + public static function retrieveWhereIn($where) { + $c = new Criteria(); + $c->add(InstrumentPeer::ID,$where,Criteria::IN); + if (sfConfig::get('app_universe')) $c->add(InstrumentPeer::SOFTWARE,sfConfig::get('app_tag')); + $c->addAnd(InstrumentPeer::SHARE,'1'); + $orderBy = ''; + foreach($where as $item) { + $orderBy .= $item . ','; + } + $orderBy = ($orderBy)? "FIELD(".InstrumentPeer::ID.",".rtrim($orderBy,',').")":InstrumentPeer::ID; + $c->addAscendingOrderByColumn($orderBy); + $instruments = InstrumentPeer::doSelect($c); + + return $instruments; + } + + public static function search($phrase, $exact = false, $offset = 0, $max = 10) + { + $words = array_values(myTools::stemPhrase($phrase)); + $nb_words = count($words); + + if (!$words) + { + return array(); + } + + $con = Propel::getConnection(); + $query = ' + SELECT DISTINCT %s, COUNT(*) AS nb, SUM(%s) AS total_weight + FROM %s + WHERE + '; + + $query .= '('.implode(' OR ', array_fill(0, $nb_words, SearchPeer::WORD.' = ?')).') + GROUP BY %s + '; + + // AND query? + if ($exact) + { + $query .= ' HAVING nb = '.$nb_words; + } + + $query .= ' ORDER BY nb DESC, total_weight DESC'; + + $query = sprintf($query, + SearchPeer::INSTRUMENT_ID, + SearchPeer::WEIGHT, + SearchPeer::TABLE_NAME, + SearchPeer::INSTRUMENT_ID + ); + + $stmt = $con->prepareStatement($query); + $stmt->setOffset($offset); + $stmt->setLimit($max); + $placeholder_offset = 1; + + for ($i = 0; $i < $nb_words; $i++) + { + $stmt->setString($i + $placeholder_offset, $words[$i]); + } + $rs = $stmt->executeQuery(ResultSet::FETCHMODE_NUM); + $instruments = array(); + while ($rs->next()) + { + $instruments[] = $rs->getInt(1); + } + $instruments = self::retrieveWhereIn($instruments); + + return $instruments; + } + +public static function getHomepagePager($page) +{ + $pager = new sfPropelPager('Instrument', sfConfig::get('app_pager_homepage_max')); + $c = new Criteria(); + $USER = sfContext::getInstance()->getUser(); + $c1 = $c->getNewCriterion(InstrumentPeer::OWNER, $USER->getUsername()); + $c2 = $c->getNewCriterion(InstrumentPeer::SHARE, '1'); + $c1->addOr($c2); + $c->add($c1); + if (sfConfig::get('app_universe')) $c->add(InstrumentPeer::SOFTWARE,sfConfig::get('app_tag')); + $c->addDescendingOrderByColumn(self::UPDATED_AT); + $pager->setCriteria($c); + $pager->setPage($page); + $pager->init(); + + return $pager; +} + +public static function getPopularPager($page) +{ + $pager = new sfPropelPager('Instrument', sfConfig::get('app_pager_homepage_max')); + $c = new Criteria(); + $USER = sfContext::getInstance()->getUser(); + $c1 = $c->getNewCriterion(InstrumentPeer::OWNER, $USER->getUsername()); + $c2 = $c->getNewCriterion(InstrumentPeer::SHARE, '1'); + $c1->addOr($c2); + $c->add($c1); + if (sfConfig::get('app_universe')) $c->add(InstrumentPeer::SOFTWARE,sfConfig::get('app_tag')); + $c->addDescendingOrderByColumn(self::POPULARITY); + $pager->setCriteria($c); + $pager->setPage($page); + $pager->init(); + + return $pager; +} + +public static function getPopularAuthor() +{ + $c = new Criteria(); + if (sfConfig::get('app_universe')) $c->add(InstrumentPeer::SOFTWARE,sfConfig::get('app_tag')); + $c->addGroupByColumn(self::AUTHOR); + $c->addDescendingOrderByColumn('count(*)'); + $author = self::doSelect($c); + + return $author; +} + +public static function getPopularByTag($tag, $page) +{ + $c = new Criteria(); + $c->add(TagsPeer::NORMALIZED, $tag); + if (sfConfig::get('app_universe')) $c->add(InstrumentPeer::SOFTWARE,sfConfig::get('app_tag')); + $c->addJoin(TagsPeer::INSTRUMENT_ID, InstrumentPeer::ID, Criteria::LEFT_JOIN); + + $pager = new sfPropelPager('Instrument', sfConfig::get('app_pager_homepage_max')); + $pager->setCriteria($c); + $pager->setPage($page); + $pager->init(); + + return $pager; +} + +public static function retrieveByName($name,$author) { + $c = new Criteria(); + $c->add(InstrumentPeer::STRIPPED, $name); + $c->addAnd(InstrumentPeer::AUTHOR_STRIP, $author); + + return InstrumentPeer::doSelectOne($c); +} + +public static function addLike($instrument) { + $count = $instrument->getPopularity() + 1; + $instrument->setPopularity($count); + $instrument->save(); +} + +} diff --git a/lib/model/Search.php b/lib/model/Search.php new file mode 100644 index 0000000..2439530 --- /dev/null +++ b/lib/model/Search.php @@ -0,0 +1,12 @@ +getDatabaseConnection('propel'); + try + { + $con->begin(); + + $ret = parent::save($con); + $this->getInstrument()->updateSearchIndex(); + + $con->commit(); + + return $ret; + } + catch (Exception $e) + { + $con->rollback(); + throw $e; + } +} +public function setTag($v) +{ + parent::setTag($v); + + $this->setNormalized(Tag::normalize($v)); +} +} diff --git a/lib/model/TagsPeer.php b/lib/model/TagsPeer.php new file mode 100644 index 0000000..ce3c41e --- /dev/null +++ b/lib/model/TagsPeer.php @@ -0,0 +1,42 @@ +prepareStatement($query); + $stmt->setLimit($max); + $rs = $stmt->executeQuery(); + $max_popularity = 0; + while ($rs->next()) + { + if (!$max_popularity) + { + $max_popularity = $rs->getInt('count'); + } + + $tags[$rs->getString('tag')] = floor(($rs->getInt('count') / $max_popularity * 3) + 1); + } + + ksort($tags); + + return $tags; +} +} diff --git a/lib/model/User.php b/lib/model/User.php new file mode 100644 index 0000000..79da0a5 --- /dev/null +++ b/lib/model/User.php @@ -0,0 +1,22 @@ +getUsername(); +} + +public function setUsername($v) { + parent::setUsername($v); + $stripped = myTools::url_encode($v); + $this->setStripped($stripped); +} +} diff --git a/lib/model/UserPeer.php b/lib/model/UserPeer.php new file mode 100644 index 0000000..ea28968 --- /dev/null +++ b/lib/model/UserPeer.php @@ -0,0 +1,30 @@ +addJoin(self::USERNAME, InstrumentPeer::OWNER); + $c->addGroupByColumn(InstrumentPeer::OWNER); + if (sfConfig::get('app_universe')) $c->add(InstrumentPeer::SOFTWARE,sfConfig::get('app_tag')); + $c->addDescendingOrderByColumn('count(*)'); + $owner = self::doSelect($c); + + return $owner; +} +public static function retrieveByStripped($name) { + $c = new Criteria(); + $c->add(self::STRIPPED,$name); + $owner = self::doSelect($c); + + return !empty($owner) > 0 ? $owner[0] : null; +} +} diff --git a/lib/model/Ware.php b/lib/model/Ware.php new file mode 100644 index 0000000..39e523d --- /dev/null +++ b/lib/model/Ware.php @@ -0,0 +1,12 @@ +dbMap !== null); + } + + + public function getDatabaseMap() + { + return $this->dbMap; + } + + + public function doBuild() + { + $this->dbMap = Propel::getDatabaseMap('propel'); + + $tMap = $this->dbMap->addTable('Bank'); + $tMap->setPhpName('Bank'); + + $tMap->setUseIdGenerator(true); + + $tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null); + + $tMap->addColumn('NAME', 'Name', 'string', CreoleTypes::VARCHAR, false, 255); + + $tMap->addForeignKey('OWNER', 'Owner', 'string', CreoleTypes::VARCHAR, 'User', 'USERNAME', false, 255); + + $tMap->addForeignKey('SOFTWARE', 'Software', 'string', CreoleTypes::VARCHAR, 'Ware', 'SOFT', true, 25); + + $tMap->addColumn('SHARE', 'Share', 'boolean', CreoleTypes::BOOLEAN, false, null); + + $tMap->addColumn('UPDATED_AT', 'UpdatedAt', 'int', CreoleTypes::TIMESTAMP, false, null); + + } +} \ No newline at end of file diff --git a/lib/model/map/CommentMapBuilder.php b/lib/model/map/CommentMapBuilder.php new file mode 100644 index 0000000..a7156c2 --- /dev/null +++ b/lib/model/map/CommentMapBuilder.php @@ -0,0 +1,46 @@ +dbMap !== null); + } + + + public function getDatabaseMap() + { + return $this->dbMap; + } + + + public function doBuild() + { + $this->dbMap = Propel::getDatabaseMap('propel'); + + $tMap = $this->dbMap->addTable('Comment'); + $tMap->setPhpName('Comment'); + + $tMap->setUseIdGenerator(true); + + $tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null); + + $tMap->addForeignKey('INSTRUMENT_ID', 'InstrumentId', 'int', CreoleTypes::INTEGER, 'Instrument', 'ID', false, null); + + $tMap->addForeignKey('AUTHOR', 'Author', 'string', CreoleTypes::VARCHAR, 'User', 'USERNAME', false, 255); + + $tMap->addColumn('COMMENT', 'Comment', 'string', CreoleTypes::LONGVARCHAR, false, null); + + $tMap->addColumn('CREATED_AT', 'CreatedAt', 'int', CreoleTypes::TIMESTAMP, false, null); + + } +} \ No newline at end of file diff --git a/lib/model/map/InstrumentBankMapBuilder.php b/lib/model/map/InstrumentBankMapBuilder.php new file mode 100644 index 0000000..f53c47f --- /dev/null +++ b/lib/model/map/InstrumentBankMapBuilder.php @@ -0,0 +1,42 @@ +dbMap !== null); + } + + + public function getDatabaseMap() + { + return $this->dbMap; + } + + + public function doBuild() + { + $this->dbMap = Propel::getDatabaseMap('propel'); + + $tMap = $this->dbMap->addTable('InstrumentBank'); + $tMap->setPhpName('InstrumentBank'); + + $tMap->setUseIdGenerator(true); + + $tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null); + + $tMap->addForeignKey('BANK_ID', 'BankId', 'int', CreoleTypes::INTEGER, 'Bank', 'ID', true, null); + + $tMap->addForeignKey('INSTRUMENT_ID', 'InstrumentId', 'int', CreoleTypes::INTEGER, 'Instrument', 'ID', true, null); + + } +} \ No newline at end of file diff --git a/lib/model/map/InstrumentMapBuilder.php b/lib/model/map/InstrumentMapBuilder.php new file mode 100644 index 0000000..57af3bd --- /dev/null +++ b/lib/model/map/InstrumentMapBuilder.php @@ -0,0 +1,64 @@ +dbMap !== null); + } + + + public function getDatabaseMap() + { + return $this->dbMap; + } + + + public function doBuild() + { + $this->dbMap = Propel::getDatabaseMap('propel'); + + $tMap = $this->dbMap->addTable('Instrument'); + $tMap->setPhpName('Instrument'); + + $tMap->setUseIdGenerator(true); + + $tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null); + + $tMap->addColumn('NAME', 'Name', 'string', CreoleTypes::VARCHAR, true, 255); + + $tMap->addColumn('STRIPPED', 'Stripped', 'string', CreoleTypes::VARCHAR, true, 255); + + $tMap->addForeignKey('SOFTWARE', 'Software', 'string', CreoleTypes::VARCHAR, 'Ware', 'SOFT', true, 25); + + $tMap->addColumn('TYPE', 'Type', 'string', CreoleTypes::VARCHAR, true, 5); + + $tMap->addColumn('DESCRIPTION', 'Description', 'string', CreoleTypes::LONGVARCHAR, false, null); + + $tMap->addColumn('OBJECT', 'Object', 'string', CreoleTypes::LONGVARCHAR, false, null); + + $tMap->addForeignKey('OWNER', 'Owner', 'string', CreoleTypes::VARCHAR, 'User', 'USERNAME', false, 255); + + $tMap->addColumn('AUTHOR', 'Author', 'string', CreoleTypes::VARCHAR, false, 255); + + $tMap->addColumn('AUTHOR_STRIP', 'AuthorStrip', 'string', CreoleTypes::VARCHAR, false, 255); + + $tMap->addColumn('SHARE', 'Share', 'boolean', CreoleTypes::BOOLEAN, false, null); + + $tMap->addColumn('POPULARITY', 'Popularity', 'int', CreoleTypes::INTEGER, false, 3); + + $tMap->addColumn('SAMPLE', 'Sample', 'string', CreoleTypes::VARCHAR, false, 36); + + $tMap->addColumn('UPDATED_AT', 'UpdatedAt', 'int', CreoleTypes::TIMESTAMP, false, null); + + } +} \ No newline at end of file diff --git a/lib/model/map/SearchMapBuilder.php b/lib/model/map/SearchMapBuilder.php new file mode 100644 index 0000000..6ef238c --- /dev/null +++ b/lib/model/map/SearchMapBuilder.php @@ -0,0 +1,44 @@ +dbMap !== null); + } + + + public function getDatabaseMap() + { + return $this->dbMap; + } + + + public function doBuild() + { + $this->dbMap = Propel::getDatabaseMap('propel'); + + $tMap = $this->dbMap->addTable('Search'); + $tMap->setPhpName('Search'); + + $tMap->setUseIdGenerator(true); + + $tMap->addForeignKey('INSTRUMENT_ID', 'InstrumentId', 'int', CreoleTypes::INTEGER, 'Instrument', 'ID', false, null); + + $tMap->addColumn('WORD', 'Word', 'string', CreoleTypes::VARCHAR, false, 255); + + $tMap->addColumn('WEIGHT', 'Weight', 'int', CreoleTypes::INTEGER, false, 3); + + $tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null); + + } +} \ No newline at end of file diff --git a/lib/model/map/TagsMapBuilder.php b/lib/model/map/TagsMapBuilder.php new file mode 100644 index 0000000..6c7e340 --- /dev/null +++ b/lib/model/map/TagsMapBuilder.php @@ -0,0 +1,46 @@ +dbMap !== null); + } + + + public function getDatabaseMap() + { + return $this->dbMap; + } + + + public function doBuild() + { + $this->dbMap = Propel::getDatabaseMap('propel'); + + $tMap = $this->dbMap->addTable('Tags'); + $tMap->setPhpName('Tags'); + + $tMap->setUseIdGenerator(false); + + $tMap->addForeignPrimaryKey('INSTRUMENT_ID', 'InstrumentId', 'int' , CreoleTypes::INTEGER, 'Instrument', 'ID', true, null); + + $tMap->addForeignPrimaryKey('USER_ID', 'UserId', 'string' , CreoleTypes::VARCHAR, 'User', 'USERNAME', true, 255); + + $tMap->addColumn('TAG', 'Tag', 'string', CreoleTypes::VARCHAR, false, 100); + + $tMap->addPrimaryKey('NORMALIZED', 'Normalized', 'string', CreoleTypes::VARCHAR, true, 100); + + $tMap->addColumn('CREATED_AT', 'CreatedAt', 'int', CreoleTypes::TIMESTAMP, false, null); + + } +} \ No newline at end of file diff --git a/lib/model/map/UserMapBuilder.php b/lib/model/map/UserMapBuilder.php new file mode 100644 index 0000000..f106e3b --- /dev/null +++ b/lib/model/map/UserMapBuilder.php @@ -0,0 +1,50 @@ +dbMap !== null); + } + + + public function getDatabaseMap() + { + return $this->dbMap; + } + + + public function doBuild() + { + $this->dbMap = Propel::getDatabaseMap('propel'); + + $tMap = $this->dbMap->addTable('User'); + $tMap->setPhpName('User'); + + $tMap->setUseIdGenerator(false); + + $tMap->addPrimaryKey('USERNAME', 'Username', 'string', CreoleTypes::VARCHAR, true, 255); + + $tMap->addColumn('STRIPPED', 'Stripped', 'string', CreoleTypes::VARCHAR, false, 255); + + $tMap->addColumn('REALNAME', 'Realname', 'string', CreoleTypes::VARCHAR, false, 255); + + $tMap->addColumn('DESCRIPTION', 'Description', 'string', CreoleTypes::LONGVARCHAR, false, null); + + $tMap->addColumn('AVATAR', 'Avatar', 'string', CreoleTypes::VARCHAR, false, 255); + + $tMap->addColumn('LOCATION', 'Location', 'string', CreoleTypes::VARCHAR, false, 255); + + $tMap->addColumn('IS_ADMIN', 'IsAdmin', 'boolean', CreoleTypes::BOOLEAN, false, null); + + } +} \ No newline at end of file diff --git a/lib/model/map/WareMapBuilder.php b/lib/model/map/WareMapBuilder.php new file mode 100644 index 0000000..f1af404 --- /dev/null +++ b/lib/model/map/WareMapBuilder.php @@ -0,0 +1,40 @@ +dbMap !== null); + } + + + public function getDatabaseMap() + { + return $this->dbMap; + } + + + public function doBuild() + { + $this->dbMap = Propel::getDatabaseMap('propel'); + + $tMap = $this->dbMap->addTable('Ware'); + $tMap->setPhpName('Ware'); + + $tMap->setUseIdGenerator(false); + + $tMap->addPrimaryKey('SOFT', 'Soft', 'string', CreoleTypes::VARCHAR, true, 25); + + $tMap->addColumn('HARD', 'Hard', 'string', CreoleTypes::VARCHAR, false, 25); + + } +} \ No newline at end of file diff --git a/lib/model/om/BaseBank.php b/lib/model/om/BaseBank.php new file mode 100644 index 0000000..70274d9 --- /dev/null +++ b/lib/model/om/BaseBank.php @@ -0,0 +1,736 @@ +id; + } + + + public function getName() + { + + return $this->name; + } + + + public function getOwner() + { + + return $this->owner; + } + + + public function getSoftware() + { + + return $this->software; + } + + + public function getShare() + { + + return $this->share; + } + + + public function getUpdatedAt($format = 'Y-m-d H:i:s') + { + + if ($this->updated_at === null || $this->updated_at === '') { + return null; + } elseif (!is_int($this->updated_at)) { + $ts = strtotime($this->updated_at); + if ($ts === -1 || $ts === false) { throw new PropelException("Unable to parse value of [updated_at] as date/time value: " . var_export($this->updated_at, true)); + } + } else { + $ts = $this->updated_at; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + + public function setId($v) + { + + + + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->id !== $v) { + $this->id = $v; + $this->modifiedColumns[] = BankPeer::ID; + } + + } + + public function setName($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->name !== $v) { + $this->name = $v; + $this->modifiedColumns[] = BankPeer::NAME; + } + + } + + public function setOwner($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->owner !== $v) { + $this->owner = $v; + $this->modifiedColumns[] = BankPeer::OWNER; + } + + if ($this->aUser !== null && $this->aUser->getUsername() !== $v) { + $this->aUser = null; + } + + } + + public function setSoftware($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->software !== $v || $v === 'LSDJ') { + $this->software = $v; + $this->modifiedColumns[] = BankPeer::SOFTWARE; + } + + if ($this->aWare !== null && $this->aWare->getSoft() !== $v) { + $this->aWare = null; + } + + } + + public function setShare($v) + { + + if ($this->share !== $v || $v === true) { + $this->share = $v; + $this->modifiedColumns[] = BankPeer::SHARE; + } + + } + + public function setUpdatedAt($v) + { + + if ($v !== null && !is_int($v)) { + $ts = strtotime($v); + if ($ts === -1 || $ts === false) { throw new PropelException("Unable to parse date/time value for [updated_at] from input: " . var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->updated_at !== $ts) { + $this->updated_at = $ts; + $this->modifiedColumns[] = BankPeer::UPDATED_AT; + } + + } + + public function hydrate(ResultSet $rs, $startcol = 1) + { + try { + + $this->id = $rs->getInt($startcol + 0); + + $this->name = $rs->getString($startcol + 1); + + $this->owner = $rs->getString($startcol + 2); + + $this->software = $rs->getString($startcol + 3); + + $this->share = $rs->getBoolean($startcol + 4); + + $this->updated_at = $rs->getTimestamp($startcol + 5, null); + + $this->resetModified(); + + $this->setNew(false); + + return $startcol + 6; + } catch (Exception $e) { + throw new PropelException("Error populating Bank object", $e); + } + } + + + public function delete($con = null) + { + if ($this->isDeleted()) { + throw new PropelException("This object has already been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(BankPeer::DATABASE_NAME); + } + + try { + $con->begin(); + BankPeer::doDelete($this, $con); + $this->setDeleted(true); + $con->commit(); + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public function save($con = null) + { + if ($this->isModified() && !$this->isColumnModified(BankPeer::UPDATED_AT)) + { + $this->setUpdatedAt(time()); + } + + if ($this->isDeleted()) { + throw new PropelException("You cannot save an object that has been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(BankPeer::DATABASE_NAME); + } + + try { + $con->begin(); + $affectedRows = $this->doSave($con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + protected function doSave($con) + { + $affectedRows = 0; if (!$this->alreadyInSave) { + $this->alreadyInSave = true; + + + + if ($this->aUser !== null) { + if ($this->aUser->isModified()) { + $affectedRows += $this->aUser->save($con); + } + $this->setUser($this->aUser); + } + + if ($this->aWare !== null) { + if ($this->aWare->isModified()) { + $affectedRows += $this->aWare->save($con); + } + $this->setWare($this->aWare); + } + + + if ($this->isModified()) { + if ($this->isNew()) { + $pk = BankPeer::doInsert($this, $con); + $affectedRows += 1; + $this->setId($pk); + $this->setNew(false); + } else { + $affectedRows += BankPeer::doUpdate($this, $con); + } + $this->resetModified(); } + + if ($this->collInstrumentBanks !== null) { + foreach($this->collInstrumentBanks as $referrerFK) { + if (!$referrerFK->isDeleted()) { + $affectedRows += $referrerFK->save($con); + } + } + } + + $this->alreadyInSave = false; + } + return $affectedRows; + } + + protected $validationFailures = array(); + + + public function getValidationFailures() + { + return $this->validationFailures; + } + + + public function validate($columns = null) + { + $res = $this->doValidate($columns); + if ($res === true) { + $this->validationFailures = array(); + return true; + } else { + $this->validationFailures = $res; + return false; + } + } + + + protected function doValidate($columns = null) + { + if (!$this->alreadyInValidation) { + $this->alreadyInValidation = true; + $retval = null; + + $failureMap = array(); + + + + if ($this->aUser !== null) { + if (!$this->aUser->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aUser->getValidationFailures()); + } + } + + if ($this->aWare !== null) { + if (!$this->aWare->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aWare->getValidationFailures()); + } + } + + + if (($retval = BankPeer::doValidate($this, $columns)) !== true) { + $failureMap = array_merge($failureMap, $retval); + } + + + if ($this->collInstrumentBanks !== null) { + foreach($this->collInstrumentBanks as $referrerFK) { + if (!$referrerFK->validate($columns)) { + $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); + } + } + } + + + $this->alreadyInValidation = false; + } + + return (!empty($failureMap) ? $failureMap : true); + } + + + public function getByName($name, $type = BasePeer::TYPE_PHPNAME) + { + $pos = BankPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->getByPosition($pos); + } + + + public function getByPosition($pos) + { + switch($pos) { + case 0: + return $this->getId(); + break; + case 1: + return $this->getName(); + break; + case 2: + return $this->getOwner(); + break; + case 3: + return $this->getSoftware(); + break; + case 4: + return $this->getShare(); + break; + case 5: + return $this->getUpdatedAt(); + break; + default: + return null; + break; + } } + + + public function toArray($keyType = BasePeer::TYPE_PHPNAME) + { + $keys = BankPeer::getFieldNames($keyType); + $result = array( + $keys[0] => $this->getId(), + $keys[1] => $this->getName(), + $keys[2] => $this->getOwner(), + $keys[3] => $this->getSoftware(), + $keys[4] => $this->getShare(), + $keys[5] => $this->getUpdatedAt(), + ); + return $result; + } + + + public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) + { + $pos = BankPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->setByPosition($pos, $value); + } + + + public function setByPosition($pos, $value) + { + switch($pos) { + case 0: + $this->setId($value); + break; + case 1: + $this->setName($value); + break; + case 2: + $this->setOwner($value); + break; + case 3: + $this->setSoftware($value); + break; + case 4: + $this->setShare($value); + break; + case 5: + $this->setUpdatedAt($value); + break; + } } + + + public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) + { + $keys = BankPeer::getFieldNames($keyType); + + if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); + if (array_key_exists($keys[1], $arr)) $this->setName($arr[$keys[1]]); + if (array_key_exists($keys[2], $arr)) $this->setOwner($arr[$keys[2]]); + if (array_key_exists($keys[3], $arr)) $this->setSoftware($arr[$keys[3]]); + if (array_key_exists($keys[4], $arr)) $this->setShare($arr[$keys[4]]); + if (array_key_exists($keys[5], $arr)) $this->setUpdatedAt($arr[$keys[5]]); + } + + + public function buildCriteria() + { + $criteria = new Criteria(BankPeer::DATABASE_NAME); + + if ($this->isColumnModified(BankPeer::ID)) $criteria->add(BankPeer::ID, $this->id); + if ($this->isColumnModified(BankPeer::NAME)) $criteria->add(BankPeer::NAME, $this->name); + if ($this->isColumnModified(BankPeer::OWNER)) $criteria->add(BankPeer::OWNER, $this->owner); + if ($this->isColumnModified(BankPeer::SOFTWARE)) $criteria->add(BankPeer::SOFTWARE, $this->software); + if ($this->isColumnModified(BankPeer::SHARE)) $criteria->add(BankPeer::SHARE, $this->share); + if ($this->isColumnModified(BankPeer::UPDATED_AT)) $criteria->add(BankPeer::UPDATED_AT, $this->updated_at); + + return $criteria; + } + + + public function buildPkeyCriteria() + { + $criteria = new Criteria(BankPeer::DATABASE_NAME); + + $criteria->add(BankPeer::ID, $this->id); + + return $criteria; + } + + + public function getPrimaryKey() + { + return $this->getId(); + } + + + public function setPrimaryKey($key) + { + $this->setId($key); + } + + + public function copyInto($copyObj, $deepCopy = false) + { + + $copyObj->setName($this->name); + + $copyObj->setOwner($this->owner); + + $copyObj->setSoftware($this->software); + + $copyObj->setShare($this->share); + + $copyObj->setUpdatedAt($this->updated_at); + + + if ($deepCopy) { + $copyObj->setNew(false); + + foreach($this->getInstrumentBanks() as $relObj) { + $copyObj->addInstrumentBank($relObj->copy($deepCopy)); + } + + } + + $copyObj->setNew(true); + + $copyObj->setId(NULL); + } + + + public function copy($deepCopy = false) + { + $clazz = get_class($this); + $copyObj = new $clazz(); + $this->copyInto($copyObj, $deepCopy); + return $copyObj; + } + + + public function getPeer() + { + if (self::$peer === null) { + self::$peer = new BankPeer(); + } + return self::$peer; + } + + + public function setUser($v) + { + + + if ($v === null) { + $this->setOwner(NULL); + } else { + $this->setOwner($v->getUsername()); + } + + + $this->aUser = $v; + } + + + + public function getUser($con = null) + { + if ($this->aUser === null && (($this->owner !== "" && $this->owner !== null))) { + include_once 'lib/model/om/BaseUserPeer.php'; + + $this->aUser = UserPeer::retrieveByPK($this->owner, $con); + + + } + return $this->aUser; + } + + + public function setWare($v) + { + + + if ($v === null) { + $this->setSoftware('LSDJ'); + } else { + $this->setSoftware($v->getSoft()); + } + + + $this->aWare = $v; + } + + + + public function getWare($con = null) + { + if ($this->aWare === null && (($this->software !== "" && $this->software !== null))) { + include_once 'lib/model/om/BaseWarePeer.php'; + + $this->aWare = WarePeer::retrieveByPK($this->software, $con); + + + } + return $this->aWare; + } + + + public function initInstrumentBanks() + { + if ($this->collInstrumentBanks === null) { + $this->collInstrumentBanks = array(); + } + } + + + public function getInstrumentBanks($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseInstrumentBankPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collInstrumentBanks === null) { + if ($this->isNew()) { + $this->collInstrumentBanks = array(); + } else { + + $criteria->add(InstrumentBankPeer::BANK_ID, $this->getId()); + + InstrumentBankPeer::addSelectColumns($criteria); + $this->collInstrumentBanks = InstrumentBankPeer::doSelect($criteria, $con); + } + } else { + if (!$this->isNew()) { + + + $criteria->add(InstrumentBankPeer::BANK_ID, $this->getId()); + + InstrumentBankPeer::addSelectColumns($criteria); + if (!isset($this->lastInstrumentBankCriteria) || !$this->lastInstrumentBankCriteria->equals($criteria)) { + $this->collInstrumentBanks = InstrumentBankPeer::doSelect($criteria, $con); + } + } + } + $this->lastInstrumentBankCriteria = $criteria; + return $this->collInstrumentBanks; + } + + + public function countInstrumentBanks($criteria = null, $distinct = false, $con = null) + { + include_once 'lib/model/om/BaseInstrumentBankPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + $criteria->add(InstrumentBankPeer::BANK_ID, $this->getId()); + + return InstrumentBankPeer::doCount($criteria, $distinct, $con); + } + + + public function addInstrumentBank(InstrumentBank $l) + { + $this->collInstrumentBanks[] = $l; + $l->setBank($this); + } + + + + public function getInstrumentBanksJoinInstrument($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseInstrumentBankPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collInstrumentBanks === null) { + if ($this->isNew()) { + $this->collInstrumentBanks = array(); + } else { + + $criteria->add(InstrumentBankPeer::BANK_ID, $this->getId()); + + $this->collInstrumentBanks = InstrumentBankPeer::doSelectJoinInstrument($criteria, $con); + } + } else { + + $criteria->add(InstrumentBankPeer::BANK_ID, $this->getId()); + + if (!isset($this->lastInstrumentBankCriteria) || !$this->lastInstrumentBankCriteria->equals($criteria)) { + $this->collInstrumentBanks = InstrumentBankPeer::doSelectJoinInstrument($criteria, $con); + } + } + $this->lastInstrumentBankCriteria = $criteria; + + return $this->collInstrumentBanks; + } + +} \ No newline at end of file diff --git a/lib/model/om/BaseBankPeer.php b/lib/model/om/BaseBankPeer.php new file mode 100644 index 0000000..e3abb34 --- /dev/null +++ b/lib/model/om/BaseBankPeer.php @@ -0,0 +1,824 @@ + array ('Id', 'Name', 'Owner', 'Software', 'Share', 'UpdatedAt', ), + BasePeer::TYPE_COLNAME => array (BankPeer::ID, BankPeer::NAME, BankPeer::OWNER, BankPeer::SOFTWARE, BankPeer::SHARE, BankPeer::UPDATED_AT, ), + BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'owner', 'software', 'share', 'updated_at', ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, ) + ); + + + private static $fieldKeys = array ( + BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Name' => 1, 'Owner' => 2, 'Software' => 3, 'Share' => 4, 'UpdatedAt' => 5, ), + BasePeer::TYPE_COLNAME => array (BankPeer::ID => 0, BankPeer::NAME => 1, BankPeer::OWNER => 2, BankPeer::SOFTWARE => 3, BankPeer::SHARE => 4, BankPeer::UPDATED_AT => 5, ), + BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'owner' => 2, 'software' => 3, 'share' => 4, 'updated_at' => 5, ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, ) + ); + + + public static function getMapBuilder() + { + include_once 'lib/model/map/BankMapBuilder.php'; + return BasePeer::getMapBuilder('lib.model.map.BankMapBuilder'); + } + + public static function getPhpNameMap() + { + if (self::$phpNameMap === null) { + $map = BankPeer::getTableMap(); + $columns = $map->getColumns(); + $nameMap = array(); + foreach ($columns as $column) { + $nameMap[$column->getPhpName()] = $column->getColumnName(); + } + self::$phpNameMap = $nameMap; + } + return self::$phpNameMap; + } + + static public function translateFieldName($name, $fromType, $toType) + { + $toNames = self::getFieldNames($toType); + $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$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(self::$fieldKeys[$fromType], true)); + } + return $toNames[$key]; + } + + + + static public function getFieldNames($type = BasePeer::TYPE_PHPNAME) + { + if (!array_key_exists($type, self::$fieldNames)) { + throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.'); + } + return self::$fieldNames[$type]; + } + + + public static function alias($alias, $column) + { + return str_replace(BankPeer::TABLE_NAME.'.', $alias.'.', $column); + } + + + public static function addSelectColumns(Criteria $criteria) + { + + $criteria->addSelectColumn(BankPeer::ID); + + $criteria->addSelectColumn(BankPeer::NAME); + + $criteria->addSelectColumn(BankPeer::OWNER); + + $criteria->addSelectColumn(BankPeer::SOFTWARE); + + $criteria->addSelectColumn(BankPeer::SHARE); + + $criteria->addSelectColumn(BankPeer::UPDATED_AT); + + } + + const COUNT = 'COUNT(Bank.ID)'; + const COUNT_DISTINCT = 'COUNT(DISTINCT Bank.ID)'; + + + public static function doCount(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(BankPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(BankPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $rs = BankPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + public static function doSelectOne(Criteria $criteria, $con = null) + { + $critcopy = clone $criteria; + $critcopy->setLimit(1); + $objects = BankPeer::doSelect($critcopy, $con); + if ($objects) { + return $objects[0]; + } + return null; + } + + public static function doSelect(Criteria $criteria, $con = null) + { + return BankPeer::populateObjects(BankPeer::doSelectRS($criteria, $con)); + } + + public static function doSelectRS(Criteria $criteria, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + if (!$criteria->getSelectColumns()) { + $criteria = clone $criteria; + BankPeer::addSelectColumns($criteria); + } + + $criteria->setDbName(self::DATABASE_NAME); + + return BasePeer::doSelect($criteria, $con); + } + + public static function populateObjects(ResultSet $rs) + { + $results = array(); + + $cls = BankPeer::getOMClass(); + $cls = Propel::import($cls); + while($rs->next()) { + + $obj = new $cls(); + $obj->hydrate($rs); + $results[] = $obj; + + } + return $results; + } + + + public static function doCountJoinUser(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(BankPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(BankPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(BankPeer::OWNER, UserPeer::USERNAME); + + $rs = BankPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doCountJoinWare(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(BankPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(BankPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(BankPeer::SOFTWARE, WarePeer::SOFT); + + $rs = BankPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doSelectJoinUser(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + BankPeer::addSelectColumns($c); + $startcol = (BankPeer::NUM_COLUMNS - BankPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + UserPeer::addSelectColumns($c); + + $c->addJoin(BankPeer::OWNER, UserPeer::USERNAME); + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = BankPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + $omClass = UserPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol); + + $newObject = true; + foreach($results as $temp_obj1) { + $temp_obj2 = $temp_obj1->getUser(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addBank($obj1); break; + } + } + if ($newObject) { + $obj2->initBanks(); + $obj2->addBank($obj1); } + $results[] = $obj1; + } + return $results; + } + + + + public static function doSelectJoinWare(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + BankPeer::addSelectColumns($c); + $startcol = (BankPeer::NUM_COLUMNS - BankPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + WarePeer::addSelectColumns($c); + + $c->addJoin(BankPeer::SOFTWARE, WarePeer::SOFT); + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = BankPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + $omClass = WarePeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol); + + $newObject = true; + foreach($results as $temp_obj1) { + $temp_obj2 = $temp_obj1->getWare(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addBank($obj1); break; + } + } + if ($newObject) { + $obj2->initBanks(); + $obj2->addBank($obj1); } + $results[] = $obj1; + } + return $results; + } + + + + public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(BankPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(BankPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(BankPeer::OWNER, UserPeer::USERNAME); + + $criteria->addJoin(BankPeer::SOFTWARE, WarePeer::SOFT); + + $rs = BankPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doSelectJoinAll(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + BankPeer::addSelectColumns($c); + $startcol2 = (BankPeer::NUM_COLUMNS - BankPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + + UserPeer::addSelectColumns($c); + $startcol3 = $startcol2 + UserPeer::NUM_COLUMNS; + + WarePeer::addSelectColumns($c); + $startcol4 = $startcol3 + WarePeer::NUM_COLUMNS; + + $c->addJoin(BankPeer::OWNER, UserPeer::USERNAME); + + $c->addJoin(BankPeer::SOFTWARE, WarePeer::SOFT); + + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = BankPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + + + $omClass = UserPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol2); + + $newObject = true; + for ($j=0, $resCount=count($results); $j < $resCount; $j++) { + $temp_obj1 = $results[$j]; + $temp_obj2 = $temp_obj1->getUser(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addBank($obj1); break; + } + } + + if ($newObject) { + $obj2->initBanks(); + $obj2->addBank($obj1); + } + + + + $omClass = WarePeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj3 = new $cls(); + $obj3->hydrate($rs, $startcol3); + + $newObject = true; + for ($j=0, $resCount=count($results); $j < $resCount; $j++) { + $temp_obj1 = $results[$j]; + $temp_obj3 = $temp_obj1->getWare(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { + $newObject = false; + $temp_obj3->addBank($obj1); break; + } + } + + if ($newObject) { + $obj3->initBanks(); + $obj3->addBank($obj1); + } + + $results[] = $obj1; + } + return $results; + } + + + + public static function doCountJoinAllExceptUser(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(BankPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(BankPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(BankPeer::SOFTWARE, WarePeer::SOFT); + + $rs = BankPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doCountJoinAllExceptWare(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(BankPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(BankPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(BankPeer::OWNER, UserPeer::USERNAME); + + $rs = BankPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doSelectJoinAllExceptUser(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + BankPeer::addSelectColumns($c); + $startcol2 = (BankPeer::NUM_COLUMNS - BankPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + + WarePeer::addSelectColumns($c); + $startcol3 = $startcol2 + WarePeer::NUM_COLUMNS; + + $c->addJoin(BankPeer::SOFTWARE, WarePeer::SOFT); + + + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = BankPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + $omClass = WarePeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol2); + + $newObject = true; + for ($j=0, $resCount=count($results); $j < $resCount; $j++) { + $temp_obj1 = $results[$j]; + $temp_obj2 = $temp_obj1->getWare(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addBank($obj1); + break; + } + } + + if ($newObject) { + $obj2->initBanks(); + $obj2->addBank($obj1); + } + + $results[] = $obj1; + } + return $results; + } + + + + public static function doSelectJoinAllExceptWare(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + BankPeer::addSelectColumns($c); + $startcol2 = (BankPeer::NUM_COLUMNS - BankPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + + UserPeer::addSelectColumns($c); + $startcol3 = $startcol2 + UserPeer::NUM_COLUMNS; + + $c->addJoin(BankPeer::OWNER, UserPeer::USERNAME); + + + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = BankPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + $omClass = UserPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol2); + + $newObject = true; + for ($j=0, $resCount=count($results); $j < $resCount; $j++) { + $temp_obj1 = $results[$j]; + $temp_obj2 = $temp_obj1->getUser(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addBank($obj1); + break; + } + } + + if ($newObject) { + $obj2->initBanks(); + $obj2->addBank($obj1); + } + + $results[] = $obj1; + } + return $results; + } + + + public static function getTableMap() + { + return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME); + } + + + public static function getOMClass() + { + return BankPeer::CLASS_DEFAULT; + } + + + public static function doInsert($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; } else { + $criteria = $values->buildCriteria(); } + + $criteria->remove(BankPeer::ID); + + $criteria->setDbName(self::DATABASE_NAME); + + try { + $con->begin(); + $pk = BasePeer::doInsert($criteria, $con); + $con->commit(); + } catch(PropelException $e) { + $con->rollback(); + throw $e; + } + + return $pk; + } + + + public static function doUpdate($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $selectCriteria = new Criteria(self::DATABASE_NAME); + + if ($values instanceof Criteria) { + $criteria = clone $values; + $comparison = $criteria->getComparison(BankPeer::ID); + $selectCriteria->add(BankPeer::ID, $criteria->remove(BankPeer::ID), $comparison); + + } else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); } + + $criteria->setDbName(self::DATABASE_NAME); + + return BasePeer::doUpdate($selectCriteria, $criteria, $con); + } + + + public static function doDeleteAll($con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + $affectedRows = 0; try { + $con->begin(); + $affectedRows += BasePeer::doDeleteAll(BankPeer::TABLE_NAME, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public static function doDelete($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(BankPeer::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; } elseif ($values instanceof Bank) { + + $criteria = $values->buildPkeyCriteria(); + } else { + $criteria = new Criteria(self::DATABASE_NAME); + $criteria->add(BankPeer::ID, (array) $values, Criteria::IN); + } + + $criteria->setDbName(self::DATABASE_NAME); + + $affectedRows = 0; + try { + $con->begin(); + + $affectedRows += BasePeer::doDelete($criteria, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public static function doValidate(Bank $obj, $cols = null) + { + $columns = array(); + + if ($cols) { + $dbMap = Propel::getDatabaseMap(BankPeer::DATABASE_NAME); + $tableMap = $dbMap->getTable(BankPeer::TABLE_NAME); + + if (! is_array($cols)) { + $cols = array($cols); + } + + foreach($cols as $colName) { + if ($tableMap->containsColumn($colName)) { + $get = 'get' . $tableMap->getColumn($colName)->getPhpName(); + $columns[$colName] = $obj->$get(); + } + } + } else { + + } + + $res = BasePeer::doValidate(BankPeer::DATABASE_NAME, BankPeer::TABLE_NAME, $columns); + if ($res !== true) { + $request = sfContext::getInstance()->getRequest(); + foreach ($res as $failed) { + $col = BankPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME); + $request->setError($col, $failed->getMessage()); + } + } + + return $res; + } + + + public static function retrieveByPK($pk, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $criteria = new Criteria(BankPeer::DATABASE_NAME); + + $criteria->add(BankPeer::ID, $pk); + + + $v = BankPeer::doSelect($criteria, $con); + + return !empty($v) > 0 ? $v[0] : null; + } + + + public static function retrieveByPKs($pks, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $objs = null; + if (empty($pks)) { + $objs = array(); + } else { + $criteria = new Criteria(); + $criteria->add(BankPeer::ID, $pks, Criteria::IN); + $objs = BankPeer::doSelect($criteria, $con); + } + return $objs; + } + +} +if (Propel::isInit()) { + try { + BaseBankPeer::getMapBuilder(); + } catch (Exception $e) { + Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR); + } +} else { + require_once 'lib/model/map/BankMapBuilder.php'; + Propel::registerMapBuilder('lib.model.map.BankMapBuilder'); +} diff --git a/lib/model/om/BaseComment.php b/lib/model/om/BaseComment.php new file mode 100644 index 0000000..6d16153 --- /dev/null +++ b/lib/model/om/BaseComment.php @@ -0,0 +1,566 @@ +id; + } + + + public function getInstrumentId() + { + + return $this->instrument_id; + } + + + public function getAuthor() + { + + return $this->author; + } + + + public function getComment() + { + + return $this->comment; + } + + + public function getCreatedAt($format = 'Y-m-d H:i:s') + { + + if ($this->created_at === null || $this->created_at === '') { + return null; + } elseif (!is_int($this->created_at)) { + $ts = strtotime($this->created_at); + if ($ts === -1 || $ts === false) { throw new PropelException("Unable to parse value of [created_at] as date/time value: " . var_export($this->created_at, true)); + } + } else { + $ts = $this->created_at; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + + public function setId($v) + { + + + + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->id !== $v) { + $this->id = $v; + $this->modifiedColumns[] = CommentPeer::ID; + } + + } + + public function setInstrumentId($v) + { + + + + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->instrument_id !== $v) { + $this->instrument_id = $v; + $this->modifiedColumns[] = CommentPeer::INSTRUMENT_ID; + } + + if ($this->aInstrument !== null && $this->aInstrument->getId() !== $v) { + $this->aInstrument = null; + } + + } + + public function setAuthor($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->author !== $v || $v === 'anonymous') { + $this->author = $v; + $this->modifiedColumns[] = CommentPeer::AUTHOR; + } + + if ($this->aUser !== null && $this->aUser->getUsername() !== $v) { + $this->aUser = null; + } + + } + + public function setComment($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->comment !== $v) { + $this->comment = $v; + $this->modifiedColumns[] = CommentPeer::COMMENT; + } + + } + + public function setCreatedAt($v) + { + + if ($v !== null && !is_int($v)) { + $ts = strtotime($v); + if ($ts === -1 || $ts === false) { throw new PropelException("Unable to parse date/time value for [created_at] from input: " . var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->created_at !== $ts) { + $this->created_at = $ts; + $this->modifiedColumns[] = CommentPeer::CREATED_AT; + } + + } + + public function hydrate(ResultSet $rs, $startcol = 1) + { + try { + + $this->id = $rs->getInt($startcol + 0); + + $this->instrument_id = $rs->getInt($startcol + 1); + + $this->author = $rs->getString($startcol + 2); + + $this->comment = $rs->getString($startcol + 3); + + $this->created_at = $rs->getTimestamp($startcol + 4, null); + + $this->resetModified(); + + $this->setNew(false); + + return $startcol + 5; + } catch (Exception $e) { + throw new PropelException("Error populating Comment object", $e); + } + } + + + public function delete($con = null) + { + if ($this->isDeleted()) { + throw new PropelException("This object has already been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(CommentPeer::DATABASE_NAME); + } + + try { + $con->begin(); + CommentPeer::doDelete($this, $con); + $this->setDeleted(true); + $con->commit(); + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public function save($con = null) + { + if ($this->isNew() && !$this->isColumnModified(CommentPeer::CREATED_AT)) + { + $this->setCreatedAt(time()); + } + + if ($this->isDeleted()) { + throw new PropelException("You cannot save an object that has been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(CommentPeer::DATABASE_NAME); + } + + try { + $con->begin(); + $affectedRows = $this->doSave($con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + protected function doSave($con) + { + $affectedRows = 0; if (!$this->alreadyInSave) { + $this->alreadyInSave = true; + + + + if ($this->aInstrument !== null) { + if ($this->aInstrument->isModified()) { + $affectedRows += $this->aInstrument->save($con); + } + $this->setInstrument($this->aInstrument); + } + + if ($this->aUser !== null) { + if ($this->aUser->isModified()) { + $affectedRows += $this->aUser->save($con); + } + $this->setUser($this->aUser); + } + + + if ($this->isModified()) { + if ($this->isNew()) { + $pk = CommentPeer::doInsert($this, $con); + $affectedRows += 1; + $this->setId($pk); + $this->setNew(false); + } else { + $affectedRows += CommentPeer::doUpdate($this, $con); + } + $this->resetModified(); } + + $this->alreadyInSave = false; + } + return $affectedRows; + } + + protected $validationFailures = array(); + + + public function getValidationFailures() + { + return $this->validationFailures; + } + + + public function validate($columns = null) + { + $res = $this->doValidate($columns); + if ($res === true) { + $this->validationFailures = array(); + return true; + } else { + $this->validationFailures = $res; + return false; + } + } + + + protected function doValidate($columns = null) + { + if (!$this->alreadyInValidation) { + $this->alreadyInValidation = true; + $retval = null; + + $failureMap = array(); + + + + if ($this->aInstrument !== null) { + if (!$this->aInstrument->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aInstrument->getValidationFailures()); + } + } + + if ($this->aUser !== null) { + if (!$this->aUser->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aUser->getValidationFailures()); + } + } + + + if (($retval = CommentPeer::doValidate($this, $columns)) !== true) { + $failureMap = array_merge($failureMap, $retval); + } + + + + $this->alreadyInValidation = false; + } + + return (!empty($failureMap) ? $failureMap : true); + } + + + public function getByName($name, $type = BasePeer::TYPE_PHPNAME) + { + $pos = CommentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->getByPosition($pos); + } + + + public function getByPosition($pos) + { + switch($pos) { + case 0: + return $this->getId(); + break; + case 1: + return $this->getInstrumentId(); + break; + case 2: + return $this->getAuthor(); + break; + case 3: + return $this->getComment(); + break; + case 4: + return $this->getCreatedAt(); + break; + default: + return null; + break; + } } + + + public function toArray($keyType = BasePeer::TYPE_PHPNAME) + { + $keys = CommentPeer::getFieldNames($keyType); + $result = array( + $keys[0] => $this->getId(), + $keys[1] => $this->getInstrumentId(), + $keys[2] => $this->getAuthor(), + $keys[3] => $this->getComment(), + $keys[4] => $this->getCreatedAt(), + ); + return $result; + } + + + public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) + { + $pos = CommentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->setByPosition($pos, $value); + } + + + public function setByPosition($pos, $value) + { + switch($pos) { + case 0: + $this->setId($value); + break; + case 1: + $this->setInstrumentId($value); + break; + case 2: + $this->setAuthor($value); + break; + case 3: + $this->setComment($value); + break; + case 4: + $this->setCreatedAt($value); + break; + } } + + + public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) + { + $keys = CommentPeer::getFieldNames($keyType); + + if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); + if (array_key_exists($keys[1], $arr)) $this->setInstrumentId($arr[$keys[1]]); + if (array_key_exists($keys[2], $arr)) $this->setAuthor($arr[$keys[2]]); + if (array_key_exists($keys[3], $arr)) $this->setComment($arr[$keys[3]]); + if (array_key_exists($keys[4], $arr)) $this->setCreatedAt($arr[$keys[4]]); + } + + + public function buildCriteria() + { + $criteria = new Criteria(CommentPeer::DATABASE_NAME); + + if ($this->isColumnModified(CommentPeer::ID)) $criteria->add(CommentPeer::ID, $this->id); + if ($this->isColumnModified(CommentPeer::INSTRUMENT_ID)) $criteria->add(CommentPeer::INSTRUMENT_ID, $this->instrument_id); + if ($this->isColumnModified(CommentPeer::AUTHOR)) $criteria->add(CommentPeer::AUTHOR, $this->author); + if ($this->isColumnModified(CommentPeer::COMMENT)) $criteria->add(CommentPeer::COMMENT, $this->comment); + if ($this->isColumnModified(CommentPeer::CREATED_AT)) $criteria->add(CommentPeer::CREATED_AT, $this->created_at); + + return $criteria; + } + + + public function buildPkeyCriteria() + { + $criteria = new Criteria(CommentPeer::DATABASE_NAME); + + $criteria->add(CommentPeer::ID, $this->id); + + return $criteria; + } + + + public function getPrimaryKey() + { + return $this->getId(); + } + + + public function setPrimaryKey($key) + { + $this->setId($key); + } + + + public function copyInto($copyObj, $deepCopy = false) + { + + $copyObj->setInstrumentId($this->instrument_id); + + $copyObj->setAuthor($this->author); + + $copyObj->setComment($this->comment); + + $copyObj->setCreatedAt($this->created_at); + + + $copyObj->setNew(true); + + $copyObj->setId(NULL); + } + + + public function copy($deepCopy = false) + { + $clazz = get_class($this); + $copyObj = new $clazz(); + $this->copyInto($copyObj, $deepCopy); + return $copyObj; + } + + + public function getPeer() + { + if (self::$peer === null) { + self::$peer = new CommentPeer(); + } + return self::$peer; + } + + + public function setInstrument($v) + { + + + if ($v === null) { + $this->setInstrumentId(NULL); + } else { + $this->setInstrumentId($v->getId()); + } + + + $this->aInstrument = $v; + } + + + + public function getInstrument($con = null) + { + if ($this->aInstrument === null && ($this->instrument_id !== null)) { + include_once 'lib/model/om/BaseInstrumentPeer.php'; + + $this->aInstrument = InstrumentPeer::retrieveByPK($this->instrument_id, $con); + + + } + return $this->aInstrument; + } + + + public function setUser($v) + { + + + if ($v === null) { + $this->setAuthor('anonymous'); + } else { + $this->setAuthor($v->getUsername()); + } + + + $this->aUser = $v; + } + + + + public function getUser($con = null) + { + if ($this->aUser === null && (($this->author !== "" && $this->author !== null))) { + include_once 'lib/model/om/BaseUserPeer.php'; + + $this->aUser = UserPeer::retrieveByPK($this->author, $con); + + + } + return $this->aUser; + } + +} \ No newline at end of file diff --git a/lib/model/om/BaseCommentPeer.php b/lib/model/om/BaseCommentPeer.php new file mode 100644 index 0000000..0851f69 --- /dev/null +++ b/lib/model/om/BaseCommentPeer.php @@ -0,0 +1,819 @@ + array ('Id', 'InstrumentId', 'Author', 'Comment', 'CreatedAt', ), + BasePeer::TYPE_COLNAME => array (CommentPeer::ID, CommentPeer::INSTRUMENT_ID, CommentPeer::AUTHOR, CommentPeer::COMMENT, CommentPeer::CREATED_AT, ), + BasePeer::TYPE_FIELDNAME => array ('id', 'instrument_id', 'author', 'comment', 'created_at', ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, ) + ); + + + private static $fieldKeys = array ( + BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'InstrumentId' => 1, 'Author' => 2, 'Comment' => 3, 'CreatedAt' => 4, ), + BasePeer::TYPE_COLNAME => array (CommentPeer::ID => 0, CommentPeer::INSTRUMENT_ID => 1, CommentPeer::AUTHOR => 2, CommentPeer::COMMENT => 3, CommentPeer::CREATED_AT => 4, ), + BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'instrument_id' => 1, 'author' => 2, 'comment' => 3, 'created_at' => 4, ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, ) + ); + + + public static function getMapBuilder() + { + include_once 'lib/model/map/CommentMapBuilder.php'; + return BasePeer::getMapBuilder('lib.model.map.CommentMapBuilder'); + } + + public static function getPhpNameMap() + { + if (self::$phpNameMap === null) { + $map = CommentPeer::getTableMap(); + $columns = $map->getColumns(); + $nameMap = array(); + foreach ($columns as $column) { + $nameMap[$column->getPhpName()] = $column->getColumnName(); + } + self::$phpNameMap = $nameMap; + } + return self::$phpNameMap; + } + + static public function translateFieldName($name, $fromType, $toType) + { + $toNames = self::getFieldNames($toType); + $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$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(self::$fieldKeys[$fromType], true)); + } + return $toNames[$key]; + } + + + + static public function getFieldNames($type = BasePeer::TYPE_PHPNAME) + { + if (!array_key_exists($type, self::$fieldNames)) { + throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.'); + } + return self::$fieldNames[$type]; + } + + + public static function alias($alias, $column) + { + return str_replace(CommentPeer::TABLE_NAME.'.', $alias.'.', $column); + } + + + public static function addSelectColumns(Criteria $criteria) + { + + $criteria->addSelectColumn(CommentPeer::ID); + + $criteria->addSelectColumn(CommentPeer::INSTRUMENT_ID); + + $criteria->addSelectColumn(CommentPeer::AUTHOR); + + $criteria->addSelectColumn(CommentPeer::COMMENT); + + $criteria->addSelectColumn(CommentPeer::CREATED_AT); + + } + + const COUNT = 'COUNT(Comment.ID)'; + const COUNT_DISTINCT = 'COUNT(DISTINCT Comment.ID)'; + + + public static function doCount(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(CommentPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(CommentPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $rs = CommentPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + public static function doSelectOne(Criteria $criteria, $con = null) + { + $critcopy = clone $criteria; + $critcopy->setLimit(1); + $objects = CommentPeer::doSelect($critcopy, $con); + if ($objects) { + return $objects[0]; + } + return null; + } + + public static function doSelect(Criteria $criteria, $con = null) + { + return CommentPeer::populateObjects(CommentPeer::doSelectRS($criteria, $con)); + } + + public static function doSelectRS(Criteria $criteria, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + if (!$criteria->getSelectColumns()) { + $criteria = clone $criteria; + CommentPeer::addSelectColumns($criteria); + } + + $criteria->setDbName(self::DATABASE_NAME); + + return BasePeer::doSelect($criteria, $con); + } + + public static function populateObjects(ResultSet $rs) + { + $results = array(); + + $cls = CommentPeer::getOMClass(); + $cls = Propel::import($cls); + while($rs->next()) { + + $obj = new $cls(); + $obj->hydrate($rs); + $results[] = $obj; + + } + return $results; + } + + + public static function doCountJoinInstrument(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(CommentPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(CommentPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(CommentPeer::INSTRUMENT_ID, InstrumentPeer::ID); + + $rs = CommentPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doCountJoinUser(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(CommentPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(CommentPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(CommentPeer::AUTHOR, UserPeer::USERNAME); + + $rs = CommentPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doSelectJoinInstrument(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + CommentPeer::addSelectColumns($c); + $startcol = (CommentPeer::NUM_COLUMNS - CommentPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + InstrumentPeer::addSelectColumns($c); + + $c->addJoin(CommentPeer::INSTRUMENT_ID, InstrumentPeer::ID); + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = CommentPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + $omClass = InstrumentPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol); + + $newObject = true; + foreach($results as $temp_obj1) { + $temp_obj2 = $temp_obj1->getInstrument(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addComment($obj1); break; + } + } + if ($newObject) { + $obj2->initComments(); + $obj2->addComment($obj1); } + $results[] = $obj1; + } + return $results; + } + + + + public static function doSelectJoinUser(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + CommentPeer::addSelectColumns($c); + $startcol = (CommentPeer::NUM_COLUMNS - CommentPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + UserPeer::addSelectColumns($c); + + $c->addJoin(CommentPeer::AUTHOR, UserPeer::USERNAME); + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = CommentPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + $omClass = UserPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol); + + $newObject = true; + foreach($results as $temp_obj1) { + $temp_obj2 = $temp_obj1->getUser(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addComment($obj1); break; + } + } + if ($newObject) { + $obj2->initComments(); + $obj2->addComment($obj1); } + $results[] = $obj1; + } + return $results; + } + + + + public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(CommentPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(CommentPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(CommentPeer::INSTRUMENT_ID, InstrumentPeer::ID); + + $criteria->addJoin(CommentPeer::AUTHOR, UserPeer::USERNAME); + + $rs = CommentPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doSelectJoinAll(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + CommentPeer::addSelectColumns($c); + $startcol2 = (CommentPeer::NUM_COLUMNS - CommentPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + + InstrumentPeer::addSelectColumns($c); + $startcol3 = $startcol2 + InstrumentPeer::NUM_COLUMNS; + + UserPeer::addSelectColumns($c); + $startcol4 = $startcol3 + UserPeer::NUM_COLUMNS; + + $c->addJoin(CommentPeer::INSTRUMENT_ID, InstrumentPeer::ID); + + $c->addJoin(CommentPeer::AUTHOR, UserPeer::USERNAME); + + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = CommentPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + + + $omClass = InstrumentPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol2); + + $newObject = true; + for ($j=0, $resCount=count($results); $j < $resCount; $j++) { + $temp_obj1 = $results[$j]; + $temp_obj2 = $temp_obj1->getInstrument(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addComment($obj1); break; + } + } + + if ($newObject) { + $obj2->initComments(); + $obj2->addComment($obj1); + } + + + + $omClass = UserPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj3 = new $cls(); + $obj3->hydrate($rs, $startcol3); + + $newObject = true; + for ($j=0, $resCount=count($results); $j < $resCount; $j++) { + $temp_obj1 = $results[$j]; + $temp_obj3 = $temp_obj1->getUser(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { + $newObject = false; + $temp_obj3->addComment($obj1); break; + } + } + + if ($newObject) { + $obj3->initComments(); + $obj3->addComment($obj1); + } + + $results[] = $obj1; + } + return $results; + } + + + + public static function doCountJoinAllExceptInstrument(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(CommentPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(CommentPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(CommentPeer::AUTHOR, UserPeer::USERNAME); + + $rs = CommentPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doCountJoinAllExceptUser(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(CommentPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(CommentPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(CommentPeer::INSTRUMENT_ID, InstrumentPeer::ID); + + $rs = CommentPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doSelectJoinAllExceptInstrument(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + CommentPeer::addSelectColumns($c); + $startcol2 = (CommentPeer::NUM_COLUMNS - CommentPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + + UserPeer::addSelectColumns($c); + $startcol3 = $startcol2 + UserPeer::NUM_COLUMNS; + + $c->addJoin(CommentPeer::AUTHOR, UserPeer::USERNAME); + + + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = CommentPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + $omClass = UserPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol2); + + $newObject = true; + for ($j=0, $resCount=count($results); $j < $resCount; $j++) { + $temp_obj1 = $results[$j]; + $temp_obj2 = $temp_obj1->getUser(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addComment($obj1); + break; + } + } + + if ($newObject) { + $obj2->initComments(); + $obj2->addComment($obj1); + } + + $results[] = $obj1; + } + return $results; + } + + + + public static function doSelectJoinAllExceptUser(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + CommentPeer::addSelectColumns($c); + $startcol2 = (CommentPeer::NUM_COLUMNS - CommentPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + + InstrumentPeer::addSelectColumns($c); + $startcol3 = $startcol2 + InstrumentPeer::NUM_COLUMNS; + + $c->addJoin(CommentPeer::INSTRUMENT_ID, InstrumentPeer::ID); + + + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = CommentPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + $omClass = InstrumentPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol2); + + $newObject = true; + for ($j=0, $resCount=count($results); $j < $resCount; $j++) { + $temp_obj1 = $results[$j]; + $temp_obj2 = $temp_obj1->getInstrument(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addComment($obj1); + break; + } + } + + if ($newObject) { + $obj2->initComments(); + $obj2->addComment($obj1); + } + + $results[] = $obj1; + } + return $results; + } + + + public static function getTableMap() + { + return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME); + } + + + public static function getOMClass() + { + return CommentPeer::CLASS_DEFAULT; + } + + + public static function doInsert($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; } else { + $criteria = $values->buildCriteria(); } + + $criteria->remove(CommentPeer::ID); + + $criteria->setDbName(self::DATABASE_NAME); + + try { + $con->begin(); + $pk = BasePeer::doInsert($criteria, $con); + $con->commit(); + } catch(PropelException $e) { + $con->rollback(); + throw $e; + } + + return $pk; + } + + + public static function doUpdate($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $selectCriteria = new Criteria(self::DATABASE_NAME); + + if ($values instanceof Criteria) { + $criteria = clone $values; + $comparison = $criteria->getComparison(CommentPeer::ID); + $selectCriteria->add(CommentPeer::ID, $criteria->remove(CommentPeer::ID), $comparison); + + } else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); } + + $criteria->setDbName(self::DATABASE_NAME); + + return BasePeer::doUpdate($selectCriteria, $criteria, $con); + } + + + public static function doDeleteAll($con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + $affectedRows = 0; try { + $con->begin(); + $affectedRows += BasePeer::doDeleteAll(CommentPeer::TABLE_NAME, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public static function doDelete($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(CommentPeer::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; } elseif ($values instanceof Comment) { + + $criteria = $values->buildPkeyCriteria(); + } else { + $criteria = new Criteria(self::DATABASE_NAME); + $criteria->add(CommentPeer::ID, (array) $values, Criteria::IN); + } + + $criteria->setDbName(self::DATABASE_NAME); + + $affectedRows = 0; + try { + $con->begin(); + + $affectedRows += BasePeer::doDelete($criteria, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public static function doValidate(Comment $obj, $cols = null) + { + $columns = array(); + + if ($cols) { + $dbMap = Propel::getDatabaseMap(CommentPeer::DATABASE_NAME); + $tableMap = $dbMap->getTable(CommentPeer::TABLE_NAME); + + if (! is_array($cols)) { + $cols = array($cols); + } + + foreach($cols as $colName) { + if ($tableMap->containsColumn($colName)) { + $get = 'get' . $tableMap->getColumn($colName)->getPhpName(); + $columns[$colName] = $obj->$get(); + } + } + } else { + + } + + $res = BasePeer::doValidate(CommentPeer::DATABASE_NAME, CommentPeer::TABLE_NAME, $columns); + if ($res !== true) { + $request = sfContext::getInstance()->getRequest(); + foreach ($res as $failed) { + $col = CommentPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME); + $request->setError($col, $failed->getMessage()); + } + } + + return $res; + } + + + public static function retrieveByPK($pk, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $criteria = new Criteria(CommentPeer::DATABASE_NAME); + + $criteria->add(CommentPeer::ID, $pk); + + + $v = CommentPeer::doSelect($criteria, $con); + + return !empty($v) > 0 ? $v[0] : null; + } + + + public static function retrieveByPKs($pks, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $objs = null; + if (empty($pks)) { + $objs = array(); + } else { + $criteria = new Criteria(); + $criteria->add(CommentPeer::ID, $pks, Criteria::IN); + $objs = CommentPeer::doSelect($criteria, $con); + } + return $objs; + } + +} +if (Propel::isInit()) { + try { + BaseCommentPeer::getMapBuilder(); + } catch (Exception $e) { + Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR); + } +} else { + require_once 'lib/model/map/CommentMapBuilder.php'; + Propel::registerMapBuilder('lib.model.map.CommentMapBuilder'); +} diff --git a/lib/model/om/BaseInstrument.php b/lib/model/om/BaseInstrument.php new file mode 100644 index 0000000..9ea4207 --- /dev/null +++ b/lib/model/om/BaseInstrument.php @@ -0,0 +1,1414 @@ +id; + } + + + public function getName() + { + + return $this->name; + } + + + public function getStripped() + { + + return $this->stripped; + } + + + public function getSoftware() + { + + return $this->software; + } + + + public function getType() + { + + return $this->type; + } + + + public function getDescription() + { + + return $this->description; + } + + + public function getObject() + { + + return $this->object; + } + + + public function getOwner() + { + + return $this->owner; + } + + + public function getAuthor() + { + + return $this->author; + } + + + public function getAuthorStrip() + { + + return $this->author_strip; + } + + + public function getShare() + { + + return $this->share; + } + + + public function getPopularity() + { + + return $this->popularity; + } + + + public function getSample() + { + + return $this->sample; + } + + + public function getUpdatedAt($format = 'Y-m-d H:i:s') + { + + if ($this->updated_at === null || $this->updated_at === '') { + return null; + } elseif (!is_int($this->updated_at)) { + $ts = strtotime($this->updated_at); + if ($ts === -1 || $ts === false) { throw new PropelException("Unable to parse value of [updated_at] as date/time value: " . var_export($this->updated_at, true)); + } + } else { + $ts = $this->updated_at; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + + public function setId($v) + { + + + + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->id !== $v) { + $this->id = $v; + $this->modifiedColumns[] = InstrumentPeer::ID; + } + + } + + public function setName($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->name !== $v) { + $this->name = $v; + $this->modifiedColumns[] = InstrumentPeer::NAME; + } + + } + + public function setStripped($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->stripped !== $v) { + $this->stripped = $v; + $this->modifiedColumns[] = InstrumentPeer::STRIPPED; + } + + } + + public function setSoftware($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->software !== $v || $v === 'LSDJ') { + $this->software = $v; + $this->modifiedColumns[] = InstrumentPeer::SOFTWARE; + } + + if ($this->aWare !== null && $this->aWare->getSoft() !== $v) { + $this->aWare = null; + } + + } + + public function setType($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->type !== $v) { + $this->type = $v; + $this->modifiedColumns[] = InstrumentPeer::TYPE; + } + + } + + public function setDescription($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->description !== $v) { + $this->description = $v; + $this->modifiedColumns[] = InstrumentPeer::DESCRIPTION; + } + + } + + public function setObject($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->object !== $v) { + $this->object = $v; + $this->modifiedColumns[] = InstrumentPeer::OBJECT; + } + + } + + public function setOwner($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->owner !== $v) { + $this->owner = $v; + $this->modifiedColumns[] = InstrumentPeer::OWNER; + } + + if ($this->aUser !== null && $this->aUser->getUsername() !== $v) { + $this->aUser = null; + } + + } + + public function setAuthor($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->author !== $v) { + $this->author = $v; + $this->modifiedColumns[] = InstrumentPeer::AUTHOR; + } + + } + + public function setAuthorStrip($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->author_strip !== $v) { + $this->author_strip = $v; + $this->modifiedColumns[] = InstrumentPeer::AUTHOR_STRIP; + } + + } + + public function setShare($v) + { + + if ($this->share !== $v || $v === true) { + $this->share = $v; + $this->modifiedColumns[] = InstrumentPeer::SHARE; + } + + } + + public function setPopularity($v) + { + + + + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->popularity !== $v || $v === 0) { + $this->popularity = $v; + $this->modifiedColumns[] = InstrumentPeer::POPULARITY; + } + + } + + public function setSample($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->sample !== $v) { + $this->sample = $v; + $this->modifiedColumns[] = InstrumentPeer::SAMPLE; + } + + } + + public function setUpdatedAt($v) + { + + if ($v !== null && !is_int($v)) { + $ts = strtotime($v); + if ($ts === -1 || $ts === false) { throw new PropelException("Unable to parse date/time value for [updated_at] from input: " . var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->updated_at !== $ts) { + $this->updated_at = $ts; + $this->modifiedColumns[] = InstrumentPeer::UPDATED_AT; + } + + } + + public function hydrate(ResultSet $rs, $startcol = 1) + { + try { + + $this->id = $rs->getInt($startcol + 0); + + $this->name = $rs->getString($startcol + 1); + + $this->stripped = $rs->getString($startcol + 2); + + $this->software = $rs->getString($startcol + 3); + + $this->type = $rs->getString($startcol + 4); + + $this->description = $rs->getString($startcol + 5); + + $this->object = $rs->getString($startcol + 6); + + $this->owner = $rs->getString($startcol + 7); + + $this->author = $rs->getString($startcol + 8); + + $this->author_strip = $rs->getString($startcol + 9); + + $this->share = $rs->getBoolean($startcol + 10); + + $this->popularity = $rs->getInt($startcol + 11); + + $this->sample = $rs->getString($startcol + 12); + + $this->updated_at = $rs->getTimestamp($startcol + 13, null); + + $this->resetModified(); + + $this->setNew(false); + + return $startcol + 14; + } catch (Exception $e) { + throw new PropelException("Error populating Instrument object", $e); + } + } + + + public function delete($con = null) + { + if ($this->isDeleted()) { + throw new PropelException("This object has already been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(InstrumentPeer::DATABASE_NAME); + } + + try { + $con->begin(); + InstrumentPeer::doDelete($this, $con); + $this->setDeleted(true); + $con->commit(); + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public function save($con = null) + { + if ($this->isModified() && !$this->isColumnModified(InstrumentPeer::UPDATED_AT)) + { + $this->setUpdatedAt(time()); + } + + if ($this->isDeleted()) { + throw new PropelException("You cannot save an object that has been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(InstrumentPeer::DATABASE_NAME); + } + + try { + $con->begin(); + $affectedRows = $this->doSave($con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + protected function doSave($con) + { + $affectedRows = 0; if (!$this->alreadyInSave) { + $this->alreadyInSave = true; + + + + if ($this->aWare !== null) { + if ($this->aWare->isModified()) { + $affectedRows += $this->aWare->save($con); + } + $this->setWare($this->aWare); + } + + if ($this->aUser !== null) { + if ($this->aUser->isModified()) { + $affectedRows += $this->aUser->save($con); + } + $this->setUser($this->aUser); + } + + + if ($this->isModified()) { + if ($this->isNew()) { + $pk = InstrumentPeer::doInsert($this, $con); + $affectedRows += 1; + $this->setId($pk); + $this->setNew(false); + } else { + $affectedRows += InstrumentPeer::doUpdate($this, $con); + } + $this->resetModified(); } + + if ($this->collTagss !== null) { + foreach($this->collTagss as $referrerFK) { + if (!$referrerFK->isDeleted()) { + $affectedRows += $referrerFK->save($con); + } + } + } + + if ($this->collSearchs !== null) { + foreach($this->collSearchs as $referrerFK) { + if (!$referrerFK->isDeleted()) { + $affectedRows += $referrerFK->save($con); + } + } + } + + if ($this->collComments !== null) { + foreach($this->collComments as $referrerFK) { + if (!$referrerFK->isDeleted()) { + $affectedRows += $referrerFK->save($con); + } + } + } + + if ($this->collInstrumentBanks !== null) { + foreach($this->collInstrumentBanks as $referrerFK) { + if (!$referrerFK->isDeleted()) { + $affectedRows += $referrerFK->save($con); + } + } + } + + $this->alreadyInSave = false; + } + return $affectedRows; + } + + protected $validationFailures = array(); + + + public function getValidationFailures() + { + return $this->validationFailures; + } + + + public function validate($columns = null) + { + $res = $this->doValidate($columns); + if ($res === true) { + $this->validationFailures = array(); + return true; + } else { + $this->validationFailures = $res; + return false; + } + } + + + protected function doValidate($columns = null) + { + if (!$this->alreadyInValidation) { + $this->alreadyInValidation = true; + $retval = null; + + $failureMap = array(); + + + + if ($this->aWare !== null) { + if (!$this->aWare->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aWare->getValidationFailures()); + } + } + + if ($this->aUser !== null) { + if (!$this->aUser->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aUser->getValidationFailures()); + } + } + + + if (($retval = InstrumentPeer::doValidate($this, $columns)) !== true) { + $failureMap = array_merge($failureMap, $retval); + } + + + if ($this->collTagss !== null) { + foreach($this->collTagss as $referrerFK) { + if (!$referrerFK->validate($columns)) { + $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); + } + } + } + + if ($this->collSearchs !== null) { + foreach($this->collSearchs as $referrerFK) { + if (!$referrerFK->validate($columns)) { + $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); + } + } + } + + if ($this->collComments !== null) { + foreach($this->collComments as $referrerFK) { + if (!$referrerFK->validate($columns)) { + $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); + } + } + } + + if ($this->collInstrumentBanks !== null) { + foreach($this->collInstrumentBanks as $referrerFK) { + if (!$referrerFK->validate($columns)) { + $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); + } + } + } + + + $this->alreadyInValidation = false; + } + + return (!empty($failureMap) ? $failureMap : true); + } + + + public function getByName($name, $type = BasePeer::TYPE_PHPNAME) + { + $pos = InstrumentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->getByPosition($pos); + } + + + public function getByPosition($pos) + { + switch($pos) { + case 0: + return $this->getId(); + break; + case 1: + return $this->getName(); + break; + case 2: + return $this->getStripped(); + break; + case 3: + return $this->getSoftware(); + break; + case 4: + return $this->getType(); + break; + case 5: + return $this->getDescription(); + break; + case 6: + return $this->getObject(); + break; + case 7: + return $this->getOwner(); + break; + case 8: + return $this->getAuthor(); + break; + case 9: + return $this->getAuthorStrip(); + break; + case 10: + return $this->getShare(); + break; + case 11: + return $this->getPopularity(); + break; + case 12: + return $this->getSample(); + break; + case 13: + return $this->getUpdatedAt(); + break; + default: + return null; + break; + } } + + + public function toArray($keyType = BasePeer::TYPE_PHPNAME) + { + $keys = InstrumentPeer::getFieldNames($keyType); + $result = array( + $keys[0] => $this->getId(), + $keys[1] => $this->getName(), + $keys[2] => $this->getStripped(), + $keys[3] => $this->getSoftware(), + $keys[4] => $this->getType(), + $keys[5] => $this->getDescription(), + $keys[6] => $this->getObject(), + $keys[7] => $this->getOwner(), + $keys[8] => $this->getAuthor(), + $keys[9] => $this->getAuthorStrip(), + $keys[10] => $this->getShare(), + $keys[11] => $this->getPopularity(), + $keys[12] => $this->getSample(), + $keys[13] => $this->getUpdatedAt(), + ); + return $result; + } + + + public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) + { + $pos = InstrumentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->setByPosition($pos, $value); + } + + + public function setByPosition($pos, $value) + { + switch($pos) { + case 0: + $this->setId($value); + break; + case 1: + $this->setName($value); + break; + case 2: + $this->setStripped($value); + break; + case 3: + $this->setSoftware($value); + break; + case 4: + $this->setType($value); + break; + case 5: + $this->setDescription($value); + break; + case 6: + $this->setObject($value); + break; + case 7: + $this->setOwner($value); + break; + case 8: + $this->setAuthor($value); + break; + case 9: + $this->setAuthorStrip($value); + break; + case 10: + $this->setShare($value); + break; + case 11: + $this->setPopularity($value); + break; + case 12: + $this->setSample($value); + break; + case 13: + $this->setUpdatedAt($value); + break; + } } + + + public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) + { + $keys = InstrumentPeer::getFieldNames($keyType); + + if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); + if (array_key_exists($keys[1], $arr)) $this->setName($arr[$keys[1]]); + if (array_key_exists($keys[2], $arr)) $this->setStripped($arr[$keys[2]]); + if (array_key_exists($keys[3], $arr)) $this->setSoftware($arr[$keys[3]]); + if (array_key_exists($keys[4], $arr)) $this->setType($arr[$keys[4]]); + if (array_key_exists($keys[5], $arr)) $this->setDescription($arr[$keys[5]]); + if (array_key_exists($keys[6], $arr)) $this->setObject($arr[$keys[6]]); + if (array_key_exists($keys[7], $arr)) $this->setOwner($arr[$keys[7]]); + if (array_key_exists($keys[8], $arr)) $this->setAuthor($arr[$keys[8]]); + if (array_key_exists($keys[9], $arr)) $this->setAuthorStrip($arr[$keys[9]]); + if (array_key_exists($keys[10], $arr)) $this->setShare($arr[$keys[10]]); + if (array_key_exists($keys[11], $arr)) $this->setPopularity($arr[$keys[11]]); + if (array_key_exists($keys[12], $arr)) $this->setSample($arr[$keys[12]]); + if (array_key_exists($keys[13], $arr)) $this->setUpdatedAt($arr[$keys[13]]); + } + + + public function buildCriteria() + { + $criteria = new Criteria(InstrumentPeer::DATABASE_NAME); + + if ($this->isColumnModified(InstrumentPeer::ID)) $criteria->add(InstrumentPeer::ID, $this->id); + if ($this->isColumnModified(InstrumentPeer::NAME)) $criteria->add(InstrumentPeer::NAME, $this->name); + if ($this->isColumnModified(InstrumentPeer::STRIPPED)) $criteria->add(InstrumentPeer::STRIPPED, $this->stripped); + if ($this->isColumnModified(InstrumentPeer::SOFTWARE)) $criteria->add(InstrumentPeer::SOFTWARE, $this->software); + if ($this->isColumnModified(InstrumentPeer::TYPE)) $criteria->add(InstrumentPeer::TYPE, $this->type); + if ($this->isColumnModified(InstrumentPeer::DESCRIPTION)) $criteria->add(InstrumentPeer::DESCRIPTION, $this->description); + if ($this->isColumnModified(InstrumentPeer::OBJECT)) $criteria->add(InstrumentPeer::OBJECT, $this->object); + if ($this->isColumnModified(InstrumentPeer::OWNER)) $criteria->add(InstrumentPeer::OWNER, $this->owner); + if ($this->isColumnModified(InstrumentPeer::AUTHOR)) $criteria->add(InstrumentPeer::AUTHOR, $this->author); + if ($this->isColumnModified(InstrumentPeer::AUTHOR_STRIP)) $criteria->add(InstrumentPeer::AUTHOR_STRIP, $this->author_strip); + if ($this->isColumnModified(InstrumentPeer::SHARE)) $criteria->add(InstrumentPeer::SHARE, $this->share); + if ($this->isColumnModified(InstrumentPeer::POPULARITY)) $criteria->add(InstrumentPeer::POPULARITY, $this->popularity); + if ($this->isColumnModified(InstrumentPeer::SAMPLE)) $criteria->add(InstrumentPeer::SAMPLE, $this->sample); + if ($this->isColumnModified(InstrumentPeer::UPDATED_AT)) $criteria->add(InstrumentPeer::UPDATED_AT, $this->updated_at); + + return $criteria; + } + + + public function buildPkeyCriteria() + { + $criteria = new Criteria(InstrumentPeer::DATABASE_NAME); + + $criteria->add(InstrumentPeer::ID, $this->id); + + return $criteria; + } + + + public function getPrimaryKey() + { + return $this->getId(); + } + + + public function setPrimaryKey($key) + { + $this->setId($key); + } + + + public function copyInto($copyObj, $deepCopy = false) + { + + $copyObj->setName($this->name); + + $copyObj->setStripped($this->stripped); + + $copyObj->setSoftware($this->software); + + $copyObj->setType($this->type); + + $copyObj->setDescription($this->description); + + $copyObj->setObject($this->object); + + $copyObj->setOwner($this->owner); + + $copyObj->setAuthor($this->author); + + $copyObj->setAuthorStrip($this->author_strip); + + $copyObj->setShare($this->share); + + $copyObj->setPopularity($this->popularity); + + $copyObj->setSample($this->sample); + + $copyObj->setUpdatedAt($this->updated_at); + + + if ($deepCopy) { + $copyObj->setNew(false); + + foreach($this->getTagss() as $relObj) { + $copyObj->addTags($relObj->copy($deepCopy)); + } + + foreach($this->getSearchs() as $relObj) { + $copyObj->addSearch($relObj->copy($deepCopy)); + } + + foreach($this->getComments() as $relObj) { + $copyObj->addComment($relObj->copy($deepCopy)); + } + + foreach($this->getInstrumentBanks() as $relObj) { + $copyObj->addInstrumentBank($relObj->copy($deepCopy)); + } + + } + + $copyObj->setNew(true); + + $copyObj->setId(NULL); + } + + + public function copy($deepCopy = false) + { + $clazz = get_class($this); + $copyObj = new $clazz(); + $this->copyInto($copyObj, $deepCopy); + return $copyObj; + } + + + public function getPeer() + { + if (self::$peer === null) { + self::$peer = new InstrumentPeer(); + } + return self::$peer; + } + + + public function setWare($v) + { + + + if ($v === null) { + $this->setSoftware('LSDJ'); + } else { + $this->setSoftware($v->getSoft()); + } + + + $this->aWare = $v; + } + + + + public function getWare($con = null) + { + if ($this->aWare === null && (($this->software !== "" && $this->software !== null))) { + include_once 'lib/model/om/BaseWarePeer.php'; + + $this->aWare = WarePeer::retrieveByPK($this->software, $con); + + + } + return $this->aWare; + } + + + public function setUser($v) + { + + + if ($v === null) { + $this->setOwner(NULL); + } else { + $this->setOwner($v->getUsername()); + } + + + $this->aUser = $v; + } + + + + public function getUser($con = null) + { + if ($this->aUser === null && (($this->owner !== "" && $this->owner !== null))) { + include_once 'lib/model/om/BaseUserPeer.php'; + + $this->aUser = UserPeer::retrieveByPK($this->owner, $con); + + + } + return $this->aUser; + } + + + public function initTagss() + { + if ($this->collTagss === null) { + $this->collTagss = array(); + } + } + + + public function getTagss($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseTagsPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collTagss === null) { + if ($this->isNew()) { + $this->collTagss = array(); + } else { + + $criteria->add(TagsPeer::INSTRUMENT_ID, $this->getId()); + + TagsPeer::addSelectColumns($criteria); + $this->collTagss = TagsPeer::doSelect($criteria, $con); + } + } else { + if (!$this->isNew()) { + + + $criteria->add(TagsPeer::INSTRUMENT_ID, $this->getId()); + + TagsPeer::addSelectColumns($criteria); + if (!isset($this->lastTagsCriteria) || !$this->lastTagsCriteria->equals($criteria)) { + $this->collTagss = TagsPeer::doSelect($criteria, $con); + } + } + } + $this->lastTagsCriteria = $criteria; + return $this->collTagss; + } + + + public function countTagss($criteria = null, $distinct = false, $con = null) + { + include_once 'lib/model/om/BaseTagsPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + $criteria->add(TagsPeer::INSTRUMENT_ID, $this->getId()); + + return TagsPeer::doCount($criteria, $distinct, $con); + } + + + public function addTags(Tags $l) + { + $this->collTagss[] = $l; + $l->setInstrument($this); + } + + + + public function getTagssJoinUser($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseTagsPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collTagss === null) { + if ($this->isNew()) { + $this->collTagss = array(); + } else { + + $criteria->add(TagsPeer::INSTRUMENT_ID, $this->getId()); + + $this->collTagss = TagsPeer::doSelectJoinUser($criteria, $con); + } + } else { + + $criteria->add(TagsPeer::INSTRUMENT_ID, $this->getId()); + + if (!isset($this->lastTagsCriteria) || !$this->lastTagsCriteria->equals($criteria)) { + $this->collTagss = TagsPeer::doSelectJoinUser($criteria, $con); + } + } + $this->lastTagsCriteria = $criteria; + + return $this->collTagss; + } + + + public function initSearchs() + { + if ($this->collSearchs === null) { + $this->collSearchs = array(); + } + } + + + public function getSearchs($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseSearchPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collSearchs === null) { + if ($this->isNew()) { + $this->collSearchs = array(); + } else { + + $criteria->add(SearchPeer::INSTRUMENT_ID, $this->getId()); + + SearchPeer::addSelectColumns($criteria); + $this->collSearchs = SearchPeer::doSelect($criteria, $con); + } + } else { + if (!$this->isNew()) { + + + $criteria->add(SearchPeer::INSTRUMENT_ID, $this->getId()); + + SearchPeer::addSelectColumns($criteria); + if (!isset($this->lastSearchCriteria) || !$this->lastSearchCriteria->equals($criteria)) { + $this->collSearchs = SearchPeer::doSelect($criteria, $con); + } + } + } + $this->lastSearchCriteria = $criteria; + return $this->collSearchs; + } + + + public function countSearchs($criteria = null, $distinct = false, $con = null) + { + include_once 'lib/model/om/BaseSearchPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + $criteria->add(SearchPeer::INSTRUMENT_ID, $this->getId()); + + return SearchPeer::doCount($criteria, $distinct, $con); + } + + + public function addSearch(Search $l) + { + $this->collSearchs[] = $l; + $l->setInstrument($this); + } + + + public function initComments() + { + if ($this->collComments === null) { + $this->collComments = array(); + } + } + + + public function getComments($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseCommentPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collComments === null) { + if ($this->isNew()) { + $this->collComments = array(); + } else { + + $criteria->add(CommentPeer::INSTRUMENT_ID, $this->getId()); + + CommentPeer::addSelectColumns($criteria); + $this->collComments = CommentPeer::doSelect($criteria, $con); + } + } else { + if (!$this->isNew()) { + + + $criteria->add(CommentPeer::INSTRUMENT_ID, $this->getId()); + + CommentPeer::addSelectColumns($criteria); + if (!isset($this->lastCommentCriteria) || !$this->lastCommentCriteria->equals($criteria)) { + $this->collComments = CommentPeer::doSelect($criteria, $con); + } + } + } + $this->lastCommentCriteria = $criteria; + return $this->collComments; + } + + + public function countComments($criteria = null, $distinct = false, $con = null) + { + include_once 'lib/model/om/BaseCommentPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + $criteria->add(CommentPeer::INSTRUMENT_ID, $this->getId()); + + return CommentPeer::doCount($criteria, $distinct, $con); + } + + + public function addComment(Comment $l) + { + $this->collComments[] = $l; + $l->setInstrument($this); + } + + + + public function getCommentsJoinUser($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseCommentPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collComments === null) { + if ($this->isNew()) { + $this->collComments = array(); + } else { + + $criteria->add(CommentPeer::INSTRUMENT_ID, $this->getId()); + + $this->collComments = CommentPeer::doSelectJoinUser($criteria, $con); + } + } else { + + $criteria->add(CommentPeer::INSTRUMENT_ID, $this->getId()); + + if (!isset($this->lastCommentCriteria) || !$this->lastCommentCriteria->equals($criteria)) { + $this->collComments = CommentPeer::doSelectJoinUser($criteria, $con); + } + } + $this->lastCommentCriteria = $criteria; + + return $this->collComments; + } + + + public function initInstrumentBanks() + { + if ($this->collInstrumentBanks === null) { + $this->collInstrumentBanks = array(); + } + } + + + public function getInstrumentBanks($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseInstrumentBankPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collInstrumentBanks === null) { + if ($this->isNew()) { + $this->collInstrumentBanks = array(); + } else { + + $criteria->add(InstrumentBankPeer::INSTRUMENT_ID, $this->getId()); + + InstrumentBankPeer::addSelectColumns($criteria); + $this->collInstrumentBanks = InstrumentBankPeer::doSelect($criteria, $con); + } + } else { + if (!$this->isNew()) { + + + $criteria->add(InstrumentBankPeer::INSTRUMENT_ID, $this->getId()); + + InstrumentBankPeer::addSelectColumns($criteria); + if (!isset($this->lastInstrumentBankCriteria) || !$this->lastInstrumentBankCriteria->equals($criteria)) { + $this->collInstrumentBanks = InstrumentBankPeer::doSelect($criteria, $con); + } + } + } + $this->lastInstrumentBankCriteria = $criteria; + return $this->collInstrumentBanks; + } + + + public function countInstrumentBanks($criteria = null, $distinct = false, $con = null) + { + include_once 'lib/model/om/BaseInstrumentBankPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + $criteria->add(InstrumentBankPeer::INSTRUMENT_ID, $this->getId()); + + return InstrumentBankPeer::doCount($criteria, $distinct, $con); + } + + + public function addInstrumentBank(InstrumentBank $l) + { + $this->collInstrumentBanks[] = $l; + $l->setInstrument($this); + } + + + + public function getInstrumentBanksJoinBank($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseInstrumentBankPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collInstrumentBanks === null) { + if ($this->isNew()) { + $this->collInstrumentBanks = array(); + } else { + + $criteria->add(InstrumentBankPeer::INSTRUMENT_ID, $this->getId()); + + $this->collInstrumentBanks = InstrumentBankPeer::doSelectJoinBank($criteria, $con); + } + } else { + + $criteria->add(InstrumentBankPeer::INSTRUMENT_ID, $this->getId()); + + if (!isset($this->lastInstrumentBankCriteria) || !$this->lastInstrumentBankCriteria->equals($criteria)) { + $this->collInstrumentBanks = InstrumentBankPeer::doSelectJoinBank($criteria, $con); + } + } + $this->lastInstrumentBankCriteria = $criteria; + + return $this->collInstrumentBanks; + } + +} \ No newline at end of file diff --git a/lib/model/om/BaseInstrumentBank.php b/lib/model/om/BaseInstrumentBank.php new file mode 100644 index 0000000..ba01bd7 --- /dev/null +++ b/lib/model/om/BaseInstrumentBank.php @@ -0,0 +1,465 @@ +id; + } + + + public function getBankId() + { + + return $this->bank_id; + } + + + public function getInstrumentId() + { + + return $this->instrument_id; + } + + + public function setId($v) + { + + + + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->id !== $v) { + $this->id = $v; + $this->modifiedColumns[] = InstrumentBankPeer::ID; + } + + } + + public function setBankId($v) + { + + + + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->bank_id !== $v) { + $this->bank_id = $v; + $this->modifiedColumns[] = InstrumentBankPeer::BANK_ID; + } + + if ($this->aBank !== null && $this->aBank->getId() !== $v) { + $this->aBank = null; + } + + } + + public function setInstrumentId($v) + { + + + + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->instrument_id !== $v) { + $this->instrument_id = $v; + $this->modifiedColumns[] = InstrumentBankPeer::INSTRUMENT_ID; + } + + if ($this->aInstrument !== null && $this->aInstrument->getId() !== $v) { + $this->aInstrument = null; + } + + } + + public function hydrate(ResultSet $rs, $startcol = 1) + { + try { + + $this->id = $rs->getInt($startcol + 0); + + $this->bank_id = $rs->getInt($startcol + 1); + + $this->instrument_id = $rs->getInt($startcol + 2); + + $this->resetModified(); + + $this->setNew(false); + + return $startcol + 3; + } catch (Exception $e) { + throw new PropelException("Error populating InstrumentBank object", $e); + } + } + + + public function delete($con = null) + { + if ($this->isDeleted()) { + throw new PropelException("This object has already been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(InstrumentBankPeer::DATABASE_NAME); + } + + try { + $con->begin(); + InstrumentBankPeer::doDelete($this, $con); + $this->setDeleted(true); + $con->commit(); + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public function save($con = null) + { + if ($this->isDeleted()) { + throw new PropelException("You cannot save an object that has been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(InstrumentBankPeer::DATABASE_NAME); + } + + try { + $con->begin(); + $affectedRows = $this->doSave($con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + protected function doSave($con) + { + $affectedRows = 0; if (!$this->alreadyInSave) { + $this->alreadyInSave = true; + + + + if ($this->aBank !== null) { + if ($this->aBank->isModified()) { + $affectedRows += $this->aBank->save($con); + } + $this->setBank($this->aBank); + } + + if ($this->aInstrument !== null) { + if ($this->aInstrument->isModified()) { + $affectedRows += $this->aInstrument->save($con); + } + $this->setInstrument($this->aInstrument); + } + + + if ($this->isModified()) { + if ($this->isNew()) { + $pk = InstrumentBankPeer::doInsert($this, $con); + $affectedRows += 1; + $this->setId($pk); + $this->setNew(false); + } else { + $affectedRows += InstrumentBankPeer::doUpdate($this, $con); + } + $this->resetModified(); } + + $this->alreadyInSave = false; + } + return $affectedRows; + } + + protected $validationFailures = array(); + + + public function getValidationFailures() + { + return $this->validationFailures; + } + + + public function validate($columns = null) + { + $res = $this->doValidate($columns); + if ($res === true) { + $this->validationFailures = array(); + return true; + } else { + $this->validationFailures = $res; + return false; + } + } + + + protected function doValidate($columns = null) + { + if (!$this->alreadyInValidation) { + $this->alreadyInValidation = true; + $retval = null; + + $failureMap = array(); + + + + if ($this->aBank !== null) { + if (!$this->aBank->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aBank->getValidationFailures()); + } + } + + if ($this->aInstrument !== null) { + if (!$this->aInstrument->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aInstrument->getValidationFailures()); + } + } + + + if (($retval = InstrumentBankPeer::doValidate($this, $columns)) !== true) { + $failureMap = array_merge($failureMap, $retval); + } + + + + $this->alreadyInValidation = false; + } + + return (!empty($failureMap) ? $failureMap : true); + } + + + public function getByName($name, $type = BasePeer::TYPE_PHPNAME) + { + $pos = InstrumentBankPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->getByPosition($pos); + } + + + public function getByPosition($pos) + { + switch($pos) { + case 0: + return $this->getId(); + break; + case 1: + return $this->getBankId(); + break; + case 2: + return $this->getInstrumentId(); + break; + default: + return null; + break; + } } + + + public function toArray($keyType = BasePeer::TYPE_PHPNAME) + { + $keys = InstrumentBankPeer::getFieldNames($keyType); + $result = array( + $keys[0] => $this->getId(), + $keys[1] => $this->getBankId(), + $keys[2] => $this->getInstrumentId(), + ); + return $result; + } + + + public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) + { + $pos = InstrumentBankPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->setByPosition($pos, $value); + } + + + public function setByPosition($pos, $value) + { + switch($pos) { + case 0: + $this->setId($value); + break; + case 1: + $this->setBankId($value); + break; + case 2: + $this->setInstrumentId($value); + break; + } } + + + public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) + { + $keys = InstrumentBankPeer::getFieldNames($keyType); + + if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); + if (array_key_exists($keys[1], $arr)) $this->setBankId($arr[$keys[1]]); + if (array_key_exists($keys[2], $arr)) $this->setInstrumentId($arr[$keys[2]]); + } + + + public function buildCriteria() + { + $criteria = new Criteria(InstrumentBankPeer::DATABASE_NAME); + + if ($this->isColumnModified(InstrumentBankPeer::ID)) $criteria->add(InstrumentBankPeer::ID, $this->id); + if ($this->isColumnModified(InstrumentBankPeer::BANK_ID)) $criteria->add(InstrumentBankPeer::BANK_ID, $this->bank_id); + if ($this->isColumnModified(InstrumentBankPeer::INSTRUMENT_ID)) $criteria->add(InstrumentBankPeer::INSTRUMENT_ID, $this->instrument_id); + + return $criteria; + } + + + public function buildPkeyCriteria() + { + $criteria = new Criteria(InstrumentBankPeer::DATABASE_NAME); + + $criteria->add(InstrumentBankPeer::ID, $this->id); + + return $criteria; + } + + + public function getPrimaryKey() + { + return $this->getId(); + } + + + public function setPrimaryKey($key) + { + $this->setId($key); + } + + + public function copyInto($copyObj, $deepCopy = false) + { + + $copyObj->setBankId($this->bank_id); + + $copyObj->setInstrumentId($this->instrument_id); + + + $copyObj->setNew(true); + + $copyObj->setId(NULL); + } + + + public function copy($deepCopy = false) + { + $clazz = get_class($this); + $copyObj = new $clazz(); + $this->copyInto($copyObj, $deepCopy); + return $copyObj; + } + + + public function getPeer() + { + if (self::$peer === null) { + self::$peer = new InstrumentBankPeer(); + } + return self::$peer; + } + + + public function setBank($v) + { + + + if ($v === null) { + $this->setBankId(NULL); + } else { + $this->setBankId($v->getId()); + } + + + $this->aBank = $v; + } + + + + public function getBank($con = null) + { + if ($this->aBank === null && ($this->bank_id !== null)) { + include_once 'lib/model/om/BaseBankPeer.php'; + + $this->aBank = BankPeer::retrieveByPK($this->bank_id, $con); + + + } + return $this->aBank; + } + + + public function setInstrument($v) + { + + + if ($v === null) { + $this->setInstrumentId(NULL); + } else { + $this->setInstrumentId($v->getId()); + } + + + $this->aInstrument = $v; + } + + + + public function getInstrument($con = null) + { + if ($this->aInstrument === null && ($this->instrument_id !== null)) { + include_once 'lib/model/om/BaseInstrumentPeer.php'; + + $this->aInstrument = InstrumentPeer::retrieveByPK($this->instrument_id, $con); + + + } + return $this->aInstrument; + } + +} \ No newline at end of file diff --git a/lib/model/om/BaseInstrumentBankPeer.php b/lib/model/om/BaseInstrumentBankPeer.php new file mode 100644 index 0000000..3f6abed --- /dev/null +++ b/lib/model/om/BaseInstrumentBankPeer.php @@ -0,0 +1,809 @@ + array ('Id', 'BankId', 'InstrumentId', ), + BasePeer::TYPE_COLNAME => array (InstrumentBankPeer::ID, InstrumentBankPeer::BANK_ID, InstrumentBankPeer::INSTRUMENT_ID, ), + BasePeer::TYPE_FIELDNAME => array ('id', 'bank_id', 'instrument_id', ), + BasePeer::TYPE_NUM => array (0, 1, 2, ) + ); + + + private static $fieldKeys = array ( + BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'BankId' => 1, 'InstrumentId' => 2, ), + BasePeer::TYPE_COLNAME => array (InstrumentBankPeer::ID => 0, InstrumentBankPeer::BANK_ID => 1, InstrumentBankPeer::INSTRUMENT_ID => 2, ), + BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'bank_id' => 1, 'instrument_id' => 2, ), + BasePeer::TYPE_NUM => array (0, 1, 2, ) + ); + + + public static function getMapBuilder() + { + include_once 'lib/model/map/InstrumentBankMapBuilder.php'; + return BasePeer::getMapBuilder('lib.model.map.InstrumentBankMapBuilder'); + } + + public static function getPhpNameMap() + { + if (self::$phpNameMap === null) { + $map = InstrumentBankPeer::getTableMap(); + $columns = $map->getColumns(); + $nameMap = array(); + foreach ($columns as $column) { + $nameMap[$column->getPhpName()] = $column->getColumnName(); + } + self::$phpNameMap = $nameMap; + } + return self::$phpNameMap; + } + + static public function translateFieldName($name, $fromType, $toType) + { + $toNames = self::getFieldNames($toType); + $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$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(self::$fieldKeys[$fromType], true)); + } + return $toNames[$key]; + } + + + + static public function getFieldNames($type = BasePeer::TYPE_PHPNAME) + { + if (!array_key_exists($type, self::$fieldNames)) { + throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.'); + } + return self::$fieldNames[$type]; + } + + + public static function alias($alias, $column) + { + return str_replace(InstrumentBankPeer::TABLE_NAME.'.', $alias.'.', $column); + } + + + public static function addSelectColumns(Criteria $criteria) + { + + $criteria->addSelectColumn(InstrumentBankPeer::ID); + + $criteria->addSelectColumn(InstrumentBankPeer::BANK_ID); + + $criteria->addSelectColumn(InstrumentBankPeer::INSTRUMENT_ID); + + } + + const COUNT = 'COUNT(InstrumentBank.ID)'; + const COUNT_DISTINCT = 'COUNT(DISTINCT InstrumentBank.ID)'; + + + public static function doCount(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(InstrumentBankPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(InstrumentBankPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $rs = InstrumentBankPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + public static function doSelectOne(Criteria $criteria, $con = null) + { + $critcopy = clone $criteria; + $critcopy->setLimit(1); + $objects = InstrumentBankPeer::doSelect($critcopy, $con); + if ($objects) { + return $objects[0]; + } + return null; + } + + public static function doSelect(Criteria $criteria, $con = null) + { + return InstrumentBankPeer::populateObjects(InstrumentBankPeer::doSelectRS($criteria, $con)); + } + + public static function doSelectRS(Criteria $criteria, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + if (!$criteria->getSelectColumns()) { + $criteria = clone $criteria; + InstrumentBankPeer::addSelectColumns($criteria); + } + + $criteria->setDbName(self::DATABASE_NAME); + + return BasePeer::doSelect($criteria, $con); + } + + public static function populateObjects(ResultSet $rs) + { + $results = array(); + + $cls = InstrumentBankPeer::getOMClass(); + $cls = Propel::import($cls); + while($rs->next()) { + + $obj = new $cls(); + $obj->hydrate($rs); + $results[] = $obj; + + } + return $results; + } + + + public static function doCountJoinBank(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(InstrumentBankPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(InstrumentBankPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(InstrumentBankPeer::BANK_ID, BankPeer::ID); + + $rs = InstrumentBankPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doCountJoinInstrument(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(InstrumentBankPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(InstrumentBankPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(InstrumentBankPeer::INSTRUMENT_ID, InstrumentPeer::ID); + + $rs = InstrumentBankPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doSelectJoinBank(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + InstrumentBankPeer::addSelectColumns($c); + $startcol = (InstrumentBankPeer::NUM_COLUMNS - InstrumentBankPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + BankPeer::addSelectColumns($c); + + $c->addJoin(InstrumentBankPeer::BANK_ID, BankPeer::ID); + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = InstrumentBankPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + $omClass = BankPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol); + + $newObject = true; + foreach($results as $temp_obj1) { + $temp_obj2 = $temp_obj1->getBank(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addInstrumentBank($obj1); break; + } + } + if ($newObject) { + $obj2->initInstrumentBanks(); + $obj2->addInstrumentBank($obj1); } + $results[] = $obj1; + } + return $results; + } + + + + public static function doSelectJoinInstrument(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + InstrumentBankPeer::addSelectColumns($c); + $startcol = (InstrumentBankPeer::NUM_COLUMNS - InstrumentBankPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + InstrumentPeer::addSelectColumns($c); + + $c->addJoin(InstrumentBankPeer::INSTRUMENT_ID, InstrumentPeer::ID); + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = InstrumentBankPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + $omClass = InstrumentPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol); + + $newObject = true; + foreach($results as $temp_obj1) { + $temp_obj2 = $temp_obj1->getInstrument(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addInstrumentBank($obj1); break; + } + } + if ($newObject) { + $obj2->initInstrumentBanks(); + $obj2->addInstrumentBank($obj1); } + $results[] = $obj1; + } + return $results; + } + + + + public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(InstrumentBankPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(InstrumentBankPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(InstrumentBankPeer::BANK_ID, BankPeer::ID); + + $criteria->addJoin(InstrumentBankPeer::INSTRUMENT_ID, InstrumentPeer::ID); + + $rs = InstrumentBankPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doSelectJoinAll(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + InstrumentBankPeer::addSelectColumns($c); + $startcol2 = (InstrumentBankPeer::NUM_COLUMNS - InstrumentBankPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + + BankPeer::addSelectColumns($c); + $startcol3 = $startcol2 + BankPeer::NUM_COLUMNS; + + InstrumentPeer::addSelectColumns($c); + $startcol4 = $startcol3 + InstrumentPeer::NUM_COLUMNS; + + $c->addJoin(InstrumentBankPeer::BANK_ID, BankPeer::ID); + + $c->addJoin(InstrumentBankPeer::INSTRUMENT_ID, InstrumentPeer::ID); + + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = InstrumentBankPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + + + $omClass = BankPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol2); + + $newObject = true; + for ($j=0, $resCount=count($results); $j < $resCount; $j++) { + $temp_obj1 = $results[$j]; + $temp_obj2 = $temp_obj1->getBank(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addInstrumentBank($obj1); break; + } + } + + if ($newObject) { + $obj2->initInstrumentBanks(); + $obj2->addInstrumentBank($obj1); + } + + + + $omClass = InstrumentPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj3 = new $cls(); + $obj3->hydrate($rs, $startcol3); + + $newObject = true; + for ($j=0, $resCount=count($results); $j < $resCount; $j++) { + $temp_obj1 = $results[$j]; + $temp_obj3 = $temp_obj1->getInstrument(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { + $newObject = false; + $temp_obj3->addInstrumentBank($obj1); break; + } + } + + if ($newObject) { + $obj3->initInstrumentBanks(); + $obj3->addInstrumentBank($obj1); + } + + $results[] = $obj1; + } + return $results; + } + + + + public static function doCountJoinAllExceptBank(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(InstrumentBankPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(InstrumentBankPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(InstrumentBankPeer::INSTRUMENT_ID, InstrumentPeer::ID); + + $rs = InstrumentBankPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doCountJoinAllExceptInstrument(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(InstrumentBankPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(InstrumentBankPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(InstrumentBankPeer::BANK_ID, BankPeer::ID); + + $rs = InstrumentBankPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doSelectJoinAllExceptBank(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + InstrumentBankPeer::addSelectColumns($c); + $startcol2 = (InstrumentBankPeer::NUM_COLUMNS - InstrumentBankPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + + InstrumentPeer::addSelectColumns($c); + $startcol3 = $startcol2 + InstrumentPeer::NUM_COLUMNS; + + $c->addJoin(InstrumentBankPeer::INSTRUMENT_ID, InstrumentPeer::ID); + + + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = InstrumentBankPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + $omClass = InstrumentPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol2); + + $newObject = true; + for ($j=0, $resCount=count($results); $j < $resCount; $j++) { + $temp_obj1 = $results[$j]; + $temp_obj2 = $temp_obj1->getInstrument(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addInstrumentBank($obj1); + break; + } + } + + if ($newObject) { + $obj2->initInstrumentBanks(); + $obj2->addInstrumentBank($obj1); + } + + $results[] = $obj1; + } + return $results; + } + + + + public static function doSelectJoinAllExceptInstrument(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + InstrumentBankPeer::addSelectColumns($c); + $startcol2 = (InstrumentBankPeer::NUM_COLUMNS - InstrumentBankPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + + BankPeer::addSelectColumns($c); + $startcol3 = $startcol2 + BankPeer::NUM_COLUMNS; + + $c->addJoin(InstrumentBankPeer::BANK_ID, BankPeer::ID); + + + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = InstrumentBankPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + $omClass = BankPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol2); + + $newObject = true; + for ($j=0, $resCount=count($results); $j < $resCount; $j++) { + $temp_obj1 = $results[$j]; + $temp_obj2 = $temp_obj1->getBank(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addInstrumentBank($obj1); + break; + } + } + + if ($newObject) { + $obj2->initInstrumentBanks(); + $obj2->addInstrumentBank($obj1); + } + + $results[] = $obj1; + } + return $results; + } + + + public static function getTableMap() + { + return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME); + } + + + public static function getOMClass() + { + return InstrumentBankPeer::CLASS_DEFAULT; + } + + + public static function doInsert($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; } else { + $criteria = $values->buildCriteria(); } + + $criteria->remove(InstrumentBankPeer::ID); + + $criteria->setDbName(self::DATABASE_NAME); + + try { + $con->begin(); + $pk = BasePeer::doInsert($criteria, $con); + $con->commit(); + } catch(PropelException $e) { + $con->rollback(); + throw $e; + } + + return $pk; + } + + + public static function doUpdate($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $selectCriteria = new Criteria(self::DATABASE_NAME); + + if ($values instanceof Criteria) { + $criteria = clone $values; + $comparison = $criteria->getComparison(InstrumentBankPeer::ID); + $selectCriteria->add(InstrumentBankPeer::ID, $criteria->remove(InstrumentBankPeer::ID), $comparison); + + } else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); } + + $criteria->setDbName(self::DATABASE_NAME); + + return BasePeer::doUpdate($selectCriteria, $criteria, $con); + } + + + public static function doDeleteAll($con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + $affectedRows = 0; try { + $con->begin(); + $affectedRows += BasePeer::doDeleteAll(InstrumentBankPeer::TABLE_NAME, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public static function doDelete($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(InstrumentBankPeer::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; } elseif ($values instanceof InstrumentBank) { + + $criteria = $values->buildPkeyCriteria(); + } else { + $criteria = new Criteria(self::DATABASE_NAME); + $criteria->add(InstrumentBankPeer::ID, (array) $values, Criteria::IN); + } + + $criteria->setDbName(self::DATABASE_NAME); + + $affectedRows = 0; + try { + $con->begin(); + + $affectedRows += BasePeer::doDelete($criteria, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public static function doValidate(InstrumentBank $obj, $cols = null) + { + $columns = array(); + + if ($cols) { + $dbMap = Propel::getDatabaseMap(InstrumentBankPeer::DATABASE_NAME); + $tableMap = $dbMap->getTable(InstrumentBankPeer::TABLE_NAME); + + if (! is_array($cols)) { + $cols = array($cols); + } + + foreach($cols as $colName) { + if ($tableMap->containsColumn($colName)) { + $get = 'get' . $tableMap->getColumn($colName)->getPhpName(); + $columns[$colName] = $obj->$get(); + } + } + } else { + + } + + $res = BasePeer::doValidate(InstrumentBankPeer::DATABASE_NAME, InstrumentBankPeer::TABLE_NAME, $columns); + if ($res !== true) { + $request = sfContext::getInstance()->getRequest(); + foreach ($res as $failed) { + $col = InstrumentBankPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME); + $request->setError($col, $failed->getMessage()); + } + } + + return $res; + } + + + public static function retrieveByPK($pk, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $criteria = new Criteria(InstrumentBankPeer::DATABASE_NAME); + + $criteria->add(InstrumentBankPeer::ID, $pk); + + + $v = InstrumentBankPeer::doSelect($criteria, $con); + + return !empty($v) > 0 ? $v[0] : null; + } + + + public static function retrieveByPKs($pks, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $objs = null; + if (empty($pks)) { + $objs = array(); + } else { + $criteria = new Criteria(); + $criteria->add(InstrumentBankPeer::ID, $pks, Criteria::IN); + $objs = InstrumentBankPeer::doSelect($criteria, $con); + } + return $objs; + } + +} +if (Propel::isInit()) { + try { + BaseInstrumentBankPeer::getMapBuilder(); + } catch (Exception $e) { + Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR); + } +} else { + require_once 'lib/model/map/InstrumentBankMapBuilder.php'; + Propel::registerMapBuilder('lib.model.map.InstrumentBankMapBuilder'); +} diff --git a/lib/model/om/BaseInstrumentPeer.php b/lib/model/om/BaseInstrumentPeer.php new file mode 100644 index 0000000..79ca86f --- /dev/null +++ b/lib/model/om/BaseInstrumentPeer.php @@ -0,0 +1,898 @@ + array ('Id', 'Name', 'Stripped', 'Software', 'Type', 'Description', 'Object', 'Owner', 'Author', 'AuthorStrip', 'Share', 'Popularity', 'Sample', 'UpdatedAt', ), + BasePeer::TYPE_COLNAME => array (InstrumentPeer::ID, InstrumentPeer::NAME, InstrumentPeer::STRIPPED, InstrumentPeer::SOFTWARE, InstrumentPeer::TYPE, InstrumentPeer::DESCRIPTION, InstrumentPeer::OBJECT, InstrumentPeer::OWNER, InstrumentPeer::AUTHOR, InstrumentPeer::AUTHOR_STRIP, InstrumentPeer::SHARE, InstrumentPeer::POPULARITY, InstrumentPeer::SAMPLE, InstrumentPeer::UPDATED_AT, ), + BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'stripped', 'software', 'type', 'description', 'object', 'owner', 'author', 'author_strip', 'share', 'popularity', 'sample', 'updated_at', ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, ) + ); + + + private static $fieldKeys = array ( + BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Name' => 1, 'Stripped' => 2, 'Software' => 3, 'Type' => 4, 'Description' => 5, 'Object' => 6, 'Owner' => 7, 'Author' => 8, 'AuthorStrip' => 9, 'Share' => 10, 'Popularity' => 11, 'Sample' => 12, 'UpdatedAt' => 13, ), + BasePeer::TYPE_COLNAME => array (InstrumentPeer::ID => 0, InstrumentPeer::NAME => 1, InstrumentPeer::STRIPPED => 2, InstrumentPeer::SOFTWARE => 3, InstrumentPeer::TYPE => 4, InstrumentPeer::DESCRIPTION => 5, InstrumentPeer::OBJECT => 6, InstrumentPeer::OWNER => 7, InstrumentPeer::AUTHOR => 8, InstrumentPeer::AUTHOR_STRIP => 9, InstrumentPeer::SHARE => 10, InstrumentPeer::POPULARITY => 11, InstrumentPeer::SAMPLE => 12, InstrumentPeer::UPDATED_AT => 13, ), + BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'stripped' => 2, 'software' => 3, 'type' => 4, 'description' => 5, 'object' => 6, 'owner' => 7, 'author' => 8, 'author_strip' => 9, 'share' => 10, 'popularity' => 11, 'sample' => 12, 'updated_at' => 13, ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, ) + ); + + + public static function getMapBuilder() + { + include_once 'lib/model/map/InstrumentMapBuilder.php'; + return BasePeer::getMapBuilder('lib.model.map.InstrumentMapBuilder'); + } + + public static function getPhpNameMap() + { + if (self::$phpNameMap === null) { + $map = InstrumentPeer::getTableMap(); + $columns = $map->getColumns(); + $nameMap = array(); + foreach ($columns as $column) { + $nameMap[$column->getPhpName()] = $column->getColumnName(); + } + self::$phpNameMap = $nameMap; + } + return self::$phpNameMap; + } + + static public function translateFieldName($name, $fromType, $toType) + { + $toNames = self::getFieldNames($toType); + $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$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(self::$fieldKeys[$fromType], true)); + } + return $toNames[$key]; + } + + + + static public function getFieldNames($type = BasePeer::TYPE_PHPNAME) + { + if (!array_key_exists($type, self::$fieldNames)) { + throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.'); + } + return self::$fieldNames[$type]; + } + + + public static function alias($alias, $column) + { + return str_replace(InstrumentPeer::TABLE_NAME.'.', $alias.'.', $column); + } + + + public static function addSelectColumns(Criteria $criteria) + { + + $criteria->addSelectColumn(InstrumentPeer::ID); + + $criteria->addSelectColumn(InstrumentPeer::NAME); + + $criteria->addSelectColumn(InstrumentPeer::STRIPPED); + + $criteria->addSelectColumn(InstrumentPeer::SOFTWARE); + + $criteria->addSelectColumn(InstrumentPeer::TYPE); + + $criteria->addSelectColumn(InstrumentPeer::DESCRIPTION); + + $criteria->addSelectColumn(InstrumentPeer::OBJECT); + + $criteria->addSelectColumn(InstrumentPeer::OWNER); + + $criteria->addSelectColumn(InstrumentPeer::AUTHOR); + + $criteria->addSelectColumn(InstrumentPeer::AUTHOR_STRIP); + + $criteria->addSelectColumn(InstrumentPeer::SHARE); + + $criteria->addSelectColumn(InstrumentPeer::POPULARITY); + + $criteria->addSelectColumn(InstrumentPeer::SAMPLE); + + $criteria->addSelectColumn(InstrumentPeer::UPDATED_AT); + + } + + const COUNT = 'COUNT(Instrument.ID)'; + const COUNT_DISTINCT = 'COUNT(DISTINCT Instrument.ID)'; + + + public static function doCount(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(InstrumentPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(InstrumentPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $rs = InstrumentPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + public static function doSelectOne(Criteria $criteria, $con = null) + { + $critcopy = clone $criteria; + $critcopy->setLimit(1); + $objects = InstrumentPeer::doSelect($critcopy, $con); + if ($objects) { + return $objects[0]; + } + return null; + } + + public static function doSelect(Criteria $criteria, $con = null) + { + return InstrumentPeer::populateObjects(InstrumentPeer::doSelectRS($criteria, $con)); + } + + public static function doSelectRS(Criteria $criteria, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + if (!$criteria->getSelectColumns()) { + $criteria = clone $criteria; + InstrumentPeer::addSelectColumns($criteria); + } + + $criteria->setDbName(self::DATABASE_NAME); + + return BasePeer::doSelect($criteria, $con); + } + + public static function populateObjects(ResultSet $rs) + { + $results = array(); + + $cls = InstrumentPeer::getOMClass(); + $cls = Propel::import($cls); + while($rs->next()) { + + $obj = new $cls(); + $obj->hydrate($rs); + $results[] = $obj; + + } + return $results; + } + + + public static function doCountJoinWare(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(InstrumentPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(InstrumentPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(InstrumentPeer::SOFTWARE, WarePeer::SOFT); + + $rs = InstrumentPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doCountJoinUser(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(InstrumentPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(InstrumentPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(InstrumentPeer::OWNER, UserPeer::USERNAME); + + $rs = InstrumentPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doSelectJoinWare(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + InstrumentPeer::addSelectColumns($c); + $startcol = (InstrumentPeer::NUM_COLUMNS - InstrumentPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + WarePeer::addSelectColumns($c); + + $c->addJoin(InstrumentPeer::SOFTWARE, WarePeer::SOFT); + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = InstrumentPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + $omClass = WarePeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol); + + $newObject = true; + foreach($results as $temp_obj1) { + $temp_obj2 = $temp_obj1->getWare(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addInstrument($obj1); break; + } + } + if ($newObject) { + $obj2->initInstruments(); + $obj2->addInstrument($obj1); } + $results[] = $obj1; + } + return $results; + } + + + + public static function doSelectJoinUser(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + InstrumentPeer::addSelectColumns($c); + $startcol = (InstrumentPeer::NUM_COLUMNS - InstrumentPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + UserPeer::addSelectColumns($c); + + $c->addJoin(InstrumentPeer::OWNER, UserPeer::USERNAME); + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = InstrumentPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + $omClass = UserPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol); + + $newObject = true; + foreach($results as $temp_obj1) { + $temp_obj2 = $temp_obj1->getUser(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addInstrument($obj1); break; + } + } + if ($newObject) { + $obj2->initInstruments(); + $obj2->addInstrument($obj1); } + $results[] = $obj1; + } + return $results; + } + + + + public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(InstrumentPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(InstrumentPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(InstrumentPeer::SOFTWARE, WarePeer::SOFT); + + $criteria->addJoin(InstrumentPeer::OWNER, UserPeer::USERNAME); + + $rs = InstrumentPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doSelectJoinAll(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + InstrumentPeer::addSelectColumns($c); + $startcol2 = (InstrumentPeer::NUM_COLUMNS - InstrumentPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + + WarePeer::addSelectColumns($c); + $startcol3 = $startcol2 + WarePeer::NUM_COLUMNS; + + UserPeer::addSelectColumns($c); + $startcol4 = $startcol3 + UserPeer::NUM_COLUMNS; + + $c->addJoin(InstrumentPeer::SOFTWARE, WarePeer::SOFT); + + $c->addJoin(InstrumentPeer::OWNER, UserPeer::USERNAME); + + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = InstrumentPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + + + $omClass = WarePeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol2); + + $newObject = true; + for ($j=0, $resCount=count($results); $j < $resCount; $j++) { + $temp_obj1 = $results[$j]; + $temp_obj2 = $temp_obj1->getWare(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addInstrument($obj1); break; + } + } + + if ($newObject) { + $obj2->initInstruments(); + $obj2->addInstrument($obj1); + } + + + + $omClass = UserPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj3 = new $cls(); + $obj3->hydrate($rs, $startcol3); + + $newObject = true; + for ($j=0, $resCount=count($results); $j < $resCount; $j++) { + $temp_obj1 = $results[$j]; + $temp_obj3 = $temp_obj1->getUser(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { + $newObject = false; + $temp_obj3->addInstrument($obj1); break; + } + } + + if ($newObject) { + $obj3->initInstruments(); + $obj3->addInstrument($obj1); + } + + $results[] = $obj1; + } + return $results; + } + + + + public static function doCountJoinAllExceptWare(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(InstrumentPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(InstrumentPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(InstrumentPeer::OWNER, UserPeer::USERNAME); + + $rs = InstrumentPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doCountJoinAllExceptUser(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(InstrumentPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(InstrumentPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(InstrumentPeer::SOFTWARE, WarePeer::SOFT); + + $rs = InstrumentPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doSelectJoinAllExceptWare(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + InstrumentPeer::addSelectColumns($c); + $startcol2 = (InstrumentPeer::NUM_COLUMNS - InstrumentPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + + UserPeer::addSelectColumns($c); + $startcol3 = $startcol2 + UserPeer::NUM_COLUMNS; + + $c->addJoin(InstrumentPeer::OWNER, UserPeer::USERNAME); + + + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = InstrumentPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + $omClass = UserPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol2); + + $newObject = true; + for ($j=0, $resCount=count($results); $j < $resCount; $j++) { + $temp_obj1 = $results[$j]; + $temp_obj2 = $temp_obj1->getUser(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addInstrument($obj1); + break; + } + } + + if ($newObject) { + $obj2->initInstruments(); + $obj2->addInstrument($obj1); + } + + $results[] = $obj1; + } + return $results; + } + + + + public static function doSelectJoinAllExceptUser(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + InstrumentPeer::addSelectColumns($c); + $startcol2 = (InstrumentPeer::NUM_COLUMNS - InstrumentPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + + WarePeer::addSelectColumns($c); + $startcol3 = $startcol2 + WarePeer::NUM_COLUMNS; + + $c->addJoin(InstrumentPeer::SOFTWARE, WarePeer::SOFT); + + + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = InstrumentPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + $omClass = WarePeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol2); + + $newObject = true; + for ($j=0, $resCount=count($results); $j < $resCount; $j++) { + $temp_obj1 = $results[$j]; + $temp_obj2 = $temp_obj1->getWare(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addInstrument($obj1); + break; + } + } + + if ($newObject) { + $obj2->initInstruments(); + $obj2->addInstrument($obj1); + } + + $results[] = $obj1; + } + return $results; + } + + + public static function getTableMap() + { + return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME); + } + + + public static function getOMClass() + { + return InstrumentPeer::CLASS_DEFAULT; + } + + + public static function doInsert($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; } else { + $criteria = $values->buildCriteria(); } + + $criteria->remove(InstrumentPeer::ID); + + $criteria->setDbName(self::DATABASE_NAME); + + try { + $con->begin(); + $pk = BasePeer::doInsert($criteria, $con); + $con->commit(); + } catch(PropelException $e) { + $con->rollback(); + throw $e; + } + + return $pk; + } + + + public static function doUpdate($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $selectCriteria = new Criteria(self::DATABASE_NAME); + + if ($values instanceof Criteria) { + $criteria = clone $values; + $comparison = $criteria->getComparison(InstrumentPeer::ID); + $selectCriteria->add(InstrumentPeer::ID, $criteria->remove(InstrumentPeer::ID), $comparison); + + } else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); } + + $criteria->setDbName(self::DATABASE_NAME); + + return BasePeer::doUpdate($selectCriteria, $criteria, $con); + } + + + public static function doDeleteAll($con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + $affectedRows = 0; try { + $con->begin(); + $affectedRows += InstrumentPeer::doOnDeleteCascade(new Criteria(), $con); + $affectedRows += BasePeer::doDeleteAll(InstrumentPeer::TABLE_NAME, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public static function doDelete($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(InstrumentPeer::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; } elseif ($values instanceof Instrument) { + + $criteria = $values->buildPkeyCriteria(); + } else { + $criteria = new Criteria(self::DATABASE_NAME); + $criteria->add(InstrumentPeer::ID, (array) $values, Criteria::IN); + } + + $criteria->setDbName(self::DATABASE_NAME); + + $affectedRows = 0; + try { + $con->begin(); + $affectedRows += InstrumentPeer::doOnDeleteCascade($criteria, $con); + $affectedRows += BasePeer::doDelete($criteria, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + protected static function doOnDeleteCascade(Criteria $criteria, Connection $con) + { + $affectedRows = 0; + + $objects = InstrumentPeer::doSelect($criteria, $con); + foreach($objects as $obj) { + + + include_once 'lib/model/Search.php'; + + $c = new Criteria(); + + $c->add(SearchPeer::INSTRUMENT_ID, $obj->getId()); + $affectedRows += SearchPeer::doDelete($c, $con); + + include_once 'lib/model/Comment.php'; + + $c = new Criteria(); + + $c->add(CommentPeer::INSTRUMENT_ID, $obj->getId()); + $affectedRows += CommentPeer::doDelete($c, $con); + + include_once 'lib/model/InstrumentBank.php'; + + $c = new Criteria(); + + $c->add(InstrumentBankPeer::INSTRUMENT_ID, $obj->getId()); + $affectedRows += InstrumentBankPeer::doDelete($c, $con); + } + return $affectedRows; + } + + + public static function doValidate(Instrument $obj, $cols = null) + { + $columns = array(); + + if ($cols) { + $dbMap = Propel::getDatabaseMap(InstrumentPeer::DATABASE_NAME); + $tableMap = $dbMap->getTable(InstrumentPeer::TABLE_NAME); + + if (! is_array($cols)) { + $cols = array($cols); + } + + foreach($cols as $colName) { + if ($tableMap->containsColumn($colName)) { + $get = 'get' . $tableMap->getColumn($colName)->getPhpName(); + $columns[$colName] = $obj->$get(); + } + } + } else { + + } + + $res = BasePeer::doValidate(InstrumentPeer::DATABASE_NAME, InstrumentPeer::TABLE_NAME, $columns); + if ($res !== true) { + $request = sfContext::getInstance()->getRequest(); + foreach ($res as $failed) { + $col = InstrumentPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME); + $request->setError($col, $failed->getMessage()); + } + } + + return $res; + } + + + public static function retrieveByPK($pk, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $criteria = new Criteria(InstrumentPeer::DATABASE_NAME); + + $criteria->add(InstrumentPeer::ID, $pk); + + + $v = InstrumentPeer::doSelect($criteria, $con); + + return !empty($v) > 0 ? $v[0] : null; + } + + + public static function retrieveByPKs($pks, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $objs = null; + if (empty($pks)) { + $objs = array(); + } else { + $criteria = new Criteria(); + $criteria->add(InstrumentPeer::ID, $pks, Criteria::IN); + $objs = InstrumentPeer::doSelect($criteria, $con); + } + return $objs; + } + +} +if (Propel::isInit()) { + try { + BaseInstrumentPeer::getMapBuilder(); + } catch (Exception $e) { + Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR); + } +} else { + require_once 'lib/model/map/InstrumentMapBuilder.php'; + Propel::registerMapBuilder('lib.model.map.InstrumentMapBuilder'); +} diff --git a/lib/model/om/BaseSearch.php b/lib/model/om/BaseSearch.php new file mode 100644 index 0000000..d7d2b9c --- /dev/null +++ b/lib/model/om/BaseSearch.php @@ -0,0 +1,456 @@ +instrument_id; + } + + + public function getWord() + { + + return $this->word; + } + + + public function getWeight() + { + + return $this->weight; + } + + + public function getId() + { + + return $this->id; + } + + + public function setInstrumentId($v) + { + + + + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->instrument_id !== $v) { + $this->instrument_id = $v; + $this->modifiedColumns[] = SearchPeer::INSTRUMENT_ID; + } + + if ($this->aInstrument !== null && $this->aInstrument->getId() !== $v) { + $this->aInstrument = null; + } + + } + + public function setWord($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->word !== $v) { + $this->word = $v; + $this->modifiedColumns[] = SearchPeer::WORD; + } + + } + + public function setWeight($v) + { + + + + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->weight !== $v || $v === 0) { + $this->weight = $v; + $this->modifiedColumns[] = SearchPeer::WEIGHT; + } + + } + + public function setId($v) + { + + + + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->id !== $v) { + $this->id = $v; + $this->modifiedColumns[] = SearchPeer::ID; + } + + } + + public function hydrate(ResultSet $rs, $startcol = 1) + { + try { + + $this->instrument_id = $rs->getInt($startcol + 0); + + $this->word = $rs->getString($startcol + 1); + + $this->weight = $rs->getInt($startcol + 2); + + $this->id = $rs->getInt($startcol + 3); + + $this->resetModified(); + + $this->setNew(false); + + return $startcol + 4; + } catch (Exception $e) { + throw new PropelException("Error populating Search object", $e); + } + } + + + public function delete($con = null) + { + if ($this->isDeleted()) { + throw new PropelException("This object has already been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(SearchPeer::DATABASE_NAME); + } + + try { + $con->begin(); + SearchPeer::doDelete($this, $con); + $this->setDeleted(true); + $con->commit(); + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public function save($con = null) + { + if ($this->isDeleted()) { + throw new PropelException("You cannot save an object that has been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(SearchPeer::DATABASE_NAME); + } + + try { + $con->begin(); + $affectedRows = $this->doSave($con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + protected function doSave($con) + { + $affectedRows = 0; if (!$this->alreadyInSave) { + $this->alreadyInSave = true; + + + + if ($this->aInstrument !== null) { + if ($this->aInstrument->isModified()) { + $affectedRows += $this->aInstrument->save($con); + } + $this->setInstrument($this->aInstrument); + } + + + if ($this->isModified()) { + if ($this->isNew()) { + $pk = SearchPeer::doInsert($this, $con); + $affectedRows += 1; + $this->setId($pk); + $this->setNew(false); + } else { + $affectedRows += SearchPeer::doUpdate($this, $con); + } + $this->resetModified(); } + + $this->alreadyInSave = false; + } + return $affectedRows; + } + + protected $validationFailures = array(); + + + public function getValidationFailures() + { + return $this->validationFailures; + } + + + public function validate($columns = null) + { + $res = $this->doValidate($columns); + if ($res === true) { + $this->validationFailures = array(); + return true; + } else { + $this->validationFailures = $res; + return false; + } + } + + + protected function doValidate($columns = null) + { + if (!$this->alreadyInValidation) { + $this->alreadyInValidation = true; + $retval = null; + + $failureMap = array(); + + + + if ($this->aInstrument !== null) { + if (!$this->aInstrument->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aInstrument->getValidationFailures()); + } + } + + + if (($retval = SearchPeer::doValidate($this, $columns)) !== true) { + $failureMap = array_merge($failureMap, $retval); + } + + + + $this->alreadyInValidation = false; + } + + return (!empty($failureMap) ? $failureMap : true); + } + + + public function getByName($name, $type = BasePeer::TYPE_PHPNAME) + { + $pos = SearchPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->getByPosition($pos); + } + + + public function getByPosition($pos) + { + switch($pos) { + case 0: + return $this->getInstrumentId(); + break; + case 1: + return $this->getWord(); + break; + case 2: + return $this->getWeight(); + break; + case 3: + return $this->getId(); + break; + default: + return null; + break; + } } + + + public function toArray($keyType = BasePeer::TYPE_PHPNAME) + { + $keys = SearchPeer::getFieldNames($keyType); + $result = array( + $keys[0] => $this->getInstrumentId(), + $keys[1] => $this->getWord(), + $keys[2] => $this->getWeight(), + $keys[3] => $this->getId(), + ); + return $result; + } + + + public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) + { + $pos = SearchPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->setByPosition($pos, $value); + } + + + public function setByPosition($pos, $value) + { + switch($pos) { + case 0: + $this->setInstrumentId($value); + break; + case 1: + $this->setWord($value); + break; + case 2: + $this->setWeight($value); + break; + case 3: + $this->setId($value); + break; + } } + + + public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) + { + $keys = SearchPeer::getFieldNames($keyType); + + if (array_key_exists($keys[0], $arr)) $this->setInstrumentId($arr[$keys[0]]); + if (array_key_exists($keys[1], $arr)) $this->setWord($arr[$keys[1]]); + if (array_key_exists($keys[2], $arr)) $this->setWeight($arr[$keys[2]]); + if (array_key_exists($keys[3], $arr)) $this->setId($arr[$keys[3]]); + } + + + public function buildCriteria() + { + $criteria = new Criteria(SearchPeer::DATABASE_NAME); + + if ($this->isColumnModified(SearchPeer::INSTRUMENT_ID)) $criteria->add(SearchPeer::INSTRUMENT_ID, $this->instrument_id); + if ($this->isColumnModified(SearchPeer::WORD)) $criteria->add(SearchPeer::WORD, $this->word); + if ($this->isColumnModified(SearchPeer::WEIGHT)) $criteria->add(SearchPeer::WEIGHT, $this->weight); + if ($this->isColumnModified(SearchPeer::ID)) $criteria->add(SearchPeer::ID, $this->id); + + return $criteria; + } + + + public function buildPkeyCriteria() + { + $criteria = new Criteria(SearchPeer::DATABASE_NAME); + + $criteria->add(SearchPeer::ID, $this->id); + + return $criteria; + } + + + public function getPrimaryKey() + { + return $this->getId(); + } + + + public function setPrimaryKey($key) + { + $this->setId($key); + } + + + public function copyInto($copyObj, $deepCopy = false) + { + + $copyObj->setInstrumentId($this->instrument_id); + + $copyObj->setWord($this->word); + + $copyObj->setWeight($this->weight); + + + $copyObj->setNew(true); + + $copyObj->setId(NULL); + } + + + public function copy($deepCopy = false) + { + $clazz = get_class($this); + $copyObj = new $clazz(); + $this->copyInto($copyObj, $deepCopy); + return $copyObj; + } + + + public function getPeer() + { + if (self::$peer === null) { + self::$peer = new SearchPeer(); + } + return self::$peer; + } + + + public function setInstrument($v) + { + + + if ($v === null) { + $this->setInstrumentId(NULL); + } else { + $this->setInstrumentId($v->getId()); + } + + + $this->aInstrument = $v; + } + + + + public function getInstrument($con = null) + { + if ($this->aInstrument === null && ($this->instrument_id !== null)) { + include_once 'lib/model/om/BaseInstrumentPeer.php'; + + $this->aInstrument = InstrumentPeer::retrieveByPK($this->instrument_id, $con); + + + } + return $this->aInstrument; + } + +} \ No newline at end of file diff --git a/lib/model/om/BaseSearchPeer.php b/lib/model/om/BaseSearchPeer.php new file mode 100644 index 0000000..8d4b917 --- /dev/null +++ b/lib/model/om/BaseSearchPeer.php @@ -0,0 +1,539 @@ + array ('InstrumentId', 'Word', 'Weight', 'Id', ), + BasePeer::TYPE_COLNAME => array (SearchPeer::INSTRUMENT_ID, SearchPeer::WORD, SearchPeer::WEIGHT, SearchPeer::ID, ), + BasePeer::TYPE_FIELDNAME => array ('instrument_id', 'word', 'weight', 'id', ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, ) + ); + + + private static $fieldKeys = array ( + BasePeer::TYPE_PHPNAME => array ('InstrumentId' => 0, 'Word' => 1, 'Weight' => 2, 'Id' => 3, ), + BasePeer::TYPE_COLNAME => array (SearchPeer::INSTRUMENT_ID => 0, SearchPeer::WORD => 1, SearchPeer::WEIGHT => 2, SearchPeer::ID => 3, ), + BasePeer::TYPE_FIELDNAME => array ('instrument_id' => 0, 'word' => 1, 'weight' => 2, 'id' => 3, ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, ) + ); + + + public static function getMapBuilder() + { + include_once 'lib/model/map/SearchMapBuilder.php'; + return BasePeer::getMapBuilder('lib.model.map.SearchMapBuilder'); + } + + public static function getPhpNameMap() + { + if (self::$phpNameMap === null) { + $map = SearchPeer::getTableMap(); + $columns = $map->getColumns(); + $nameMap = array(); + foreach ($columns as $column) { + $nameMap[$column->getPhpName()] = $column->getColumnName(); + } + self::$phpNameMap = $nameMap; + } + return self::$phpNameMap; + } + + static public function translateFieldName($name, $fromType, $toType) + { + $toNames = self::getFieldNames($toType); + $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$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(self::$fieldKeys[$fromType], true)); + } + return $toNames[$key]; + } + + + + static public function getFieldNames($type = BasePeer::TYPE_PHPNAME) + { + if (!array_key_exists($type, self::$fieldNames)) { + throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.'); + } + return self::$fieldNames[$type]; + } + + + public static function alias($alias, $column) + { + return str_replace(SearchPeer::TABLE_NAME.'.', $alias.'.', $column); + } + + + public static function addSelectColumns(Criteria $criteria) + { + + $criteria->addSelectColumn(SearchPeer::INSTRUMENT_ID); + + $criteria->addSelectColumn(SearchPeer::WORD); + + $criteria->addSelectColumn(SearchPeer::WEIGHT); + + $criteria->addSelectColumn(SearchPeer::ID); + + } + + const COUNT = 'COUNT(Search.ID)'; + const COUNT_DISTINCT = 'COUNT(DISTINCT Search.ID)'; + + + public static function doCount(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(SearchPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(SearchPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $rs = SearchPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + public static function doSelectOne(Criteria $criteria, $con = null) + { + $critcopy = clone $criteria; + $critcopy->setLimit(1); + $objects = SearchPeer::doSelect($critcopy, $con); + if ($objects) { + return $objects[0]; + } + return null; + } + + public static function doSelect(Criteria $criteria, $con = null) + { + return SearchPeer::populateObjects(SearchPeer::doSelectRS($criteria, $con)); + } + + public static function doSelectRS(Criteria $criteria, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + if (!$criteria->getSelectColumns()) { + $criteria = clone $criteria; + SearchPeer::addSelectColumns($criteria); + } + + $criteria->setDbName(self::DATABASE_NAME); + + return BasePeer::doSelect($criteria, $con); + } + + public static function populateObjects(ResultSet $rs) + { + $results = array(); + + $cls = SearchPeer::getOMClass(); + $cls = Propel::import($cls); + while($rs->next()) { + + $obj = new $cls(); + $obj->hydrate($rs); + $results[] = $obj; + + } + return $results; + } + + + public static function doCountJoinInstrument(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(SearchPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(SearchPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(SearchPeer::INSTRUMENT_ID, InstrumentPeer::ID); + + $rs = SearchPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doSelectJoinInstrument(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + SearchPeer::addSelectColumns($c); + $startcol = (SearchPeer::NUM_COLUMNS - SearchPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + InstrumentPeer::addSelectColumns($c); + + $c->addJoin(SearchPeer::INSTRUMENT_ID, InstrumentPeer::ID); + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = SearchPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + $omClass = InstrumentPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol); + + $newObject = true; + foreach($results as $temp_obj1) { + $temp_obj2 = $temp_obj1->getInstrument(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addSearch($obj1); break; + } + } + if ($newObject) { + $obj2->initSearchs(); + $obj2->addSearch($obj1); } + $results[] = $obj1; + } + return $results; + } + + + + public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(SearchPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(SearchPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(SearchPeer::INSTRUMENT_ID, InstrumentPeer::ID); + + $rs = SearchPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doSelectJoinAll(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + SearchPeer::addSelectColumns($c); + $startcol2 = (SearchPeer::NUM_COLUMNS - SearchPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + + InstrumentPeer::addSelectColumns($c); + $startcol3 = $startcol2 + InstrumentPeer::NUM_COLUMNS; + + $c->addJoin(SearchPeer::INSTRUMENT_ID, InstrumentPeer::ID); + + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = SearchPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + + + $omClass = InstrumentPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol2); + + $newObject = true; + for ($j=0, $resCount=count($results); $j < $resCount; $j++) { + $temp_obj1 = $results[$j]; + $temp_obj2 = $temp_obj1->getInstrument(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addSearch($obj1); break; + } + } + + if ($newObject) { + $obj2->initSearchs(); + $obj2->addSearch($obj1); + } + + $results[] = $obj1; + } + return $results; + } + + + public static function getTableMap() + { + return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME); + } + + + public static function getOMClass() + { + return SearchPeer::CLASS_DEFAULT; + } + + + public static function doInsert($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; } else { + $criteria = $values->buildCriteria(); } + + $criteria->remove(SearchPeer::ID); + + $criteria->setDbName(self::DATABASE_NAME); + + try { + $con->begin(); + $pk = BasePeer::doInsert($criteria, $con); + $con->commit(); + } catch(PropelException $e) { + $con->rollback(); + throw $e; + } + + return $pk; + } + + + public static function doUpdate($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $selectCriteria = new Criteria(self::DATABASE_NAME); + + if ($values instanceof Criteria) { + $criteria = clone $values; + $comparison = $criteria->getComparison(SearchPeer::ID); + $selectCriteria->add(SearchPeer::ID, $criteria->remove(SearchPeer::ID), $comparison); + + } else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); } + + $criteria->setDbName(self::DATABASE_NAME); + + return BasePeer::doUpdate($selectCriteria, $criteria, $con); + } + + + public static function doDeleteAll($con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + $affectedRows = 0; try { + $con->begin(); + $affectedRows += BasePeer::doDeleteAll(SearchPeer::TABLE_NAME, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public static function doDelete($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(SearchPeer::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; } elseif ($values instanceof Search) { + + $criteria = $values->buildPkeyCriteria(); + } else { + $criteria = new Criteria(self::DATABASE_NAME); + $criteria->add(SearchPeer::ID, (array) $values, Criteria::IN); + } + + $criteria->setDbName(self::DATABASE_NAME); + + $affectedRows = 0; + try { + $con->begin(); + + $affectedRows += BasePeer::doDelete($criteria, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public static function doValidate(Search $obj, $cols = null) + { + $columns = array(); + + if ($cols) { + $dbMap = Propel::getDatabaseMap(SearchPeer::DATABASE_NAME); + $tableMap = $dbMap->getTable(SearchPeer::TABLE_NAME); + + if (! is_array($cols)) { + $cols = array($cols); + } + + foreach($cols as $colName) { + if ($tableMap->containsColumn($colName)) { + $get = 'get' . $tableMap->getColumn($colName)->getPhpName(); + $columns[$colName] = $obj->$get(); + } + } + } else { + + } + + $res = BasePeer::doValidate(SearchPeer::DATABASE_NAME, SearchPeer::TABLE_NAME, $columns); + if ($res !== true) { + $request = sfContext::getInstance()->getRequest(); + foreach ($res as $failed) { + $col = SearchPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME); + $request->setError($col, $failed->getMessage()); + } + } + + return $res; + } + + + public static function retrieveByPK($pk, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $criteria = new Criteria(SearchPeer::DATABASE_NAME); + + $criteria->add(SearchPeer::ID, $pk); + + + $v = SearchPeer::doSelect($criteria, $con); + + return !empty($v) > 0 ? $v[0] : null; + } + + + public static function retrieveByPKs($pks, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $objs = null; + if (empty($pks)) { + $objs = array(); + } else { + $criteria = new Criteria(); + $criteria->add(SearchPeer::ID, $pks, Criteria::IN); + $objs = SearchPeer::doSelect($criteria, $con); + } + return $objs; + } + +} +if (Propel::isInit()) { + try { + BaseSearchPeer::getMapBuilder(); + } catch (Exception $e) { + Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR); + } +} else { + require_once 'lib/model/map/SearchMapBuilder.php'; + Propel::registerMapBuilder('lib.model.map.SearchMapBuilder'); +} diff --git a/lib/model/om/BaseTags.php b/lib/model/om/BaseTags.php new file mode 100644 index 0000000..646d353 --- /dev/null +++ b/lib/model/om/BaseTags.php @@ -0,0 +1,579 @@ +instrument_id; + } + + + public function getUserId() + { + + return $this->user_id; + } + + + public function getTag() + { + + return $this->tag; + } + + + public function getNormalized() + { + + return $this->normalized; + } + + + public function getCreatedAt($format = 'Y-m-d H:i:s') + { + + if ($this->created_at === null || $this->created_at === '') { + return null; + } elseif (!is_int($this->created_at)) { + $ts = strtotime($this->created_at); + if ($ts === -1 || $ts === false) { throw new PropelException("Unable to parse value of [created_at] as date/time value: " . var_export($this->created_at, true)); + } + } else { + $ts = $this->created_at; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + + public function setInstrumentId($v) + { + + + + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->instrument_id !== $v) { + $this->instrument_id = $v; + $this->modifiedColumns[] = TagsPeer::INSTRUMENT_ID; + } + + if ($this->aInstrument !== null && $this->aInstrument->getId() !== $v) { + $this->aInstrument = null; + } + + } + + public function setUserId($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->user_id !== $v) { + $this->user_id = $v; + $this->modifiedColumns[] = TagsPeer::USER_ID; + } + + if ($this->aUser !== null && $this->aUser->getUsername() !== $v) { + $this->aUser = null; + } + + } + + public function setTag($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->tag !== $v) { + $this->tag = $v; + $this->modifiedColumns[] = TagsPeer::TAG; + } + + } + + public function setNormalized($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->normalized !== $v) { + $this->normalized = $v; + $this->modifiedColumns[] = TagsPeer::NORMALIZED; + } + + } + + public function setCreatedAt($v) + { + + if ($v !== null && !is_int($v)) { + $ts = strtotime($v); + if ($ts === -1 || $ts === false) { throw new PropelException("Unable to parse date/time value for [created_at] from input: " . var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->created_at !== $ts) { + $this->created_at = $ts; + $this->modifiedColumns[] = TagsPeer::CREATED_AT; + } + + } + + public function hydrate(ResultSet $rs, $startcol = 1) + { + try { + + $this->instrument_id = $rs->getInt($startcol + 0); + + $this->user_id = $rs->getString($startcol + 1); + + $this->tag = $rs->getString($startcol + 2); + + $this->normalized = $rs->getString($startcol + 3); + + $this->created_at = $rs->getTimestamp($startcol + 4, null); + + $this->resetModified(); + + $this->setNew(false); + + return $startcol + 5; + } catch (Exception $e) { + throw new PropelException("Error populating Tags object", $e); + } + } + + + public function delete($con = null) + { + if ($this->isDeleted()) { + throw new PropelException("This object has already been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(TagsPeer::DATABASE_NAME); + } + + try { + $con->begin(); + TagsPeer::doDelete($this, $con); + $this->setDeleted(true); + $con->commit(); + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public function save($con = null) + { + if ($this->isNew() && !$this->isColumnModified(TagsPeer::CREATED_AT)) + { + $this->setCreatedAt(time()); + } + + if ($this->isDeleted()) { + throw new PropelException("You cannot save an object that has been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(TagsPeer::DATABASE_NAME); + } + + try { + $con->begin(); + $affectedRows = $this->doSave($con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + protected function doSave($con) + { + $affectedRows = 0; if (!$this->alreadyInSave) { + $this->alreadyInSave = true; + + + + if ($this->aInstrument !== null) { + if ($this->aInstrument->isModified()) { + $affectedRows += $this->aInstrument->save($con); + } + $this->setInstrument($this->aInstrument); + } + + if ($this->aUser !== null) { + if ($this->aUser->isModified()) { + $affectedRows += $this->aUser->save($con); + } + $this->setUser($this->aUser); + } + + + if ($this->isModified()) { + if ($this->isNew()) { + $pk = TagsPeer::doInsert($this, $con); + $affectedRows += 1; + $this->setNew(false); + } else { + $affectedRows += TagsPeer::doUpdate($this, $con); + } + $this->resetModified(); } + + $this->alreadyInSave = false; + } + return $affectedRows; + } + + protected $validationFailures = array(); + + + public function getValidationFailures() + { + return $this->validationFailures; + } + + + public function validate($columns = null) + { + $res = $this->doValidate($columns); + if ($res === true) { + $this->validationFailures = array(); + return true; + } else { + $this->validationFailures = $res; + return false; + } + } + + + protected function doValidate($columns = null) + { + if (!$this->alreadyInValidation) { + $this->alreadyInValidation = true; + $retval = null; + + $failureMap = array(); + + + + if ($this->aInstrument !== null) { + if (!$this->aInstrument->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aInstrument->getValidationFailures()); + } + } + + if ($this->aUser !== null) { + if (!$this->aUser->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aUser->getValidationFailures()); + } + } + + + if (($retval = TagsPeer::doValidate($this, $columns)) !== true) { + $failureMap = array_merge($failureMap, $retval); + } + + + + $this->alreadyInValidation = false; + } + + return (!empty($failureMap) ? $failureMap : true); + } + + + public function getByName($name, $type = BasePeer::TYPE_PHPNAME) + { + $pos = TagsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->getByPosition($pos); + } + + + public function getByPosition($pos) + { + switch($pos) { + case 0: + return $this->getInstrumentId(); + break; + case 1: + return $this->getUserId(); + break; + case 2: + return $this->getTag(); + break; + case 3: + return $this->getNormalized(); + break; + case 4: + return $this->getCreatedAt(); + break; + default: + return null; + break; + } } + + + public function toArray($keyType = BasePeer::TYPE_PHPNAME) + { + $keys = TagsPeer::getFieldNames($keyType); + $result = array( + $keys[0] => $this->getInstrumentId(), + $keys[1] => $this->getUserId(), + $keys[2] => $this->getTag(), + $keys[3] => $this->getNormalized(), + $keys[4] => $this->getCreatedAt(), + ); + return $result; + } + + + public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) + { + $pos = TagsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->setByPosition($pos, $value); + } + + + public function setByPosition($pos, $value) + { + switch($pos) { + case 0: + $this->setInstrumentId($value); + break; + case 1: + $this->setUserId($value); + break; + case 2: + $this->setTag($value); + break; + case 3: + $this->setNormalized($value); + break; + case 4: + $this->setCreatedAt($value); + break; + } } + + + public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) + { + $keys = TagsPeer::getFieldNames($keyType); + + if (array_key_exists($keys[0], $arr)) $this->setInstrumentId($arr[$keys[0]]); + if (array_key_exists($keys[1], $arr)) $this->setUserId($arr[$keys[1]]); + if (array_key_exists($keys[2], $arr)) $this->setTag($arr[$keys[2]]); + if (array_key_exists($keys[3], $arr)) $this->setNormalized($arr[$keys[3]]); + if (array_key_exists($keys[4], $arr)) $this->setCreatedAt($arr[$keys[4]]); + } + + + public function buildCriteria() + { + $criteria = new Criteria(TagsPeer::DATABASE_NAME); + + if ($this->isColumnModified(TagsPeer::INSTRUMENT_ID)) $criteria->add(TagsPeer::INSTRUMENT_ID, $this->instrument_id); + if ($this->isColumnModified(TagsPeer::USER_ID)) $criteria->add(TagsPeer::USER_ID, $this->user_id); + if ($this->isColumnModified(TagsPeer::TAG)) $criteria->add(TagsPeer::TAG, $this->tag); + if ($this->isColumnModified(TagsPeer::NORMALIZED)) $criteria->add(TagsPeer::NORMALIZED, $this->normalized); + if ($this->isColumnModified(TagsPeer::CREATED_AT)) $criteria->add(TagsPeer::CREATED_AT, $this->created_at); + + return $criteria; + } + + + public function buildPkeyCriteria() + { + $criteria = new Criteria(TagsPeer::DATABASE_NAME); + + $criteria->add(TagsPeer::INSTRUMENT_ID, $this->instrument_id); + $criteria->add(TagsPeer::USER_ID, $this->user_id); + $criteria->add(TagsPeer::NORMALIZED, $this->normalized); + + return $criteria; + } + + + public function getPrimaryKey() + { + $pks = array(); + + $pks[0] = $this->getInstrumentId(); + + $pks[1] = $this->getUserId(); + + $pks[2] = $this->getNormalized(); + + return $pks; + } + + + public function setPrimaryKey($keys) + { + + $this->setInstrumentId($keys[0]); + + $this->setUserId($keys[1]); + + $this->setNormalized($keys[2]); + + } + + + public function copyInto($copyObj, $deepCopy = false) + { + + $copyObj->setTag($this->tag); + + $copyObj->setCreatedAt($this->created_at); + + + $copyObj->setNew(true); + + $copyObj->setInstrumentId(NULL); + $copyObj->setUserId(NULL); + $copyObj->setNormalized(NULL); + } + + + public function copy($deepCopy = false) + { + $clazz = get_class($this); + $copyObj = new $clazz(); + $this->copyInto($copyObj, $deepCopy); + return $copyObj; + } + + + public function getPeer() + { + if (self::$peer === null) { + self::$peer = new TagsPeer(); + } + return self::$peer; + } + + + public function setInstrument($v) + { + + + if ($v === null) { + $this->setInstrumentId(NULL); + } else { + $this->setInstrumentId($v->getId()); + } + + + $this->aInstrument = $v; + } + + + + public function getInstrument($con = null) + { + if ($this->aInstrument === null && ($this->instrument_id !== null)) { + include_once 'lib/model/om/BaseInstrumentPeer.php'; + + $this->aInstrument = InstrumentPeer::retrieveByPK($this->instrument_id, $con); + + + } + return $this->aInstrument; + } + + + public function setUser($v) + { + + + if ($v === null) { + $this->setUserId(NULL); + } else { + $this->setUserId($v->getUsername()); + } + + + $this->aUser = $v; + } + + + + public function getUser($con = null) + { + if ($this->aUser === null && (($this->user_id !== "" && $this->user_id !== null))) { + include_once 'lib/model/om/BaseUserPeer.php'; + + $this->aUser = UserPeer::retrieveByPK($this->user_id, $con); + + + } + return $this->aUser; + } + +} \ No newline at end of file diff --git a/lib/model/om/BaseTagsPeer.php b/lib/model/om/BaseTagsPeer.php new file mode 100644 index 0000000..5ca78b1 --- /dev/null +++ b/lib/model/om/BaseTagsPeer.php @@ -0,0 +1,817 @@ + array ('InstrumentId', 'UserId', 'Tag', 'Normalized', 'CreatedAt', ), + BasePeer::TYPE_COLNAME => array (TagsPeer::INSTRUMENT_ID, TagsPeer::USER_ID, TagsPeer::TAG, TagsPeer::NORMALIZED, TagsPeer::CREATED_AT, ), + BasePeer::TYPE_FIELDNAME => array ('instrument_id', 'user_id', 'tag', 'normalized', 'created_at', ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, ) + ); + + + private static $fieldKeys = array ( + BasePeer::TYPE_PHPNAME => array ('InstrumentId' => 0, 'UserId' => 1, 'Tag' => 2, 'Normalized' => 3, 'CreatedAt' => 4, ), + BasePeer::TYPE_COLNAME => array (TagsPeer::INSTRUMENT_ID => 0, TagsPeer::USER_ID => 1, TagsPeer::TAG => 2, TagsPeer::NORMALIZED => 3, TagsPeer::CREATED_AT => 4, ), + BasePeer::TYPE_FIELDNAME => array ('instrument_id' => 0, 'user_id' => 1, 'tag' => 2, 'normalized' => 3, 'created_at' => 4, ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, ) + ); + + + public static function getMapBuilder() + { + include_once 'lib/model/map/TagsMapBuilder.php'; + return BasePeer::getMapBuilder('lib.model.map.TagsMapBuilder'); + } + + public static function getPhpNameMap() + { + if (self::$phpNameMap === null) { + $map = TagsPeer::getTableMap(); + $columns = $map->getColumns(); + $nameMap = array(); + foreach ($columns as $column) { + $nameMap[$column->getPhpName()] = $column->getColumnName(); + } + self::$phpNameMap = $nameMap; + } + return self::$phpNameMap; + } + + static public function translateFieldName($name, $fromType, $toType) + { + $toNames = self::getFieldNames($toType); + $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$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(self::$fieldKeys[$fromType], true)); + } + return $toNames[$key]; + } + + + + static public function getFieldNames($type = BasePeer::TYPE_PHPNAME) + { + if (!array_key_exists($type, self::$fieldNames)) { + throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.'); + } + return self::$fieldNames[$type]; + } + + + public static function alias($alias, $column) + { + return str_replace(TagsPeer::TABLE_NAME.'.', $alias.'.', $column); + } + + + public static function addSelectColumns(Criteria $criteria) + { + + $criteria->addSelectColumn(TagsPeer::INSTRUMENT_ID); + + $criteria->addSelectColumn(TagsPeer::USER_ID); + + $criteria->addSelectColumn(TagsPeer::TAG); + + $criteria->addSelectColumn(TagsPeer::NORMALIZED); + + $criteria->addSelectColumn(TagsPeer::CREATED_AT); + + } + + const COUNT = 'COUNT(Tags.INSTRUMENT_ID)'; + const COUNT_DISTINCT = 'COUNT(DISTINCT Tags.INSTRUMENT_ID)'; + + + public static function doCount(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(TagsPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(TagsPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $rs = TagsPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + public static function doSelectOne(Criteria $criteria, $con = null) + { + $critcopy = clone $criteria; + $critcopy->setLimit(1); + $objects = TagsPeer::doSelect($critcopy, $con); + if ($objects) { + return $objects[0]; + } + return null; + } + + public static function doSelect(Criteria $criteria, $con = null) + { + return TagsPeer::populateObjects(TagsPeer::doSelectRS($criteria, $con)); + } + + public static function doSelectRS(Criteria $criteria, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + if (!$criteria->getSelectColumns()) { + $criteria = clone $criteria; + TagsPeer::addSelectColumns($criteria); + } + + $criteria->setDbName(self::DATABASE_NAME); + + return BasePeer::doSelect($criteria, $con); + } + + public static function populateObjects(ResultSet $rs) + { + $results = array(); + + $cls = TagsPeer::getOMClass(); + $cls = Propel::import($cls); + while($rs->next()) { + + $obj = new $cls(); + $obj->hydrate($rs); + $results[] = $obj; + + } + return $results; + } + + + public static function doCountJoinInstrument(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(TagsPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(TagsPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(TagsPeer::INSTRUMENT_ID, InstrumentPeer::ID); + + $rs = TagsPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doCountJoinUser(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(TagsPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(TagsPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(TagsPeer::USER_ID, UserPeer::USERNAME); + + $rs = TagsPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doSelectJoinInstrument(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + TagsPeer::addSelectColumns($c); + $startcol = (TagsPeer::NUM_COLUMNS - TagsPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + InstrumentPeer::addSelectColumns($c); + + $c->addJoin(TagsPeer::INSTRUMENT_ID, InstrumentPeer::ID); + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = TagsPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + $omClass = InstrumentPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol); + + $newObject = true; + foreach($results as $temp_obj1) { + $temp_obj2 = $temp_obj1->getInstrument(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addTags($obj1); break; + } + } + if ($newObject) { + $obj2->initTagss(); + $obj2->addTags($obj1); } + $results[] = $obj1; + } + return $results; + } + + + + public static function doSelectJoinUser(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + TagsPeer::addSelectColumns($c); + $startcol = (TagsPeer::NUM_COLUMNS - TagsPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + UserPeer::addSelectColumns($c); + + $c->addJoin(TagsPeer::USER_ID, UserPeer::USERNAME); + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = TagsPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + $omClass = UserPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol); + + $newObject = true; + foreach($results as $temp_obj1) { + $temp_obj2 = $temp_obj1->getUser(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addTags($obj1); break; + } + } + if ($newObject) { + $obj2->initTagss(); + $obj2->addTags($obj1); } + $results[] = $obj1; + } + return $results; + } + + + + public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(TagsPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(TagsPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(TagsPeer::INSTRUMENT_ID, InstrumentPeer::ID); + + $criteria->addJoin(TagsPeer::USER_ID, UserPeer::USERNAME); + + $rs = TagsPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doSelectJoinAll(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + TagsPeer::addSelectColumns($c); + $startcol2 = (TagsPeer::NUM_COLUMNS - TagsPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + + InstrumentPeer::addSelectColumns($c); + $startcol3 = $startcol2 + InstrumentPeer::NUM_COLUMNS; + + UserPeer::addSelectColumns($c); + $startcol4 = $startcol3 + UserPeer::NUM_COLUMNS; + + $c->addJoin(TagsPeer::INSTRUMENT_ID, InstrumentPeer::ID); + + $c->addJoin(TagsPeer::USER_ID, UserPeer::USERNAME); + + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = TagsPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + + + $omClass = InstrumentPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol2); + + $newObject = true; + for ($j=0, $resCount=count($results); $j < $resCount; $j++) { + $temp_obj1 = $results[$j]; + $temp_obj2 = $temp_obj1->getInstrument(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addTags($obj1); break; + } + } + + if ($newObject) { + $obj2->initTagss(); + $obj2->addTags($obj1); + } + + + + $omClass = UserPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj3 = new $cls(); + $obj3->hydrate($rs, $startcol3); + + $newObject = true; + for ($j=0, $resCount=count($results); $j < $resCount; $j++) { + $temp_obj1 = $results[$j]; + $temp_obj3 = $temp_obj1->getUser(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { + $newObject = false; + $temp_obj3->addTags($obj1); break; + } + } + + if ($newObject) { + $obj3->initTagss(); + $obj3->addTags($obj1); + } + + $results[] = $obj1; + } + return $results; + } + + + + public static function doCountJoinAllExceptInstrument(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(TagsPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(TagsPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(TagsPeer::USER_ID, UserPeer::USERNAME); + + $rs = TagsPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doCountJoinAllExceptUser(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(TagsPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(TagsPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $criteria->addJoin(TagsPeer::INSTRUMENT_ID, InstrumentPeer::ID); + + $rs = TagsPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + + + public static function doSelectJoinAllExceptInstrument(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + TagsPeer::addSelectColumns($c); + $startcol2 = (TagsPeer::NUM_COLUMNS - TagsPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + + UserPeer::addSelectColumns($c); + $startcol3 = $startcol2 + UserPeer::NUM_COLUMNS; + + $c->addJoin(TagsPeer::USER_ID, UserPeer::USERNAME); + + + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = TagsPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + $omClass = UserPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol2); + + $newObject = true; + for ($j=0, $resCount=count($results); $j < $resCount; $j++) { + $temp_obj1 = $results[$j]; + $temp_obj2 = $temp_obj1->getUser(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addTags($obj1); + break; + } + } + + if ($newObject) { + $obj2->initTagss(); + $obj2->addTags($obj1); + } + + $results[] = $obj1; + } + return $results; + } + + + + public static function doSelectJoinAllExceptUser(Criteria $c, $con = null) + { + $c = clone $c; + + if ($c->getDbName() == Propel::getDefaultDB()) { + $c->setDbName(self::DATABASE_NAME); + } + + TagsPeer::addSelectColumns($c); + $startcol2 = (TagsPeer::NUM_COLUMNS - TagsPeer::NUM_LAZY_LOAD_COLUMNS) + 1; + + InstrumentPeer::addSelectColumns($c); + $startcol3 = $startcol2 + InstrumentPeer::NUM_COLUMNS; + + $c->addJoin(TagsPeer::INSTRUMENT_ID, InstrumentPeer::ID); + + + $rs = BasePeer::doSelect($c, $con); + $results = array(); + + while($rs->next()) { + + $omClass = TagsPeer::getOMClass(); + + $cls = Propel::import($omClass); + $obj1 = new $cls(); + $obj1->hydrate($rs); + + $omClass = InstrumentPeer::getOMClass(); + + + $cls = Propel::import($omClass); + $obj2 = new $cls(); + $obj2->hydrate($rs, $startcol2); + + $newObject = true; + for ($j=0, $resCount=count($results); $j < $resCount; $j++) { + $temp_obj1 = $results[$j]; + $temp_obj2 = $temp_obj1->getInstrument(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { + $newObject = false; + $temp_obj2->addTags($obj1); + break; + } + } + + if ($newObject) { + $obj2->initTagss(); + $obj2->addTags($obj1); + } + + $results[] = $obj1; + } + return $results; + } + + + public static function getTableMap() + { + return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME); + } + + + public static function getOMClass() + { + return TagsPeer::CLASS_DEFAULT; + } + + + public static function doInsert($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; } else { + $criteria = $values->buildCriteria(); } + + + $criteria->setDbName(self::DATABASE_NAME); + + try { + $con->begin(); + $pk = BasePeer::doInsert($criteria, $con); + $con->commit(); + } catch(PropelException $e) { + $con->rollback(); + throw $e; + } + + return $pk; + } + + + public static function doUpdate($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $selectCriteria = new Criteria(self::DATABASE_NAME); + + if ($values instanceof Criteria) { + $criteria = clone $values; + $comparison = $criteria->getComparison(TagsPeer::INSTRUMENT_ID); + $selectCriteria->add(TagsPeer::INSTRUMENT_ID, $criteria->remove(TagsPeer::INSTRUMENT_ID), $comparison); + + $comparison = $criteria->getComparison(TagsPeer::USER_ID); + $selectCriteria->add(TagsPeer::USER_ID, $criteria->remove(TagsPeer::USER_ID), $comparison); + + $comparison = $criteria->getComparison(TagsPeer::NORMALIZED); + $selectCriteria->add(TagsPeer::NORMALIZED, $criteria->remove(TagsPeer::NORMALIZED), $comparison); + + } else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); } + + $criteria->setDbName(self::DATABASE_NAME); + + return BasePeer::doUpdate($selectCriteria, $criteria, $con); + } + + + public static function doDeleteAll($con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + $affectedRows = 0; try { + $con->begin(); + $affectedRows += BasePeer::doDeleteAll(TagsPeer::TABLE_NAME, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public static function doDelete($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(TagsPeer::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; } elseif ($values instanceof Tags) { + + $criteria = $values->buildPkeyCriteria(); + } else { + $criteria = new Criteria(self::DATABASE_NAME); + if(count($values) == count($values, COUNT_RECURSIVE)) + { + $values = array($values); + } + $vals = array(); + foreach($values as $value) + { + + $vals[0][] = $value[0]; + $vals[1][] = $value[1]; + $vals[2][] = $value[2]; + } + + $criteria->add(TagsPeer::INSTRUMENT_ID, $vals[0], Criteria::IN); + $criteria->add(TagsPeer::USER_ID, $vals[1], Criteria::IN); + $criteria->add(TagsPeer::NORMALIZED, $vals[2], Criteria::IN); + } + + $criteria->setDbName(self::DATABASE_NAME); + + $affectedRows = 0; + try { + $con->begin(); + + $affectedRows += BasePeer::doDelete($criteria, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public static function doValidate(Tags $obj, $cols = null) + { + $columns = array(); + + if ($cols) { + $dbMap = Propel::getDatabaseMap(TagsPeer::DATABASE_NAME); + $tableMap = $dbMap->getTable(TagsPeer::TABLE_NAME); + + if (! is_array($cols)) { + $cols = array($cols); + } + + foreach($cols as $colName) { + if ($tableMap->containsColumn($colName)) { + $get = 'get' . $tableMap->getColumn($colName)->getPhpName(); + $columns[$colName] = $obj->$get(); + } + } + } else { + + } + + $res = BasePeer::doValidate(TagsPeer::DATABASE_NAME, TagsPeer::TABLE_NAME, $columns); + if ($res !== true) { + $request = sfContext::getInstance()->getRequest(); + foreach ($res as $failed) { + $col = TagsPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME); + $request->setError($col, $failed->getMessage()); + } + } + + return $res; + } + + + public static function retrieveByPK( $instrument_id, $user_id, $normalized, $con = null) { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + $criteria = new Criteria(); + $criteria->add(TagsPeer::INSTRUMENT_ID, $instrument_id); + $criteria->add(TagsPeer::USER_ID, $user_id); + $criteria->add(TagsPeer::NORMALIZED, $normalized); + $v = TagsPeer::doSelect($criteria, $con); + + return !empty($v) ? $v[0] : null; + } +} +if (Propel::isInit()) { + try { + BaseTagsPeer::getMapBuilder(); + } catch (Exception $e) { + Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR); + } +} else { + require_once 'lib/model/map/TagsMapBuilder.php'; + Propel::registerMapBuilder('lib.model.map.TagsMapBuilder'); +} diff --git a/lib/model/om/BaseUser.php b/lib/model/om/BaseUser.php new file mode 100644 index 0000000..fce868e --- /dev/null +++ b/lib/model/om/BaseUser.php @@ -0,0 +1,1045 @@ +username; + } + + + public function getStripped() + { + + return $this->stripped; + } + + + public function getRealname() + { + + return $this->realname; + } + + + public function getDescription() + { + + return $this->description; + } + + + public function getAvatar() + { + + return $this->avatar; + } + + + public function getLocation() + { + + return $this->location; + } + + + public function getIsAdmin() + { + + return $this->is_admin; + } + + + public function setUsername($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->username !== $v) { + $this->username = $v; + $this->modifiedColumns[] = UserPeer::USERNAME; + } + + } + + public function setStripped($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->stripped !== $v) { + $this->stripped = $v; + $this->modifiedColumns[] = UserPeer::STRIPPED; + } + + } + + public function setRealname($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->realname !== $v) { + $this->realname = $v; + $this->modifiedColumns[] = UserPeer::REALNAME; + } + + } + + public function setDescription($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->description !== $v) { + $this->description = $v; + $this->modifiedColumns[] = UserPeer::DESCRIPTION; + } + + } + + public function setAvatar($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->avatar !== $v) { + $this->avatar = $v; + $this->modifiedColumns[] = UserPeer::AVATAR; + } + + } + + public function setLocation($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->location !== $v) { + $this->location = $v; + $this->modifiedColumns[] = UserPeer::LOCATION; + } + + } + + public function setIsAdmin($v) + { + + if ($this->is_admin !== $v || $v === false) { + $this->is_admin = $v; + $this->modifiedColumns[] = UserPeer::IS_ADMIN; + } + + } + + public function hydrate(ResultSet $rs, $startcol = 1) + { + try { + + $this->username = $rs->getString($startcol + 0); + + $this->stripped = $rs->getString($startcol + 1); + + $this->realname = $rs->getString($startcol + 2); + + $this->description = $rs->getString($startcol + 3); + + $this->avatar = $rs->getString($startcol + 4); + + $this->location = $rs->getString($startcol + 5); + + $this->is_admin = $rs->getBoolean($startcol + 6); + + $this->resetModified(); + + $this->setNew(false); + + return $startcol + 7; + } catch (Exception $e) { + throw new PropelException("Error populating User object", $e); + } + } + + + public function delete($con = null) + { + if ($this->isDeleted()) { + throw new PropelException("This object has already been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(UserPeer::DATABASE_NAME); + } + + try { + $con->begin(); + UserPeer::doDelete($this, $con); + $this->setDeleted(true); + $con->commit(); + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public function save($con = null) + { + if ($this->isDeleted()) { + throw new PropelException("You cannot save an object that has been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(UserPeer::DATABASE_NAME); + } + + try { + $con->begin(); + $affectedRows = $this->doSave($con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + protected function doSave($con) + { + $affectedRows = 0; if (!$this->alreadyInSave) { + $this->alreadyInSave = true; + + + if ($this->isModified()) { + if ($this->isNew()) { + $pk = UserPeer::doInsert($this, $con); + $affectedRows += 1; + $this->setNew(false); + } else { + $affectedRows += UserPeer::doUpdate($this, $con); + } + $this->resetModified(); } + + if ($this->collInstruments !== null) { + foreach($this->collInstruments as $referrerFK) { + if (!$referrerFK->isDeleted()) { + $affectedRows += $referrerFK->save($con); + } + } + } + + if ($this->collTagss !== null) { + foreach($this->collTagss as $referrerFK) { + if (!$referrerFK->isDeleted()) { + $affectedRows += $referrerFK->save($con); + } + } + } + + if ($this->collComments !== null) { + foreach($this->collComments as $referrerFK) { + if (!$referrerFK->isDeleted()) { + $affectedRows += $referrerFK->save($con); + } + } + } + + if ($this->collBanks !== null) { + foreach($this->collBanks as $referrerFK) { + if (!$referrerFK->isDeleted()) { + $affectedRows += $referrerFK->save($con); + } + } + } + + $this->alreadyInSave = false; + } + return $affectedRows; + } + + protected $validationFailures = array(); + + + public function getValidationFailures() + { + return $this->validationFailures; + } + + + public function validate($columns = null) + { + $res = $this->doValidate($columns); + if ($res === true) { + $this->validationFailures = array(); + return true; + } else { + $this->validationFailures = $res; + return false; + } + } + + + protected function doValidate($columns = null) + { + if (!$this->alreadyInValidation) { + $this->alreadyInValidation = true; + $retval = null; + + $failureMap = array(); + + + if (($retval = UserPeer::doValidate($this, $columns)) !== true) { + $failureMap = array_merge($failureMap, $retval); + } + + + if ($this->collInstruments !== null) { + foreach($this->collInstruments as $referrerFK) { + if (!$referrerFK->validate($columns)) { + $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); + } + } + } + + if ($this->collTagss !== null) { + foreach($this->collTagss as $referrerFK) { + if (!$referrerFK->validate($columns)) { + $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); + } + } + } + + if ($this->collComments !== null) { + foreach($this->collComments as $referrerFK) { + if (!$referrerFK->validate($columns)) { + $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); + } + } + } + + if ($this->collBanks !== null) { + foreach($this->collBanks as $referrerFK) { + if (!$referrerFK->validate($columns)) { + $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); + } + } + } + + + $this->alreadyInValidation = false; + } + + return (!empty($failureMap) ? $failureMap : true); + } + + + public function getByName($name, $type = BasePeer::TYPE_PHPNAME) + { + $pos = UserPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->getByPosition($pos); + } + + + public function getByPosition($pos) + { + switch($pos) { + case 0: + return $this->getUsername(); + break; + case 1: + return $this->getStripped(); + break; + case 2: + return $this->getRealname(); + break; + case 3: + return $this->getDescription(); + break; + case 4: + return $this->getAvatar(); + break; + case 5: + return $this->getLocation(); + break; + case 6: + return $this->getIsAdmin(); + break; + default: + return null; + break; + } } + + + public function toArray($keyType = BasePeer::TYPE_PHPNAME) + { + $keys = UserPeer::getFieldNames($keyType); + $result = array( + $keys[0] => $this->getUsername(), + $keys[1] => $this->getStripped(), + $keys[2] => $this->getRealname(), + $keys[3] => $this->getDescription(), + $keys[4] => $this->getAvatar(), + $keys[5] => $this->getLocation(), + $keys[6] => $this->getIsAdmin(), + ); + return $result; + } + + + public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) + { + $pos = UserPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->setByPosition($pos, $value); + } + + + public function setByPosition($pos, $value) + { + switch($pos) { + case 0: + $this->setUsername($value); + break; + case 1: + $this->setStripped($value); + break; + case 2: + $this->setRealname($value); + break; + case 3: + $this->setDescription($value); + break; + case 4: + $this->setAvatar($value); + break; + case 5: + $this->setLocation($value); + break; + case 6: + $this->setIsAdmin($value); + break; + } } + + + public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) + { + $keys = UserPeer::getFieldNames($keyType); + + if (array_key_exists($keys[0], $arr)) $this->setUsername($arr[$keys[0]]); + if (array_key_exists($keys[1], $arr)) $this->setStripped($arr[$keys[1]]); + if (array_key_exists($keys[2], $arr)) $this->setRealname($arr[$keys[2]]); + if (array_key_exists($keys[3], $arr)) $this->setDescription($arr[$keys[3]]); + if (array_key_exists($keys[4], $arr)) $this->setAvatar($arr[$keys[4]]); + if (array_key_exists($keys[5], $arr)) $this->setLocation($arr[$keys[5]]); + if (array_key_exists($keys[6], $arr)) $this->setIsAdmin($arr[$keys[6]]); + } + + + public function buildCriteria() + { + $criteria = new Criteria(UserPeer::DATABASE_NAME); + + if ($this->isColumnModified(UserPeer::USERNAME)) $criteria->add(UserPeer::USERNAME, $this->username); + if ($this->isColumnModified(UserPeer::STRIPPED)) $criteria->add(UserPeer::STRIPPED, $this->stripped); + if ($this->isColumnModified(UserPeer::REALNAME)) $criteria->add(UserPeer::REALNAME, $this->realname); + if ($this->isColumnModified(UserPeer::DESCRIPTION)) $criteria->add(UserPeer::DESCRIPTION, $this->description); + if ($this->isColumnModified(UserPeer::AVATAR)) $criteria->add(UserPeer::AVATAR, $this->avatar); + if ($this->isColumnModified(UserPeer::LOCATION)) $criteria->add(UserPeer::LOCATION, $this->location); + if ($this->isColumnModified(UserPeer::IS_ADMIN)) $criteria->add(UserPeer::IS_ADMIN, $this->is_admin); + + return $criteria; + } + + + public function buildPkeyCriteria() + { + $criteria = new Criteria(UserPeer::DATABASE_NAME); + + $criteria->add(UserPeer::USERNAME, $this->username); + + return $criteria; + } + + + public function getPrimaryKey() + { + return $this->getUsername(); + } + + + public function setPrimaryKey($key) + { + $this->setUsername($key); + } + + + public function copyInto($copyObj, $deepCopy = false) + { + + $copyObj->setStripped($this->stripped); + + $copyObj->setRealname($this->realname); + + $copyObj->setDescription($this->description); + + $copyObj->setAvatar($this->avatar); + + $copyObj->setLocation($this->location); + + $copyObj->setIsAdmin($this->is_admin); + + + if ($deepCopy) { + $copyObj->setNew(false); + + foreach($this->getInstruments() as $relObj) { + $copyObj->addInstrument($relObj->copy($deepCopy)); + } + + foreach($this->getTagss() as $relObj) { + $copyObj->addTags($relObj->copy($deepCopy)); + } + + foreach($this->getComments() as $relObj) { + $copyObj->addComment($relObj->copy($deepCopy)); + } + + foreach($this->getBanks() as $relObj) { + $copyObj->addBank($relObj->copy($deepCopy)); + } + + } + + $copyObj->setNew(true); + + $copyObj->setUsername(NULL); + } + + + public function copy($deepCopy = false) + { + $clazz = get_class($this); + $copyObj = new $clazz(); + $this->copyInto($copyObj, $deepCopy); + return $copyObj; + } + + + public function getPeer() + { + if (self::$peer === null) { + self::$peer = new UserPeer(); + } + return self::$peer; + } + + + public function initInstruments() + { + if ($this->collInstruments === null) { + $this->collInstruments = array(); + } + } + + + public function getInstruments($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseInstrumentPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collInstruments === null) { + if ($this->isNew()) { + $this->collInstruments = array(); + } else { + + $criteria->add(InstrumentPeer::OWNER, $this->getUsername()); + + InstrumentPeer::addSelectColumns($criteria); + $this->collInstruments = InstrumentPeer::doSelect($criteria, $con); + } + } else { + if (!$this->isNew()) { + + + $criteria->add(InstrumentPeer::OWNER, $this->getUsername()); + + InstrumentPeer::addSelectColumns($criteria); + if (!isset($this->lastInstrumentCriteria) || !$this->lastInstrumentCriteria->equals($criteria)) { + $this->collInstruments = InstrumentPeer::doSelect($criteria, $con); + } + } + } + $this->lastInstrumentCriteria = $criteria; + return $this->collInstruments; + } + + + public function countInstruments($criteria = null, $distinct = false, $con = null) + { + include_once 'lib/model/om/BaseInstrumentPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + $criteria->add(InstrumentPeer::OWNER, $this->getUsername()); + + return InstrumentPeer::doCount($criteria, $distinct, $con); + } + + + public function addInstrument(Instrument $l) + { + $this->collInstruments[] = $l; + $l->setUser($this); + } + + + + public function getInstrumentsJoinWare($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseInstrumentPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collInstruments === null) { + if ($this->isNew()) { + $this->collInstruments = array(); + } else { + + $criteria->add(InstrumentPeer::OWNER, $this->getUsername()); + + $this->collInstruments = InstrumentPeer::doSelectJoinWare($criteria, $con); + } + } else { + + $criteria->add(InstrumentPeer::OWNER, $this->getUsername()); + + if (!isset($this->lastInstrumentCriteria) || !$this->lastInstrumentCriteria->equals($criteria)) { + $this->collInstruments = InstrumentPeer::doSelectJoinWare($criteria, $con); + } + } + $this->lastInstrumentCriteria = $criteria; + + return $this->collInstruments; + } + + + public function initTagss() + { + if ($this->collTagss === null) { + $this->collTagss = array(); + } + } + + + public function getTagss($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseTagsPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collTagss === null) { + if ($this->isNew()) { + $this->collTagss = array(); + } else { + + $criteria->add(TagsPeer::USER_ID, $this->getUsername()); + + TagsPeer::addSelectColumns($criteria); + $this->collTagss = TagsPeer::doSelect($criteria, $con); + } + } else { + if (!$this->isNew()) { + + + $criteria->add(TagsPeer::USER_ID, $this->getUsername()); + + TagsPeer::addSelectColumns($criteria); + if (!isset($this->lastTagsCriteria) || !$this->lastTagsCriteria->equals($criteria)) { + $this->collTagss = TagsPeer::doSelect($criteria, $con); + } + } + } + $this->lastTagsCriteria = $criteria; + return $this->collTagss; + } + + + public function countTagss($criteria = null, $distinct = false, $con = null) + { + include_once 'lib/model/om/BaseTagsPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + $criteria->add(TagsPeer::USER_ID, $this->getUsername()); + + return TagsPeer::doCount($criteria, $distinct, $con); + } + + + public function addTags(Tags $l) + { + $this->collTagss[] = $l; + $l->setUser($this); + } + + + + public function getTagssJoinInstrument($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseTagsPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collTagss === null) { + if ($this->isNew()) { + $this->collTagss = array(); + } else { + + $criteria->add(TagsPeer::USER_ID, $this->getUsername()); + + $this->collTagss = TagsPeer::doSelectJoinInstrument($criteria, $con); + } + } else { + + $criteria->add(TagsPeer::USER_ID, $this->getUsername()); + + if (!isset($this->lastTagsCriteria) || !$this->lastTagsCriteria->equals($criteria)) { + $this->collTagss = TagsPeer::doSelectJoinInstrument($criteria, $con); + } + } + $this->lastTagsCriteria = $criteria; + + return $this->collTagss; + } + + + public function initComments() + { + if ($this->collComments === null) { + $this->collComments = array(); + } + } + + + public function getComments($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseCommentPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collComments === null) { + if ($this->isNew()) { + $this->collComments = array(); + } else { + + $criteria->add(CommentPeer::AUTHOR, $this->getUsername()); + + CommentPeer::addSelectColumns($criteria); + $this->collComments = CommentPeer::doSelect($criteria, $con); + } + } else { + if (!$this->isNew()) { + + + $criteria->add(CommentPeer::AUTHOR, $this->getUsername()); + + CommentPeer::addSelectColumns($criteria); + if (!isset($this->lastCommentCriteria) || !$this->lastCommentCriteria->equals($criteria)) { + $this->collComments = CommentPeer::doSelect($criteria, $con); + } + } + } + $this->lastCommentCriteria = $criteria; + return $this->collComments; + } + + + public function countComments($criteria = null, $distinct = false, $con = null) + { + include_once 'lib/model/om/BaseCommentPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + $criteria->add(CommentPeer::AUTHOR, $this->getUsername()); + + return CommentPeer::doCount($criteria, $distinct, $con); + } + + + public function addComment(Comment $l) + { + $this->collComments[] = $l; + $l->setUser($this); + } + + + + public function getCommentsJoinInstrument($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseCommentPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collComments === null) { + if ($this->isNew()) { + $this->collComments = array(); + } else { + + $criteria->add(CommentPeer::AUTHOR, $this->getUsername()); + + $this->collComments = CommentPeer::doSelectJoinInstrument($criteria, $con); + } + } else { + + $criteria->add(CommentPeer::AUTHOR, $this->getUsername()); + + if (!isset($this->lastCommentCriteria) || !$this->lastCommentCriteria->equals($criteria)) { + $this->collComments = CommentPeer::doSelectJoinInstrument($criteria, $con); + } + } + $this->lastCommentCriteria = $criteria; + + return $this->collComments; + } + + + public function initBanks() + { + if ($this->collBanks === null) { + $this->collBanks = array(); + } + } + + + public function getBanks($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseBankPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collBanks === null) { + if ($this->isNew()) { + $this->collBanks = array(); + } else { + + $criteria->add(BankPeer::OWNER, $this->getUsername()); + + BankPeer::addSelectColumns($criteria); + $this->collBanks = BankPeer::doSelect($criteria, $con); + } + } else { + if (!$this->isNew()) { + + + $criteria->add(BankPeer::OWNER, $this->getUsername()); + + BankPeer::addSelectColumns($criteria); + if (!isset($this->lastBankCriteria) || !$this->lastBankCriteria->equals($criteria)) { + $this->collBanks = BankPeer::doSelect($criteria, $con); + } + } + } + $this->lastBankCriteria = $criteria; + return $this->collBanks; + } + + + public function countBanks($criteria = null, $distinct = false, $con = null) + { + include_once 'lib/model/om/BaseBankPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + $criteria->add(BankPeer::OWNER, $this->getUsername()); + + return BankPeer::doCount($criteria, $distinct, $con); + } + + + public function addBank(Bank $l) + { + $this->collBanks[] = $l; + $l->setUser($this); + } + + + + public function getBanksJoinWare($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseBankPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collBanks === null) { + if ($this->isNew()) { + $this->collBanks = array(); + } else { + + $criteria->add(BankPeer::OWNER, $this->getUsername()); + + $this->collBanks = BankPeer::doSelectJoinWare($criteria, $con); + } + } else { + + $criteria->add(BankPeer::OWNER, $this->getUsername()); + + if (!isset($this->lastBankCriteria) || !$this->lastBankCriteria->equals($criteria)) { + $this->collBanks = BankPeer::doSelectJoinWare($criteria, $con); + } + } + $this->lastBankCriteria = $criteria; + + return $this->collBanks; + } + +} \ No newline at end of file diff --git a/lib/model/om/BaseUserPeer.php b/lib/model/om/BaseUserPeer.php new file mode 100644 index 0000000..a352292 --- /dev/null +++ b/lib/model/om/BaseUserPeer.php @@ -0,0 +1,392 @@ + array ('Username', 'Stripped', 'Realname', 'Description', 'Avatar', 'Location', 'IsAdmin', ), + BasePeer::TYPE_COLNAME => array (UserPeer::USERNAME, UserPeer::STRIPPED, UserPeer::REALNAME, UserPeer::DESCRIPTION, UserPeer::AVATAR, UserPeer::LOCATION, UserPeer::IS_ADMIN, ), + BasePeer::TYPE_FIELDNAME => array ('username', 'stripped', 'realname', 'description', 'avatar', 'location', 'is_admin', ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, ) + ); + + + private static $fieldKeys = array ( + BasePeer::TYPE_PHPNAME => array ('Username' => 0, 'Stripped' => 1, 'Realname' => 2, 'Description' => 3, 'Avatar' => 4, 'Location' => 5, 'IsAdmin' => 6, ), + BasePeer::TYPE_COLNAME => array (UserPeer::USERNAME => 0, UserPeer::STRIPPED => 1, UserPeer::REALNAME => 2, UserPeer::DESCRIPTION => 3, UserPeer::AVATAR => 4, UserPeer::LOCATION => 5, UserPeer::IS_ADMIN => 6, ), + BasePeer::TYPE_FIELDNAME => array ('username' => 0, 'stripped' => 1, 'realname' => 2, 'description' => 3, 'avatar' => 4, 'location' => 5, 'is_admin' => 6, ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, ) + ); + + + public static function getMapBuilder() + { + include_once 'lib/model/map/UserMapBuilder.php'; + return BasePeer::getMapBuilder('lib.model.map.UserMapBuilder'); + } + + public static function getPhpNameMap() + { + if (self::$phpNameMap === null) { + $map = UserPeer::getTableMap(); + $columns = $map->getColumns(); + $nameMap = array(); + foreach ($columns as $column) { + $nameMap[$column->getPhpName()] = $column->getColumnName(); + } + self::$phpNameMap = $nameMap; + } + return self::$phpNameMap; + } + + static public function translateFieldName($name, $fromType, $toType) + { + $toNames = self::getFieldNames($toType); + $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$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(self::$fieldKeys[$fromType], true)); + } + return $toNames[$key]; + } + + + + static public function getFieldNames($type = BasePeer::TYPE_PHPNAME) + { + if (!array_key_exists($type, self::$fieldNames)) { + throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.'); + } + return self::$fieldNames[$type]; + } + + + public static function alias($alias, $column) + { + return str_replace(UserPeer::TABLE_NAME.'.', $alias.'.', $column); + } + + + public static function addSelectColumns(Criteria $criteria) + { + + $criteria->addSelectColumn(UserPeer::USERNAME); + + $criteria->addSelectColumn(UserPeer::STRIPPED); + + $criteria->addSelectColumn(UserPeer::REALNAME); + + $criteria->addSelectColumn(UserPeer::DESCRIPTION); + + $criteria->addSelectColumn(UserPeer::AVATAR); + + $criteria->addSelectColumn(UserPeer::LOCATION); + + $criteria->addSelectColumn(UserPeer::IS_ADMIN); + + } + + const COUNT = 'COUNT(User.USERNAME)'; + const COUNT_DISTINCT = 'COUNT(DISTINCT User.USERNAME)'; + + + public static function doCount(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(UserPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(UserPeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $rs = UserPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + public static function doSelectOne(Criteria $criteria, $con = null) + { + $critcopy = clone $criteria; + $critcopy->setLimit(1); + $objects = UserPeer::doSelect($critcopy, $con); + if ($objects) { + return $objects[0]; + } + return null; + } + + public static function doSelect(Criteria $criteria, $con = null) + { + return UserPeer::populateObjects(UserPeer::doSelectRS($criteria, $con)); + } + + public static function doSelectRS(Criteria $criteria, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + if (!$criteria->getSelectColumns()) { + $criteria = clone $criteria; + UserPeer::addSelectColumns($criteria); + } + + $criteria->setDbName(self::DATABASE_NAME); + + return BasePeer::doSelect($criteria, $con); + } + + public static function populateObjects(ResultSet $rs) + { + $results = array(); + + $cls = UserPeer::getOMClass(); + $cls = Propel::import($cls); + while($rs->next()) { + + $obj = new $cls(); + $obj->hydrate($rs); + $results[] = $obj; + + } + return $results; + } + + public static function getTableMap() + { + return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME); + } + + + public static function getOMClass() + { + return UserPeer::CLASS_DEFAULT; + } + + + public static function doInsert($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; } else { + $criteria = $values->buildCriteria(); } + + + $criteria->setDbName(self::DATABASE_NAME); + + try { + $con->begin(); + $pk = BasePeer::doInsert($criteria, $con); + $con->commit(); + } catch(PropelException $e) { + $con->rollback(); + throw $e; + } + + return $pk; + } + + + public static function doUpdate($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $selectCriteria = new Criteria(self::DATABASE_NAME); + + if ($values instanceof Criteria) { + $criteria = clone $values; + $comparison = $criteria->getComparison(UserPeer::USERNAME); + $selectCriteria->add(UserPeer::USERNAME, $criteria->remove(UserPeer::USERNAME), $comparison); + + } else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); } + + $criteria->setDbName(self::DATABASE_NAME); + + return BasePeer::doUpdate($selectCriteria, $criteria, $con); + } + + + public static function doDeleteAll($con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + $affectedRows = 0; try { + $con->begin(); + $affectedRows += BasePeer::doDeleteAll(UserPeer::TABLE_NAME, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public static function doDelete($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(UserPeer::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; } elseif ($values instanceof User) { + + $criteria = $values->buildPkeyCriteria(); + } else { + $criteria = new Criteria(self::DATABASE_NAME); + $criteria->add(UserPeer::USERNAME, (array) $values, Criteria::IN); + } + + $criteria->setDbName(self::DATABASE_NAME); + + $affectedRows = 0; + try { + $con->begin(); + + $affectedRows += BasePeer::doDelete($criteria, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public static function doValidate(User $obj, $cols = null) + { + $columns = array(); + + if ($cols) { + $dbMap = Propel::getDatabaseMap(UserPeer::DATABASE_NAME); + $tableMap = $dbMap->getTable(UserPeer::TABLE_NAME); + + if (! is_array($cols)) { + $cols = array($cols); + } + + foreach($cols as $colName) { + if ($tableMap->containsColumn($colName)) { + $get = 'get' . $tableMap->getColumn($colName)->getPhpName(); + $columns[$colName] = $obj->$get(); + } + } + } else { + + } + + $res = BasePeer::doValidate(UserPeer::DATABASE_NAME, UserPeer::TABLE_NAME, $columns); + if ($res !== true) { + $request = sfContext::getInstance()->getRequest(); + foreach ($res as $failed) { + $col = UserPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME); + $request->setError($col, $failed->getMessage()); + } + } + + return $res; + } + + + public static function retrieveByPK($pk, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $criteria = new Criteria(UserPeer::DATABASE_NAME); + + $criteria->add(UserPeer::USERNAME, $pk); + + + $v = UserPeer::doSelect($criteria, $con); + + return !empty($v) > 0 ? $v[0] : null; + } + + + public static function retrieveByPKs($pks, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $objs = null; + if (empty($pks)) { + $objs = array(); + } else { + $criteria = new Criteria(); + $criteria->add(UserPeer::USERNAME, $pks, Criteria::IN); + $objs = UserPeer::doSelect($criteria, $con); + } + return $objs; + } + +} +if (Propel::isInit()) { + try { + BaseUserPeer::getMapBuilder(); + } catch (Exception $e) { + Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR); + } +} else { + require_once 'lib/model/map/UserMapBuilder.php'; + Propel::registerMapBuilder('lib.model.map.UserMapBuilder'); +} diff --git a/lib/model/om/BaseWare.php b/lib/model/om/BaseWare.php new file mode 100644 index 0000000..54a918e --- /dev/null +++ b/lib/model/om/BaseWare.php @@ -0,0 +1,589 @@ +soft; + } + + + public function getHard() + { + + return $this->hard; + } + + + public function setSoft($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->soft !== $v) { + $this->soft = $v; + $this->modifiedColumns[] = WarePeer::SOFT; + } + + } + + public function setHard($v) + { + + + + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->hard !== $v) { + $this->hard = $v; + $this->modifiedColumns[] = WarePeer::HARD; + } + + } + + public function hydrate(ResultSet $rs, $startcol = 1) + { + try { + + $this->soft = $rs->getString($startcol + 0); + + $this->hard = $rs->getString($startcol + 1); + + $this->resetModified(); + + $this->setNew(false); + + return $startcol + 2; + } catch (Exception $e) { + throw new PropelException("Error populating Ware object", $e); + } + } + + + public function delete($con = null) + { + if ($this->isDeleted()) { + throw new PropelException("This object has already been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(WarePeer::DATABASE_NAME); + } + + try { + $con->begin(); + WarePeer::doDelete($this, $con); + $this->setDeleted(true); + $con->commit(); + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public function save($con = null) + { + if ($this->isDeleted()) { + throw new PropelException("You cannot save an object that has been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(WarePeer::DATABASE_NAME); + } + + try { + $con->begin(); + $affectedRows = $this->doSave($con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + protected function doSave($con) + { + $affectedRows = 0; if (!$this->alreadyInSave) { + $this->alreadyInSave = true; + + + if ($this->isModified()) { + if ($this->isNew()) { + $pk = WarePeer::doInsert($this, $con); + $affectedRows += 1; + $this->setNew(false); + } else { + $affectedRows += WarePeer::doUpdate($this, $con); + } + $this->resetModified(); } + + if ($this->collInstruments !== null) { + foreach($this->collInstruments as $referrerFK) { + if (!$referrerFK->isDeleted()) { + $affectedRows += $referrerFK->save($con); + } + } + } + + if ($this->collBanks !== null) { + foreach($this->collBanks as $referrerFK) { + if (!$referrerFK->isDeleted()) { + $affectedRows += $referrerFK->save($con); + } + } + } + + $this->alreadyInSave = false; + } + return $affectedRows; + } + + protected $validationFailures = array(); + + + public function getValidationFailures() + { + return $this->validationFailures; + } + + + public function validate($columns = null) + { + $res = $this->doValidate($columns); + if ($res === true) { + $this->validationFailures = array(); + return true; + } else { + $this->validationFailures = $res; + return false; + } + } + + + protected function doValidate($columns = null) + { + if (!$this->alreadyInValidation) { + $this->alreadyInValidation = true; + $retval = null; + + $failureMap = array(); + + + if (($retval = WarePeer::doValidate($this, $columns)) !== true) { + $failureMap = array_merge($failureMap, $retval); + } + + + if ($this->collInstruments !== null) { + foreach($this->collInstruments as $referrerFK) { + if (!$referrerFK->validate($columns)) { + $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); + } + } + } + + if ($this->collBanks !== null) { + foreach($this->collBanks as $referrerFK) { + if (!$referrerFK->validate($columns)) { + $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); + } + } + } + + + $this->alreadyInValidation = false; + } + + return (!empty($failureMap) ? $failureMap : true); + } + + + public function getByName($name, $type = BasePeer::TYPE_PHPNAME) + { + $pos = WarePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->getByPosition($pos); + } + + + public function getByPosition($pos) + { + switch($pos) { + case 0: + return $this->getSoft(); + break; + case 1: + return $this->getHard(); + break; + default: + return null; + break; + } } + + + public function toArray($keyType = BasePeer::TYPE_PHPNAME) + { + $keys = WarePeer::getFieldNames($keyType); + $result = array( + $keys[0] => $this->getSoft(), + $keys[1] => $this->getHard(), + ); + return $result; + } + + + public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) + { + $pos = WarePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->setByPosition($pos, $value); + } + + + public function setByPosition($pos, $value) + { + switch($pos) { + case 0: + $this->setSoft($value); + break; + case 1: + $this->setHard($value); + break; + } } + + + public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) + { + $keys = WarePeer::getFieldNames($keyType); + + if (array_key_exists($keys[0], $arr)) $this->setSoft($arr[$keys[0]]); + if (array_key_exists($keys[1], $arr)) $this->setHard($arr[$keys[1]]); + } + + + public function buildCriteria() + { + $criteria = new Criteria(WarePeer::DATABASE_NAME); + + if ($this->isColumnModified(WarePeer::SOFT)) $criteria->add(WarePeer::SOFT, $this->soft); + if ($this->isColumnModified(WarePeer::HARD)) $criteria->add(WarePeer::HARD, $this->hard); + + return $criteria; + } + + + public function buildPkeyCriteria() + { + $criteria = new Criteria(WarePeer::DATABASE_NAME); + + $criteria->add(WarePeer::SOFT, $this->soft); + + return $criteria; + } + + + public function getPrimaryKey() + { + return $this->getSoft(); + } + + + public function setPrimaryKey($key) + { + $this->setSoft($key); + } + + + public function copyInto($copyObj, $deepCopy = false) + { + + $copyObj->setHard($this->hard); + + + if ($deepCopy) { + $copyObj->setNew(false); + + foreach($this->getInstruments() as $relObj) { + $copyObj->addInstrument($relObj->copy($deepCopy)); + } + + foreach($this->getBanks() as $relObj) { + $copyObj->addBank($relObj->copy($deepCopy)); + } + + } + + $copyObj->setNew(true); + + $copyObj->setSoft(NULL); + } + + + public function copy($deepCopy = false) + { + $clazz = get_class($this); + $copyObj = new $clazz(); + $this->copyInto($copyObj, $deepCopy); + return $copyObj; + } + + + public function getPeer() + { + if (self::$peer === null) { + self::$peer = new WarePeer(); + } + return self::$peer; + } + + + public function initInstruments() + { + if ($this->collInstruments === null) { + $this->collInstruments = array(); + } + } + + + public function getInstruments($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseInstrumentPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collInstruments === null) { + if ($this->isNew()) { + $this->collInstruments = array(); + } else { + + $criteria->add(InstrumentPeer::SOFTWARE, $this->getSoft()); + + InstrumentPeer::addSelectColumns($criteria); + $this->collInstruments = InstrumentPeer::doSelect($criteria, $con); + } + } else { + if (!$this->isNew()) { + + + $criteria->add(InstrumentPeer::SOFTWARE, $this->getSoft()); + + InstrumentPeer::addSelectColumns($criteria); + if (!isset($this->lastInstrumentCriteria) || !$this->lastInstrumentCriteria->equals($criteria)) { + $this->collInstruments = InstrumentPeer::doSelect($criteria, $con); + } + } + } + $this->lastInstrumentCriteria = $criteria; + return $this->collInstruments; + } + + + public function countInstruments($criteria = null, $distinct = false, $con = null) + { + include_once 'lib/model/om/BaseInstrumentPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + $criteria->add(InstrumentPeer::SOFTWARE, $this->getSoft()); + + return InstrumentPeer::doCount($criteria, $distinct, $con); + } + + + public function addInstrument(Instrument $l) + { + $this->collInstruments[] = $l; + $l->setWare($this); + } + + + + public function getInstrumentsJoinUser($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseInstrumentPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collInstruments === null) { + if ($this->isNew()) { + $this->collInstruments = array(); + } else { + + $criteria->add(InstrumentPeer::SOFTWARE, $this->getSoft()); + + $this->collInstruments = InstrumentPeer::doSelectJoinUser($criteria, $con); + } + } else { + + $criteria->add(InstrumentPeer::SOFTWARE, $this->getSoft()); + + if (!isset($this->lastInstrumentCriteria) || !$this->lastInstrumentCriteria->equals($criteria)) { + $this->collInstruments = InstrumentPeer::doSelectJoinUser($criteria, $con); + } + } + $this->lastInstrumentCriteria = $criteria; + + return $this->collInstruments; + } + + + public function initBanks() + { + if ($this->collBanks === null) { + $this->collBanks = array(); + } + } + + + public function getBanks($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseBankPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collBanks === null) { + if ($this->isNew()) { + $this->collBanks = array(); + } else { + + $criteria->add(BankPeer::SOFTWARE, $this->getSoft()); + + BankPeer::addSelectColumns($criteria); + $this->collBanks = BankPeer::doSelect($criteria, $con); + } + } else { + if (!$this->isNew()) { + + + $criteria->add(BankPeer::SOFTWARE, $this->getSoft()); + + BankPeer::addSelectColumns($criteria); + if (!isset($this->lastBankCriteria) || !$this->lastBankCriteria->equals($criteria)) { + $this->collBanks = BankPeer::doSelect($criteria, $con); + } + } + } + $this->lastBankCriteria = $criteria; + return $this->collBanks; + } + + + public function countBanks($criteria = null, $distinct = false, $con = null) + { + include_once 'lib/model/om/BaseBankPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + $criteria->add(BankPeer::SOFTWARE, $this->getSoft()); + + return BankPeer::doCount($criteria, $distinct, $con); + } + + + public function addBank(Bank $l) + { + $this->collBanks[] = $l; + $l->setWare($this); + } + + + + public function getBanksJoinUser($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseBankPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collBanks === null) { + if ($this->isNew()) { + $this->collBanks = array(); + } else { + + $criteria->add(BankPeer::SOFTWARE, $this->getSoft()); + + $this->collBanks = BankPeer::doSelectJoinUser($criteria, $con); + } + } else { + + $criteria->add(BankPeer::SOFTWARE, $this->getSoft()); + + if (!isset($this->lastBankCriteria) || !$this->lastBankCriteria->equals($criteria)) { + $this->collBanks = BankPeer::doSelectJoinUser($criteria, $con); + } + } + $this->lastBankCriteria = $criteria; + + return $this->collBanks; + } + +} \ No newline at end of file diff --git a/lib/model/om/BaseWarePeer.php b/lib/model/om/BaseWarePeer.php new file mode 100644 index 0000000..5c6e9dc --- /dev/null +++ b/lib/model/om/BaseWarePeer.php @@ -0,0 +1,367 @@ + array ('Soft', 'Hard', ), + BasePeer::TYPE_COLNAME => array (WarePeer::SOFT, WarePeer::HARD, ), + BasePeer::TYPE_FIELDNAME => array ('soft', 'hard', ), + BasePeer::TYPE_NUM => array (0, 1, ) + ); + + + private static $fieldKeys = array ( + BasePeer::TYPE_PHPNAME => array ('Soft' => 0, 'Hard' => 1, ), + BasePeer::TYPE_COLNAME => array (WarePeer::SOFT => 0, WarePeer::HARD => 1, ), + BasePeer::TYPE_FIELDNAME => array ('soft' => 0, 'hard' => 1, ), + BasePeer::TYPE_NUM => array (0, 1, ) + ); + + + public static function getMapBuilder() + { + include_once 'lib/model/map/WareMapBuilder.php'; + return BasePeer::getMapBuilder('lib.model.map.WareMapBuilder'); + } + + public static function getPhpNameMap() + { + if (self::$phpNameMap === null) { + $map = WarePeer::getTableMap(); + $columns = $map->getColumns(); + $nameMap = array(); + foreach ($columns as $column) { + $nameMap[$column->getPhpName()] = $column->getColumnName(); + } + self::$phpNameMap = $nameMap; + } + return self::$phpNameMap; + } + + static public function translateFieldName($name, $fromType, $toType) + { + $toNames = self::getFieldNames($toType); + $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$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(self::$fieldKeys[$fromType], true)); + } + return $toNames[$key]; + } + + + + static public function getFieldNames($type = BasePeer::TYPE_PHPNAME) + { + if (!array_key_exists($type, self::$fieldNames)) { + throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.'); + } + return self::$fieldNames[$type]; + } + + + public static function alias($alias, $column) + { + return str_replace(WarePeer::TABLE_NAME.'.', $alias.'.', $column); + } + + + public static function addSelectColumns(Criteria $criteria) + { + + $criteria->addSelectColumn(WarePeer::SOFT); + + $criteria->addSelectColumn(WarePeer::HARD); + + } + + const COUNT = 'COUNT(Ware.SOFT)'; + const COUNT_DISTINCT = 'COUNT(DISTINCT Ware.SOFT)'; + + + public static function doCount(Criteria $criteria, $distinct = false, $con = null) + { + $criteria = clone $criteria; + + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(WarePeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(WarePeer::COUNT); + } + + foreach($criteria->getGroupByColumns() as $column) + { + $criteria->addSelectColumn($column); + } + + $rs = WarePeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + return 0; + } + } + + public static function doSelectOne(Criteria $criteria, $con = null) + { + $critcopy = clone $criteria; + $critcopy->setLimit(1); + $objects = WarePeer::doSelect($critcopy, $con); + if ($objects) { + return $objects[0]; + } + return null; + } + + public static function doSelect(Criteria $criteria, $con = null) + { + return WarePeer::populateObjects(WarePeer::doSelectRS($criteria, $con)); + } + + public static function doSelectRS(Criteria $criteria, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + if (!$criteria->getSelectColumns()) { + $criteria = clone $criteria; + WarePeer::addSelectColumns($criteria); + } + + $criteria->setDbName(self::DATABASE_NAME); + + return BasePeer::doSelect($criteria, $con); + } + + public static function populateObjects(ResultSet $rs) + { + $results = array(); + + $cls = WarePeer::getOMClass(); + $cls = Propel::import($cls); + while($rs->next()) { + + $obj = new $cls(); + $obj->hydrate($rs); + $results[] = $obj; + + } + return $results; + } + + public static function getTableMap() + { + return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME); + } + + + public static function getOMClass() + { + return WarePeer::CLASS_DEFAULT; + } + + + public static function doInsert($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; } else { + $criteria = $values->buildCriteria(); } + + + $criteria->setDbName(self::DATABASE_NAME); + + try { + $con->begin(); + $pk = BasePeer::doInsert($criteria, $con); + $con->commit(); + } catch(PropelException $e) { + $con->rollback(); + throw $e; + } + + return $pk; + } + + + public static function doUpdate($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $selectCriteria = new Criteria(self::DATABASE_NAME); + + if ($values instanceof Criteria) { + $criteria = clone $values; + $comparison = $criteria->getComparison(WarePeer::SOFT); + $selectCriteria->add(WarePeer::SOFT, $criteria->remove(WarePeer::SOFT), $comparison); + + } else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); } + + $criteria->setDbName(self::DATABASE_NAME); + + return BasePeer::doUpdate($selectCriteria, $criteria, $con); + } + + + public static function doDeleteAll($con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + $affectedRows = 0; try { + $con->begin(); + $affectedRows += BasePeer::doDeleteAll(WarePeer::TABLE_NAME, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public static function doDelete($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(WarePeer::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; } elseif ($values instanceof Ware) { + + $criteria = $values->buildPkeyCriteria(); + } else { + $criteria = new Criteria(self::DATABASE_NAME); + $criteria->add(WarePeer::SOFT, (array) $values, Criteria::IN); + } + + $criteria->setDbName(self::DATABASE_NAME); + + $affectedRows = 0; + try { + $con->begin(); + + $affectedRows += BasePeer::doDelete($criteria, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + + public static function doValidate(Ware $obj, $cols = null) + { + $columns = array(); + + if ($cols) { + $dbMap = Propel::getDatabaseMap(WarePeer::DATABASE_NAME); + $tableMap = $dbMap->getTable(WarePeer::TABLE_NAME); + + if (! is_array($cols)) { + $cols = array($cols); + } + + foreach($cols as $colName) { + if ($tableMap->containsColumn($colName)) { + $get = 'get' . $tableMap->getColumn($colName)->getPhpName(); + $columns[$colName] = $obj->$get(); + } + } + } else { + + } + + $res = BasePeer::doValidate(WarePeer::DATABASE_NAME, WarePeer::TABLE_NAME, $columns); + if ($res !== true) { + $request = sfContext::getInstance()->getRequest(); + foreach ($res as $failed) { + $col = WarePeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME); + $request->setError($col, $failed->getMessage()); + } + } + + return $res; + } + + + public static function retrieveByPK($pk, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $criteria = new Criteria(WarePeer::DATABASE_NAME); + + $criteria->add(WarePeer::SOFT, $pk); + + + $v = WarePeer::doSelect($criteria, $con); + + return !empty($v) > 0 ? $v[0] : null; + } + + + public static function retrieveByPKs($pks, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $objs = null; + if (empty($pks)) { + $objs = array(); + } else { + $criteria = new Criteria(); + $criteria->add(WarePeer::SOFT, $pks, Criteria::IN); + $objs = WarePeer::doSelect($criteria, $con); + } + return $objs; + } + +} +if (Propel::isInit()) { + try { + BaseWarePeer::getMapBuilder(); + } catch (Exception $e) { + Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR); + } +} else { + require_once 'lib/model/map/WareMapBuilder.php'; + Propel::registerMapBuilder('lib.model.map.WareMapBuilder'); +} diff --git a/lib/myTools.class.php b/lib/myTools.class.php new file mode 100644 index 0000000..1d7f108 --- /dev/null +++ b/lib/myTools.class.php @@ -0,0 +1,204 @@ +Get the Flash Player to see this player. + + '; + } + + public static function stemPhrase($phrase) + { + // split into words + $words = split(' ',strtolower($phrase)); + + // ignore stop words + $words = myTools::removeStopWordsFromArray($words); + + // stem words + $stemmed_words = array(); + foreach ($words as $word) + { + // ignore 1 and 2 letter words + if (strlen($word) <= 2) + { + continue; + } + + $stemmed_words[] = PorterStemmer::stem($word, true); + } + + return $stemmed_words; + } + + public static function stripText($text) + { + $text = strtolower($text); + + // strip all non word chars + $text = preg_replace('/\W/', ' ', $text); + + // replace all white space sections with a dash + $text = preg_replace('/\ +/', '-', $text); + + // trim dashes + $text = preg_replace('/\-$/', '', $text); + $text = preg_replace('/^\-/', '', $text); + + return $text; + } +public static function removeStopWordsFromArray($words) +{ + $stop_words = array( + 'i', 'me', 'my', 'myself', 'we', 'our', 'ours', 'ourselves', 'you', 'your', 'yours', + 'yourself', 'yourselves', 'he', 'him', 'his', 'himself', 'she', 'her', 'hers', + 'herself', 'it', 'its', 'itself', 'they', 'them', 'their', 'theirs', 'themselves', + 'what', 'which', 'who', 'whom', 'this', 'that', 'these', 'those', 'am', 'is', 'are', + 'was', 'were', 'be', 'been', 'being', 'have', 'has', 'had', 'having', 'do', 'does', + 'did', 'doing', 'a', 'an', 'the', 'and', 'but', 'if', 'or', 'because', 'as', 'until', + 'while', 'of', 'at', 'by', 'for', 'with', 'about', 'against', 'between', 'into', + 'through', 'during', 'before', 'after', 'above', 'below', 'to', 'from', 'up', 'down', + 'in', 'out', 'on', 'off', 'over', 'under', 'again', 'further', 'then', 'once', 'here', + 'there', 'when', 'where', 'why', 'how', 'all', 'any', 'both', 'each', 'few', 'more', + 'most', 'other', 'some', 'such', 'no', 'nor', 'not', 'only', 'own', 'same', 'so', + 'than', 'too', 'very', + ); + + return array_diff($words, $stop_words); +} + + public static function url_encode($v) { + return str_replace(' ','-',trim(ereg_replace(' +',' ',preg_replace('/[^a-zA-Z0-9\s]/',' ',strtolower($v))))); + } + +public static function Xml2Array($contents, $get_attributes = 1, $priority = 'tag') +{ + $parser = xml_parser_create(); + xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8"); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); + xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); + xml_parse_into_struct($parser, trim($contents), $xml_values); + xml_parser_free($parser); + if (!$xml_values) + return; //Hmm... + $xml_array = array (); + $parents = array (); + $opened_tags = array (); + $arr = array (); + $current = & $xml_array; + $repeated_tag_index = array (); + foreach ($xml_values as $data) + { + unset ($attributes, $value); + extract($data); + $result = array (); + $attributes_data = array (); + if (isset ($value)) + { + if ($priority == 'tag') + $result = $value; + else + $result['value'] = $value; + } + if (isset ($attributes) and $get_attributes) + { + foreach ($attributes as $attr => $val) + { + if ($priority == 'tag') + $attributes_data[$attr] = $val; + else + $result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr' + } + } + if ($type == "open") + { + $parent[$level -1] = & $current; + if (!is_array($current) or (!in_array($tag, array_keys($current)))) + { + $current[$tag] = $result; + if ($attributes_data) + $current[$tag . '_attr'] = $attributes_data; + $repeated_tag_index[$tag . '_' . $level] = 1; + $current = & $current[$tag]; + } + else + { + if (isset ($current[$tag][0])) + { + $current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result; + $repeated_tag_index[$tag . '_' . $level]++; + } + else + { + $current[$tag] = array ( + $current[$tag], + $result + ); + $repeated_tag_index[$tag . '_' . $level] = 2; + if (isset ($current[$tag . '_attr'])) + { + $current[$tag]['0_attr'] = $current[$tag . '_attr']; + unset ($current[$tag . '_attr']); + } + } + $last_item_index = $repeated_tag_index[$tag . '_' . $level] - 1; + $current = & $current[$tag][$last_item_index]; + } + } + elseif ($type == "complete") + { + if (!isset ($current[$tag])) + { + $current[$tag] = $result; + $repeated_tag_index[$tag . '_' . $level] = 1; + if ($priority == 'tag' and $attributes_data) + $current[$tag . '_attr'] = $attributes_data; + } + else + { + if (isset ($current[$tag][0]) and is_array($current[$tag])) + { + $current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result; + if ($priority == 'tag' and $get_attributes and $attributes_data) + { + $current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data; + } + $repeated_tag_index[$tag . '_' . $level]++; + } + else + { + $current[$tag] = array ( + $current[$tag], + $result + ); + $repeated_tag_index[$tag . '_' . $level] = 1; + if ($priority == 'tag' and $get_attributes) + { + if (isset ($current[$tag . '_attr'])) + { + $current[$tag]['0_attr'] = $current[$tag . '_attr']; + unset ($current[$tag . '_attr']); + } + if ($attributes_data) + { + $current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data; + } + } + $repeated_tag_index[$tag . '_' . $level]++; //0 and 1 index is already taken + } + } + } + elseif ($type == 'close') + { + $current = & $parent[$level -1]; + } + } + return ($xml_array); +} +} +?> diff --git a/plugins/.channels/.alias/pear.txt b/plugins/.channels/.alias/pear.txt new file mode 100644 index 0000000..f4730b9 --- /dev/null +++ b/plugins/.channels/.alias/pear.txt @@ -0,0 +1 @@ +pear.php.net \ No newline at end of file diff --git a/plugins/.channels/.alias/pecl.txt b/plugins/.channels/.alias/pecl.txt new file mode 100644 index 0000000..2de48f1 --- /dev/null +++ b/plugins/.channels/.alias/pecl.txt @@ -0,0 +1 @@ +pecl.php.net \ No newline at end of file diff --git a/plugins/.channels/.alias/symfony.txt b/plugins/.channels/.alias/symfony.txt new file mode 100644 index 0000000..2589a3a --- /dev/null +++ b/plugins/.channels/.alias/symfony.txt @@ -0,0 +1 @@ +pear.symfony-project.com \ No newline at end of file diff --git a/plugins/.channels/__uri.reg b/plugins/.channels/__uri.reg new file mode 100644 index 0000000..c90024c --- /dev/null +++ b/plugins/.channels/__uri.reg @@ -0,0 +1 @@ +a:4:{s:4:"name";s:5:"__uri";s:7:"servers";a:1:{s:7:"primary";a:1:{s:6:"xmlrpc";a:1:{s:8:"function";a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:4:"****";}}}}s:7:"summary";s:34:"Pseudo-channel for static packages";s:13:"_lastmodified";s:31:"Thu, 05 Feb 2009 00:38:24 -0500";} \ No newline at end of file diff --git a/plugins/.channels/pear.php.net.reg b/plugins/.channels/pear.php.net.reg new file mode 100644 index 0000000..1609f77 --- /dev/null +++ b/plugins/.channels/pear.php.net.reg @@ -0,0 +1 @@ +a:5:{s:4:"name";s:12:"pear.php.net";s:14:"suggestedalias";s:4:"pear";s:7:"summary";s:40:"PHP Extension and Application Repository";s:7:"servers";a:1:{s:7:"primary";a:2:{s:6:"xmlrpc";a:1:{s:8:"function";a:10:{i:0;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:9:"logintest";}i:1;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:26:"package.listLatestReleases";}i:2;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:15:"package.listAll";}i:3;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:12:"package.info";}i:4;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:22:"package.getDownloadURL";}i:5;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.1";}s:8:"_content";s:22:"package.getDownloadURL";}i:6;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:25:"package.getDepDownloadURL";}i:7;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.1";}s:8:"_content";s:25:"package.getDepDownloadURL";}i:8;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:14:"package.search";}i:9;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:15:"channel.listAll";}}}s:4:"rest";a:1:{s:7:"baseurl";a:2:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.0";}s:8:"_content";s:25:"http://pear.php.net/rest/";}i:1;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.1";}s:8:"_content";s:25:"http://pear.php.net/rest/";}}}}}s:13:"_lastmodified";s:31:"Thu, 05 Feb 2009 00:38:24 -0500";} \ No newline at end of file diff --git a/plugins/.channels/pear.symfony-project.com.reg b/plugins/.channels/pear.symfony-project.com.reg new file mode 100644 index 0000000..bac469f --- /dev/null +++ b/plugins/.channels/pear.symfony-project.com.reg @@ -0,0 +1 @@ +a:6:{s:7:"attribs";a:4:{s:7:"version";s:3:"1.0";s:5:"xmlns";s:31:"http://pear.php.net/channel-1.0";s:9:"xmlns:xsi";s:41:"http://www.w3.org/2001/XMLSchema-instance";s:18:"xsi:schemaLocation";s:75:"http://pear.php.net/dtd/channel-1.0 http://pear.php.net/dtd/channel-1.0.xsd";}s:4:"name";s:24:"pear.symfony-project.com";s:7:"summary";s:28:"symfony project PEAR channel";s:14:"suggestedalias";s:7:"symfony";s:7:"servers";a:1:{s:7:"primary";a:1:{s:4:"rest";a:1:{s:7:"baseurl";a:2:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.0";}s:8:"_content";s:56:"http://pear.symfony-project.com/Chiara_PEAR_Server_REST/";}i:1;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.1";}s:8:"_content";s:56:"http://pear.symfony-project.com/Chiara_PEAR_Server_REST/";}}}}}s:13:"_lastmodified";a:2:{s:4:"ETag";s:19:"113845-297-dc93f000";s:13:"Last-Modified";s:31:"Thu, 05 Feb 2009 05:38:24 +0000";}} \ No newline at end of file diff --git a/plugins/.channels/pecl.php.net.reg b/plugins/.channels/pecl.php.net.reg new file mode 100644 index 0000000..8322b49 --- /dev/null +++ b/plugins/.channels/pecl.php.net.reg @@ -0,0 +1 @@ +a:6:{s:4:"name";s:12:"pecl.php.net";s:14:"suggestedalias";s:4:"pecl";s:7:"summary";s:31:"PHP Extension Community Library";s:7:"servers";a:1:{s:7:"primary";a:2:{s:6:"xmlrpc";a:1:{s:8:"function";a:10:{i:0;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:9:"logintest";}i:1;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:26:"package.listLatestReleases";}i:2;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:15:"package.listAll";}i:3;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:12:"package.info";}i:4;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:22:"package.getDownloadURL";}i:5;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.1";}s:8:"_content";s:22:"package.getDownloadURL";}i:6;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:25:"package.getDepDownloadURL";}i:7;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.1";}s:8:"_content";s:25:"package.getDepDownloadURL";}i:8;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:14:"package.search";}i:9;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:15:"channel.listAll";}}}s:4:"rest";a:1:{s:7:"baseurl";a:2:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.0";}s:8:"_content";s:25:"http://pecl.php.net/rest/";}i:1;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.1";}s:8:"_content";s:25:"http://pecl.php.net/rest/";}}}}}s:15:"validatepackage";a:2:{s:8:"_content";s:19:"PEAR_Validator_PECL";s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}}s:13:"_lastmodified";s:31:"Thu, 05 Feb 2009 00:38:24 -0500";} \ No newline at end of file diff --git a/plugins/.depdb b/plugins/.depdb new file mode 100644 index 0000000..3b50f75 --- /dev/null +++ b/plugins/.depdb @@ -0,0 +1 @@ +a:2:{s:8:"_version";s:3:"1.0";s:12:"dependencies";a:0:{}} \ No newline at end of file diff --git a/plugins/.depdblock b/plugins/.depdblock new file mode 100644 index 0000000..e69de29 diff --git a/plugins/.filemap b/plugins/.filemap new file mode 100644 index 0000000..93e3b7f --- /dev/null +++ b/plugins/.filemap @@ -0,0 +1 @@ +a:1:{s:4:"data";a:9:{s:38:"sffeedplugin/lib/sfAtom1Feed.class.php";a:2:{i:0;s:24:"pear.symfony-project.com";i:1;s:12:"sffeedplugin";}s:33:"sffeedplugin/lib/sfFeed.class.php";a:2:{i:0;s:24:"pear.symfony-project.com";i:1;s:12:"sffeedplugin";}s:42:"sffeedplugin/lib/sfFeedEnclosure.class.php";a:2:{i:0;s:24:"pear.symfony-project.com";i:1;s:12:"sffeedplugin";}s:37:"sffeedplugin/lib/sfFeedItem.class.php";a:2:{i:0;s:24:"pear.symfony-project.com";i:1;s:12:"sffeedplugin";}s:43:"sffeedplugin/lib/sfRss201rev2Feed.class.php";a:2:{i:0;s:24:"pear.symfony-project.com";i:1;s:12:"sffeedplugin";}s:36:"sffeedplugin/lib/sfRssFeed.class.php";a:2:{i:0;s:24:"pear.symfony-project.com";i:1;s:12:"sffeedplugin";}s:47:"sffeedplugin/lib/sfRssUserland091Feed.class.php";a:2:{i:0;s:24:"pear.symfony-project.com";i:1;s:12:"sffeedplugin";}s:19:"sffeedplugin/README";a:2:{i:0;s:24:"pear.symfony-project.com";i:1;s:12:"sffeedplugin";}s:20:"sffeedplugin/LICENSE";a:2:{i:0;s:24:"pear.symfony-project.com";i:1;s:12:"sffeedplugin";}}} \ No newline at end of file diff --git a/plugins/.lock b/plugins/.lock new file mode 100644 index 0000000..e69de29 diff --git a/plugins/.pearrc b/plugins/.pearrc new file mode 100644 index 0000000..5a69056 --- /dev/null +++ b/plugins/.pearrc @@ -0,0 +1,2 @@ +#PEAR_Config 0.9 +a:8:{s:7:"php_dir";s:21:"/var/www/lsdj/plugins";s:8:"data_dir";s:21:"/var/www/lsdj/plugins";s:8:"test_dir";s:21:"/var/www/lsdj/plugins";s:7:"doc_dir";s:21:"/var/www/lsdj/plugins";s:7:"bin_dir";s:21:"/var/www/lsdj/plugins";s:9:"cache_dir";s:21:"/var/www/lsdj/cache//";s:12:"download_dir";s:21:"/var/www/lsdj/cache//";s:10:"__channels";a:2:{s:5:"__uri";a:0:{}s:12:"pecl.php.net";a:0:{}}} \ No newline at end of file diff --git a/plugins/.registry/.channel.pear.symfony-project.com/sffeedplugin.reg b/plugins/.registry/.channel.pear.symfony-project.com/sffeedplugin.reg new file mode 100644 index 0000000..5491cb9 --- /dev/null +++ b/plugins/.registry/.channel.pear.symfony-project.com/sffeedplugin.reg @@ -0,0 +1 @@ +a:22:{s:7:"attribs";a:6:{s:5:"xmlns";s:35:"http://pear.php.net/dtd/package-2.0";s:11:"xmlns:tasks";s:33:"http://pear.php.net/dtd/tasks-1.0";s:9:"xmlns:xsi";s:41:"http://www.w3.org/2001/XMLSchema-instance";s:15:"packagerversion";s:6:"1.4.11";s:7:"version";s:3:"2.0";s:18:"xsi:schemaLocation";s:147:"http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd";}s:4:"name";s:12:"sfFeedPlugin";s:7:"channel";s:24:"pear.symfony-project.com";s:7:"summary";s:21:"symfony feed support.";s:11:"description";s:21:"symfony feed support.";s:4:"lead";a:4:{s:4:"name";s:16:"Fabien POTENCIER";s:4:"user";s:6:"fabpot";s:5:"email";s:36:"fabien.potencier@symfony-project.com";s:6:"active";s:3:"yes";}s:4:"date";s:10:"2007-02-22";s:4:"time";s:8:"09:10:18";s:7:"version";a:2:{s:7:"release";s:5:"1.2.2";s:3:"api";s:5:"1.0.1";}s:9:"stability";a:2:{s:7:"release";s:6:"stable";s:3:"api";s:6:"stable";}s:7:"license";a:2:{s:7:"attribs";a:1:{s:3:"uri";s:38:"http://www.symfony-project.com/license";}s:8:"_content";s:11:"MIT license";}s:5:"notes";s:1:"-";s:8:"contents";a:1:{s:3:"dir";a:2:{s:7:"attribs";a:1:{s:4:"name";s:1:"/";}s:4:"file";a:9:{i:0;a:1:{s:7:"attribs";a:3:{s:6:"md5sum";s:32:"40bdda4c347cc5a444d946e11f8b4a55";s:4:"name";s:25:"lib/sfAtom1Feed.class.php";s:4:"role";s:4:"data";}}i:1;a:1:{s:7:"attribs";a:3:{s:6:"md5sum";s:32:"d0c386a50c8b4a90c1ef7b700df3de7c";s:4:"name";s:20:"lib/sfFeed.class.php";s:4:"role";s:4:"data";}}i:2;a:1:{s:7:"attribs";a:3:{s:6:"md5sum";s:32:"1fefb3794c7f8ecdb52f36ed0396f107";s:4:"name";s:29:"lib/sfFeedEnclosure.class.php";s:4:"role";s:4:"data";}}i:3;a:1:{s:7:"attribs";a:3:{s:6:"md5sum";s:32:"17e3cee250509f630da2dda6d8751e9f";s:4:"name";s:24:"lib/sfFeedItem.class.php";s:4:"role";s:4:"data";}}i:4;a:1:{s:7:"attribs";a:3:{s:6:"md5sum";s:32:"daa811cb2f690d3d3a42913c6c89900a";s:4:"name";s:30:"lib/sfRss201rev2Feed.class.php";s:4:"role";s:4:"data";}}i:5;a:1:{s:7:"attribs";a:3:{s:6:"md5sum";s:32:"20d131e8ff90966cd719e433b9c530f6";s:4:"name";s:23:"lib/sfRssFeed.class.php";s:4:"role";s:4:"data";}}i:6;a:1:{s:7:"attribs";a:3:{s:6:"md5sum";s:32:"ab3eeecfa3a723640e79105f41f4439c";s:4:"name";s:34:"lib/sfRssUserland091Feed.class.php";s:4:"role";s:4:"data";}}i:7;a:1:{s:7:"attribs";a:3:{s:6:"md5sum";s:32:"0869a6ca340c91bffdfb5f05c0935061";s:4:"name";s:6:"README";s:4:"role";s:4:"data";}}i:8;a:1:{s:7:"attribs";a:3:{s:6:"md5sum";s:32:"c0ab88a4687e9ff8e0fb6c95ca49ed74";s:4:"name";s:7:"LICENSE";s:4:"role";s:4:"data";}}}}}s:12:"dependencies";a:1:{s:8:"required";a:2:{s:3:"php";a:1:{s:3:"min";s:5:"5.0.0";}s:13:"pearinstaller";a:1:{s:3:"min";s:5:"1.4.1";}}}s:10:"phprelease";s:0:"";s:9:"changelog";s:0:"";s:8:"filelist";a:9:{s:25:"lib/sfAtom1Feed.class.php";a:4:{s:6:"md5sum";s:32:"40bdda4c347cc5a444d946e11f8b4a55";s:4:"name";s:25:"lib/sfAtom1Feed.class.php";s:4:"role";s:4:"data";s:12:"installed_as";s:60:"/var/www/lsdj/plugins/sfFeedPlugin/lib/sfAtom1Feed.class.php";}s:20:"lib/sfFeed.class.php";a:4:{s:6:"md5sum";s:32:"d0c386a50c8b4a90c1ef7b700df3de7c";s:4:"name";s:20:"lib/sfFeed.class.php";s:4:"role";s:4:"data";s:12:"installed_as";s:55:"/var/www/lsdj/plugins/sfFeedPlugin/lib/sfFeed.class.php";}s:29:"lib/sfFeedEnclosure.class.php";a:4:{s:6:"md5sum";s:32:"1fefb3794c7f8ecdb52f36ed0396f107";s:4:"name";s:29:"lib/sfFeedEnclosure.class.php";s:4:"role";s:4:"data";s:12:"installed_as";s:64:"/var/www/lsdj/plugins/sfFeedPlugin/lib/sfFeedEnclosure.class.php";}s:24:"lib/sfFeedItem.class.php";a:4:{s:6:"md5sum";s:32:"17e3cee250509f630da2dda6d8751e9f";s:4:"name";s:24:"lib/sfFeedItem.class.php";s:4:"role";s:4:"data";s:12:"installed_as";s:59:"/var/www/lsdj/plugins/sfFeedPlugin/lib/sfFeedItem.class.php";}s:30:"lib/sfRss201rev2Feed.class.php";a:4:{s:6:"md5sum";s:32:"daa811cb2f690d3d3a42913c6c89900a";s:4:"name";s:30:"lib/sfRss201rev2Feed.class.php";s:4:"role";s:4:"data";s:12:"installed_as";s:65:"/var/www/lsdj/plugins/sfFeedPlugin/lib/sfRss201rev2Feed.class.php";}s:23:"lib/sfRssFeed.class.php";a:4:{s:6:"md5sum";s:32:"20d131e8ff90966cd719e433b9c530f6";s:4:"name";s:23:"lib/sfRssFeed.class.php";s:4:"role";s:4:"data";s:12:"installed_as";s:58:"/var/www/lsdj/plugins/sfFeedPlugin/lib/sfRssFeed.class.php";}s:34:"lib/sfRssUserland091Feed.class.php";a:4:{s:6:"md5sum";s:32:"ab3eeecfa3a723640e79105f41f4439c";s:4:"name";s:34:"lib/sfRssUserland091Feed.class.php";s:4:"role";s:4:"data";s:12:"installed_as";s:69:"/var/www/lsdj/plugins/sfFeedPlugin/lib/sfRssUserland091Feed.class.php";}s:6:"README";a:4:{s:6:"md5sum";s:32:"0869a6ca340c91bffdfb5f05c0935061";s:4:"name";s:6:"README";s:4:"role";s:4:"data";s:12:"installed_as";s:41:"/var/www/lsdj/plugins/sfFeedPlugin/README";}s:7:"LICENSE";a:4:{s:6:"md5sum";s:32:"c0ab88a4687e9ff8e0fb6c95ca49ed74";s:4:"name";s:7:"LICENSE";s:4:"role";s:4:"data";s:12:"installed_as";s:42:"/var/www/lsdj/plugins/sfFeedPlugin/LICENSE";}}s:12:"_lastversion";N;s:7:"dirtree";a:2:{s:38:"/var/www/lsdj/plugins/sfFeedPlugin/lib";b:1;s:34:"/var/www/lsdj/plugins/sfFeedPlugin";b:1;}s:3:"old";a:7:{s:7:"version";s:5:"1.2.2";s:12:"release_date";s:10:"2007-02-22";s:13:"release_state";s:6:"stable";s:15:"release_license";s:11:"MIT license";s:13:"release_notes";s:1:"-";s:12:"release_deps";a:2:{i:0;a:4:{s:4:"type";s:3:"php";s:3:"rel";s:2:"ge";s:7:"version";s:5:"5.0.0";s:8:"optional";s:2:"no";}i:1;a:6:{s:4:"type";s:3:"pkg";s:7:"channel";s:12:"pear.php.net";s:4:"name";s:4:"PEAR";s:3:"rel";s:2:"ge";s:7:"version";s:5:"1.4.1";s:8:"optional";s:2:"no";}}s:11:"maintainers";a:1:{i:0;a:5:{s:4:"name";s:16:"Fabien POTENCIER";s:5:"email";s:36:"fabien.potencier@symfony-project.com";s:6:"active";s:3:"yes";s:6:"handle";s:6:"fabpot";s:4:"role";s:4:"lead";}}}s:10:"xsdversion";s:3:"2.0";s:13:"_lastmodified";i:1233812307;} \ No newline at end of file diff --git a/plugins/.registry/.channel.pear.symfony-project.com/symfony.reg b/plugins/.registry/.channel.pear.symfony-project.com/symfony.reg new file mode 100644 index 0000000..4ee8737 --- /dev/null +++ b/plugins/.registry/.channel.pear.symfony-project.com/symfony.reg @@ -0,0 +1,3 @@ +a:9:{s:4:"name";s:7:"symfony";s:7:"channel";s:24:"pear.symfony-project.com";s:4:"date";s:10:"2009-02-05";s:4:"time";s:8:"05:38:24";s:7:"version";a:2:{s:7:"release";s:7:"1.0.19 +";s:3:"api";s:5:"1.0.0";}s:9:"stability";a:2:{s:7:"release";s:6:"stable";s:3:"api";s:6:"stable";}s:10:"xsdversion";s:3:"2.0";s:13:"_lastmodified";i:1233812304;s:3:"old";a:2:{s:7:"version";s:7:"1.0.19 +";s:13:"release_state";s:6:"stable";}} \ No newline at end of file diff --git a/plugins/sfFeedPlugin/LICENSE b/plugins/sfFeedPlugin/LICENSE new file mode 100644 index 0000000..28956ad --- /dev/null +++ b/plugins/sfFeedPlugin/LICENSE @@ -0,0 +1,7 @@ +Copyright (c) 2004-2006 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/plugins/sfFeedPlugin/README b/plugins/sfFeedPlugin/README new file mode 100644 index 0000000..1aa0fc6 --- /dev/null +++ b/plugins/sfFeedPlugin/README @@ -0,0 +1,19 @@ += sfFeedPlugin plugin = + +The `sfFeedPlugin` simplifies the creation of syndication feeds. + +== Installation == + + * Install the plugin + + {{{ + symfony plugin-install http://plugins.symfony-project.com/sfFeedPlugin + }}} + + * Clear you cache + + {{{ + symfony cc + }}} + + * You're done. diff --git a/plugins/sfFeedPlugin/lib/sfAtom1Feed.class.php b/plugins/sfFeedPlugin/lib/sfAtom1Feed.class.php new file mode 100644 index 0000000..53bc99e --- /dev/null +++ b/plugins/sfFeedPlugin/lib/sfAtom1Feed.class.php @@ -0,0 +1,181 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * + * Specification: http://atompub.org/2005/07/11/draft-ietf-atompub-format-10.html + * + * @package symfony + * @subpackage addon + * @author Fabien Potencier + * @version SVN: $Id: sfAtom1Feed.class.php 1951 2006-09-05 15:09:34Z fabien $ + */ +class sfAtom1Feed extends sfFeed +{ + public function getFeed() + { + header('Content-Type: application/atom+xml'); + + $xml = array(); + $xml[] = 'getEncoding().'" ?>'; + + if ($this->getLanguage()) + { + $xml[] = sprintf('', 'http://www.w3.org/2005/Atom', $this->getLanguage()); + } + else + { + $xml[] = sprintf('', 'http://www.w3.org/2005/Atom'); + } + + $xml[] = ' '.$this->getTitle().''; + $xml[] = ' '; + if ($this->getFeedUrl()) + { + $xml[] = ' '; + } + $xml[] = ' '.sfContext::getInstance()->getController()->genUrl($this->getLink(), true).''; + $xml[] = ' '.strftime('%Y-%m-%dT%H:%M:%SZ', $this->getLatestPostDate()).''; + + if ($this->getAuthorName()) + { + $xml[] = ' '; + $xml[] = ' '.$this->getAuthorName().''; + if ($this->getAuthorEmail()) + { + $xml[] = ' '.$this->getAuthorEmail().''; + } + if ($this->getAuthorLink()) + { + $xml[] = ' '.$this->getAuthorLink().''; + } + $xml[] = ' '; + } + + if ($this->getSubtitle()) + { + $xml[] = ' '.$this->getSubtitle().''; + } + + foreach ($this->getCategories() as $category) + { + $xml[] = ' '; + } + + $xml[] = $this->getFeedElements(); + + $xml[] = ''; + + return implode("\n", $xml); + } + + private function getFeedElements() + { + $xml = array(); + + foreach ($this->getItems() as $item) + { + $xml[] = ''; + $xml[] = ' '.htmlspecialchars($this->getItemFeedTitle($item)).''; + $xml[] = ' '; + if ($this->getItemFeedPubdate($item)) + { + $xml[] = ' '.strftime('%Y-%m-%dT%H:%M:%SZ', $this->getItemFeedPubdate($item)).''; + } + + // author information + if ($this->getItemFeedAuthorName($item)) + { + $xml[] = ' '; + $xml[] = ' '.$this->getItemFeedAuthorName($item).''; + if ($this->getItemFeedAuthorEmail($item)) + { + $xml[] = ' '.$this->getItemFeedAuthorEmail($item).''; + } + if ($this->getItemFeedAuthorLink($item)) + { + $xml[] = ' '.sfContext::getInstance()->getController()->genUrl($this->getItemFeedAuthorLink($item), true).''; + } + $xml[] = ' '; + } + + // unique id + if ($this->getItemFeedUniqueId($item)) + { + $uniqueId = $this->getItemFeedUniqueId($item); + } + else + { + $uniqueId = $this->getTagUri($this->getItemFeedLink($item), $this->getItemFeedPubdate($item)); + } + $xml[] = ' '.$uniqueId.''; + + // summary + if ($this->getItemFeedDescription($item)) + { + $xml[] = sprintf(' %s', htmlspecialchars($this->getItemFeedDescription($item))); + } + + // enclosure + if ((method_exists($item, 'getFeedEnclosure')) && ($enclosure = $item->getFeedEnclosure())) + { + $xml[] = sprintf(' ', $enclosure->getUrl(), $enclosure->getLength(), $enclosure->getMimeType()); + } + + // categories + foreach ($this->getItemFeedCategories($item) as $category) + { + $xml[] = ' '; + } + + $xml[] = ''; + } + + return implode("\n", $xml); + } + + // Creates a TagURI. See http://diveintomark.org/archives/2004/05/28/howto-atom-id + private function getTagUri($url, $date) + { + $tag = preg_replace('#^http\://#', '', $url); + if ($date) + { + $tag = preg_replace('#/#', ','.strftime('%Y-%m-%d', $date).':/', $tag, 1); + } + $tag = preg_replace('/#/', '/', $tag); + + return 'tag:'.$tag; + } + + private function getLatestPostDate() + { + $updates = array(); + foreach ($this->getItems() as $item) + { + if ($this->getItemFeedPubdate($item)) + { + $updates[] = $this->getItemFeedPubdate($item); + } + } + + if ($updates) + { + sort($updates); + return $updates[count($updates) - 1]; + } + else + { + return time(); + } + } + +} + +?> diff --git a/plugins/sfFeedPlugin/lib/sfFeed.class.php b/plugins/sfFeedPlugin/lib/sfFeed.class.php new file mode 100644 index 0000000..4788031 --- /dev/null +++ b/plugins/sfFeedPlugin/lib/sfFeed.class.php @@ -0,0 +1,490 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * sfFeed. + * + * based on feedgenerator.py from django project + * + * @package symfony + * @subpackage addon + * @author Fabien Potencier + * @version SVN: $Id: sfFeed.class.php 3283 2007-01-15 12:28:15Z fabien $ + */ +class sfFeed +{ + protected + $items = array(), + $title, + $link, + $description, + $language = 'en', + $authorEmail, + $authorName, + $authorLink, + $subtitle, + $categories = array(), + $feedItemsRouteName = '', + $feedUrl, + $encoding = 'UTF-8'; + + private + $context = null; + + /** + * Retrieve a new sfFeed implementation instance. + * + * @param string A sfFeed implementation name. + * + * @return sfFeed A sfFeed implementation instance. + * + * @throws sfFactoryException If a new syndication feed implementation instance cannot be created. + */ + public static function newInstance ($class) + { + try + { + $class = 'sf'.ucfirst($class).'Feed'; + + // the class exists + $object = new $class(); + + if (!($object instanceof sfFeed)) + { + // the class name is of the wrong type + $error = 'Class "%s" is not of the type sfFeed'; + $error = sprintf($error, $class); + + throw new sfFactoryException($error); + } + + $object->context = sfContext::getInstance(); + + return $object; + } + catch (sfException $e) + { + $e->printStackTrace(); + } + } + + public function addItem($item) + { + $this->items[] = $item; + } + + public function setItems($items) + { + $this->items = $items; + } + + public function getItems() + { + return $this->items; + } + + public function addItemFromArray($item_array) + { + $item = new sfFeedItem(); + + $item->setTitle(isset($item_array['title']) ? $item_array['title'] : ''); + $item->setLink(isset($item_array['link']) ? $item_array['link'] : ''); + $item->setDescription(isset($item_array['description']) ? $item_array['description'] : ''); + $item->setAuthorEmail(isset($item_array['authorEmail']) ? $item_array['authorEmail'] : ''); + $item->setAuthorName(isset($item_array['authorName']) ? $item_array['authorName'] : ''); + $item->setAuthorLink(isset($item_array['authorLink']) ? $item_array['authorLink'] : ''); + $item->setPubdate(isset($item_array['pubdate']) ? $item_array['pubdate'] : ''); + $item->setComments(isset($item_array['comments']) ? $item_array['comments'] : ''); + $item->setUniqueId(isset($item_array['uniqueId']) ? $item_array['uniqueId'] : ''); + $item->setEnclosure(isset($item_array['enclosure']) ? $item_array['enclosure'] : ''); + $item->setCategories(isset($item_array['categories']) ? $item_array['categories'] : ''); + + $this->items[] = $item; + } + + public function getFeed() + { + throw new sfException('You must use newInstance to get a real feed.'); + } + + public function setFeedItemsRouteName($routeName) + { + $this->feedItemsRouteName = $routeName; + } + + public function getFeedItemsRouteName() + { + return $this->feedItemsRouteName; + } + + public function setTitle ($title) + { + $this->title = $title; + } + + public function getTitle () + { + return $this->title; + } + + public function setLink ($link) + { + $this->link = $link; + } + + public function getLink () + { + return $this->link; + } + + public function setDescription ($description) + { + $this->description = $description; + } + + public function getDescription () + { + return $this->description; + } + + public function setLanguage ($language) + { + $this->language = $language; + } + + public function getLanguage () + { + return $this->language; + } + + public function setAuthorEmail ($authorEmail) + { + $this->authorEmail = $authorEmail; + } + + public function getAuthorEmail () + { + return $this->authorEmail; + } + + public function setAuthorName ($authorName) + { + $this->authorName = $authorName; + } + + public function getAuthorName () + { + return $this->authorName; + } + + public function setAuthorLink ($authorLink) + { + $this->authorLink = $authorLink; + } + + public function getAuthorLink () + { + return $this->authorLink; + } + + public function setSubtitle ($subtitle) + { + $this->subtitle = $subtitle; + } + + public function getSubtitle () + { + return $this->subtitle; + } + + public function setFeedUrl ($feedUrl) + { + $this->feedUrl = $feedUrl; + } + + public function getFeedUrl () + { + return $this->feedUrl; + } + + public function setCategories ($categories) + { + $this->categories = $categories; + } + + public function getCategories () + { + return $this->categories; + } + + // item feed methods + public function getItemFeedTitle ($item) + { + foreach (array('getFeedTitle', 'getTitle', 'getName', '__toString') as $methodName) + { + if (method_exists($item, $methodName)) + { + return $item->$methodName(); + } + } + + return ''; + } + + public function getItemFeedDescription ($item) + { + foreach (array('getFeedDescription', 'getDescription', 'getBody') as $methodName) + { + if (method_exists($item, $methodName)) + { + return $item->$methodName(); + } + } + + return ''; + } + + public function getItemFeedLink ($item) + { + if ($routeName = $this->getFeedItemsRouteName()) + { + $routing = sfRouting::getInstance(); + $route = $routing->getRouteByName($routeName); + + $url = $route[0]; + $defaults = $route[4]; + + // we get all parameters + $params = array(); + if (preg_match_all('/\:([^\/]+)/', $url, $matches)) + { + foreach ($matches[1] as $paramName) + { + $value = null; + $name = ucfirst(sfInflector::camelize($paramName)); + + $found = false; + foreach (array('getFeed'.$name, 'get'.$name) as $methodName) + { + if (method_exists($item, $methodName)) + { + $value = $item->$methodName(); + $found = true; + break; + } + } + + if (!$found) + { + if (array_key_exists($paramName, $defaults)) + { + $value = $defaults[$paramName]; + } + else + { + $error = 'Cannot find a "getFeed%s()" or "get%s()" method for object "%s" to generate URL with the "%s" route'; + $error = sprintf($error, $name, $name, get_class($item), $routeName); + throw new sfException($error); + } + } + + $params[] = $paramName.'='.$value; + } + } + + return $this->context->getController()->genUrl($routeName.($params ? '?'.implode('&', $params) : ''), true); + } + + foreach (array('getFeedLink', 'getLink', 'getUrl') as $methodName) + { + if (method_exists($item, $methodName)) + { + return $this->context->getController()->genUrl($item->$methodName(), true); + } + } + + if ($this->getLink()) + { + return sfContext::getInstance()->getController()->genUrl($this->getLink(), true); + } + else + { + return $this->context->getController()->genUrl('/', true); + } + } + + public function getItemFeedUniqueId ($item) + { + foreach (array('getFeedUniqueId', 'getUniqueId', 'getId') as $methodName) + { + if (method_exists($item, $methodName)) + { + return $item->$methodName(); + } + } + + return ''; + } + + public function getItemFeedAuthorEmail ($item) + { + foreach (array('getFeedAuthorEmail', 'getAuthorEmail') as $methodName) + { + if (method_exists($item, $methodName)) + { + return $item->$methodName(); + } + } + + // author as an object link + if ($author = $this->getItemFeedAuthor($item)) + { + foreach (array('getEmail', 'getMail') as $methodName) + { + if (method_exists($author, $methodName)) + { + return $author->$methodName(); + } + } + } + + return ''; + } + + public function getItemFeedAuthorName ($item) + { + foreach (array('getFeedAuthorName', 'getAuthorName') as $methodName) + { + if (method_exists($item, $methodName)) + { + return $item->$methodName(); + } + } + + // author as an object link + if ($author = $this->getItemFeedAuthor($item)) + { + foreach (array('getName', '__toString') as $methodName) + { + if (method_exists($author, $methodName)) + { + return $author->$methodName(); + } + } + } + + return ''; + } + + public function getItemFeedAuthorLink ($item) + { + foreach (array('getFeedAuthorLink', 'getAuthorLink') as $methodName) + { + if (method_exists($item, $methodName)) + { + return $item->$methodName(); + } + } + + // author as an object link + if ($author = $this->getItemFeedAuthor($item)) + { + foreach (array('getLink') as $methodName) + { + if (method_exists($author, $methodName)) + { + return $author->$methodName(); + } + } + } + + return ''; + } + + public function getItemFeedPubdate ($item) + { + foreach (array('getFeedPubdate', 'getPubdate', 'getCreatedAt', 'getDate') as $methodName) + { + if (method_exists($item, $methodName)) + { + return $item->$methodName('U'); + } + } + + return ''; + } + + public function getItemFeedComments ($item) + { + foreach (array('getFeedComments', 'getComments') as $methodName) + { + if (method_exists($item, $methodName)) + { + return $item->$methodName(); + } + } + + return ''; + } + + public function getItemFeedCategories ($item) + { + foreach (array('getFeedCategories', 'getCategories') as $methodName) + { + if (method_exists($item, $methodName) && is_object($item->$methodName())) + { + // categories as an object + $categories = $item->$methodName(); + if (is_array($categories)) + { + $cats = array(); + foreach ($categories as $category) + { + $cats[] = (string) $category; + } + + return $cats; + } + } + } + + return array(); + } + + public function getContext() + { + return $this->context; + } + + public function getEncoding() + { + return $this->encoding; + } + + public function setEncoding($encoding) + { + $this->encoding = $encoding; + } + + private function getItemFeedAuthor ($item) + { + foreach (array('getAuthor', 'getUser', 'getPerson') as $methodName) + { + if (method_exists($item, $methodName) && is_object($item->$methodName())) + { + return $item->$methodName(); + } + } + + return null; + } +} + +?> \ No newline at end of file diff --git a/plugins/sfFeedPlugin/lib/sfFeedEnclosure.class.php b/plugins/sfFeedPlugin/lib/sfFeedEnclosure.class.php new file mode 100644 index 0000000..ce3ba96 --- /dev/null +++ b/plugins/sfFeedPlugin/lib/sfFeedEnclosure.class.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * + * @package symfony + * @subpackage addon + * @author Fabien Potencier + * @version SVN: $Id: sfFeedEnclosure.class.php 1406 2006-06-09 12:55:59Z fabien $ + */ +class sfFeedEnclosure +{ + private + $url, + $length, + $mimeType; + + public function setUrl ($url) + { + $this->url = $url; + } + + public function getUrl () + { + return $this->url; + } + + public function setLength ($length) + { + $this->length = $length; + } + + public function getLength () + { + return $this->length; + } + + public function setMimeType ($mimeType) + { + $this->mimeType = $mimeType; + } + + public function getMimeType () + { + return $this->mimeType; + } +} + +?> \ No newline at end of file diff --git a/plugins/sfFeedPlugin/lib/sfFeedItem.class.php b/plugins/sfFeedPlugin/lib/sfFeedItem.class.php new file mode 100644 index 0000000..d339497 --- /dev/null +++ b/plugins/sfFeedPlugin/lib/sfFeedItem.class.php @@ -0,0 +1,144 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * + * @package symfony + * @subpackage addon + * @author Fabien Potencier + * @version SVN: $Id: sfFeedItem.class.php 1469 2006-06-16 15:32:04Z fabien $ + */ +class sfFeedItem +{ + private + $title, + $link, + $description, + $authorEmail, + $authorName, + $authorLink, + $pubdate, + $comments, + $uniqueId, + $enclosure, + $categories = array(); + + public function setTitle ($title) + { + $this->title = $title; + } + + public function getTitle () + { + return $this->title; + } + + public function setLink ($link) + { + $this->link = $link; + } + + public function getLink () + { + return $this->link; + } + + public function setDescription ($description) + { + $this->description = $description; + } + + public function getDescription () + { + return $this->description; + } + + public function setAuthorEmail ($authorEmail) + { + $this->authorEmail = $authorEmail; + } + + public function getAuthorEmail () + { + return $this->authorEmail; + } + + public function setAuthorName ($authorName) + { + $this->authorName = $authorName; + } + + public function getAuthorName () + { + return $this->authorName; + } + + public function setAuthorLink ($authorLink) + { + $this->authorLink = $authorLink; + } + + public function getAuthorLink () + { + return $this->authorLink; + } + + public function setPubdate ($pubdate) + { + $this->pubdate = $pubdate; + } + + public function getPubdate () + { + return $this->pubdate; + } + + public function setComments ($comments) + { + $this->comments = $comments; + } + + public function getComments () + { + return $this->comments; + } + + public function setUniqueId ($uniqueId) + { + $this->uniqueId = $uniqueId; + } + + public function getUniqueId () + { + return $this->uniqueId; + } + + public function setEnclosure ($enclosure) + { + $this->enclosure = $enclosure; + } + + public function getEnclosure () + { + return $this->enclosure; + } + + public function setCategories ($categories) + { + $this->categories = $categories; + } + + public function getCategories () + { + return $this->categories; + } +} + +?> \ No newline at end of file diff --git a/plugins/sfFeedPlugin/lib/sfRss201rev2Feed.class.php b/plugins/sfFeedPlugin/lib/sfRss201rev2Feed.class.php new file mode 100644 index 0000000..3db71db --- /dev/null +++ b/plugins/sfFeedPlugin/lib/sfRss201rev2Feed.class.php @@ -0,0 +1,78 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * + * Specification: http://blogs.law.harvard.edu/tech/rss + * + * @package symfony + * @subpackage addon + * @author Fabien Potencier + * @version SVN: $Id: sfRss201rev2Feed.class.php 1409 2006-06-09 13:18:11Z fabien $ + */ +class sfRss201rev2Feed extends sfRssFeed +{ + protected function getFeedElements() + { + $xml = array(); + foreach ($this->getItems() as $item) + { + $xml[] = ''; + $xml[] = ' '.htmlspecialchars($this->getItemFeedTitle($item)).''; + if ($this->getItemFeedDescription($item)) + { + $xml[] = ' '.htmlspecialchars($this->getItemFeedDescription($item)).''; + } + $xml[] = ' '.$this->getItemFeedLink($item).''; + if ($this->getItemFeedUniqueId($item)) + { + $xml[] = ' '.$this->getItemFeedUniqueId($item).''; + } + + // author information + if ($this->getItemFeedAuthorEmail($item) && $this->getItemFeedAuthorName($item)) + { + $xml[] = sprintf(' %s (%s)', $this->getItemFeedAuthorEmail($item), $this->getItemFeedAuthorName($item)); + } + if ($this->getItemFeedPubdate($item)) + { + $xml[] = ' '.date('r', $this->getItemFeedPubdate($item)).''; + } + if ($this->getItemFeedComments($item)) + { + $xml[] = ' '.htmlspecialchars($this->getItemFeedComments($item)).''; + } + + // enclosure + if ((method_exists($item, 'getFeedEnclosure')) && ($enclosure = $item->getFeedEnclosure())) + { + $enclosure_attributes = sprintf('url="%s" length="%s" type="%s"', $enclosure->getUrl(), $enclosure->getLength(), $enclosure->getMimeType()); + $xml[] = ' '; + } + + // categories + foreach ($this->getItemFeedCategories($item) as $category) + { + $xml[] = ' '.$category.''; + } + + $xml[] = ''; + } + + return $xml; + } + + protected function getVersion() + { + return '2.0'; + } +} + +?> \ No newline at end of file diff --git a/plugins/sfFeedPlugin/lib/sfRssFeed.class.php b/plugins/sfFeedPlugin/lib/sfRssFeed.class.php new file mode 100644 index 0000000..a1b8ca2 --- /dev/null +++ b/plugins/sfFeedPlugin/lib/sfRssFeed.class.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * + * @package symfony + * @subpackage addon + * @author Fabien Potencier + * @version SVN: $Id: sfRssFeed.class.php 1400 2006-06-09 11:21:30Z fabien $ + */ +abstract class sfRssFeed extends sfFeed +{ + public function getFeed() + { + $this->getContext()->getResponse()->setContentType('application/rss+xml'); + + $xml = array(); + $xml[] = 'getEncoding().'" ?>'; + $xml[] = ''; + $xml[] = ' '; + $xml[] = ' '.$this->getTitle().''; + $xml[] = ' '.sfContext::getInstance()->getController()->genUrl($this->getLink(), true).''; + $xml[] = ' '.$this->getDescription().''; + if ($this->getLanguage()) + { + $xml[] = ' '.$this->getLanguage().''; + } + $xml[] = implode("\n", $this->getFeedElements()); + $xml[] = ' '; + $xml[] = ''; + + return implode("\n", $xml); + } + + abstract protected function getFeedElements(); + + abstract protected function getVersion(); +} + +?> diff --git a/plugins/sfFeedPlugin/lib/sfRssUserland091Feed.class.php b/plugins/sfFeedPlugin/lib/sfRssUserland091Feed.class.php new file mode 100644 index 0000000..054efd4 --- /dev/null +++ b/plugins/sfFeedPlugin/lib/sfRssUserland091Feed.class.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * + * @package symfony + * @subpackage addon + * @author Fabien Potencier + * @version SVN: $Id: sfRssUserland091Feed.class.php 460 2006-01-18 14:45:19Z fabien $ + */ +class sfRssUserland091Feed extends sfRssFeed +{ + protected function getFeedElements() + { + $xml = array(); + foreach ($this->getItems() as $item) + { + $xml[] = ''; + $xml[] = ' '.htmlspecialchars($this->getItemFeedTitle($item)).''; + if ($this->getItemFeedDescription($item)) + { + $xml[] = ' '.htmlspecialchars($this->getItemFeedDescription($item)).''; + } + $xml[] = ' '.$this->getItemFeedLink($item).''; + $xml[] = ''; + } + + return $xml; + } + + protected function getVersion() + { + return '0.91'; + } +} + +?> \ No newline at end of file diff --git a/symfony b/symfony new file mode 100755 index 0000000..e69de29 diff --git a/test/bootstrap/functional.php b/test/bootstrap/functional.php new file mode 100644 index 0000000..05ea38c --- /dev/null +++ b/test/bootstrap/functional.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +// guess current application +if (!isset($app)) +{ + $traces = debug_backtrace(); + $caller = $traces[0]; + $app = array_pop(explode(DIRECTORY_SEPARATOR, dirname($caller['file']))); +} + +// define symfony constant +define('SF_ROOT_DIR', realpath(dirname(__FILE__).'/../..')); +define('SF_APP', $app); +define('SF_ENVIRONMENT', 'test'); +define('SF_DEBUG', true); + +// initialize symfony +require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php'); + +// remove all cache +sfToolkit::clearDirectory(sfConfig::get('sf_cache_dir')); diff --git a/test/bootstrap/unit.php b/test/bootstrap/unit.php new file mode 100644 index 0000000..fccb9eb --- /dev/null +++ b/test/bootstrap/unit.php @@ -0,0 +1,17 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +$_test_dir = realpath(dirname(__FILE__).'/..'); +define('SF_ROOT_DIR', realpath($_test_dir.'/..')); + +// symfony directories +include(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php'); + +require_once($sf_symfony_lib_dir.'/vendor/lime/lime.php'); diff --git a/test/functional/frontend/bankActionsTest.php b/test/functional/frontend/bankActionsTest.php new file mode 100644 index 0000000..a69023a --- /dev/null +++ b/test/functional/frontend/bankActionsTest.php @@ -0,0 +1,15 @@ +initialize(); + +$browser-> + get('/bank/index')-> + isStatusCode(200)-> + isRequestParameter('module', 'bank')-> + isRequestParameter('action', 'index')-> + checkResponseElement('body', '!/This is a temporary page/') +; diff --git a/test/functional/frontend/feedActionsTest.php b/test/functional/frontend/feedActionsTest.php new file mode 100644 index 0000000..485fd59 --- /dev/null +++ b/test/functional/frontend/feedActionsTest.php @@ -0,0 +1,15 @@ +initialize(); + +$browser-> + get('/feed/index')-> + isStatusCode(200)-> + isRequestParameter('module', 'feed')-> + isRequestParameter('action', 'index')-> + checkResponseElement('body', '!/This is a temporary page/') +; diff --git a/test/functional/frontend/instrumentActionsTest.php b/test/functional/frontend/instrumentActionsTest.php new file mode 100644 index 0000000..8d1e74e --- /dev/null +++ b/test/functional/frontend/instrumentActionsTest.php @@ -0,0 +1,15 @@ +initialize(); + +$browser-> + get('/instrument/index')-> + isStatusCode(200)-> + isRequestParameter('module', 'instrument')-> + isRequestParameter('action', 'index')-> + checkResponseElement('body', '!/This is a temporary page/') +; diff --git a/test/functional/frontend/tagActionsTest.php b/test/functional/frontend/tagActionsTest.php new file mode 100644 index 0000000..86ad4d5 --- /dev/null +++ b/test/functional/frontend/tagActionsTest.php @@ -0,0 +1,15 @@ +initialize(); + +$browser-> + get('/tag/index')-> + isStatusCode(200)-> + isRequestParameter('module', 'tag')-> + isRequestParameter('action', 'index')-> + checkResponseElement('body', '!/This is a temporary page/') +; diff --git a/test/functional/frontend/userActionsTest.php b/test/functional/frontend/userActionsTest.php new file mode 100644 index 0000000..fca0dd1 --- /dev/null +++ b/test/functional/frontend/userActionsTest.php @@ -0,0 +1,15 @@ +initialize(); + +$browser-> + get('/user/index')-> + isStatusCode(200)-> + isRequestParameter('module', 'user')-> + isRequestParameter('action', 'index')-> + checkResponseElement('body', '!/This is a temporary page/') +; diff --git a/web/.htaccess b/web/.htaccess new file mode 100644 index 0000000..e1e37e8 --- /dev/null +++ b/web/.htaccess @@ -0,0 +1,26 @@ +Options +FollowSymLinks +ExecCGI + + + RewriteEngine On + + # uncomment the following line, if you are having trouble + # getting no_script_name to work + #RewriteBase / + + # we skip all files with .something + # comment the following 3 lines to allow periods in routes + RewriteCond %{REQUEST_URI} \..+$ + RewriteCond %{REQUEST_URI} !\.html$ + RewriteRule .* - [L] + + # we check if the .html version is here (caching) + RewriteRule ^$ index.html [QSA] + RewriteRule ^([^.]+)$ $1.html [QSA] + RewriteCond %{REQUEST_FILENAME} !-f + + # no, so we redirect to our front web controller + RewriteRule ^(.*)$ index.php [QSA,L] + + +# big crash from our front web controller +ErrorDocument 500 "

    Application error

    symfony application failed to start properly" diff --git a/web/admin.php b/web/admin.php new file mode 100644 index 0000000..1526292 --- /dev/null +++ b/web/admin.php @@ -0,0 +1,10 @@ +getController()->dispatch(); diff --git a/web/backend_dev.php b/web/backend_dev.php new file mode 100644 index 0000000..ef1c27a --- /dev/null +++ b/web/backend_dev.php @@ -0,0 +1,10 @@ +getController()->dispatch(); diff --git a/web/bin/blank.sav b/web/bin/blank.sav new file mode 100644 index 0000000000000000000000000000000000000000..ee6cb2fb4ffb956314898e1d6879a06e0a3a7f97 GIT binary patch literal 131072 zcmeI)K}y3w7zWTmLAM?u;0e^~K26hHKri6Jh3;IqcBd=%-ax&AS5WXS9zeee3KbX9 zBG}{whA-1jXy-MV{)LiKYy=1pAV7cs0RjXF5FkK+K;H!3mfZf@V`F3f74(PYvE=FL zZ~_EYSYUp&(<4BD009C7ek0ISdsVZ&S51 zhX@cLK!5-N0tEUiu;Bjyw(^^C);_mE^)EkWy}9-|c}ai(0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&QTj1vT>G9$I_WJ7Lz>% literal 0 HcmV?d00001 diff --git a/web/bin/lsdj2xml b/web/bin/lsdj2xml new file mode 100755 index 0000000000000000000000000000000000000000..c8bd5687017b8c39fa1aef797a3b1e740c2298cf GIT binary patch literal 11790 zcmb_i4RBP|y+8Xw2m&Ess;E3&AQ7l$lR)^=5VF~9mei1hgaCffb(7s>w{CXV-Ma`K zi{O$eyny19H)E%~85pfPQ#xgo@zGbPX<>@KQeVd5b$qW@@qrQqeP~gs((e2H&N(-G z0euhOcxHb0|9SrB^PYRpz2^~MbEC~>6K1jthoF?)RF;x^m zMO*a-_yEVj6Qckp-~dVxq-3MBkhm5yK^tQeG9j-Zz6A+jeo?IL)cpiDU@rph2Usrc zc90U-OJF00AQQB+3}PkRiA=GDsZGNuc*iNr)G;yhO{NgVNrjIDpm zmS-umFyr3{x#n?aA^Uxzm>@(T(A$@Y2hv6`Wds5O-Q3OYohJfKt* zz-)Kb2v@19XGcGCmOCURkLm+wn!CHGDI)!#AL~;c85xRrkJnC^z>kO3am=!5djo;mZ|QMB7$J+xiGuIm``~i3DnVS** zEXo^j_Md+alS+;J7qq_w`x600J1D%Jb{$|TR?!d5S5As@Plx>s@yUG}=lrH1uGv7w;InWLN?h90XCL}%u zh7VG@5mFVUpHt#2$B2sI-H^aHvCL1v>$+?@3nTbHtFGSS+jGQs6e@A%&g>8NIM(yJ zczpq`-t`r@KC*ty#vkm-!ePA&%*$k`IYg!?+qcJ=^&Q2WJ33+g%LBeWn-N%!{Dgky zK?OQkfsm>I3mxbjWTT%#b2lF3bp!m^Zt{cVXJjQ`XV_)C?_+@JY#ZAhr1ULHYuAbrzluV2ve$zN2_n+7NJ^ZAKrAE~K+Kh_oP`5HZcr#wG|RjW@?y$|XE z-%+g+PeQdDs?#r`9lA~Z&nf;Z0;lqUr~CHmK-V+SDrNaZRmhpI(CxI|p{$?7I^Ad1 zX)!G>Ys3RO;tE;{ta%P(2W{HeN8{-WvM)Z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!}vZ2*;=0$A)muB9}wJE<1bs= zKFYmHgHCMkG4SSi+U(Z}u2cM9BVFth#TS>!MYz$-`C+q{i0dJnK zQ2uQCW1Zzpo(TJV$b4QhEbXBG0u&Ae-}lk|+{!?ayrvXY)qT zI`sEGP?q;YZ8y*5Jp-A4D7mK4{!_>`miYeynSZfO`^)s#<5vv-qmcPK(rnM`keRq{ zv-}f~dE7_Ucd~d-+s$)-7qmQE`;WmA)Z6bY#Ih&*V*j9_>FLGSfnU&HmV|{mpZTKZ0y6Zx>{qz%l)w*ZyYz?1%imo}ZKKZ!Ec$c@f2b!BYmg9_LAkc7$^c}Co6iNhoV~MU{EFgCl zfna8>z^)+~3mf5(d+vhjIU-3?g;S2$D+EHBzP@#40lt=oe0)=AZ1*hn1x$&BnS8!1 zxtWn=@iX{r{9j_N{mrfQp5_349CY}W2bO#4n|-W3+lZ}8D!49yujrR5W5yB~NESOGXOBCoy1|koE zpmg)_XI-6nqO($PBM7g{&wN^4)c=ahcg_53gM5~n%0CL~MCm2jllpvVUWq~A-#e?K zD;SNnX0SI8gwlyXBp46H!W_Upa3l3&C$Jaw>D7GxO60>vQFn{}S0!XO^VF-=F&Rvy z!%ZW<_R@ksTh!54t6Lx}x1ZSi$K&CcJVtwoIS`$Rs literal 0 HcmV?d00001 diff --git a/web/css/FamiTracker.css b/web/css/FamiTracker.css new file mode 100644 index 0000000..0d23328 --- /dev/null +++ b/web/css/FamiTracker.css @@ -0,0 +1,74 @@ +body { + background: url(/images/ft.gif) repeat !important; +} + +#header { + background: url(/images/ft-header.png) repeat !important; + border-bottom: 2px solid #cccccc; +} + +a { + border-bottom: dotted 1px #333380; + color: #000080; +} + +#container { + border: 2px solid #cccccc; +} + +#search input { + background: #BABAD6; +} + +#instrument_settings { + float: left; +} + +#sequence_editor { + float: right; +} + +#instrument_settings #editing { + margin-top: 50px; +} + +#sequence { + margin: 0 20px 0 0 !important; + height: 150px; + width: 300px; + list-style-type: none; + border: 1px solid #000055; + position: relative; + background: #999; + overflow: hidden; +} + +#sequence li { + background: #999; + border-bottom: 1px solid #FFF; +} + +#sequence .bar { + background: #198099; + border: 1px solid #105060; + border-bottom: 0px; + display: block; + position: absolute; +/* bottom: 0px; */ +} + +#test_0 { + left: 0px; + height: 35px; + width: 148px; +} + +#test_1 { + left: 150px; + height: 98px; + width: 148px; +} + +#mml { + width: 220px; +} diff --git a/web/css/LSDJ.css b/web/css/LSDJ.css new file mode 100644 index 0000000..e80a6ca --- /dev/null +++ b/web/css/LSDJ.css @@ -0,0 +1,21 @@ +body { + background: url(/images/bg.gif) repeat; +} + +#header { + background: url(/images/header.png); + border-bottom: 2px solid #fbde3f; +} + +a { + border-bottom: dotted 1px #aa4400; + color: #aa4400; +} + +#container { + border: 2px solid #fbde3f; +} + +#search input { + background: #FFEDA3; +} diff --git a/web/css/main.css b/web/css/main.css new file mode 100644 index 0000000..9cce8c5 --- /dev/null +++ b/web/css/main.css @@ -0,0 +1,423 @@ +ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,body,html,p,blockquote,fieldset,input +{ margin: 0; padding: 0; } +a img,:link img,:visited img { border: none; } + +a {text-decoration: none;} + +body { + margin: 0px; + padding: 0px; + font-family: verdana,sans-serif; +} + +fieldset { + border: none; +} + +br.clearFloat { + clear: both; +} + +#container { + width: 700px; + margin-left: auto; + margin-right: auto; + margin-top: 10px; + background: #FFF; + overflow: hidden; +} + +#header { + width: 700px; + height: 80px; +} + +#content { + font-size: 11px; + margin-top: 14px; + margin-left: 8px; + margin-right: 8px; + margin-bottom: 14px; +} + +#content p { + margin-bottom: 10px; +} + +#content h1 { + font-family: Helvetica; + margin-bottom: 6px; +} + +#content h1 span.user { + font-size:16px; +} + +#content h2 { + font-family: Helvetica; + margin-bottom: 6px; + color: #EE9E00; +} + +#content th { + border-bottom: 1px dotted black; +} + +#header ul#navigation { + list-style-type: none; + margin: 0px; + padding: 0px; + float: right; + position: relative; + left: -100px; +} + +#header ul#navigation li { + float: left; + font-family: "Helvetica Neue", "Helvetica", sans-serif; + margin-right: 10px; + font-size: 12px; + margin-top: 62px; + font-weight: bold; +} + +#header ul#navigation li.active a { + color: #0033AA; +} + +#header ul#navigation li a { + color: #000; + text-decoration: none; + border-bottom: 1px solid #FFF; + text-shadow: #DDDDDD 1px 1px; +} + +#header ul#navigation li a:hover { + border-bottom: 1px solid #000; +} + +#content ul#navigation { + text-align: center; + list-style-type: none; + font-size: 18px; + margin: 0px; + padding: 0px; +} + +#content ul#navigation li { + margin-bottom: 6px; +} + +#content ul#navigation li a { + text-decoration: none; + border-bottom: dotted 1px #aa4400; + color: #aa4400; +} + +#content ul#navigation li a:hover { + border-bottom: solid 1px #aa4400; + color: #991100; +} + +div.home_instrument ul { + list-style-type: none; + width: 690px; +} + +div.home_instrument ul li { + width: 230px; + min-height: 30px; + float: left; +} + +#search { + width: 265px; + text-align: center; + float: right; + clear: both; +} + +#search input { + color: #000; + border: 1px solid #555; + text-align: left; + font-size: 1em; + padding: 2px; + margin: 0px; +} + +#cInstrument tr th span { + color: #CC0000; +} + +#sidebar { + float: right; + width: 190px; + clear:both; +} + +ul#tags { + list-style-type: none; + width: 190px; +} + +ul#tags li { + display: inline; + font-size: 1.3em; +} + +ul#comments { + list-style-type: none; + border-bottom: 1px solid #999; +} + +ul#comments li { + border-top: 1px solid #999; + padding: 5px 10px; + min-height: 20px; +} +ul#comments li.alt { + background: #EEE; +} + +#postComment { + margin-top: 20px; + position: relative; + height: 120px; +} + +textarea#comment { + background: #CCC; + border: 1px solid #555; + width: 100%; + height: 70px; +} + +#postComment input { + position: absolute; + right: 0px; + bottom: 0px; + background: #CCC; + border: 1px solid #555; + font-weight: bold; + padding: 0 5px; +} + +div#content ol { + margin-left: 20px; +} + +.newInstrument { + font-size: 1.3em; + color: #0011EE; + float: left; +} + +.newInstrument:hover { + background: #CCC; + color: #AA4400; +} + +.instrument input, .instrument select { border: none; } /* WTSnacks Recommended */ + +td +{ + margin: 0; + padding: 0; + font-size: 11px; + background-color: #fff; +} + +body +{ + padding: 20px; +} +div.instrument, div.table { /* Keff recommended to use Verdana for this */ + float: left; + font-size: 12px; + border: 1px solid #ddd; + margin: 10px 0; + margin-right: 10px; + padding: 5px; + width: 140px; + overflow: hidden; +} + +div.instrument span, div.table span { + display: block; + padding-left: 2px; + position: relative; +} + +div.instrument em, div.instrument input, div.instrument select { + padding: 0 2px; + position: absolute;; + right: 0; + font-style: normal; + background-color: #e0e0e0; +} +div.instrument input, div.instrument select { + height: 15px; +} +div.instrument br { +} + +div.table em { + padding: 0 2px; + text-align: center; + border: 1px solid black; + background-color: #e0e0e0; + font-style: normal; +} +div#indicator +{ + position: absolute; + width: 100px; + height: 40px; + left: 10px; + top: 10px; + z-index: 900; + background: url(/images/indicator.gif) no-repeat 0 0; +} +#INST_Table { + display: none; +} +#INST_Table.table input { + width: 20px; +} + +.metainfo { + width: 100%; + float: left; + margin-bottom: 10px; + position: relative; +} + +#login-form table tr td { + font-size: 18px; + font-weight: bold; + font-family: Helvetica; +} + +#login-form input { + font-size: 14px; + padding: 4px; + margin: 4px; + font-family: Helvetica; + font-weight: bold; + border: 2px solid #FFAC0B; + width: 300px; +} + +.submit input { + font-size: 16px; + font-family: Helvetica; + font-weight: bold; + color: #0033AA; + border: none; + background: #FFFFFF; +} + +#eightbc-connect { + width: 254 px; + float: right; +} + +#eightbc-connect h1 { + font-size: 18px; + margin-bottom: 0px; +} + +#form-wrapper { + width: 420px; + float: left; +} + +#sidebar h2 { + margin-top: 10px; +} + +#sf_admin_content { + margin: 0 ! important; +} + +div.metainfo a.postComment { + position: absolute; + right: 20px; +} + +#license { + float: right; +} + +#LightBox-blackout { + position: fixed; + z-index:100; + top: 0px; + left: 0px; + background-color:#000; + filter:alpha(opacity=75); + -moz-opacity: 0.75; + opacity: 0.75; + height:100%; + width:100%; +} + +* html #LightBox-blackout { /* ie6 hack */ + position: absolute; + height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); +} + +#LightBox-wrapper { + position: fixed; + background: #ffffff; + z-index: 102; + color:#000000; + border: 4px solid #525252; + text-align:left; + display: none; + top:50%; + left:50%; + margin-left:-200px; + margin-top:-250px; +} + +* html #LightBox-wrapper { /* ie6 hack */ + position: absolute; + margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop +|| document.body.scrollTop) + 'px'); +} + +#LightBox-ajaxloader { + position: fixed; + top: 50%; + left: 50%; + margin-top:-150px; +} + +#LightBox { + border: solid 1px #ccc; + margin: 0 auto; + padding: 45px 15px 0 15px; + width: 400px; + height: 400px; + overflow:auto; + background: #333; + color:#aaa; +} + +#LightBox-wrapper a.close { + text-decoration: none; + position: absolute; + top: 0px; + font-size: 11px; + padding: 5px; + font-weight: bold; + background: #999; + width: 5em; + color: #fff; +} + +#LightBox-wrapper h2 { + text-align: right; +} diff --git a/web/errors/error500.php b/web/errors/error500.php new file mode 100644 index 0000000..e69de29 diff --git a/web/errors/unavailable.php b/web/errors/unavailable.php new file mode 100644 index 0000000..e69de29 diff --git a/web/frontend_dev.php b/web/frontend_dev.php new file mode 100644 index 0000000..27b5b58 --- /dev/null +++ b/web/frontend_dev.php @@ -0,0 +1,10 @@ +getController()->dispatch(); diff --git a/web/images/bg.gif b/web/images/bg.gif new file mode 100644 index 0000000000000000000000000000000000000000..9ad67df330ada162f557b1bc84d296b4345e7575 GIT binary patch literal 503 zcmVOVA^8LV00000EC2ui05kwJ00092 z6fT*;!rzpf@VTfCS}OF(fszN3&X)k=iJG2SvMl^cs!g4Bm~%C3h^2zO1+8a9s%|r4 zkObYCn9xhe!&L2V+zv*U+U$&xuJe>_TC2mWwV7rIsg&c&t8{+P;4zT*Bh!ZBbLS$M zb0|0_qlj1}^4Cas!Ddmhw^UbAd1c{cCo)JUL}uvrIFTlbYB^b$A)*Pw1P0g?h*%p- z+Y>0)fI-5QRh)4H{GuoJ|l$3}*_X zjr63H+8Y+coIZVuEaPx#24YJ`L;(K){{a7>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*=n;)u13?Va8V*bcka~jN8~jQ z)|N~dUS0I-DWx{V1gb6p*qXSCLi-HvbXV~mmlA$VMF>7IQmZ$ar-CVkep`j63C~CO z|7zP!+QJVS*g%Kn%nWQfm<+L6!h^3*&SCy->Vnj^`n4Yj-r&s$BWF*Z2Uj{2TFDE@ rSO-LV$@m$7my{9*x<1fY_vSX}K{}S0Mgdwq5Xjo{szsUEou~f+L(tQ% literal 0 HcmV?d00001 diff --git a/web/images/ft.gif b/web/images/ft.gif new file mode 100644 index 0000000000000000000000000000000000000000..a11cf635c203a58aa4cb28e023fd348b998c5882 GIT binary patch literal 495 zcmV_TC2mWwV7rIsg&c&t8{+P;4zT*Bh!ZBbLS$Mb0|0_qlj1} z^4Cas!Ddmhw^UbAd1c{cCo)JUL}uvrIFTlbYB^b$A)*Pw1P0g?h*%p-+Y>0)fI-5Q zRh)4H{GuoJ|l$3}*_Xjr63H+8Y+c zoIZVuEa`#$%%f4|?gocp@2R2L^ZA$}Qt4h{|>2YYKb4vv2S z_SuCO#$E?wJj&UdbhwRY__+}OaJ27jB!`7x$W^4G1IqV0(hceBhY2MjjX5~>#k-t! zw_z|C&!0VmUfcd23|w1VgRp!vTwIfrlQR3c$Ye6qrZG~a2H}oCEpn_K;`>}_s974H zpa1~Cqnihtqop9g7;4x5{hhecpaH#ghTb?rJq}-Mw4iP)sLKNCG=+duP>11lzspc9 z4^#t#UhIP!53q1LiHV8Os}oSW-nU9ws9tzvWCSAUKy`w;*Zm>9X332kP{V!*uQfkE z549>nO;XTH<)x{CjP&${XPT6{o5e*%8%^-ujKftp+?VG{b0so39FExn|6M1#P_D9z z)7q|=ef8hXr2En9HS)Ol`0Zx(Zb!#(SK;lZBZ&_m{-{;kZq?kZkxcX5KTini?XB&u z2>4Mco}Q5KrAmDVE4JNuxVfWaw_ft+A`yZ{?mc=G9v8QbmDp`ngWjBhx~-v}(@+g3 zRLcd`2|x{E5J5LK_WqALt;tf2Dzxk`yv}B|=r63;FRaL~Ci&f$M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<$`fbsaBB9&wWwe39}odA{!k)nkD3^>f&pj&Ug!83r-xPPW{DJCI+*2l8EnqBCP zIb=a0&c~E^g*YA<0o(zzV z4Up>rMCcn)TPoJv54=l{p2#1+X(}iAkrX9i5xtOyXDNE7nxJkJ;GPT}If$U@{`DSy zg2D@)npu$g2Qa;kne!&OhVH=&Vs{u{x1?KQ7E4jvTo%zKy5^ji*|VJx~J zXcJ^FPZ&ipWtfM~LZAKJ9ZMUY9c^6>$TP@oscGkBnTH|~JW4)v`CsGkZXACj$`NYE+ zKw-SSsl$iphxhhWl7?D^rb$!TconF<`V8-acs20aPKl6@hS6-kZ+CORIIdM#@+4Ks SX|U&L4hI`2>juj!_x}e^xYF(b literal 0 HcmV?d00001 diff --git a/web/images/indicator.gif b/web/images/indicator.gif new file mode 100644 index 0000000000000000000000000000000000000000..085ccaecaf5fa5c34bc14cd2c2ed5cbbd8e25dcb GIT binary patch literal 1553 zcma)+TTl~c6vwlh>nb99Af5rT)t{mCEg5urg=A(g z{C|6SPb~9Xage|wB`SrZk2FOMYM!buln2sX?5Y+T78iB(Zu9cS7|LZyZ++}u$^oi1 z_j@S}bW9OzU2R+RMy&~OT>X-oZ98$jq#ogNfJ!BM-42wHGZk*6s2KD}U*IA%epmxb zm}|6BK9YoIF;*xSL!+z@<64lB7->LTW2Vi4ostCA(z&2XniwNIv}fFo-`MbG;)u4G z^p@F!)|9HhZprHd_vXjDoxs6WkK-6P0@lfxnGT>*p(QHoUV=u1FAqb@b%*W=a3{`LsH5k^AvQNL>6fPpy#oU(&MuH(*aEX4b35*} zn4n7)`I2U%=+Z=?BVZQ?vjQFW4gD@~XSOO6b{qu81`4&LFuU2(ilxW+1|ZkNMnWe79C$gs zWT?Ele|HR{JGPe)5BTW>0Ey?-Ls6S#GoV0tbt6ku7B&*0 z;i9QM$W1Rj*rRIdceL)rAOSl+sDe3LkB87<%){;ZdHp6|SNlopDXRx< zxBDF9-lTo&v`8$humFygUij@qgT=Qzhj8{ym2-{Xciwqq_Xwk%=O3B-MNAL_6e`3U zyxwmXex4`g0^1RYw~Dth3av3Dl^AAlpO3mG!nLr#&ZZ7c_wUboI+deC+&%TFjK2Lm z!Y&f1h|T_On%RCV&=4bx`!>(YezqGVhl&QpED?N6GV)HmzJ9&rh$x*i?*@o9#6QI< z5ZI_MRX;0+pY8$`j)eF#TlUyG(eE%E7S!rj;mj^M5vhUicPm zVWQ2z+imFyg}SRABmOBY_@osR!>7Ov!ioK`NB6_Rv}7Ud?35ed5Sb@?yND?kv~RCa wqs^a3Sh>&&L4)!LKI?D2&k@))k(LESaga|C278ChSzn3NWVkcuNoY&{0f?~U_5c6? literal 0 HcmV?d00001 diff --git a/web/index.php b/web/index.php new file mode 100644 index 0000000..a72e6f1 --- /dev/null +++ b/web/index.php @@ -0,0 +1,10 @@ +getController()->dispatch(); diff --git a/web/js/FamiTracker.js b/web/js/FamiTracker.js new file mode 100644 index 0000000..3b9f1cf --- /dev/null +++ b/web/js/FamiTracker.js @@ -0,0 +1,123 @@ +var Instr = ['volume','arpeggio','pitch','hi_pitch','duty_noise']; +var InstrVal = ['','','','','']; // may be obsolete + +function FT_Init(val) { // initializes the sequencer for parsing MML + var Key = Instr.getKey(val); + + var mml = $('mml').value.split(" "); + FT_Clear(); + return mml; +} + +function FT_Clear() { // Clears sequencer data + var clearMe = $$('bar'); + if (clearMe) { + for (var i=0; i 15 || Validate({ validate: mml, is: "numeric" }) == false) mml = 15; <<< the numeric validate sux balls + if (val == "volume") { + if (mml > 15) return 15; + } + else if (val == "arpeggio" || val == "pitch" || val == "hi_pitch") { + if (mml > 126) return 126; + if (mml < -127) return -127; + } + else if (val == "duty_noise") { + if (mml > 3) return 3; + } + return mml; +} + +function FT_Duty_Noise() { + var mml = FT_Init(); +} + +function FT_Parse() { // parses the volume MML + var val = $('editing').innerHTML; + var mml = FT_Init(val); + + for(var i=0; iBy choosing to share your instrument patch you are agreeing to distribute your patch through the following license:

    Creative Commons License
    This work is licensed under a Creative Commons Attribution 3.0 Unported License.

    This basically means that you allow anyone to freely share, build upon, or modify this patch as long as there is proper attribution.

    Sharing is not mandatory and one may use this service as a private patch storage space.

    Instruments you did not author are always shared and can not be changed unless specified by the original author.

    ', + fade: true + }) +} + +Array.prototype.getKey = function (compare) { + var count = 0; + for (key in this) { + if (this[key] == compare) return count; + count++; + } +} diff --git a/web/js/swfobject.js b/web/js/swfobject.js new file mode 100644 index 0000000..e7edd42 --- /dev/null +++ b/web/js/swfobject.js @@ -0,0 +1,8 @@ +/** + * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/ + * + * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License: + * http://www.opensource.org/licenses/mit-license.php + * + */ +if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="";_19+="";var _1d=this.getParams();for(var key in _1d){_19+="";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="";}_19+="";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.majorfv.major){return true;}if(this.minorfv.minor){return true;}if(this.rev=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject; \ No newline at end of file diff --git a/web/js/turbov110.js b/web/js/turbov110.js new file mode 100644 index 0000000..139a18e --- /dev/null +++ b/web/js/turbov110.js @@ -0,0 +1 @@ +var IE=document.all?true:false;var $_SERVER=location.protocol+"//"+location.host;var TimeOuts=[];function $(A){return document.getElementById(A)?document.getElementById(A):false}function $$(G,F){var A=[];var E=new RegExp("\\b"+G+"\\b");var D=document.all;F=(!F)?document.getElementsByTagName("body")[0]:F;if(!D){D=F.getElementsByTagName("*")}for(var C=0,B=D.length;C1){return $(A[0]).getElementsByTagName(A[1])}}function include(B){var A=document.createElement("script");A.type="text/javascript";A.src=vServer+B.src;A.onload=B.run;document.getElementsByTagName("head")[0].appendChild(A)}Array.prototype.count=function(){var A=-1;for(key in this){A++}return A};function SetTimeout(C,B,A){A=(A)?A:"t"+TimeOuts.length;TimeOuts[A]=setTimeout(C,B)}function SetInterval(C,B,A){A=(A)?A:"t"+TimeOuts.length;TimeOuts[A]=setInterval(C,B)}function ClearTimeout(A){clearTimeout(TimeOuts[A])}function ClearInterval(A){clearInterval(TimeOuts[A])}function ClearAllTimeouts(){for(key in TimeOuts){clearTimeout(TimeOuts[key])}}function GenerateChr(B){B=(B)?B:32;var C="123456789@#%^! :;<>._abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";var D="";for(var A=0;AE.drop.offsetLeft&&E.drag.offsetLeft<(E.drop.offsetLeft+E.drop.offsetWidth)){if((E.drag.offsetTop+E.drag.offsetHeight)>E.drop.offsetTop&&E.drag.offsetTop<(E.drop.offsetTop+E.drop.offsetHeight)){return true}}return false}document.onmouseup=function(){if(E.onDroppable){if(C()){E.onDroppable(E.drag)}}drag[0]="";if(E.hover){E.drop.className=""}E.drag.style.zIndex=E.drag.style.zIndex-1;document.onselectstart=function(){};document.onmousedown=function(){};document.onmouseup=function(){};if(E.onDrop){E.onDrop()}};function D(){E.drag.style.top=mouse[1]+mouse[3]+"px";E.drag.style.left=mouse[0]+mouse[2]+"px";if(E.hover){if(C()){E.drop.className="hover"}else{E.drop.className=""}}if(E.limit){if(E.drag.offsetLeftE.limit[1]){E.drag.style.left=E.limit[1]+"px"}if(E.drag.offsetTopE.limit[3]){E.drag.style.top=E.limit[3]+"px"}}if(E.onDrag){E.onDrag()}}function B(){E.drag.style.left=mouse[0]+mouse[2]+"px";if(E.limit){if(E.drag.offsetLeftE.limit[1]){E.drag.style.left=E.limit[1]+"px"}}if(E.onDrag){E.onDrag()}}function A(){E.drag.style.top=mouse[1]+mouse[3]+"px";if(E.limit){if(E.drag.offsetTopE.limit[1]){E.drag.style.top=E.limit[1]+"px"}}if(E.onDrag){E.onDrag()}}}function AttachDrag(B){if(B.drag.length>0){for(var A=0;A=E.limit){ClearInterval(E.name);if(E.response){E.response()}}};var A=function(){E.opacity=E.opacity-(10+(E.opacity*0.2));if(E.SlideStyle){E.item.style.width=E.opacity+"px"}else{E.item.style.height=E.opacity+"px"}if(E.opacity<=E.limit){ClearInterval(E.name);if(E.limit===0){E.item.style.display="none"}if(E.response){E.response()}}};var C=function(){E.opacity=E.opacity+(10+(E.opacity*0.2));if(E.SlideStyle){E.item.style.width=E.opacity+"px"}else{E.item.style.height=E.opacity+"px"}if(E.opacity>=E.limit){ClearInterval(E.name);if(E.response){E.response()}}};if(E.method==="fadein"){E.limit=(!E.limit)?100:E.limit;E.opacity=(!E.opacity)?0:E.opacity;E.item.style.opacity=E.opacity/100;SetInterval(D,E.timeout,E.name)}else{if(E.method==="fadeout"){E.limit=(!E.limit)?0:E.limit;E.opacity=(!E.opacity)?100:E.opacity;E.item.style.opacity=E.opacity/100;SetInterval(B,E.timeout,E.name)}else{if(E.method==="slidein"){if(E.SlideStyle){E.opacity=(!E.opacity)?E.item.offsetWidth:E.opacity;E.item.style.width=E.opacity+"px"}else{E.opacity=(!E.opacity)?E.item.offsetHeight:E.opacity;E.item.style.height=E.opacity+"px"}E.limit=(!E.limit)?0:E.limit;SetInterval(A,E.timeout,E.name)}else{if(E.method==="slideout"){E.opacity=(!E.opacity)?0:E.opacity;if(E.SlideStyle){E.limit=(!E.limit)?E.item.childNodes[0].offsetWidth:E.limit;E.item.style.width=E.opacity+"px"}else{E.limit=(!E.limit)?E.item.childNodes[0].offsetHeight:E.limit;E.item.style.height=E.opacity+"px"}SetInterval(C,E.timeout,E.name)}}}}}function Validate(A){if(A.is==="email"){A.regxp=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/}else{if(A.is==="integer"){A.regxp=/^[-]?[0-9]+[\.]?[0-9]+$/}else{if(A.is==="numeric"){A.regxp=/^[0-9]$/}else{if(A.is==="alpha"){A.regxp=/^[A-Za-z]$/}else{if(A.is==="alphanumeric"){A.regxp=/^[A-Za-z0-9]$/}else{if(A.is==="hex")A.regxp = /^[A-F0-9]{2}$/}}}}}return A.regxp.test(A.validate)}function Accordion(D){var C=[];D.accordion.normalize();for(var A=0;A0)?D:B.knob.offsetLeft;if(B.snap){for(var C=0;CB.range[C]&&DB.list.childNodes[A].offsetTop){E=A}}B.list.insertBefore(C,B.list.childNodes[E].nextSibling)},onDrop:function(){B.list.removeChild($("SortGhost"));C.style.visibility="visible";if(B.onSort){B.onSort()}}})}}}function Tabs(D){D.tabs.normalize();var A=document.createElement("div");A.id="TabContent";document.body.insertBefore(A,D.tabs.nextSibling);var C=[];for(var B=0;B(document.body.offsetWidth-$("Tooltip").offsetWidth)){$("Tooltip").style.left=(mouse[0]-$("Tooltip").offsetWidth)+"px"}else{$("Tooltip").style.left=mouse[0]+"px"}};var A=function(){this.title=B.innerHTML;B.style.display="none";drag[0]=""};if(F.item.length>0){for(var C=0;C")!=-1){if(G==="string"){$(F.response).innerHTML=H.responseText}else{if(G==="function"){return F.response()}}}else{DisplayMessage({message:"Uploading file...",type:"ok"});SetTimeout(A,1500,"AjaxUpload")}};var A=function(){http_request({method:"get",parameters:"filedir="+F.filedir,url:"turbojs/upload.php",response:B})};var E=document.createElement("input");E.name="dirname";E.type="hidden";E.value=F.directory;F.form.appendChild(E);F.form.submit();A()}function Hover(C){var B=function(){this.style.background="#"+C.start;ClearInterval(this+this.title)};if(C.start.length==3){C.start=C.start+""+C.start}if(C.finish.length==3){C.finish=C.finish+""+C.finish}if(C.item.length>0){for(var A=0;AparseInt(F.finish,16)){F.lr=(F.fr>0)?F.fr:0;F.lg=(F.fg>0)?F.fg:0;F.lb=(F.fb>0)?F.fb:0;SetInterval(B,50,F.item+F.item.title)}else{F.lr=(F.fr<255)?F.fr:255;F.lg=(F.fg<255)?F.fg:255;F.lb=(F.fb<255)?F.fb:255;SetInterval(A,50,F.item+F.item.title)}function E(){F.start=F.r.toString(16)+F.g.toString(16)+F.b.toString(16);F.item.style.background="#"+F.start;if(F.r==F.lr&F.g==F.lg&F.b==F.lb){clearInterval(F.item+F.item.title)}}function A(){F.r+=5;F.g+=5;F.b+=5;F.r=(F.rF.lr)?F.r:F.lr;F.g=(F.g>F.lg)?F.g:F.lg;F.b=(F.b>F.lb)?F.b:F.lb;E()}}; diff --git a/web/robots.txt b/web/robots.txt new file mode 100644 index 0000000..0827227 --- /dev/null +++ b/web/robots.txt @@ -0,0 +1,2 @@ +#User-agent: * +#Disallow: diff --git a/web/swf/player.swf b/web/swf/player.swf new file mode 100644 index 0000000000000000000000000000000000000000..7a36433a8ae8c886572f82bfc7bf8cd6d1a4fef3 GIT binary patch literal 42566 zcmV)oK%BorS5pabRsjHboa}seU{uBS|DAj1-n)0RsRW3LXut@FORpjzA<0TGAv_X9 z-+Lr%HoIhHvm19el=r^x`zWF!76c3SP!yztVg>BIkwn4Xd&OR1f1fk=ZVAQr{e6G` z{-S5fnKNh3oH=vm%-q#xDYI3Q9$X-u#H7+}n-V~$G!(G{HJHVVUzfrkiX#sPpE0Y1>SJT8=UJ$?hnoy z;GN?QMk9{m`baeF_C(M1d*`P60`5rTfChi0IpCgeREFmGy(IyEvpyjd3V7W?ZE{Of zy*KPI$xH@n8D&~^l$draHM>^TU*PpbOG3e@+aL6Xwd&@uKkBuc{i5D^QKJTl%kK>| zsKsHwJCNR~quvtq`$FL+&8&hX?4GZjS6RVZ{K2SN9d*z0rXh{CM8xR!%1}$hD~g#k zXgCxIc*F6g25&$Vv#1HfR(gXi0%3Et1U*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