View gist:480352
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class QreddContentForm extends BaseQreddContentForm | |
{ | |
public function configure() | |
{ | |
$content_type = $this->object->getTemplate(); | |
foreach($content_type->getAdditionalFields() as $field) | |
{ |
View gist:480354
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
click('Save', array('qredd_content' => array( | |
'content_type_id' => 1, | |
'title' => 'Content sample', | |
'aggregator_id' => '0', | |
'is_active' => true, | |
)))-> | |
with('request')->begin()-> | |
isParameter('module', 'content')-> | |
isParameter('action', 'create')-> |
View gist:480384
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FIXME: workaround for lime! Lime sucks so much | |
// proper code $content_type = $this->object->getTemplate() | |
if ($this->object->isNew()) | |
{ | |
$content_type = new QreddCckTemplateFlat; | |
} | |
else | |
{ | |
$content_type = Doctrine::getTable('QreddCckTemplateFlat')->find($this->object->content_type_id); | |
} |
View gist:480386
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FIXME: workaround for lime! Lime sucks so much | |
// proper code $content_type = $this->object->getTemplate() | |
if (!$this->object->isNew()) | |
{ | |
$this->object->setTemplate(Doctrine::getTable('QreddCckTemplateFlat')->find($this->object->content_type_id)); | |
} | |
$content_type = $this->object->getTemplate(); | |
foreach($content_type->getAdditionalFields() as $field) |
View gist:500423
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: | |
doctrine: | |
class: sfDoctrineDatabase | |
param: | |
dsn: mysql:host=localhost;dbname=db | |
username: nsd | |
password: nsdtodb | |
test: | |
doctrine: |
View LOLCODE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HAI | |
CAN HAS STDIO? | |
I HAS A VAR | |
IM IN YR LOOP | |
UP VAR!!1 | |
IZ VAR BIGGER THAN 10? KTHX | |
VISIBLE VAR | |
IM OUTTA YR LOOP | |
KTHXBYE |
View gist:549183
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test: | |
doctrine: | |
class: sfDoctrineDatabase | |
param: | |
dsn: 'mysql:host=localhost; dbname=***_test' | |
username: *** | |
password: *** | |
staging: | |
doctrine: |
View gist:549195
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###### CONTROLLER | |
$this->form = new myForm(array(), array('user' => $this->getUser())); | |
###### FORM | |
public function configure() | |
{ | |
parent::configure(); |
View gist:549438
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getImage() | |
{ | |
$asset = Doctrine::gettable('Asset')->find($this->thumbnail_id); | |
if ($asset) | |
{ | |
return $asset->getId(); | |
} | |
return false; |
View gist:549473
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getAsset() | |
{ | |
return $this->getDataProperty('Asset', 1, 'file'); | |
} | |
######### In una parent | |
public function getDataproperty($model, $id, $property) | |
{ | |
$object = Doctrine::getTable($model)->find($id); |
OlderNewer