Simple Books, Languages and connection to Users

This commit is contained in:
Marek Sebera 2013-02-26 20:45:05 +01:00
parent a3ce16c886
commit 012f8b7e7a
5 changed files with 30 additions and 1 deletions

View file

@ -0,0 +1,7 @@
<?php
class BooksController extends AppController {
var $scaffold;
}

View file

@ -0,0 +1,7 @@
<?php
class LanguagesController extends AppController {
var $scaffold;
}

7
app/Model/Book.php Normal file
View file

@ -0,0 +1,7 @@
<?php
class Book extends AppModel {
var $belongsTo = array("Language","User");
}

8
app/Model/Language.php Normal file
View file

@ -0,0 +1,8 @@
<?php
class Language extends AppModel {
var $displayField = "language";
var $hasMany = array('Book');
}

View file

@ -2,7 +2,7 @@
class User extends AppModel {
var $hasMany = array('Item');
var $hasMany = array('Item','Book');
var $order = "User.name ASC";
}