symfony API

sfModelGenerator Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website

« Back to API menu

1.2 API OpenSearch


You are currently browsing the symfony API for the 1.2 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

Model generator.


sfDoctrineGenerator, sfPropelGenerator  <  sfModelGenerator  <  sfGenerator

Method Summary

Methods inherited from sfGenerator

evalTemplate , generate , generatePhpFiles , getGeneratedModuleName , getGeneratorClass , getGeneratorManager , getModuleName , getTheme , initialize , replacePhpMarks , setGeneratedModuleName , setGeneratorClass , setModuleName , setTheme , __construct

Method Details

  • (string) addCredentialCondition ($content, $params = array()) Browse code

    $content The content
    $params The parameters

    Wraps content with a credential condition.

    returns HTML code

  • asPhp ($variable) Browse code


  • configure () Browse code

    Configures this generator.

  • escapeString ($string) Browse code


  • (string) generate ($params = array()) Browse code

    $params The parameters

    Generates classes and templates in cache.

    returns The data to put in configuration cache

  • getAllFieldNames () Browse code

  • (string) getColumnGetter ($column, $developed = false, $prefix = '') Browse code

    $column The column name
    $developed true if you want developped method names, false otherwise
    $prefix The prefix value

    Returns the getter either non-developped: &apos;getFoo&apos; or developped: &apos;$class-&gt;getFoo()&apos;.

    This method is ORM dependant.

    returns PHP code

  • (string) getFormMultipartHtml () Browse code

    Gets the HTML to add to the form tag if the form is multipart.

  • getFormObject () Browse code

    Gets the form object

  • (string) getI18nCatalogue () Browse code

    Gets the i18n catalogue to use for user strings.

    returns The i18n catalogue

  • (string) getI18NString ($key) Browse code

    $key The configuration key name

    Wraps a content for I18N.

    returns HTML code

  • (string) getLinkToAction ($actionName, $params, $pk_link = false) Browse code

    $actionName The action name
    $params The parameters
    $pk_link Whether to add a primary key link or not

    Returns HTML code for an action link.

    returns HTML code

  • getManyToManyTables () Browse code

  • (string) getModelClass () Browse code

    Gets the class name for current model.

  • (string) getPluralName () Browse code

    Gets the plural name for current model.

  • (array) getPrimaryKeys ((Boolean) $firstOne = false) Browse code

    $firstOne Whether to return the first PK or not

    Gets the primary key name.

    returns An array of primary keys

  • (string) getPrimaryKeyUrlParams ($prefix = '', $full = false) Browse code

    $prefix The prefix value

    Returns PHP code to add to a URL for primary keys.

    returns PHP code

  • (string) getRetrieveByPkParamsForAction ($indent, $callee) Browse code

    $indent The indentation value
    $callee The function to call

    Returns PHP code for primary keys parameters.

    returns The PHP code

  • (string) getSingularName () Browse code

    Gets the singular name for current model.

  • getType ($column) Browse code


  • (string) getUrlForAction ($action) Browse code


    Returns the URL for a given action.

    returns The URL related to a given action

  • loadConfiguration () Browse code

    Loads the configuration for this generated module.

  • (string) renderField ((sfModelGeneratorConfigurationField) $field) Browse code

    $field The field

    Returns HTML code for a field.

    returns HTML code

  • validateParameters ($params) Browse code

    $params An array of parameters

    Validates the basic structure of the parameters.