From 904b103f8c83dcaa23f6897386f29e81e242af72 Mon Sep 17 00:00:00 2001 From: gballan1 Date: Wed, 20 Apr 2016 21:53:00 -0400 Subject: [PATCH] Added models for albums and songs --- app/Fieldprotocol/Music/Album.php | 22 ++++++++++++++++++++++ app/Fieldprotocol/Music/Song.php | 21 +++++++++++++++++++++ app/start.php | 15 +++++++++------ 3 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 app/Fieldprotocol/Music/Album.php create mode 100644 app/Fieldprotocol/Music/Song.php diff --git a/app/Fieldprotocol/Music/Album.php b/app/Fieldprotocol/Music/Album.php new file mode 100644 index 0000000..8682a9f --- /dev/null +++ b/app/Fieldprotocol/Music/Album.php @@ -0,0 +1,22 @@ +hasMany('FieldProtocol\Music\Song'); + } + +} diff --git a/app/Fieldprotocol/Music/Song.php b/app/Fieldprotocol/Music/Song.php new file mode 100644 index 0000000..e24fea9 --- /dev/null +++ b/app/Fieldprotocol/Music/Song.php @@ -0,0 +1,21 @@ +belongsTo('FieldProtocol\Music\Album'); + } + +} diff --git a/app/start.php b/app/start.php index cebf65e..e73a486 100755 --- a/app/start.php +++ b/app/start.php @@ -9,7 +9,8 @@ use Slim\Views\TwigExtension; use Noodlehaus\Config; // Our dependencies -//use Fieldprotocol\User\User; +use Fieldprotocol\Music\Album; +use FieldProtocol\Music\Song; // Let's get this session started session_cache_limiter(false); @@ -48,12 +49,14 @@ require 'routes.php'; //$app->auth = false; -$app->container->set('user', function() { - return new User; -}); +// Album singleton +$app->container->set('album', function() { + return new Album; +}) -$app->container->set('post', function() { - return new Post; +// Song singleton +$app->container->set('song', function() { + return new Song; }); // Slappin' some hoes with our views