|
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 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
class LocalEvent extends BaseLocalEvent |
|---|
| 8 |
{ |
|---|
| 9 |
|
|---|
| 10 |
public function __toString() |
|---|
| 11 |
{ |
|---|
| 12 |
return $this->getTitle(); |
|---|
| 13 |
} |
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
* Generates and return local event route |
|---|
| 17 |
* |
|---|
| 18 |
* @return string |
|---|
| 19 |
*/ |
|---|
| 20 |
public function getRoute() |
|---|
| 21 |
{ |
|---|
| 22 |
return sprintf('@local_event_details?year=%d&month=%s&day=%s&slug=%s', |
|---|
| 23 |
$this->getYear(), |
|---|
| 24 |
$this->getMonth(), |
|---|
| 25 |
$this->getDay(), |
|---|
| 26 |
$this->getSlug()); |
|---|
| 27 |
} |
|---|
| 28 |
|
|---|
| 29 |
public function getDay() |
|---|
| 30 |
{ |
|---|
| 31 |
return $this->getCreatedAt('d'); |
|---|
| 32 |
} |
|---|
| 33 |
|
|---|
| 34 |
public function getMonth() |
|---|
| 35 |
{ |
|---|
| 36 |
return $this->getCreatedAt('m'); |
|---|
| 37 |
} |
|---|
| 38 |
|
|---|
| 39 |
public function getYear() |
|---|
| 40 |
{ |
|---|
| 41 |
return $this->getCreatedAt('Y'); |
|---|
| 42 |
} |
|---|
| 43 |
|
|---|
| 44 |
} |
|---|
| 45 |
|
|---|
| 46 |
$columns_map = array('from' => LocalEventPeer::TITLE, |
|---|
| 47 |
'to' => LocalEventPeer::SLUG); |
|---|
| 48 |
|
|---|
| 49 |
sfPropelBehavior::add('LocalEvent', |
|---|
| 50 |
array('sfPropelActAsSluggableBehavior' => |
|---|
| 51 |
array('columns' => $columns_map, |
|---|
| 52 |
'separator' => '-', |
|---|
| 53 |
'permanent' => true))); |
|---|
| 54 |
|
|---|
| 55 |
|
|---|