How to: Increase PHP memory limit

In the php.ini file In your php.ini file search for memory_limit property and modify it like bellow: memory_limit = 128M In the .htaccess file In your .htaccess file add the instructions bellow, changing the value for the memory (expressed in …

Read more »

How to: Use Propel addOr Function

$c = new Criteria(); $c1 = $c->getNewCriterion(TablePeer::COLUMN1, $value); $c2 = $c->getNewCriterion(TablePeer::COLUMN2, $value); $c1->addOr($c2); $c->add($c1); $results = TablePeer::doSelect($c);

Function: Check if string is numeric in Oracle

This function returns the string value as number or the second argument if the string is not a number. create or replace function f_is_numeric ( p_number varchar2, p_default number ) return number is begin return to_number(p_number); exception when others then …

Read more »

How to: Disable output escaping in action or template

Disabling escaping for action output can be done by setting the configuration value for output escaping to false as described bellow: // actions.class.php class escapedActions extends sfActions { { public function executeMyAction() { sfConfig::set(‘sf_escaping_strategy’, false); } } In the template …

Read more »

How to: Manually add symfony plugin to your project

Download plugin package Unzip package to /plugins directory Enable the plugin by hand in ProjectConfiguration.class.php as described bellow // config/ProjectConfiguration.class.php class ProjectConfiguration extends sfProjectConfiguration { public function setup() { $this->enablePlugins(‘YourPluginName’); } }

How to: Propel order by custom column

$c = new Criteria(); $c->addAsColumn(‘extra_column’,'count(‘ . TablePeer::column1 . ‘)’); $c->addAscendingOrderByColumn($c->getColumnForAs(‘extra_column’)); $c->addGroupbyColumn(TablePeer::column2); $results = TablePeer::doSelect($c);

How to: Propel select with 2 joins on the same table

$c = new Criteria(); $c->addAlias(‘alias1′, Table1Peer::TABLE_NAME); $c->addAlias(‘alias2′, Table1Peer::TABLE_NAME); $c->addJoin(Table1Peer::alias(‘alias1′, Table1Peer::FK1), Table2Peer::ID, Criteria::LEFT_JOIN); $c->addJoin(Table1Peer::alias(‘alias2′, Table1Peer::FK2), Table2Peer::ID, Criteria::LEFT_JOIN); $results = Table1Peer::doSelect($c);