root/trunk/lib/model/BlogPost.php

Revision 48, 1.2 kB (checked in by nperriault, 6 months ago)

Upgraded scripts to use symfony 1.1, everything is broken, use with caution.

Line 
1 <?php
2 /**
3  * Subclass for representing a row from the 'blog_posts' table.
4  *
5  * @package lib.model
6  */
7 class BlogPost extends BaseBlogPost
8 {
9  
10   /**
11    * Generates and return blog post route
12    *
13    * @return string
14    */
15   public function getRoute()
16   {
17     return sprintf('@blog_post_details?year=%d&month=%s&day=%s&slug=%s',
18                    $this->getYear(),
19                    $this->getMonth(),
20                    $this->getDay(),
21                    $this->getSlug());
22   }
23  
24   public function getDay()
25   {
26     return $this->getCreatedAt('d');
27   }
28  
29   public function getMonth()
30   {
31     return $this->getCreatedAt('m');
32   }
33  
34   public function getYear()
35   {
36     return $this->getCreatedAt('Y');
37   }
38  
39 }
40
41 $columns_map = array('from' => BlogPostPeer::TITLE,
42                      'to'   => BlogPostPeer::SLUG);
43
44 sfPropelBehavior::add('BlogPost',
45                       array('sfPropelActAsSluggableBehavior' =>
46                             array('columns'   => $columns_map,
47                                   'separator' => '-',
48                                   'permanent' => true),
49                             'sfPropelActAsTaggableBehavior'));
50
51 //sfLucenePropelBehavior::getInitializer()->setupModel('BlogPost');
Note: See TracBrowser for help on using the browser.