Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class PostsController extends AppController {
- var $scaffold;
- }
- class CommentsController extends AppController {
- var $scaffold;
- }
- class Post extends AppModel {
- var $name = 'Post';
- var $hasMany = array('Comment' =>
- array('className' => 'Comment',
- 'foreignKey' => 'post_id',
- )
- );
- }
- class Comment extends AppModel {
- var $name = 'Comment';
- var $belongsTo = array('Post' =>
- array('className' => 'Post',
- 'foreignKey' => 'post_id'
- )
- );
- }
- ?>
Add Comment
Please, Sign In to add comment