::execute() must be compatible with that of sfComponent::execute()

This is since 1.1 or greater version of symfony:

class testAction extends sfAction{
public function execute() {

}

}

The above code will work fine for symfony 1.0, but for the versions above it; it won’t work.

Below given is the change you need to implement to make it work

class testAction extends sfAction{
public function execute($request) {

}

}

fatal error: call to a member function get children column() on a non-object

Below is given schema.yml of my project:

propel:
_attributes: {noXsd: false, defaultIdMethod: none, package: lib.model}
cms_admin:
_attributes:               { phpName: Admin, isI18N: true, i18nTable: cms_admin_i18n }
adm_id:                    { type: INTEGER, required: true, primaryKey: true, autoIncrement: true}
adm_email:                 { type: VARCHAR, size:100, required: true }
adm_passwd:                { type: VARCHAR, size:100, required: true }
adm_create_date:           { type: TIMESTAMP }
adm_last_login:            { type: TIMESTAMP }
adm_last_login_ip:         { type: VARCHAR, size:100 }

cms_admin_i18n:
_attributes:               { phpName: AdminI18n }
adm_id:                    { type: INTEGER, required: true, primaryKey: true  }
adm_culture:               { isCulture: true, type: varchar, size: 7, required:true, primaryKey: true }
adm_f_name:                { type: VARCHAR, size:100 }
adm_l_name:                { type: VARCHAR, size:100 }

when i tried to generate model with this schema.yml i throw me an error “fatal error: call to a member function getchildrencolumn() on a non-object”

but it was soon resolved. below is the changed schema.yml that generated a model without any errors:

propel:
_attributes: {noXsd: false, defaultIdMethod: none, package: lib.model}
cms_admin:
_attributes:               { phpName: Admin, isI18N: true, i18nTable: cms_admin_i18n }
adm_id:                    { type: INTEGER, required: true, primaryKey: true, autoIncrement: true}
adm_email:                 { type: VARCHAR, size:100, required: true }
adm_passwd:                { type: VARCHAR, size:100, required: true }
adm_create_date:           { type: TIMESTAMP }
adm_last_login:            { type: TIMESTAMP }
adm_last_login_ip:         { type: VARCHAR, size:100 }

cms_admin_i18n:
_attributes:               { phpName: AdminI18n }
adm_id:                    { type: INTEGER, required: true, primaryKey: true, foreignTable: cms_admin, foreignReference: adm_id }
adm_culture:               { isCulture: true, type: varchar, size: 7, required:true, primaryKey: true }
adm_f_name:                { type: VARCHAR, size:100 }
adm_l_name:                { type: VARCHAR, size:100 }

installing symfony plugins

To install any plugin in symfony you have to use command line interface. Here is an example how to install symfony plugins (here we’re using ‘sfGuardPlugin‘ installation) using command line interface:

1) Linux :   ./symfony plugin:install sfGuardPlugin

2) Windows:  php symfony plugin:install sfGuardPlugin

on windows if the php command is not executing you can check my blog for the same.

One more thing, if you are not having pear installed you won’t be able to install a symfony plugin through command line interface. In this case there is one more way to install symfony plugin which is given as below:

Download the plugin and extract it to the /plugin directory (folder) of the project. Now just run the following command from the command line interface:

1) Linux: ./symfony plugin:publish-assets

2) Windows: php symfony plugin:publish-assets

but before running this command you have to enable that plugin in the applications setting.yml file as below:

enabled_modules:        [default, sfGuardGroup, sfGuardUser, sfGuardPermission]
here we have enabled the sfGuardGroup, sfGuardUser and sfGuardPermission plugins.

hope this will help you out. if you have any doubt or query please contact me.

database connection in symfony 1.2

Propel

Propel has been upgraded to version 1.3, which replaces support for Creole with PDO.

Due to the removal of Creole, the following classes are removed:

class name equivalent
sfCreoleDatabase sfPropelDatabase
sfDebugConnection DebugPDO
sfMessageSource_Creole sfMessageSource_PDO
sfCreoleSessionStorage sfPDOSessionStorage

The propel:build-db task has been removed as this functionality is not yet provided by Propel 1.3.

The first step to upgrading is changing from Creole to PDO syntax in the database configuration from the project databases.yml file.

Locate the following:

all:
  propel:
    class:      sfPropelDatabase
    param:
      dsn:      mysql://username:password@localhost/example

Replace with the following:

dev:
  propel:
    param:
      classname: DebugPDO

test:
  propel:
    param:
      classname:  DebugPDO

all:
  propel:
    class: sfPropelDatabase
    param:
      dsn:        mysql:dbname=example;host=localhost
      username:   username
      password:   password
      encoding:   utf8
      persistent: true
      pooling:    true
      classname:  PropelPDO

Next, you must also upgrade the propel.ini with the PDO format DSN and updated configuration options.

Locate the following:

propel.database            = mysql
propel.database.createUrl  = mysql://username:password@localhost/
propel.database.url        = mysql://username:password@localhost/example

Replace with the following:

propel.database            = mysql
propel.database.driver     = mysql
propel.database.url        = mysql:dbname=example;host=localhost
propel.database.user       = username
propel.database.password   = password
propel.database.encoding   = utf8