Class: Doctrine_Tokenizer

Source Location: /Doctrine/Tokenizer.php

Class Doctrine_Tokenizer

Class Overview

Doctrine_Tokenizer

Located in /Doctrine/Tokenizer.php [line 33]



		
				Author(s):
		
		
		
Information Tags:
Version:  $Revision: 1080 $
Link:  www.phpdoctrine.com
Since:  1.0
License:  LGPL

Methods

[ Top ]
Method Summary
static void   bracketExplode()   bracketExplode
static void   bracketTrim()   trims brackets
static array   clauseExplode()   clauseExplode
static void   quoteExplode()   quoteExplode
static array   sqlExplode()   sqlExplode
Doctrine_Tokenizer   __construct()  
void   tokenize()  

[ Top ]
Methods
static method bracketExplode  [line 79]

  static void bracketExplode( string $str, [string $d = ' '], [string $e1 = '('], [string $e2 = ')']  )

bracketExplode

example:

parameters: $str = (age < 20 AND age > 18) AND email LIKE 'John@example.com' $d = ' AND ' $e1 = '(' $e2 = ')'

would return an array: array("(age < 20 AND age > 18)", "email LIKE 'John@example.com'")

Parameters:
string   $str: 
string   $d:  the delimeter which explodes the string
string   $e1:  the first bracket, usually '('
string   $e2:  the second bracket, usually ')'

API Tags:
Access:  public


[ Top ]
static method bracketTrim  [line 50]

  static void bracketTrim( string $str, [string $e1 = '('], [string $e2 = ')']  )

trims brackets

Parameters:
string   $str: 
string   $e1:  the first bracket, usually '('
string   $e2:  the second bracket, usually ')'

API Tags:
Access:  public


[ Top ]
static method clauseExplode  [line 269]

  static array clauseExplode( string $str, $d, [string $e1 = '('], [string $e2 = ')']  )

clauseExplode

explodes a string into array using custom brackets and quote delimeters

example:

parameters: $str = "(age < 20 AND age > 18) AND name LIKE 'John Doe'" $d = ' ' $e1 = '(' $e2 = ')'

would return an array: array('(age < 20 AND age > 18)', 'name', 'LIKE', 'John Doe')

Parameters:
string   $str: 
string   $d:  the delimeter which explodes the string
string   $e1:  the first bracket, usually '('
string   $e2:  the second bracket, usually ')'

API Tags:
Access:  public


[ Top ]
static method quoteExplode  [line 126]

  static void quoteExplode( string $str, [string $d = ' ']  )

quoteExplode

example:

parameters: $str = email LIKE 'John@example.com' $d = ' AND '

would return an array: array("email", "LIKE", "'John@example.com'")

Parameters:
string   $str: 
string   $d:  the delimeter which explodes the string

API Tags:
Access:  public


[ Top ]
static method sqlExplode  [line 182]

  static array sqlExplode( string $str, [string $d = ' '], [string $e1 = '('], [string $e2 = ')']  )

sqlExplode

explodes a string into array using custom brackets and quote delimeters

example:

parameters: $str = "(age < 20 AND age > 18) AND name LIKE 'John Doe'" $d = ' ' $e1 = '(' $e2 = ')'

would return an array: array('(age < 20 AND age > 18)', 'name', 'LIKE', 'John Doe')

Parameters:
string   $str: 
string   $d:  the delimeter which explodes the string
string   $e1:  the first bracket, usually '('
string   $e2:  the second bracket, usually ')'

API Tags:
Access:  public


[ Top ]
Constructor __construct  [line 35]

  Doctrine_Tokenizer __construct( )


API Tags:
Access:  public


[ Top ]
tokenize  [line 39]

  void tokenize( )


API Tags:
Access:  public


[ Top ]