symfony API

sfClassManipulator Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.3 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.3 version. Switch to:

sfClassManipulator manipulates class code.

Method Summary

  • filterMethod($method, $callable)
    Filters each line of the given method through a callable.
  • sfClassManipulator fromFile($file)
    Creates a manipulator object from a file.
  • string getCode()
    Gets the modified code.
  • string getFile()
    Gets the associated file.
  • string getTokenValue($token)
    Returns a token's string value.
  • save()
    Saves the code back to the associated file.
  • setFile()
    Sets the file associated with this instance.
  • splitSetup()
  • wrapMethod($method, $topCode, $bottomCode)
    Wraps an existing method with some code.
  • __construct($code)
    Constructor.

Method Details

  • filterMethod ($method, $callable) Browse code

    $method The method name
    $callable A PHP callable that accepts and returns one line of PHP code

    Filters each line of the given method through a callable.

  • (sfClassManipulator) fromFile ($file) Browse code

    $file A file name

    Creates a manipulator object from a file.

    returns A sfClassManipulator instance

  • (string) getCode () Browse code

    Gets the modified code.

    returns The modified code

  • (string) getFile () Browse code

    Gets the associated file.

    returns The associated file

  • (string) getTokenValue ($token) Browse code

    Returns a token's string value.

  • save () Browse code

    Saves the code back to the associated file.


    This only works if you have bound the instance with a file with the setFile() method.

  • setFile () Browse code

    Sets the file associated with this instance.

  • splitSetup () Browse code

  • wrapMethod ($method, $topCode, $bottomCode) Browse code

    $method The method name to change
    $topCode The code to add at the top of the method
    $bottomCode The code to add at the bottom of the method

    Wraps an existing method with some code.

  • __construct ($code) Browse code

    $code The code to manipulate

    Constructor.