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) | |
{ |
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')-> |
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); | |
} |
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) |
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: |
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 |
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: |
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(); |
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; |
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