|
Revision 2, 1.1 kB
(checked in by nperriault, 10 months ago)
|
First commit of the extracted code from production, I hope no passwd has been forgotten :-)
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
class EventPeer extends BaseEventPeer |
|---|
| 8 |
{ |
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
* Retrieves a source propel object |
|---|
| 12 |
* |
|---|
| 13 |
* @param string $model |
|---|
| 14 |
* @param string $slug |
|---|
| 15 |
* @return BaseObject |
|---|
| 16 |
*/ |
|---|
| 17 |
public static function retrieveSourceObject($model, $slug) |
|---|
| 18 |
{ |
|---|
| 19 |
$peer = sprintf('%sPeer', $model); |
|---|
| 20 |
if (!class_exists($model) or !class_exists($peer)) |
|---|
| 21 |
{ |
|---|
| 22 |
throw new sfException(sprintf('Class %s does not seem to be a valid event source Propel object class', $model)); |
|---|
| 23 |
} |
|---|
| 24 |
return call_user_func(array($peer, 'retrieveBySlug'), $slug); |
|---|
| 25 |
} |
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
* Retrieves a target propel object |
|---|
| 29 |
* |
|---|
| 30 |
* @param string $model |
|---|
| 31 |
* @param string $slug |
|---|
| 32 |
* @return BaseObject |
|---|
| 33 |
*/ |
|---|
| 34 |
public static function retrieveTargetObject($model, $slug) |
|---|
| 35 |
{ |
|---|
| 36 |
$peer = sprintf('%sPeer', $model); |
|---|
| 37 |
if (!class_exists($model) or !class_exists($peer)) |
|---|
| 38 |
{ |
|---|
| 39 |
throw new sfException(sprintf('Class %s does not seem to be a valid event target Propel object class', $model)); |
|---|
| 40 |
} |
|---|
| 41 |
return call_user_func(array($peer, 'retrieveBySlug'), $slug); |
|---|
| 42 |
} |
|---|
| 43 |
|
|---|
| 44 |
} |
|---|
| 45 |
|
|---|