repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
kosinix/grafika
src/Grafika/Gd/DrawingObject/Ellipse.php
Ellipse.draw
public function draw($image) { list($x, $y) = $this->pos; $left = $x + $this->width / 2; $top = $y + $this->height / 2; if( null !== $this->fillColor ){ list($r, $g, $b, $alpha) = $this->fillColor->getRgba(); $fillColorResource = imagecolorallocatealpha($ima...
php
public function draw($image) { list($x, $y) = $this->pos; $left = $x + $this->width / 2; $top = $y + $this->height / 2; if( null !== $this->fillColor ){ list($r, $g, $b, $alpha) = $this->fillColor->getRgba(); $fillColorResource = imagecolorallocatealpha($ima...
[ "public", "function", "draw", "(", "$", "image", ")", "{", "list", "(", "$", "x", ",", "$", "y", ")", "=", "$", "this", "->", "pos", ";", "$", "left", "=", "$", "x", "+", "$", "this", "->", "width", "/", "2", ";", "$", "top", "=", "$", "y...
TODO: Anti-aliased curves @param ImageInterface $image @return ImageInterface
[ "TODO", ":", "Anti", "-", "aliased", "curves" ]
train
https://github.com/kosinix/grafika/blob/211f61fc334b8b36616b23e8af7c5727971d96ee/src/Grafika/Gd/DrawingObject/Ellipse.php#L21-L41
kosinix/grafika
src/Grafika/Gd/Filter/Pixelate.php
Pixelate.apply
public function apply( $image ) { imagefilter($image->getCore(), IMG_FILTER_PIXELATE, $this->amount, true); return $image; }
php
public function apply( $image ) { imagefilter($image->getCore(), IMG_FILTER_PIXELATE, $this->amount, true); return $image; }
[ "public", "function", "apply", "(", "$", "image", ")", "{", "imagefilter", "(", "$", "image", "->", "getCore", "(", ")", ",", "IMG_FILTER_PIXELATE", ",", "$", "this", "->", "amount", ",", "true", ")", ";", "return", "$", "image", ";", "}" ]
@param Image $image @return Image
[ "@param", "Image", "$image" ]
train
https://github.com/kosinix/grafika/blob/211f61fc334b8b36616b23e8af7c5727971d96ee/src/Grafika/Gd/Filter/Pixelate.php#L32-L36
kosinix/grafika
src/Grafika/Imagick/Filter/Pixelate.php
Pixelate.apply
public function apply( $image ) { $size = $this->amount; $width = $image->getWidth(); $height = $image->getHeight(); $image->getCore()->scaleImage(max(1, ($width / $size)), max(1, ($height / $size))); $image->getCore()->scaleImage($width, $height); return $image; }
php
public function apply( $image ) { $size = $this->amount; $width = $image->getWidth(); $height = $image->getHeight(); $image->getCore()->scaleImage(max(1, ($width / $size)), max(1, ($height / $size))); $image->getCore()->scaleImage($width, $height); return $image; }
[ "public", "function", "apply", "(", "$", "image", ")", "{", "$", "size", "=", "$", "this", "->", "amount", ";", "$", "width", "=", "$", "image", "->", "getWidth", "(", ")", ";", "$", "height", "=", "$", "image", "->", "getHeight", "(", ")", ";", ...
@param Image $image @return Image
[ "@param", "Image", "$image" ]
train
https://github.com/kosinix/grafika/blob/211f61fc334b8b36616b23e8af7c5727971d96ee/src/Grafika/Imagick/Filter/Pixelate.php#L32-L40
kosinix/grafika
src/Grafika/Position.php
Position.getXY
public function getXY($canvasWidth, $canvasHeight, $imageWidth, $imageHeight){ if ( self::TOP_LEFT === $this->position) { $x = 0; $y = 0; } else if ( self::TOP_CENTER === $this->position) { $x = (int)round(($canvasWidth / 2) - ($imageWidth / 2)); $y = 0; ...
php
public function getXY($canvasWidth, $canvasHeight, $imageWidth, $imageHeight){ if ( self::TOP_LEFT === $this->position) { $x = 0; $y = 0; } else if ( self::TOP_CENTER === $this->position) { $x = (int)round(($canvasWidth / 2) - ($imageWidth / 2)); $y = 0; ...
[ "public", "function", "getXY", "(", "$", "canvasWidth", ",", "$", "canvasHeight", ",", "$", "imageWidth", ",", "$", "imageHeight", ")", "{", "if", "(", "self", "::", "TOP_LEFT", "===", "$", "this", "->", "position", ")", "{", "$", "x", "=", "0", ";",...
Translate the textual position + offsets into x,y values. @param int $canvasWidth Width of canvas. @param int $canvasHeight Height of canvas. @param int $imageWidth Width of image/object added. @param int $imageHeight Height of image/object added. @return array Array of X and Y coordinates: array($x, $y). @throws \Ex...
[ "Translate", "the", "textual", "position", "+", "offsets", "into", "x", "y", "values", "." ]
train
https://github.com/kosinix/grafika/blob/211f61fc334b8b36616b23e8af7c5727971d96ee/src/Grafika/Position.php#L86-L122
kosinix/grafika
src/Grafika/Imagick/Filter/Sobel.php
Sobel.apply
public function apply( $image ) { $pixels = array(); $finalPx = array(); // Localize vars $width = $image->getWidth(); $height = $image->getHeight(); // Loop $pixelIterator = $image->getCore()->getPixelIterator(); foreach ($pixelIterator as $y => $rows) ...
php
public function apply( $image ) { $pixels = array(); $finalPx = array(); // Localize vars $width = $image->getWidth(); $height = $image->getHeight(); // Loop $pixelIterator = $image->getCore()->getPixelIterator(); foreach ($pixelIterator as $y => $rows) ...
[ "public", "function", "apply", "(", "$", "image", ")", "{", "$", "pixels", "=", "array", "(", ")", ";", "$", "finalPx", "=", "array", "(", ")", ";", "// Localize vars", "$", "width", "=", "$", "image", "->", "getWidth", "(", ")", ";", "$", "height"...
@param Image $image @return Image
[ "@param", "Image", "$image" ]
train
https://github.com/kosinix/grafika/blob/211f61fc334b8b36616b23e8af7c5727971d96ee/src/Grafika/Imagick/Filter/Sobel.php#L20-L112
kosinix/grafika
src/Grafika/Imagick/Filter/Sobel.php
Sobel.getColor
private function getColor($px, &$pixels, $x, $y) { if (isset($pixels[$x][$y])) { return $pixels[$x][$y]; } $rgba = $px->getColor(); return $pixels[$x][$y] = round($rgba['r'] * 0.3 + $rgba['g'] * 0.59 + $rgba['b'] * 0.11); // gray }
php
private function getColor($px, &$pixels, $x, $y) { if (isset($pixels[$x][$y])) { return $pixels[$x][$y]; } $rgba = $px->getColor(); return $pixels[$x][$y] = round($rgba['r'] * 0.3 + $rgba['g'] * 0.59 + $rgba['b'] * 0.11); // gray }
[ "private", "function", "getColor", "(", "$", "px", ",", "&", "$", "pixels", ",", "$", "x", ",", "$", "y", ")", "{", "if", "(", "isset", "(", "$", "pixels", "[", "$", "x", "]", "[", "$", "y", "]", ")", ")", "{", "return", "$", "pixels", "[",...
@param \ImagickPixel $px @param array $pixels @param int $x @param int $y @return float
[ "@param", "\\", "ImagickPixel", "$px", "@param", "array", "$pixels", "@param", "int", "$x", "@param", "int", "$y" ]
train
https://github.com/kosinix/grafika/blob/211f61fc334b8b36616b23e8af7c5727971d96ee/src/Grafika/Imagick/Filter/Sobel.php#L134-L141
kosinix/grafika
src/Grafika/Gd/DrawingObject/Line.php
Line.draw
public function draw($image) { list( $x1, $y1 ) = $this->point1; list( $x2, $y2 ) = $this->point2; list( $r, $g, $b ) = $this->color->getRgb(); $color = imagecolorallocate( $image->getCore(), $r, $g, $b ); if ( function_exists( 'imageantialias' ) ) { // Not available on some...
php
public function draw($image) { list( $x1, $y1 ) = $this->point1; list( $x2, $y2 ) = $this->point2; list( $r, $g, $b ) = $this->color->getRgb(); $color = imagecolorallocate( $image->getCore(), $r, $g, $b ); if ( function_exists( 'imageantialias' ) ) { // Not available on some...
[ "public", "function", "draw", "(", "$", "image", ")", "{", "list", "(", "$", "x1", ",", "$", "y1", ")", "=", "$", "this", "->", "point1", ";", "list", "(", "$", "x2", ",", "$", "y2", ")", "=", "$", "this", "->", "point2", ";", "list", "(", ...
@param Image $image @return Image
[ "@param", "Image", "$image" ]
train
https://github.com/kosinix/grafika/blob/211f61fc334b8b36616b23e8af7c5727971d96ee/src/Grafika/Gd/DrawingObject/Line.php#L20-L33
kosinix/grafika
src/Grafika/Gd/ImageHash/DifferenceHash.php
DifferenceHash.hash
public function hash($image, $editor) { $width = 9; $height = 8; $image = clone $image; // Make sure we are working on the clone if Image is passed $editor->resizeExact($image, $width, $height); // Resize to exactly 9x8 $gd = $image->getCore(); // Build hash ...
php
public function hash($image, $editor) { $width = 9; $height = 8; $image = clone $image; // Make sure we are working on the clone if Image is passed $editor->resizeExact($image, $width, $height); // Resize to exactly 9x8 $gd = $image->getCore(); // Build hash ...
[ "public", "function", "hash", "(", "$", "image", ",", "$", "editor", ")", "{", "$", "width", "=", "9", ";", "$", "height", "=", "8", ";", "$", "image", "=", "clone", "$", "image", ";", "// Make sure we are working on the clone if Image is passed", "$", "ed...
Generate and get the difference hash of image. @param Image $image @param Editor $editor @return string
[ "Generate", "and", "get", "the", "difference", "hash", "of", "image", "." ]
train
https://github.com/kosinix/grafika/blob/211f61fc334b8b36616b23e8af7c5727971d96ee/src/Grafika/Gd/ImageHash/DifferenceHash.php#L34-L72
kosinix/grafika
doc-src/classes/DocBlock.php
DocBlock.parse_block
private function parse_block() { // split at each line foreach(preg_split("/(\r?\n)/", $this->docblock) as $line){ // if starts with an asterisk if( preg_match('/^(?=\s+?\*[^\/])(.+)/', $line, $matches) ) { $info = $matches[1]; // remove wrappin...
php
private function parse_block() { // split at each line foreach(preg_split("/(\r?\n)/", $this->docblock) as $line){ // if starts with an asterisk if( preg_match('/^(?=\s+?\*[^\/])(.+)/', $line, $matches) ) { $info = $matches[1]; // remove wrappin...
[ "private", "function", "parse_block", "(", ")", "{", "// split at each line", "foreach", "(", "preg_split", "(", "\"/(\\r?\\n)/\"", ",", "$", "this", "->", "docblock", ")", "as", "$", "line", ")", "{", "// if starts with an asterisk", "if", "(", "preg_match", "(...
Parse each line in the docblock and store the params in `$this->all_params` and the rest in `$this->description`
[ "Parse", "each", "line", "in", "the", "docblock", "and", "store", "the", "params", "in", "$this", "-", ">", "all_params", "and", "the", "rest", "in", "$this", "-", ">", "description" ]
train
https://github.com/kosinix/grafika/blob/211f61fc334b8b36616b23e8af7c5727971d96ee/doc-src/classes/DocBlock.php#L60-L100
kosinix/grafika
src/Grafika/Gd/Filter/Dither.php
Dither.diffusion
private function diffusion( $image ){ $pixel = array(); // Localize vars $width = $image->getWidth(); $height = $image->getHeight(); $old = $image->getCore(); $new = imagecreatetruecolor($width, $height); for ( $y = 0; $y < $height; $y+=1 ) { for ( ...
php
private function diffusion( $image ){ $pixel = array(); // Localize vars $width = $image->getWidth(); $height = $image->getHeight(); $old = $image->getCore(); $new = imagecreatetruecolor($width, $height); for ( $y = 0; $y < $height; $y+=1 ) { for ( ...
[ "private", "function", "diffusion", "(", "$", "image", ")", "{", "$", "pixel", "=", "array", "(", ")", ";", "// Localize vars", "$", "width", "=", "$", "image", "->", "getWidth", "(", ")", ";", "$", "height", "=", "$", "image", "->", "getHeight", "("...
Dither using error diffusion. @param Image $image @return Image
[ "Dither", "using", "error", "diffusion", "." ]
train
https://github.com/kosinix/grafika/blob/211f61fc334b8b36616b23e8af7c5727971d96ee/src/Grafika/Gd/Filter/Dither.php#L53-L126
kosinix/grafika
src/Grafika/Gd/Filter/Dither.php
Dither.ordered
private function ordered( $image ) { // Localize vars $width = $image->getWidth(); $height = $image->getHeight(); $old = $image->getCore(); $new = imagecreatetruecolor( $width, $height ); $thresholdMap = array( array( 15, 135, 45, 165 ), arra...
php
private function ordered( $image ) { // Localize vars $width = $image->getWidth(); $height = $image->getHeight(); $old = $image->getCore(); $new = imagecreatetruecolor( $width, $height ); $thresholdMap = array( array( 15, 135, 45, 165 ), arra...
[ "private", "function", "ordered", "(", "$", "image", ")", "{", "// Localize vars", "$", "width", "=", "$", "image", "->", "getWidth", "(", ")", ";", "$", "height", "=", "$", "image", "->", "getHeight", "(", ")", ";", "$", "old", "=", "$", "image", ...
Dither by applying a threshold map. @param Image $image @return Image
[ "Dither", "by", "applying", "a", "threshold", "map", "." ]
train
https://github.com/kosinix/grafika/blob/211f61fc334b8b36616b23e8af7c5727971d96ee/src/Grafika/Gd/Filter/Dither.php#L135-L189
kosinix/grafika
src/Grafika/Imagick/Filter/Blur.php
Blur.apply
public function apply( $image ) { $image->getCore()->blurImage(1 * $this->amount, 0.5 * $this->amount); return $image; }
php
public function apply( $image ) { $image->getCore()->blurImage(1 * $this->amount, 0.5 * $this->amount); return $image; }
[ "public", "function", "apply", "(", "$", "image", ")", "{", "$", "image", "->", "getCore", "(", ")", "->", "blurImage", "(", "1", "*", "$", "this", "->", "amount", ",", "0.5", "*", "$", "this", "->", "amount", ")", ";", "return", "$", "image", ";...
@param Image $image @return Image
[ "@param", "Image", "$image" ]
train
https://github.com/kosinix/grafika/blob/211f61fc334b8b36616b23e8af7c5727971d96ee/src/Grafika/Imagick/Filter/Blur.php#L32-L35
kosinix/grafika
src/Grafika/Imagick/Filter/Contrast.php
Contrast.apply
public function apply( $image ) { $image->getCore()->sigmoidalContrastImage($this->amount > 0, $this->amount / 4, 0); return $image; }
php
public function apply( $image ) { $image->getCore()->sigmoidalContrastImage($this->amount > 0, $this->amount / 4, 0); return $image; }
[ "public", "function", "apply", "(", "$", "image", ")", "{", "$", "image", "->", "getCore", "(", ")", "->", "sigmoidalContrastImage", "(", "$", "this", "->", "amount", ">", "0", ",", "$", "this", "->", "amount", "/", "4", ",", "0", ")", ";", "return...
@param Image $image @return Image
[ "@param", "Image", "$image" ]
train
https://github.com/kosinix/grafika/blob/211f61fc334b8b36616b23e8af7c5727971d96ee/src/Grafika/Imagick/Filter/Contrast.php#L32-L36
propelorm/Propel2
src/Propel/Generator/Model/PropelTypes.php
PropelTypes.isTemporalType
public static function isTemporalType($type) { return in_array($type, [ self::DATE, self::TIME, self::TIMESTAMP, self::BU_DATE, self::BU_TIMESTAMP, ]); }
php
public static function isTemporalType($type) { return in_array($type, [ self::DATE, self::TIME, self::TIMESTAMP, self::BU_DATE, self::BU_TIMESTAMP, ]); }
[ "public", "static", "function", "isTemporalType", "(", "$", "type", ")", "{", "return", "in_array", "(", "$", "type", ",", "[", "self", "::", "DATE", ",", "self", "::", "TIME", ",", "self", "::", "TIMESTAMP", ",", "self", "::", "BU_DATE", ",", "self", ...
Returns whether or not the given type is a temporal type. @param string $type @return boolean
[ "Returns", "whether", "or", "not", "the", "given", "type", "is", "a", "temporal", "type", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/PropelTypes.php#L270-L279
propelorm/Propel2
src/Propel/Generator/Model/PropelTypes.php
PropelTypes.isTextType
public static function isTextType($mappingType) { return in_array($mappingType, [ self::CHAR, self::VARCHAR, self::LONGVARCHAR, self::CLOB, self::DATE, self::TIME, self::TIMESTAMP, self::BU_DATE, self...
php
public static function isTextType($mappingType) { return in_array($mappingType, [ self::CHAR, self::VARCHAR, self::LONGVARCHAR, self::CLOB, self::DATE, self::TIME, self::TIMESTAMP, self::BU_DATE, self...
[ "public", "static", "function", "isTextType", "(", "$", "mappingType", ")", "{", "return", "in_array", "(", "$", "mappingType", ",", "[", "self", "::", "CHAR", ",", "self", "::", "VARCHAR", ",", "self", "::", "LONGVARCHAR", ",", "self", "::", "CLOB", ","...
Returns whether or not the given type is a text type. @param string $mappingType @return boolean
[ "Returns", "whether", "or", "not", "the", "given", "type", "is", "a", "text", "type", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/PropelTypes.php#L287-L301
propelorm/Propel2
src/Propel/Generator/Model/PropelTypes.php
PropelTypes.isNumericType
public static function isNumericType($mappingType) { return in_array($mappingType, [ self::SMALLINT, self::TINYINT, self::INTEGER, self::BIGINT, self::FLOAT, self::DOUBLE, self::NUMERIC, self::DECIMAL, ...
php
public static function isNumericType($mappingType) { return in_array($mappingType, [ self::SMALLINT, self::TINYINT, self::INTEGER, self::BIGINT, self::FLOAT, self::DOUBLE, self::NUMERIC, self::DECIMAL, ...
[ "public", "static", "function", "isNumericType", "(", "$", "mappingType", ")", "{", "return", "in_array", "(", "$", "mappingType", ",", "[", "self", "::", "SMALLINT", ",", "self", "::", "TINYINT", ",", "self", "::", "INTEGER", ",", "self", "::", "BIGINT", ...
Returns whether or not the given type is a numeric type. @param string $mappingType @return boolean
[ "Returns", "whether", "or", "not", "the", "given", "type", "is", "a", "numeric", "type", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/PropelTypes.php#L309-L322
propelorm/Propel2
src/Propel/Generator/Model/PropelTypes.php
PropelTypes.isLobType
public static function isLobType($mappingType) { return in_array($mappingType, [ self::VARBINARY, self::LONGVARBINARY, self::BLOB, self::OBJECT, self::GEOMETRY ]); }
php
public static function isLobType($mappingType) { return in_array($mappingType, [ self::VARBINARY, self::LONGVARBINARY, self::BLOB, self::OBJECT, self::GEOMETRY ]); }
[ "public", "static", "function", "isLobType", "(", "$", "mappingType", ")", "{", "return", "in_array", "(", "$", "mappingType", ",", "[", "self", "::", "VARBINARY", ",", "self", "::", "LONGVARBINARY", ",", "self", "::", "BLOB", ",", "self", "::", "OBJECT", ...
Returns whether or not this column is a lob/blob type. @param string $mappingType @return boolean
[ "Returns", "whether", "or", "not", "this", "column", "is", "a", "lob", "/", "blob", "type", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/PropelTypes.php#L341-L344
propelorm/Propel2
src/Propel/Runtime/Parser/AbstractParser.php
AbstractParser.load
public function load($path) { if (!file_exists($path)) { throw new FileNotFoundException(sprintf('File "%s" does not exist or is unreadable', $path)); } ob_start(); include $path; $contents = ob_get_clean(); return $contents; }
php
public function load($path) { if (!file_exists($path)) { throw new FileNotFoundException(sprintf('File "%s" does not exist or is unreadable', $path)); } ob_start(); include $path; $contents = ob_get_clean(); return $contents; }
[ "public", "function", "load", "(", "$", "path", ")", "{", "if", "(", "!", "file_exists", "(", "$", "path", ")", ")", "{", "throw", "new", "FileNotFoundException", "(", "sprintf", "(", "'File \"%s\" does not exist or is unreadable'", ",", "$", "path", ")", ")...
Loads data from a file. Executes PHP code blocks in the file. @param string $path Path to the file to load @return string The file content processed by PHP
[ "Loads", "data", "from", "a", "file", ".", "Executes", "PHP", "code", "blocks", "in", "the", "file", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Parser/AbstractParser.php#L64-L75
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.getParentClass
public function getParentClass() { $parentClass = $this->getBehaviorContent('parentClass'); return null === $parentClass ? ($this->getTable()->getBaseQueryClass() != "" ? $this->getTable()->getBaseQueryClass() : 'ModelCriteria') : $parentClass; }
php
public function getParentClass() { $parentClass = $this->getBehaviorContent('parentClass'); return null === $parentClass ? ($this->getTable()->getBaseQueryClass() != "" ? $this->getTable()->getBaseQueryClass() : 'ModelCriteria') : $parentClass; }
[ "public", "function", "getParentClass", "(", ")", "{", "$", "parentClass", "=", "$", "this", "->", "getBehaviorContent", "(", "'parentClass'", ")", ";", "return", "null", "===", "$", "parentClass", "?", "(", "$", "this", "->", "getTable", "(", ")", "->", ...
Returns parent class name that extends TableQuery Object if is set this class must extends ModelCriteria for be compatible @return string
[ "Returns", "parent", "class", "name", "that", "extends", "TableQuery", "Object", "if", "is", "set", "this", "class", "must", "extends", "ModelCriteria", "for", "be", "compatible" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L66-L70
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addClassOpen
protected function addClassOpen(&$script) { $table = $this->getTable(); $tableName = $table->getName(); $tableDesc = $table->getDescription(); $queryClass = $this->getQueryClassName(); $modelClass = $this->getObjectClassName(); $parentClass = $this->getParentClass(); ...
php
protected function addClassOpen(&$script) { $table = $this->getTable(); $tableName = $table->getName(); $tableDesc = $table->getDescription(); $queryClass = $this->getQueryClassName(); $modelClass = $this->getObjectClassName(); $parentClass = $this->getParentClass(); ...
[ "protected", "function", "addClassOpen", "(", "&", "$", "script", ")", "{", "$", "table", "=", "$", "this", "->", "getTable", "(", ")", ";", "$", "tableName", "=", "$", "table", "->", "getName", "(", ")", ";", "$", "tableDesc", "=", "$", "table", "...
Adds class phpdoc comment and opening of class. @param string &$script The script will be modified in this method.
[ "Adds", "class", "phpdoc", "comment", "and", "opening", "of", "class", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L76-L221
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addClassBody
protected function addClassBody(&$script) { $table = $this->getTable(); // namespaces $this->declareClasses( '\Propel\Runtime\Propel', '\Propel\Runtime\ActiveQuery\ModelCriteria', '\Propel\Runtime\ActiveQuery\Criteria', '\Propel\Runtime\Active...
php
protected function addClassBody(&$script) { $table = $this->getTable(); // namespaces $this->declareClasses( '\Propel\Runtime\Propel', '\Propel\Runtime\ActiveQuery\ModelCriteria', '\Propel\Runtime\ActiveQuery\Criteria', '\Propel\Runtime\Active...
[ "protected", "function", "addClassBody", "(", "&", "$", "script", ")", "{", "$", "table", "=", "$", "this", "->", "getTable", "(", ")", ";", "// namespaces", "$", "this", "->", "declareClasses", "(", "'\\Propel\\Runtime\\Propel'", ",", "'\\Propel\\Runtime\\Activ...
Specifies the methods that are added as part of the stub object class. By default there are no methods for the empty stub classes; override this method if you want to change that behavior. @see ObjectBuilder::addClassBody()
[ "Specifies", "the", "methods", "that", "are", "added", "as", "part", "of", "the", "stub", "object", "class", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L231-L299
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addDeleteMethods
protected function addDeleteMethods(&$script) { $this->addDoDeleteAll($script); $this->addDelete($script); if ($this->isDeleteCascadeEmulationNeeded()) { $this->addDoOnDeleteCascade($script); } if ($this->isDeleteSetNullEmulationNeeded()) { $this->ad...
php
protected function addDeleteMethods(&$script) { $this->addDoDeleteAll($script); $this->addDelete($script); if ($this->isDeleteCascadeEmulationNeeded()) { $this->addDoOnDeleteCascade($script); } if ($this->isDeleteSetNullEmulationNeeded()) { $this->ad...
[ "protected", "function", "addDeleteMethods", "(", "&", "$", "script", ")", "{", "$", "this", "->", "addDoDeleteAll", "(", "$", "script", ")", ";", "$", "this", "->", "addDelete", "(", "$", "script", ")", ";", "if", "(", "$", "this", "->", "isDeleteCasc...
Adds the doDeleteAll(), etc. methods. @param string &$script The script will be modified in this method.
[ "Adds", "the", "doDeleteAll", "()", "etc", ".", "methods", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L319-L331
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.isDeleteCascadeEmulationNeeded
protected function isDeleteCascadeEmulationNeeded() { $table = $this->getTable(); if ((!$this->getPlatform()->supportsNativeDeleteTrigger() || $this->getBuildProperty('generator.objectModel.emulateForeignKeyConstraints')) && count($table->getReferrers()) > 0) { foreach ($table->getReferr...
php
protected function isDeleteCascadeEmulationNeeded() { $table = $this->getTable(); if ((!$this->getPlatform()->supportsNativeDeleteTrigger() || $this->getBuildProperty('generator.objectModel.emulateForeignKeyConstraints')) && count($table->getReferrers()) > 0) { foreach ($table->getReferr...
[ "protected", "function", "isDeleteCascadeEmulationNeeded", "(", ")", "{", "$", "table", "=", "$", "this", "->", "getTable", "(", ")", ";", "if", "(", "(", "!", "$", "this", "->", "getPlatform", "(", ")", "->", "supportsNativeDeleteTrigger", "(", ")", "||",...
Whether the platform in use requires ON DELETE CASCADE emulation and whether there are references to this table. @return boolean
[ "Whether", "the", "platform", "in", "use", "requires", "ON", "DELETE", "CASCADE", "emulation", "and", "whether", "there", "are", "references", "to", "this", "table", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L337-L349
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.isDeleteSetNullEmulationNeeded
protected function isDeleteSetNullEmulationNeeded() { $table = $this->getTable(); if ((!$this->getPlatform()->supportsNativeDeleteTrigger() || $this->getBuildProperty('generator.objectModel.emulateForeignKeyConstraints')) && count($table->getReferrers()) > 0) { foreach ($table->getReferr...
php
protected function isDeleteSetNullEmulationNeeded() { $table = $this->getTable(); if ((!$this->getPlatform()->supportsNativeDeleteTrigger() || $this->getBuildProperty('generator.objectModel.emulateForeignKeyConstraints')) && count($table->getReferrers()) > 0) { foreach ($table->getReferr...
[ "protected", "function", "isDeleteSetNullEmulationNeeded", "(", ")", "{", "$", "table", "=", "$", "this", "->", "getTable", "(", ")", ";", "if", "(", "(", "!", "$", "this", "->", "getPlatform", "(", ")", "->", "supportsNativeDeleteTrigger", "(", ")", "||",...
Whether the platform in use requires ON DELETE SETNULL emulation and whether there are references to this table. @return boolean
[ "Whether", "the", "platform", "in", "use", "requires", "ON", "DELETE", "SETNULL", "emulation", "and", "whether", "there", "are", "references", "to", "this", "table", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L355-L367
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addConstructor
protected function addConstructor(&$script) { $this->addConstructorComment($script); $this->addConstructorOpen($script); $this->addConstructorBody($script); $this->addConstructorClose($script); }
php
protected function addConstructor(&$script) { $this->addConstructorComment($script); $this->addConstructorOpen($script); $this->addConstructorBody($script); $this->addConstructorClose($script); }
[ "protected", "function", "addConstructor", "(", "&", "$", "script", ")", "{", "$", "this", "->", "addConstructorComment", "(", "$", "script", ")", ";", "$", "this", "->", "addConstructorOpen", "(", "$", "script", ")", ";", "$", "this", "->", "addConstructo...
Adds the constructor for this object. @param string &$script The script will be modified in this method. @see addConstructor()
[ "Adds", "the", "constructor", "for", "this", "object", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L386-L392
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addConstructorOpen
protected function addConstructorOpen(&$script) { $table = $this->getTable(); $script .= " public function __construct(\$dbName = '" . $table->getDatabase()->getName() . "', \$modelName = '" . addslashes($this->getNewStubObjectBuilder($table)->getFullyQualifiedClassName()) . "', \$modelAlias = n...
php
protected function addConstructorOpen(&$script) { $table = $this->getTable(); $script .= " public function __construct(\$dbName = '" . $table->getDatabase()->getName() . "', \$modelName = '" . addslashes($this->getNewStubObjectBuilder($table)->getFullyQualifiedClassName()) . "', \$modelAlias = n...
[ "protected", "function", "addConstructorOpen", "(", "&", "$", "script", ")", "{", "$", "table", "=", "$", "this", "->", "getTable", "(", ")", ";", "$", "script", ".=", "\"\n public function __construct(\\$dbName = '\"", ".", "$", "table", "->", "getDatabase",...
Adds the function declaration for the constructor @param string &$script The script will be modified in this method.
[ "Adds", "the", "function", "declaration", "for", "the", "constructor" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L414-L420
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addFactory
protected function addFactory(&$script) { $this->addFactoryComment($script); $this->addFactoryOpen($script); $this->addFactoryBody($script); $this->addFactoryClose($script); }
php
protected function addFactory(&$script) { $this->addFactoryComment($script); $this->addFactoryOpen($script); $this->addFactoryBody($script); $this->addFactoryClose($script); }
[ "protected", "function", "addFactory", "(", "&", "$", "script", ")", "{", "$", "this", "->", "addFactoryComment", "(", "$", "script", ")", ";", "$", "this", "->", "addFactoryOpen", "(", "$", "script", ")", ";", "$", "this", "->", "addFactoryBody", "(", ...
Adds the factory for this object. @param string &$script The script will be modified in this method.
[ "Adds", "the", "factory", "for", "this", "object", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L447-L453
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addFactoryComment
protected function addFactoryComment(&$script) { $classname = $this->getClassNameFromBuilder($this->getNewStubQueryBuilder($this->getTable())); $script .= " /** * Returns a new " . $classname . " object. * * @param string \$modelAlias The alias of a model in the query * @...
php
protected function addFactoryComment(&$script) { $classname = $this->getClassNameFromBuilder($this->getNewStubQueryBuilder($this->getTable())); $script .= " /** * Returns a new " . $classname . " object. * * @param string \$modelAlias The alias of a model in the query * @...
[ "protected", "function", "addFactoryComment", "(", "&", "$", "script", ")", "{", "$", "classname", "=", "$", "this", "->", "getClassNameFromBuilder", "(", "$", "this", "->", "getNewStubQueryBuilder", "(", "$", "this", "->", "getTable", "(", ")", ")", ")", ...
Adds the comment for the factory @param string &$script The script will be modified in this method.
[ "Adds", "the", "comment", "for", "the", "factory" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L459-L471
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addFactoryBody
protected function addFactoryBody(&$script) { $classname = $this->getClassNameFromBuilder($this->getNewStubQueryBuilder($this->getTable())); $script .= " if (\$criteria instanceof " . $classname . ") { return \$criteria; } \$query = new " . $classname . "(); ...
php
protected function addFactoryBody(&$script) { $classname = $this->getClassNameFromBuilder($this->getNewStubQueryBuilder($this->getTable())); $script .= " if (\$criteria instanceof " . $classname . ") { return \$criteria; } \$query = new " . $classname . "(); ...
[ "protected", "function", "addFactoryBody", "(", "&", "$", "script", ")", "{", "$", "classname", "=", "$", "this", "->", "getClassNameFromBuilder", "(", "$", "this", "->", "getNewStubQueryBuilder", "(", "$", "this", "->", "getTable", "(", ")", ")", ")", ";"...
Adds the function body for the factory @param string &$script The script will be modified in this method.
[ "Adds", "the", "function", "body", "for", "the", "factory" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L488-L504
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addFindPkComplex
protected function addFindPkComplex(&$script) { $class = $this->getObjectClassName(); $table = $this->getTable(); // this method is not needed if the table has no primary key if (!$table->hasPrimaryKey()) { return ''; } $this->declareClasses('\Propel\Run...
php
protected function addFindPkComplex(&$script) { $class = $this->getObjectClassName(); $table = $this->getTable(); // this method is not needed if the table has no primary key if (!$table->hasPrimaryKey()) { return ''; } $this->declareClasses('\Propel\Run...
[ "protected", "function", "addFindPkComplex", "(", "&", "$", "script", ")", "{", "$", "class", "=", "$", "this", "->", "getObjectClassName", "(", ")", ";", "$", "table", "=", "$", "this", "->", "getTable", "(", ")", ";", "// this method is not needed if the t...
Adds the findPk method for this object. @param string &$script The script will be modified in this method.
[ "Adds", "the", "findPk", "method", "for", "this", "object", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L705-L736
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addFindPks
protected function addFindPks(&$script) { $this->declareClasses( '\Propel\Runtime\Collection\ObjectCollection', '\Propel\Runtime\Connection\ConnectionInterface', '\Propel\Runtime\Propel' ); $table = $this->getTable(); $pks = $table->getPrimaryKey()...
php
protected function addFindPks(&$script) { $this->declareClasses( '\Propel\Runtime\Collection\ObjectCollection', '\Propel\Runtime\Connection\ConnectionInterface', '\Propel\Runtime\Propel' ); $table = $this->getTable(); $pks = $table->getPrimaryKey()...
[ "protected", "function", "addFindPks", "(", "&", "$", "script", ")", "{", "$", "this", "->", "declareClasses", "(", "'\\Propel\\Runtime\\Collection\\ObjectCollection'", ",", "'\\Propel\\Runtime\\Connection\\ConnectionInterface'", ",", "'\\Propel\\Runtime\\Propel'", ")", ";", ...
Adds the findPks method for this object. @param string &$script The script will be modified in this method.
[ "Adds", "the", "findPks", "method", "for", "this", "object", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L742-L795
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addFilterByPrimaryKey
protected function addFilterByPrimaryKey(&$script) { $script .= " /** * Filter the query by primary key * * @param mixed \$key Primary key to use for the query * * @return \$this|" . $this->getQueryClassName() . " The current query, for fluid interface */ public fun...
php
protected function addFilterByPrimaryKey(&$script) { $script .= " /** * Filter the query by primary key * * @param mixed \$key Primary key to use for the query * * @return \$this|" . $this->getQueryClassName() . " The current query, for fluid interface */ public fun...
[ "protected", "function", "addFilterByPrimaryKey", "(", "&", "$", "script", ")", "{", "$", "script", ".=", "\"\n /**\n * Filter the query by primary key\n *\n * @param mixed \\$key Primary key to use for the query\n *\n * @return \\$this|\"", ".", "$", "this",...
Adds the filterByPrimaryKey method for this object. @param string &$script The script will be modified in this method.
[ "Adds", "the", "filterByPrimaryKey", "method", "for", "this", "object", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L801-L849
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addFilterByCol
protected function addFilterByCol(&$script, Column $col) { $colPhpName = $col->getPhpName(); $colName = $col->getName(); $variableName = $col->getCamelCaseName(); $qualifiedName = $this->getColumnConstant($col); $script .= " /** * Filter the query on the $colName col...
php
protected function addFilterByCol(&$script, Column $col) { $colPhpName = $col->getPhpName(); $colName = $col->getName(); $variableName = $col->getCamelCaseName(); $qualifiedName = $this->getColumnConstant($col); $script .= " /** * Filter the query on the $colName col...
[ "protected", "function", "addFilterByCol", "(", "&", "$", "script", ",", "Column", "$", "col", ")", "{", "$", "colPhpName", "=", "$", "col", "->", "getPhpName", "(", ")", ";", "$", "colName", "=", "$", "col", "->", "getName", "(", ")", ";", "$", "v...
Adds the filterByCol method for this object. @param string &$script The script will be modified in this method. @param Column $col
[ "Adds", "the", "filterByCol", "method", "for", "this", "object", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L923-L1137
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addFilterByArrayCol
protected function addFilterByArrayCol(&$script, Column $col) { $colPhpName = $col->getPhpName(); $singularPhpName = $col->getPhpSingularName(); $colName = $col->getName(); $variableName = $col->getCamelCaseName(); $qualifiedName = $this->getColumnConstant($col); $scr...
php
protected function addFilterByArrayCol(&$script, Column $col) { $colPhpName = $col->getPhpName(); $singularPhpName = $col->getPhpSingularName(); $colName = $col->getName(); $variableName = $col->getCamelCaseName(); $qualifiedName = $this->getColumnConstant($col); $scr...
[ "protected", "function", "addFilterByArrayCol", "(", "&", "$", "script", ",", "Column", "$", "col", ")", "{", "$", "colPhpName", "=", "$", "col", "->", "getPhpName", "(", ")", ";", "$", "singularPhpName", "=", "$", "col", "->", "getPhpSingularName", "(", ...
Adds the singular filterByCol method for an Array column. @param string &$script The script will be modified in this method. @param Column $col
[ "Adds", "the", "singular", "filterByCol", "method", "for", "an", "Array", "column", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L1144-L1183
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addFilterBySetCol
protected function addFilterBySetCol(&$script, Column $col) { $colPhpName = $col->getPhpName(); $singularPhpName = $col->getPhpSingularName(); $colName = $col->getName(); $variableName = $col->getCamelCaseName(); $script .= " /** * Filter the query on the $colName co...
php
protected function addFilterBySetCol(&$script, Column $col) { $colPhpName = $col->getPhpName(); $singularPhpName = $col->getPhpSingularName(); $colName = $col->getName(); $variableName = $col->getCamelCaseName(); $script .= " /** * Filter the query on the $colName co...
[ "protected", "function", "addFilterBySetCol", "(", "&", "$", "script", ",", "Column", "$", "col", ")", "{", "$", "colPhpName", "=", "$", "col", "->", "getPhpName", "(", ")", ";", "$", "singularPhpName", "=", "$", "col", "->", "getPhpSingularName", "(", "...
Adds the singular filterByCol method for an Array column. @param string &$script The script will be modified in this method. @param Column $col
[ "Adds", "the", "singular", "filterByCol", "method", "for", "an", "Array", "column", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L1191-L1210
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addFilterByFk
protected function addFilterByFk(&$script, $fk) { $this->declareClasses( '\Propel\Runtime\Collection\ObjectCollection', '\Propel\Runtime\Exception\PropelException' ); $table = $this->getTable(); $queryClass = $this->getQueryClassName(); $fkTable = $fk-...
php
protected function addFilterByFk(&$script, $fk) { $this->declareClasses( '\Propel\Runtime\Collection\ObjectCollection', '\Propel\Runtime\Exception\PropelException' ); $table = $this->getTable(); $queryClass = $this->getQueryClassName(); $fkTable = $fk-...
[ "protected", "function", "addFilterByFk", "(", "&", "$", "script", ",", "$", "fk", ")", "{", "$", "this", "->", "declareClasses", "(", "'\\Propel\\Runtime\\Collection\\ObjectCollection'", ",", "'\\Propel\\Runtime\\Exception\\PropelException'", ")", ";", "$", "table", ...
Adds the filterByFk method for this object. @param string &$script The script will be modified in this method. @param $fk ForeignKey
[ "Adds", "the", "filterByFk", "method", "for", "this", "object", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L1217-L1293
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addFilterByRefFk
protected function addFilterByRefFk(&$script, ForeignKey $fk) { $this->declareClasses( '\Propel\Runtime\Collection\ObjectCollection', '\Propel\Runtime\Exception\PropelException' ); $queryClass = $this->getQueryClassName(); $fkTable = $this->getTable()->getData...
php
protected function addFilterByRefFk(&$script, ForeignKey $fk) { $this->declareClasses( '\Propel\Runtime\Collection\ObjectCollection', '\Propel\Runtime\Exception\PropelException' ); $queryClass = $this->getQueryClassName(); $fkTable = $this->getTable()->getData...
[ "protected", "function", "addFilterByRefFk", "(", "&", "$", "script", ",", "ForeignKey", "$", "fk", ")", "{", "$", "this", "->", "declareClasses", "(", "'\\Propel\\Runtime\\Collection\\ObjectCollection'", ",", "'\\Propel\\Runtime\\Exception\\PropelException'", ")", ";", ...
Adds the filterByRefFk method for this object. @param string &$script The script will be modified in this method. @param ForeignKey $fk
[ "Adds", "the", "filterByRefFk", "method", "for", "this", "object", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L1301-L1365
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addJoinFk
protected function addJoinFk(&$script, $fk) { $queryClass = $this->getQueryClassName(); $fkTable = $fk->getForeignTable(); $relationName = $this->getFKPhpNameAffix($fk); $joinType = $this->getJoinType($fk); $this->addJoinRelated($script, $fkTable, $queryClass, $relationName, ...
php
protected function addJoinFk(&$script, $fk) { $queryClass = $this->getQueryClassName(); $fkTable = $fk->getForeignTable(); $relationName = $this->getFKPhpNameAffix($fk); $joinType = $this->getJoinType($fk); $this->addJoinRelated($script, $fkTable, $queryClass, $relationName, ...
[ "protected", "function", "addJoinFk", "(", "&", "$", "script", ",", "$", "fk", ")", "{", "$", "queryClass", "=", "$", "this", "->", "getQueryClassName", "(", ")", ";", "$", "fkTable", "=", "$", "fk", "->", "getForeignTable", "(", ")", ";", "$", "rela...
Adds the joinFk method for this object. @param string &$script The script will be modified in this method. @param $fk ForeignKey
[ "Adds", "the", "joinFk", "method", "for", "this", "object", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L1372-L1379
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addJoinRefFk
protected function addJoinRefFk(&$script, ForeignKey $fk) { $queryClass = $this->getQueryClassName(); $fkTable = $this->getTable()->getDatabase()->getTable($fk->getTableName()); $relationName = $this->getRefFKPhpNameAffix($fk); $joinType = $this->getJoinType($fk); $this->addJ...
php
protected function addJoinRefFk(&$script, ForeignKey $fk) { $queryClass = $this->getQueryClassName(); $fkTable = $this->getTable()->getDatabase()->getTable($fk->getTableName()); $relationName = $this->getRefFKPhpNameAffix($fk); $joinType = $this->getJoinType($fk); $this->addJ...
[ "protected", "function", "addJoinRefFk", "(", "&", "$", "script", ",", "ForeignKey", "$", "fk", ")", "{", "$", "queryClass", "=", "$", "this", "->", "getQueryClassName", "(", ")", ";", "$", "fkTable", "=", "$", "this", "->", "getTable", "(", ")", "->",...
Adds the joinRefFk method for this object. @param string &$script The script will be modified in this method. @param ForeignKey $fk
[ "Adds", "the", "joinRefFk", "method", "for", "this", "object", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L1386-L1393
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addUseFkQuery
protected function addUseFkQuery(&$script, $fk) { $fkTable = $fk->getForeignTable(); $fkQueryBuilder = $this->getNewStubQueryBuilder($fkTable); $queryClass = $this->getClassNameFromBuilder($fkQueryBuilder, true); $relationName = $this->getFKPhpNameAffix($fk); $joinType = $thi...
php
protected function addUseFkQuery(&$script, $fk) { $fkTable = $fk->getForeignTable(); $fkQueryBuilder = $this->getNewStubQueryBuilder($fkTable); $queryClass = $this->getClassNameFromBuilder($fkQueryBuilder, true); $relationName = $this->getFKPhpNameAffix($fk); $joinType = $thi...
[ "protected", "function", "addUseFkQuery", "(", "&", "$", "script", ",", "$", "fk", ")", "{", "$", "fkTable", "=", "$", "fk", "->", "getForeignTable", "(", ")", ";", "$", "fkQueryBuilder", "=", "$", "this", "->", "getNewStubQueryBuilder", "(", "$", "fkTab...
Adds the useFkQuery method for this object. @param string &$script The script will be modified in this method. @param $fk ForeignKey
[ "Adds", "the", "useFkQuery", "method", "for", "this", "object", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L1441-L1450
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addUseRefFkQuery
protected function addUseRefFkQuery(&$script, ForeignKey $fk) { $fkTable = $this->getTable()->getDatabase()->getTable($fk->getTableName()); $fkQueryBuilder = $this->getNewStubQueryBuilder($fkTable); $queryClass = $this->getClassNameFromBuilder($fkQueryBuilder, true); $relationName = ...
php
protected function addUseRefFkQuery(&$script, ForeignKey $fk) { $fkTable = $this->getTable()->getDatabase()->getTable($fk->getTableName()); $fkQueryBuilder = $this->getNewStubQueryBuilder($fkTable); $queryClass = $this->getClassNameFromBuilder($fkQueryBuilder, true); $relationName = ...
[ "protected", "function", "addUseRefFkQuery", "(", "&", "$", "script", ",", "ForeignKey", "$", "fk", ")", "{", "$", "fkTable", "=", "$", "this", "->", "getTable", "(", ")", "->", "getDatabase", "(", ")", "->", "getTable", "(", "$", "fk", "->", "getTable...
Adds the useFkQuery method for this object. @param string &$script The script will be modified in this method. @param ForeignKey $fk
[ "Adds", "the", "useFkQuery", "method", "for", "this", "object", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L1457-L1466
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addPrune
protected function addPrune(&$script) { $table = $this->getTable(); $class = $this->getObjectClassName(); $objectName = '$' . $table->getCamelCaseName(); $script .= " /** * Exclude object from result * * @param $class $objectName Object to remove from the list o...
php
protected function addPrune(&$script) { $table = $this->getTable(); $class = $this->getObjectClassName(); $objectName = '$' . $table->getCamelCaseName(); $script .= " /** * Exclude object from result * * @param $class $objectName Object to remove from the list o...
[ "protected", "function", "addPrune", "(", "&", "$", "script", ")", "{", "$", "table", "=", "$", "this", "->", "getTable", "(", ")", ";", "$", "class", "=", "$", "this", "->", "getObjectClassName", "(", ")", ";", "$", "objectName", "=", "'$'", ".", ...
Adds the prune method for this object. @param string &$script The script will be modified in this method.
[ "Adds", "the", "prune", "method", "for", "this", "object", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L1532-L1581
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addDelete
protected function addDelete(&$script) { $script .= " /** * Performs a DELETE on the database based on the current ModelCriteria * * @param ConnectionInterface \$con the connection to use * @return int The number of affected rows (if supported by underlying database drive...
php
protected function addDelete(&$script) { $script .= " /** * Performs a DELETE on the database based on the current ModelCriteria * * @param ConnectionInterface \$con the connection to use * @return int The number of affected rows (if supported by underlying database drive...
[ "protected", "function", "addDelete", "(", "&", "$", "script", ")", "{", "$", "script", ".=", "\"\n /**\n * Performs a DELETE on the database based on the current ModelCriteria\n *\n * @param ConnectionInterface \\$con the connection to use\n * @return int The ...
Adds the doDelete() method. @param string &$script The script will be modified in this method.
[ "Adds", "the", "doDelete", "()", "method", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L1745-L1802
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addDoOnDeleteCascade
protected function addDoOnDeleteCascade(&$script) { $table = $this->getTable(); $script .= " /** * This is a method for emulating ON DELETE CASCADE for DBs that don't support this * feature (like MySQL or SQLite). * * This method is not very speedy because it must perform a q...
php
protected function addDoOnDeleteCascade(&$script) { $table = $this->getTable(); $script .= " /** * This is a method for emulating ON DELETE CASCADE for DBs that don't support this * feature (like MySQL or SQLite). * * This method is not very speedy because it must perform a q...
[ "protected", "function", "addDoOnDeleteCascade", "(", "&", "$", "script", ")", "{", "$", "table", "=", "$", "this", "->", "getTable", "(", ")", ";", "$", "script", ".=", "\"\n /**\n * This is a method for emulating ON DELETE CASCADE for DBs that don't support this\...
Adds the doOnDeleteCascade() method, which provides ON DELETE CASCADE emulation. @param string &$script The script will be modified in this method.
[ "Adds", "the", "doOnDeleteCascade", "()", "method", "which", "provides", "ON", "DELETE", "CASCADE", "emulation", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L1808-L1882
propelorm/Propel2
src/Propel/Generator/Builder/Om/QueryBuilder.php
QueryBuilder.addDoDeleteAll
protected function addDoDeleteAll(&$script) { $table = $this->getTable(); $script .= " /** * Deletes all rows from the ".$table->getName()." table. * * @param ConnectionInterface \$con the connection to use * @return int The number of affected rows (if supported by underlying...
php
protected function addDoDeleteAll(&$script) { $table = $this->getTable(); $script .= " /** * Deletes all rows from the ".$table->getName()." table. * * @param ConnectionInterface \$con the connection to use * @return int The number of affected rows (if supported by underlying...
[ "protected", "function", "addDoDeleteAll", "(", "&", "$", "script", ")", "{", "$", "table", "=", "$", "this", "->", "getTable", "(", ")", ";", "$", "script", ".=", "\"\n /**\n * Deletes all rows from the \"", ".", "$", "table", "->", "getName", "(", "...
Adds the doDeleteAll() method. @param string &$script The script will be modified in this method.
[ "Adds", "the", "doDeleteAll", "()", "method", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/QueryBuilder.php#L1966-L2006
propelorm/Propel2
src/Propel/Generator/Command/SqlBuildCommand.php
SqlBuildCommand.execute
protected function execute(InputInterface $input, OutputInterface $output) { $configOptions = []; foreach ($input->getOptions() as $key => $option) { if (null !== $option) { switch ($key) { case 'schema-dir': $configOptions['pr...
php
protected function execute(InputInterface $input, OutputInterface $output) { $configOptions = []; foreach ($input->getOptions() as $key => $option) { if (null !== $option) { switch ($key) { case 'schema-dir': $configOptions['pr...
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "configOptions", "=", "[", "]", ";", "foreach", "(", "$", "input", "->", "getOptions", "(", ")", "as", "$", "key", "=>", "$", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Command/SqlBuildCommand.php#L50-L113
propelorm/Propel2
src/Propel/Generator/Behavior/Sortable/SortableBehavior.php
SortableBehavior.modifyTable
public function modifyTable() { $table = $this->getTable(); if (!$table->hasColumn($this->getParameter('rank_column'))) { $table->addColumn([ 'name' => $this->getParameter('rank_column'), 'type' => 'INTEGER' ]); } if ($this->u...
php
public function modifyTable() { $table = $this->getTable(); if (!$table->hasColumn($this->getParameter('rank_column'))) { $table->addColumn([ 'name' => $this->getParameter('rank_column'), 'type' => 'INTEGER' ]); } if ($this->u...
[ "public", "function", "modifyTable", "(", ")", "{", "$", "table", "=", "$", "this", "->", "getTable", "(", ")", ";", "if", "(", "!", "$", "table", "->", "hasColumn", "(", "$", "this", "->", "getParameter", "(", "'rank_column'", ")", ")", ")", "{", ...
Add the rank_column to the current table
[ "Add", "the", "rank_column", "to", "the", "current", "table" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Behavior/Sortable/SortableBehavior.php#L38-L65
propelorm/Propel2
src/Propel/Generator/Behavior/Sortable/SortableBehavior.php
SortableBehavior.generateScopePhp
public function generateScopePhp() { $methodSignature = ''; $paramsDoc = ''; $buildScope = ''; $buildScopeVars = ''; if ($this->hasMultipleScopes()) { $methodSignature = []; $buildScope = []; $buildScopeVars = []; ...
php
public function generateScopePhp() { $methodSignature = ''; $paramsDoc = ''; $buildScope = ''; $buildScopeVars = ''; if ($this->hasMultipleScopes()) { $methodSignature = []; $buildScope = []; $buildScopeVars = []; ...
[ "public", "function", "generateScopePhp", "(", ")", "{", "$", "methodSignature", "=", "''", ";", "$", "paramsDoc", "=", "''", ";", "$", "buildScope", "=", "''", ";", "$", "buildScopeVars", "=", "''", ";", "if", "(", "$", "this", "->", "hasMultipleScopes"...
Generates the method argument signature, the appropriate phpDoc for @params, the scope builder php code and the scope variable builder php code/ @return array ($methodSignature, $paramsDoc, $scopeBuilder, $buildScopeVars)
[ "Generates", "the", "method", "argument", "signature", "the", "appropriate", "phpDoc", "for", "@params", "the", "scope", "builder", "php", "code", "and", "the", "scope", "variable", "builder", "php", "code", "/" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Behavior/Sortable/SortableBehavior.php#L105-L152
propelorm/Propel2
src/Propel/Generator/Behavior/Sortable/SortableBehavior.php
SortableBehavior.addParameter
public function addParameter(array $parameter) { if ('scope_column' === $parameter['name']) { $this->parameters['scope_column'] .= ($this->parameters['scope_column'] ? ',' : '') . $parameter['value']; } else { parent::addParameter($parameter); } }
php
public function addParameter(array $parameter) { if ('scope_column' === $parameter['name']) { $this->parameters['scope_column'] .= ($this->parameters['scope_column'] ? ',' : '') . $parameter['value']; } else { parent::addParameter($parameter); } }
[ "public", "function", "addParameter", "(", "array", "$", "parameter", ")", "{", "if", "(", "'scope_column'", "===", "$", "parameter", "[", "'name'", "]", ")", "{", "$", "this", "->", "parameters", "[", "'scope_column'", "]", ".=", "(", "$", "this", "->",...
{@inheritdoc}
[ "{" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Behavior/Sortable/SortableBehavior.php#L179-L186
propelorm/Propel2
src/Propel/Generator/Platform/PgsqlPlatform.php
PgsqlPlatform.initialize
protected function initialize() { parent::initialize(); $this->setSchemaDomainMapping(new Domain(PropelTypes::BOOLEAN, 'BOOLEAN')); $this->setSchemaDomainMapping(new Domain(PropelTypes::TINYINT, 'INT2')); $this->setSchemaDomainMapping(new Domain(PropelTypes::SMALLINT, 'INT2')); ...
php
protected function initialize() { parent::initialize(); $this->setSchemaDomainMapping(new Domain(PropelTypes::BOOLEAN, 'BOOLEAN')); $this->setSchemaDomainMapping(new Domain(PropelTypes::TINYINT, 'INT2')); $this->setSchemaDomainMapping(new Domain(PropelTypes::SMALLINT, 'INT2')); ...
[ "protected", "function", "initialize", "(", ")", "{", "parent", "::", "initialize", "(", ")", ";", "$", "this", "->", "setSchemaDomainMapping", "(", "new", "Domain", "(", "PropelTypes", "::", "BOOLEAN", ",", "'BOOLEAN'", ")", ")", ";", "$", "this", "->", ...
Initializes db specific domain mapping.
[ "Initializes", "db", "specific", "domain", "mapping", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/PgsqlPlatform.php#L44-L65
propelorm/Propel2
src/Propel/Generator/Platform/PgsqlPlatform.php
PgsqlPlatform.getSequenceName
public function getSequenceName(Table $table) { $result = null; if ($table->getIdMethod() == IdMethod::NATIVE) { $idMethodParams = $table->getIdMethodParameters(); if (empty($idMethodParams)) { $result = null; // We're going to ignore a check f...
php
public function getSequenceName(Table $table) { $result = null; if ($table->getIdMethod() == IdMethod::NATIVE) { $idMethodParams = $table->getIdMethodParameters(); if (empty($idMethodParams)) { $result = null; // We're going to ignore a check f...
[ "public", "function", "getSequenceName", "(", "Table", "$", "table", ")", "{", "$", "result", "=", "null", ";", "if", "(", "$", "table", "->", "getIdMethod", "(", ")", "==", "IdMethod", "::", "NATIVE", ")", "{", "$", "idMethodParams", "=", "$", "table"...
Override to provide sequence names that conform to postgres' standard when no id-method-parameter specified. @param Table $table @return string
[ "Override", "to", "provide", "sequence", "names", "that", "conform", "to", "postgres", "standard", "when", "no", "id", "-", "method", "-", "parameter", "specified", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/PgsqlPlatform.php#L116-L137
propelorm/Propel2
src/Propel/Generator/Platform/PgsqlPlatform.php
PgsqlPlatform.getAddForeignKeysDDL
public function getAddForeignKeysDDL(Table $table) { $ret = ''; foreach ($table->getForeignKeys() as $fk) { $ret .= $this->getAddForeignKeyDDL($fk); } return $ret; }
php
public function getAddForeignKeysDDL(Table $table) { $ret = ''; foreach ($table->getForeignKeys() as $fk) { $ret .= $this->getAddForeignKeyDDL($fk); } return $ret; }
[ "public", "function", "getAddForeignKeysDDL", "(", "Table", "$", "table", ")", "{", "$", "ret", "=", "''", ";", "foreach", "(", "$", "table", "->", "getForeignKeys", "(", ")", "as", "$", "fk", ")", "{", "$", "ret", ".=", "$", "this", "->", "getAddFor...
{@inheritDoc}
[ "{" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/PgsqlPlatform.php#L280-L288
propelorm/Propel2
src/Propel/Generator/Platform/PgsqlPlatform.php
PgsqlPlatform.getModifyColumnDDL
public function getModifyColumnDDL(ColumnDiff $columnDiff) { $ret = ''; $changedProperties = $columnDiff->getChangedProperties(); $fromColumn = $columnDiff->getFromColumn(); $toColumn = clone $columnDiff->getToColumn(); $fromTable = $fromColumn->getTable(); $table =...
php
public function getModifyColumnDDL(ColumnDiff $columnDiff) { $ret = ''; $changedProperties = $columnDiff->getChangedProperties(); $fromColumn = $columnDiff->getFromColumn(); $toColumn = clone $columnDiff->getToColumn(); $fromTable = $fromColumn->getTable(); $table =...
[ "public", "function", "getModifyColumnDDL", "(", "ColumnDiff", "$", "columnDiff", ")", "{", "$", "ret", "=", "''", ";", "$", "changedProperties", "=", "$", "columnDiff", "->", "getChangedProperties", "(", ")", ";", "$", "fromColumn", "=", "$", "columnDiff", ...
Overrides the implementation from DefaultPlatform @author Niklas Närhinen <niklas@narhinen.net> @return string @see DefaultPlatform::getModifyColumnDDL
[ "Overrides", "the", "implementation", "from", "DefaultPlatform" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/PgsqlPlatform.php#L487-L584
propelorm/Propel2
src/Propel/Generator/Platform/PgsqlPlatform.php
PgsqlPlatform.getModifyColumnsDDL
public function getModifyColumnsDDL($columnDiffs) { $ret = ''; foreach ($columnDiffs as $columnDiff) { $ret .= $this->getModifyColumnDDL($columnDiff); } return $ret; }
php
public function getModifyColumnsDDL($columnDiffs) { $ret = ''; foreach ($columnDiffs as $columnDiff) { $ret .= $this->getModifyColumnDDL($columnDiff); } return $ret; }
[ "public", "function", "getModifyColumnsDDL", "(", "$", "columnDiffs", ")", "{", "$", "ret", "=", "''", ";", "foreach", "(", "$", "columnDiffs", "as", "$", "columnDiff", ")", "{", "$", "ret", ".=", "$", "this", "->", "getModifyColumnDDL", "(", "$", "colum...
Overrides the implementation from DefaultPlatform @author Niklas Närhinen <niklas@narhinen.net> @return string @see DefaultPlatform::getModifyColumnsDDL
[ "Overrides", "the", "implementation", "from", "DefaultPlatform" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/PgsqlPlatform.php#L644-L652
propelorm/Propel2
src/Propel/Generator/Platform/PgsqlPlatform.php
PgsqlPlatform.getAddColumnsDDL
public function getAddColumnsDDL($columns) { $ret = ''; foreach ($columns as $column) { $ret .= $this->getAddColumnDDL($column); } return $ret; }
php
public function getAddColumnsDDL($columns) { $ret = ''; foreach ($columns as $column) { $ret .= $this->getAddColumnDDL($column); } return $ret; }
[ "public", "function", "getAddColumnsDDL", "(", "$", "columns", ")", "{", "$", "ret", "=", "''", ";", "foreach", "(", "$", "columns", "as", "$", "column", ")", "{", "$", "ret", ".=", "$", "this", "->", "getAddColumnDDL", "(", "$", "column", ")", ";", ...
Overrides the implementation from DefaultPlatform @author Niklas Närhinen <niklas@narhinen.net> @return string @see DefaultPlatform::getAddColumnsDLL
[ "Overrides", "the", "implementation", "from", "DefaultPlatform" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/PgsqlPlatform.php#L661-L669
propelorm/Propel2
src/Propel/Generator/Platform/PgsqlPlatform.php
PgsqlPlatform.getDropIndexDDL
public function getDropIndexDDL(Index $index) { if ($index instanceof Unique) { $pattern = " ALTER TABLE %s DROP CONSTRAINT %s; "; return sprintf($pattern, $this->quoteIdentifier($index->getTable()->getName()), $this->quoteIdentifier($index->g...
php
public function getDropIndexDDL(Index $index) { if ($index instanceof Unique) { $pattern = " ALTER TABLE %s DROP CONSTRAINT %s; "; return sprintf($pattern, $this->quoteIdentifier($index->getTable()->getName()), $this->quoteIdentifier($index->g...
[ "public", "function", "getDropIndexDDL", "(", "Index", "$", "index", ")", "{", "if", "(", "$", "index", "instanceof", "Unique", ")", "{", "$", "pattern", "=", "\"\n ALTER TABLE %s DROP CONSTRAINT %s;\n \"", ";", "return", "sprintf", "(", "$", "pattern", ",...
Overrides the implementation from DefaultPlatform @author Niklas Närhinen <niklas@narhinen.net> @return string @see DefaultPlatform::getDropIndexDDL
[ "Overrides", "the", "implementation", "from", "DefaultPlatform" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/PgsqlPlatform.php#L678-L692
propelorm/Propel2
src/Propel/Generator/Platform/PgsqlPlatform.php
PgsqlPlatform.getIdentifierPhp
public function getIdentifierPhp($columnValueMutator, $connectionVariableName = '$con', $sequenceName = '', $tab = " ", $phpType = null) { if (!$sequenceName) { throw new EngineException('PostgreSQL needs a sequence name to fetch primary keys'); } $snippet = " \$dataFe...
php
public function getIdentifierPhp($columnValueMutator, $connectionVariableName = '$con', $sequenceName = '', $tab = " ", $phpType = null) { if (!$sequenceName) { throw new EngineException('PostgreSQL needs a sequence name to fetch primary keys'); } $snippet = " \$dataFe...
[ "public", "function", "getIdentifierPhp", "(", "$", "columnValueMutator", ",", "$", "connectionVariableName", "=", "'$con'", ",", "$", "sequenceName", "=", "''", ",", "$", "tab", "=", "\" \"", ",", "$", "phpType", "=", "null", ")", "{", "if", "(",...
Get the PHP snippet for getting a Pk from the database. Warning: duplicates logic from PgsqlAdapter::getId(). Any code modification here must be ported there.
[ "Get", "the", "PHP", "snippet", "for", "getting", "a", "Pk", "from", "the", "database", ".", "Warning", ":", "duplicates", "logic", "from", "PgsqlAdapter", "::", "getId", "()", ".", "Any", "code", "modification", "here", "must", "be", "ported", "there", "....
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/PgsqlPlatform.php#L699-L715
propelorm/Propel2
src/Propel/Generator/Model/BehaviorableTrait.php
BehaviorableTrait.getBehaviorLocator
private function getBehaviorLocator() { if (null === $this->behaviorLocator) { $config = $this->getGeneratorConfig(); if (null !== $config) { $this->behaviorLocator = $config->getBehaviorLocator(); if (null === $this->behaviorLocator) { ...
php
private function getBehaviorLocator() { if (null === $this->behaviorLocator) { $config = $this->getGeneratorConfig(); if (null !== $config) { $this->behaviorLocator = $config->getBehaviorLocator(); if (null === $this->behaviorLocator) { ...
[ "private", "function", "getBehaviorLocator", "(", ")", "{", "if", "(", "null", "===", "$", "this", "->", "behaviorLocator", ")", "{", "$", "config", "=", "$", "this", "->", "getGeneratorConfig", "(", ")", ";", "if", "(", "null", "!==", "$", "config", "...
Returns the behavior locator. @return BehaviorLocator
[ "Returns", "the", "behavior", "locator", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/BehaviorableTrait.php#L34-L49
propelorm/Propel2
src/Propel/Generator/Model/BehaviorableTrait.php
BehaviorableTrait.addBehavior
public function addBehavior($bdata) { if ($bdata instanceof Behavior) { $behavior = $bdata; // the new behavior is already registered if ($this->hasBehavior($behavior->getId()) && $behavior->allowMultiple()) { // the user probably just forgot to specify t...
php
public function addBehavior($bdata) { if ($bdata instanceof Behavior) { $behavior = $bdata; // the new behavior is already registered if ($this->hasBehavior($behavior->getId()) && $behavior->allowMultiple()) { // the user probably just forgot to specify t...
[ "public", "function", "addBehavior", "(", "$", "bdata", ")", "{", "if", "(", "$", "bdata", "instanceof", "Behavior", ")", "{", "$", "behavior", "=", "$", "bdata", ";", "// the new behavior is already registered", "if", "(", "$", "this", "->", "hasBehavior", ...
Adds a new Behavior @param $bdata @throws BuildException when the added behavior is not an instance of \Propel\Generator\Model\Behavior @return Behavior $bdata
[ "Adds", "a", "new", "Behavior" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/BehaviorableTrait.php#L58-L89
propelorm/Propel2
src/Propel/Generator/Model/Diff/ColumnDiff.php
ColumnDiff.getReverseDiff
public function getReverseDiff() { $diff = new self(); // columns $diff->setFromColumn($this->toColumn); $diff->setToColumn($this->fromColumn); // properties $changedProperties = []; foreach ($this->changedProperties as $name => $propertyChange) { ...
php
public function getReverseDiff() { $diff = new self(); // columns $diff->setFromColumn($this->toColumn); $diff->setToColumn($this->fromColumn); // properties $changedProperties = []; foreach ($this->changedProperties as $name => $propertyChange) { ...
[ "public", "function", "getReverseDiff", "(", ")", "{", "$", "diff", "=", "new", "self", "(", ")", ";", "// columns", "$", "diff", "->", "setFromColumn", "(", "$", "this", "->", "toColumn", ")", ";", "$", "diff", "->", "setToColumn", "(", "$", "this", ...
Returns the reverse diff for this diff. @return ColumnDiff
[ "Returns", "the", "reverse", "diff", "for", "this", "diff", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Diff/ColumnDiff.php#L127-L143
propelorm/Propel2
src/Propel/Generator/Builder/Om/MultiExtendObjectBuilder.php
MultiExtendObjectBuilder.addClassOpen
protected function addClassOpen(&$script) { if ($this->getChild()->getAncestor()) { $ancestorClassName = $this->getChild()->getAncestor(); if ($this->getDatabase()->hasTableByPhpName($ancestorClassName)) { $this->declareClassFromBuilder($this->getNewStubObjectBuilder(...
php
protected function addClassOpen(&$script) { if ($this->getChild()->getAncestor()) { $ancestorClassName = $this->getChild()->getAncestor(); if ($this->getDatabase()->hasTableByPhpName($ancestorClassName)) { $this->declareClassFromBuilder($this->getNewStubObjectBuilder(...
[ "protected", "function", "addClassOpen", "(", "&", "$", "script", ")", "{", "if", "(", "$", "this", "->", "getChild", "(", ")", "->", "getAncestor", "(", ")", ")", "{", "$", "ancestorClassName", "=", "$", "this", "->", "getChild", "(", ")", "->", "ge...
Adds class phpdoc comment and opening of class. @param string &$script
[ "Adds", "class", "phpdoc", "comment", "and", "opening", "of", "class", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/MultiExtendObjectBuilder.php#L108-L151
propelorm/Propel2
src/Propel/Generator/Builder/Om/MultiExtendObjectBuilder.php
MultiExtendObjectBuilder.addClassBody
protected function addClassBody(&$script) { $child = $this->getChild(); $col = $child->getColumn(); $cfc = $col->getPhpName(); $const = "CLASSKEY_".$child->getConstantSuffix(); $script .= " /** * Constructs a new ".$this->getChild()->getClassName()." class, setting...
php
protected function addClassBody(&$script) { $child = $this->getChild(); $col = $child->getColumn(); $cfc = $col->getPhpName(); $const = "CLASSKEY_".$child->getConstantSuffix(); $script .= " /** * Constructs a new ".$this->getChild()->getClassName()." class, setting...
[ "protected", "function", "addClassBody", "(", "&", "$", "script", ")", "{", "$", "child", "=", "$", "this", "->", "getChild", "(", ")", ";", "$", "col", "=", "$", "child", "->", "getColumn", "(", ")", ";", "$", "cfc", "=", "$", "col", "->", "getP...
Specifies the methods that are added as part of the stub object class. By default there are no methods for the empty stub classes; override this method if you want to change that behavior. @param string &$script @see ObjectBuilder::addClassBody()
[ "Specifies", "the", "methods", "that", "are", "added", "as", "part", "of", "the", "stub", "object", "class", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/MultiExtendObjectBuilder.php#L162-L181
propelorm/Propel2
src/Propel/Runtime/Adapter/Pdo/MysqlAdapter.php
MysqlAdapter.applyLimit
public function applyLimit(&$sql, $offset, $limit) { $offset = (int) $offset; $limit = (int) $limit; if ($limit >= 0) { $sql .= ' LIMIT ' . ($offset > 0 ? $offset . ', ' : '') . $limit; } elseif ($offset > 0) { $sql .= ' LIMIT ' . $offset . ', 184467440737095...
php
public function applyLimit(&$sql, $offset, $limit) { $offset = (int) $offset; $limit = (int) $limit; if ($limit >= 0) { $sql .= ' LIMIT ' . ($offset > 0 ? $offset . ', ' : '') . $limit; } elseif ($offset > 0) { $sql .= ' LIMIT ' . $offset . ', 184467440737095...
[ "public", "function", "applyLimit", "(", "&", "$", "sql", ",", "$", "offset", ",", "$", "limit", ")", "{", "$", "offset", "=", "(", "int", ")", "$", "offset", ";", "$", "limit", "=", "(", "int", ")", "$", "limit", ";", "if", "(", "$", "limit", ...
@see AdapterInterface::applyLimit() @param string $sql @param integer $offset @param integer $limit
[ "@see", "AdapterInterface", "::", "applyLimit", "()" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Adapter/Pdo/MysqlAdapter.php#L122-L132
propelorm/Propel2
src/Propel/Runtime/Adapter/Pdo/MysqlAdapter.php
MysqlAdapter.bindValue
public function bindValue(\PDOStatement $stmt, $parameter, $value, ColumnMap $cMap, $position = null) { $pdoType = $cMap->getPdoType(); // FIXME - This is a temporary hack to get around apparent bugs w/ PDO+MYSQL // See http://pecl.php.net/bugs/bug.php?id=9919 if (\PDO::PARAM_BOOL ==...
php
public function bindValue(\PDOStatement $stmt, $parameter, $value, ColumnMap $cMap, $position = null) { $pdoType = $cMap->getPdoType(); // FIXME - This is a temporary hack to get around apparent bugs w/ PDO+MYSQL // See http://pecl.php.net/bugs/bug.php?id=9919 if (\PDO::PARAM_BOOL ==...
[ "public", "function", "bindValue", "(", "\\", "PDOStatement", "$", "stmt", ",", "$", "parameter", ",", "$", "value", ",", "ColumnMap", "$", "cMap", ",", "$", "position", "=", "null", ")", "{", "$", "pdoType", "=", "$", "cMap", "->", "getPdoType", "(", ...
@see AdapterInterface::bindValue() @param \PDOStatement $stmt @param string $parameter @param mixed $value @param ColumnMap $cMap @param null|integer $position @return boolean
[ "@see", "AdapterInterface", "::", "bindValue", "()" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Adapter/Pdo/MysqlAdapter.php#L156-L177
propelorm/Propel2
src/Propel/Runtime/Adapter/Pdo/MysqlAdapter.php
MysqlAdapter.prepareParams
protected function prepareParams($params) { if (isset($params['settings']['charset'])) { if (false === strpos($params['dsn'], ';charset=')) { $params['dsn'] .= ';charset=' . $params['settings']['charset']; unset($params['settings']['charset']); } ...
php
protected function prepareParams($params) { if (isset($params['settings']['charset'])) { if (false === strpos($params['dsn'], ';charset=')) { $params['dsn'] .= ';charset=' . $params['settings']['charset']; unset($params['settings']['charset']); } ...
[ "protected", "function", "prepareParams", "(", "$", "params", ")", "{", "if", "(", "isset", "(", "$", "params", "[", "'settings'", "]", "[", "'charset'", "]", ")", ")", "{", "if", "(", "false", "===", "strpos", "(", "$", "params", "[", "'dsn'", "]", ...
Prepare the parameters for a PDO connection. Protects MySQL from charset injection risk. @see http://www.propelorm.org/ticket/1360 @param array $params the connection parameters from the configuration @return array the modified parameters
[ "Prepare", "the", "parameters", "for", "a", "PDO", "connection", ".", "Protects", "MySQL", "from", "charset", "injection", "risk", ".", "@see", "http", ":", "//", "www", ".", "propelorm", ".", "org", "/", "ticket", "/", "1360" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Adapter/Pdo/MysqlAdapter.php#L188-L198
propelorm/Propel2
src/Propel/Common/Config/XmlToArrayConverter.php
XmlToArrayConverter.convert
public static function convert($xmlToParse) { if (!is_string($xmlToParse)) { throw new InvalidArgumentException("XmlToArrayConverter::convert method expects an xml file to parse, or a string containing valid xml"); } $isFile = file_exists($xmlToParse); //Empty xml file ...
php
public static function convert($xmlToParse) { if (!is_string($xmlToParse)) { throw new InvalidArgumentException("XmlToArrayConverter::convert method expects an xml file to parse, or a string containing valid xml"); } $isFile = file_exists($xmlToParse); //Empty xml file ...
[ "public", "static", "function", "convert", "(", "$", "xmlToParse", ")", "{", "if", "(", "!", "is_string", "(", "$", "xmlToParse", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "\"XmlToArrayConverter::convert method expects an xml file to parse, or a st...
Create a PHP array from the XML file @param String $xmlToParse The XML file or a string containing xml to parse @return array @throws \Propel\Common\Config\Exception\XmlParseException if parse errors occur
[ "Create", "a", "PHP", "array", "from", "the", "XML", "file" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Common/Config/XmlToArrayConverter.php#L31-L77
propelorm/Propel2
src/Propel/Common/Config/XmlToArrayConverter.php
XmlToArrayConverter.simpleXmlToArray
protected static function simpleXmlToArray($xml) { $ar = []; foreach ($xml->children() as $k => $v) { // recurse the child $child = self::simpleXmlToArray($v); // if it's not an array, then it was empty, thus a value/string if (count($child) == 0) { ...
php
protected static function simpleXmlToArray($xml) { $ar = []; foreach ($xml->children() as $k => $v) { // recurse the child $child = self::simpleXmlToArray($v); // if it's not an array, then it was empty, thus a value/string if (count($child) == 0) { ...
[ "protected", "static", "function", "simpleXmlToArray", "(", "$", "xml", ")", "{", "$", "ar", "=", "[", "]", ";", "foreach", "(", "$", "xml", "->", "children", "(", ")", "as", "$", "k", "=>", "$", "v", ")", "{", "// recurse the child", "$", "child", ...
Recursive function that converts an SimpleXML object into an array. @author Christophe VG (based on code form php.net manual comment) @param \SimpleXMLElement $xml SimpleXML object. @return array Array representation of SimpleXML object.
[ "Recursive", "function", "that", "converts", "an", "SimpleXML", "object", "into", "an", "array", ".", "@author", "Christophe", "VG", "(", "based", "on", "code", "form", "php", ".", "net", "manual", "comment", ")" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Common/Config/XmlToArrayConverter.php#L86-L133
propelorm/Propel2
src/Propel/Common/Config/XmlToArrayConverter.php
XmlToArrayConverter.getConvertedXmlValue
private static function getConvertedXmlValue($value) { $value = (string) $value; // convert from simplexml to string //handle numeric values if (is_numeric($value)) { if (ctype_digit($value)) { $value = intval($value); } else { $value ...
php
private static function getConvertedXmlValue($value) { $value = (string) $value; // convert from simplexml to string //handle numeric values if (is_numeric($value)) { if (ctype_digit($value)) { $value = intval($value); } else { $value ...
[ "private", "static", "function", "getConvertedXmlValue", "(", "$", "value", ")", "{", "$", "value", "=", "(", "string", ")", "$", "value", ";", "// convert from simplexml to string", "//handle numeric values", "if", "(", "is_numeric", "(", "$", "value", ")", ")"...
Process XML value, handling boolean, if appropriate. @param \SimpleXMLElement $value The simplexml value object. @return mixed string or boolean value
[ "Process", "XML", "value", "handling", "boolean", "if", "appropriate", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Common/Config/XmlToArrayConverter.php#L140-L163
propelorm/Propel2
src/Propel/Generator/Model/Diff/TableComparator.php
TableComparator.computeDiff
public static function computeDiff(Table $fromTable, Table $toTable, $caseInsensitive = false) { $tc = new self(); $tc->setFromTable($fromTable); $tc->setToTable($toTable); $differences = 0; $differences += $tc->compareColumns($caseInsensitive); $differences += $tc-...
php
public static function computeDiff(Table $fromTable, Table $toTable, $caseInsensitive = false) { $tc = new self(); $tc->setFromTable($fromTable); $tc->setToTable($toTable); $differences = 0; $differences += $tc->compareColumns($caseInsensitive); $differences += $tc-...
[ "public", "static", "function", "computeDiff", "(", "Table", "$", "fromTable", ",", "Table", "$", "toTable", ",", "$", "caseInsensitive", "=", "false", ")", "{", "$", "tc", "=", "new", "self", "(", ")", ";", "$", "tc", "->", "setFromTable", "(", "$", ...
Returns the computed difference between two table objects. @param Table $fromTable @param Table $toTable @param boolean $caseInsensitive @return TableDiff|Boolean
[ "Returns", "the", "computed", "difference", "between", "two", "table", "objects", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Diff/TableComparator.php#L97-L111
propelorm/Propel2
src/Propel/Runtime/Map/RelationMap.php
RelationMap.addColumnMapping
public function addColumnMapping(ColumnMap $local, $foreign) { $this->localColumns[] = $local; if ($foreign instanceof ColumnMap) { $this->foreignColumns[] = $foreign; $this->localValues[] = null; } else { $this->localValues[] = $foreign; $thi...
php
public function addColumnMapping(ColumnMap $local, $foreign) { $this->localColumns[] = $local; if ($foreign instanceof ColumnMap) { $this->foreignColumns[] = $foreign; $this->localValues[] = null; } else { $this->localValues[] = $foreign; $thi...
[ "public", "function", "addColumnMapping", "(", "ColumnMap", "$", "local", ",", "$", "foreign", ")", "{", "$", "this", "->", "localColumns", "[", "]", "=", "$", "local", ";", "if", "(", "$", "foreign", "instanceof", "ColumnMap", ")", "{", "$", "this", "...
Add a column mapping @param ColumnMap $local The local column @param ColumnMap|mixed $foreign The foreign column or value
[ "Add", "a", "column", "mapping" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Map/RelationMap.php#L214-L225
propelorm/Propel2
src/Propel/Runtime/Map/RelationMap.php
RelationMap.getColumnMappings
public function getColumnMappings($direction = RelationMap::LOCAL_TO_FOREIGN) { $h = []; if (RelationMap::LEFT_TO_RIGHT === $direction && RelationMap::MANY_TO_ONE === $this->getType()) { $direction = RelationMap::LOCAL_TO_FOREIGN; } for ($i = 0, $size = count...
php
public function getColumnMappings($direction = RelationMap::LOCAL_TO_FOREIGN) { $h = []; if (RelationMap::LEFT_TO_RIGHT === $direction && RelationMap::MANY_TO_ONE === $this->getType()) { $direction = RelationMap::LOCAL_TO_FOREIGN; } for ($i = 0, $size = count...
[ "public", "function", "getColumnMappings", "(", "$", "direction", "=", "RelationMap", "::", "LOCAL_TO_FOREIGN", ")", "{", "$", "h", "=", "[", "]", ";", "if", "(", "RelationMap", "::", "LEFT_TO_RIGHT", "===", "$", "direction", "&&", "RelationMap", "::", "MANY...
Get an associative array mapping local column names to foreign column names The arrangement of the returned array depends on the $direction parameter: - If the value is RelationMap::LOCAL_TO_FOREIGN, then the returned array is local => foreign - If the value is RelationMap::LEFT_TO_RIGHT, then the returned array is lef...
[ "Get", "an", "associative", "array", "mapping", "local", "column", "names", "to", "foreign", "column", "names", "The", "arrangement", "of", "the", "returned", "array", "depends", "on", "the", "$direction", "parameter", ":", "-", "If", "the", "value", "is", "...
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Map/RelationMap.php#L236-L253
propelorm/Propel2
src/Propel/Runtime/Map/RelationMap.php
RelationMap.getSymmetricalRelation
public function getSymmetricalRelation() { $localMapping = [$this->getLeftColumns(), $this->getRightColumns()]; foreach ($this->getRightTable()->getRelations() as $relation) { if ($localMapping == [$relation->getRightColumns(), $relation->getLeftColumns()]) { return $rela...
php
public function getSymmetricalRelation() { $localMapping = [$this->getLeftColumns(), $this->getRightColumns()]; foreach ($this->getRightTable()->getRelations() as $relation) { if ($localMapping == [$relation->getRightColumns(), $relation->getLeftColumns()]) { return $rela...
[ "public", "function", "getSymmetricalRelation", "(", ")", "{", "$", "localMapping", "=", "[", "$", "this", "->", "getLeftColumns", "(", ")", ",", "$", "this", "->", "getRightColumns", "(", ")", "]", ";", "foreach", "(", "$", "this", "->", "getRightTable", ...
Gets the symmetrical relation @return \Propel\Runtime\Map\RelationMap
[ "Gets", "the", "symmetrical", "relation" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Map/RelationMap.php#L368-L376
propelorm/Propel2
src/Propel/Generator/Reverse/AbstractSchemaParser.php
AbstractSchemaParser.getMappedPropelType
protected function getMappedPropelType($nativeType) { if (null === $this->nativeToPropelTypeMap) { $this->nativeToPropelTypeMap = $this->getTypeMapping(); } if (isset($this->nativeToPropelTypeMap[$nativeType])) { return $this->nativeToPropelTypeMap[$nativeType]; ...
php
protected function getMappedPropelType($nativeType) { if (null === $this->nativeToPropelTypeMap) { $this->nativeToPropelTypeMap = $this->getTypeMapping(); } if (isset($this->nativeToPropelTypeMap[$nativeType])) { return $this->nativeToPropelTypeMap[$nativeType]; ...
[ "protected", "function", "getMappedPropelType", "(", "$", "nativeType", ")", "{", "if", "(", "null", "===", "$", "this", "->", "nativeToPropelTypeMap", ")", "{", "$", "this", "->", "nativeToPropelTypeMap", "=", "$", "this", "->", "getTypeMapping", "(", ")", ...
Gets a mapped Propel type for specified native type. @param string $nativeType @return string The mapped Propel type.
[ "Gets", "a", "mapped", "Propel", "type", "for", "specified", "native", "type", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Reverse/AbstractSchemaParser.php#L178-L189
propelorm/Propel2
src/Propel/Generator/Reverse/AbstractSchemaParser.php
AbstractSchemaParser.getMappedNativeType
protected function getMappedNativeType($propelType) { if (null === $this->reverseTypeMap) { $this->reverseTypeMap = array_flip($this->getTypeMapping()); } return isset($this->reverseTypeMap[$propelType]) ? $this->reverseTypeMap[$propelType] : null; }
php
protected function getMappedNativeType($propelType) { if (null === $this->reverseTypeMap) { $this->reverseTypeMap = array_flip($this->getTypeMapping()); } return isset($this->reverseTypeMap[$propelType]) ? $this->reverseTypeMap[$propelType] : null; }
[ "protected", "function", "getMappedNativeType", "(", "$", "propelType", ")", "{", "if", "(", "null", "===", "$", "this", "->", "reverseTypeMap", ")", "{", "$", "this", "->", "reverseTypeMap", "=", "array_flip", "(", "$", "this", "->", "getTypeMapping", "(", ...
Give a best guess at the native type. @param string $propelType @return string The native SQL type that best matches the specified Propel type.
[ "Give", "a", "best", "guess", "at", "the", "native", "type", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Reverse/AbstractSchemaParser.php#L197-L204
propelorm/Propel2
src/Propel/Generator/Reverse/AbstractSchemaParser.php
AbstractSchemaParser.getNewVendorInfoObject
protected function getNewVendorInfoObject(array $params) { $type = $this->getPlatform()->getDatabaseType(); $vi = new VendorInfo($type); $vi->setParameters($params); return $vi; }
php
protected function getNewVendorInfoObject(array $params) { $type = $this->getPlatform()->getDatabaseType(); $vi = new VendorInfo($type); $vi->setParameters($params); return $vi; }
[ "protected", "function", "getNewVendorInfoObject", "(", "array", "$", "params", ")", "{", "$", "type", "=", "$", "this", "->", "getPlatform", "(", ")", "->", "getDatabaseType", "(", ")", ";", "$", "vi", "=", "new", "VendorInfo", "(", "$", "type", ")", ...
Gets a new VendorInfo object for this platform with specified params. @param array $params
[ "Gets", "a", "new", "VendorInfo", "object", "for", "this", "platform", "with", "specified", "params", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Reverse/AbstractSchemaParser.php#L211-L219
propelorm/Propel2
src/Propel/Generator/Reverse/AbstractSchemaParser.php
AbstractSchemaParser.getPlatform
public function getPlatform() { if (null === $this->platform) { $this->platform = $this->getGeneratorConfig()->getConfiguredPlatform(); } return $this->platform; }
php
public function getPlatform() { if (null === $this->platform) { $this->platform = $this->getGeneratorConfig()->getConfiguredPlatform(); } return $this->platform; }
[ "public", "function", "getPlatform", "(", ")", "{", "if", "(", "null", "===", "$", "this", "->", "platform", ")", "{", "$", "this", "->", "platform", "=", "$", "this", "->", "getGeneratorConfig", "(", ")", "->", "getConfiguredPlatform", "(", ")", ";", ...
Returns the database's platform. @return \Propel\Generator\Platform\PlatformInterface
[ "Returns", "the", "database", "s", "platform", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Reverse/AbstractSchemaParser.php#L231-L238
propelorm/Propel2
src/Propel/Generator/Model/Diff/ColumnComparator.php
ColumnComparator.computeDiff
public static function computeDiff(Column $fromColumn, Column $toColumn) { if ($changedProperties = self::compareColumns($fromColumn, $toColumn)) { if ($fromColumn->hasPlatform() || $toColumn->hasPlatform()) { $platform = $fromColumn->hasPlatform() ? $fromColumn->getPlatform() : ...
php
public static function computeDiff(Column $fromColumn, Column $toColumn) { if ($changedProperties = self::compareColumns($fromColumn, $toColumn)) { if ($fromColumn->hasPlatform() || $toColumn->hasPlatform()) { $platform = $fromColumn->hasPlatform() ? $fromColumn->getPlatform() : ...
[ "public", "static", "function", "computeDiff", "(", "Column", "$", "fromColumn", ",", "Column", "$", "toColumn", ")", "{", "if", "(", "$", "changedProperties", "=", "self", "::", "compareColumns", "(", "$", "fromColumn", ",", "$", "toColumn", ")", ")", "{"...
Compute and return the difference between two column objects @param Column $fromColumn @param Column $toColumn @return ColumnDiff|boolean return false if the two columns are similar
[ "Compute", "and", "return", "the", "difference", "between", "two", "column", "objects" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Diff/ColumnComparator.php#L29-L45
propelorm/Propel2
src/Propel/Generator/Builder/Om/ExtensionQueryInheritanceBuilder.php
ExtensionQueryInheritanceBuilder.addClassOpen
protected function addClassOpen(&$script) { $table = $this->getTable(); $tableName = $table->getName(); $tableDesc = $table->getDescription(); $baseBuilder = $this->getNewQueryInheritanceBuilder($this->getChild()); $baseClassName = $this->getClassNameFromBuilder($baseBuilder...
php
protected function addClassOpen(&$script) { $table = $this->getTable(); $tableName = $table->getName(); $tableDesc = $table->getDescription(); $baseBuilder = $this->getNewQueryInheritanceBuilder($this->getChild()); $baseClassName = $this->getClassNameFromBuilder($baseBuilder...
[ "protected", "function", "addClassOpen", "(", "&", "$", "script", ")", "{", "$", "table", "=", "$", "this", "->", "getTable", "(", ")", ";", "$", "tableName", "=", "$", "table", "->", "getName", "(", ")", ";", "$", "tableDesc", "=", "$", "table", "...
Adds class phpdoc comment and opening of class. @param string $script
[ "Adds", "class", "phpdoc", "comment", "and", "opening", "of", "class", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/ExtensionQueryInheritanceBuilder.php#L82-L118
propelorm/Propel2
src/Propel/Generator/Behavior/I18n/I18nBehavior.php
I18nBehavior.moveI18nColumns
protected function moveI18nColumns() { $table = $this->getTable(); $i18nTable = $this->i18nTable; $i18nValidateParams = []; foreach ($this->getI18nColumnNamesFromConfig() as $columnName) { if (!$i18nTable->hasColumn($columnName)) { if (!$table->hasCol...
php
protected function moveI18nColumns() { $table = $this->getTable(); $i18nTable = $this->i18nTable; $i18nValidateParams = []; foreach ($this->getI18nColumnNamesFromConfig() as $columnName) { if (!$i18nTable->hasColumn($columnName)) { if (!$table->hasCol...
[ "protected", "function", "moveI18nColumns", "(", ")", "{", "$", "table", "=", "$", "this", "->", "getTable", "(", ")", ";", "$", "i18nTable", "=", "$", "this", "->", "i18nTable", ";", "$", "i18nValidateParams", "=", "[", "]", ";", "foreach", "(", "$", ...
Moves i18n columns from the main table to the i18n table
[ "Moves", "i18n", "columns", "from", "the", "main", "table", "to", "the", "i18n", "table" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Behavior/I18n/I18nBehavior.php#L236-L277
propelorm/Propel2
src/Propel/Generator/Command/MigrationDownCommand.php
MigrationDownCommand.execute
protected function execute(InputInterface $input, OutputInterface $output) { $configOptions = []; if ($this->hasInputOption('output-dir', $input)) { $configOptions['propel']['paths']['migrationDir'] = $input->getOption('output-dir'); } if ($this->hasInputOption('migrati...
php
protected function execute(InputInterface $input, OutputInterface $output) { $configOptions = []; if ($this->hasInputOption('output-dir', $input)) { $configOptions['propel']['paths']['migrationDir'] = $input->getOption('output-dir'); } if ($this->hasInputOption('migrati...
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "configOptions", "=", "[", "]", ";", "if", "(", "$", "this", "->", "hasInputOption", "(", "'output-dir'", ",", "$", "input", ")",...
{@inheritdoc}
[ "{" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Command/MigrationDownCommand.php#L47-L184
propelorm/Propel2
src/Propel/Runtime/Collection/ObjectCollection.php
ObjectCollection.save
public function save($con = null) { if (!method_exists($this->getFullyQualifiedModel(), 'save')) { throw new ReadOnlyModelException('Cannot save objects on a read-only model'); } if (null === $con) { $con = $this->getWriteConnection(); } $con->transact...
php
public function save($con = null) { if (!method_exists($this->getFullyQualifiedModel(), 'save')) { throw new ReadOnlyModelException('Cannot save objects on a read-only model'); } if (null === $con) { $con = $this->getWriteConnection(); } $con->transact...
[ "public", "function", "save", "(", "$", "con", "=", "null", ")", "{", "if", "(", "!", "method_exists", "(", "$", "this", "->", "getFullyQualifiedModel", "(", ")", ",", "'save'", ")", ")", "{", "throw", "new", "ReadOnlyModelException", "(", "'Cannot save ob...
Save all the elements in the collection @param ConnectionInterface $con
[ "Save", "all", "the", "elements", "in", "the", "collection" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/ObjectCollection.php#L60-L74
propelorm/Propel2
src/Propel/Runtime/Collection/ObjectCollection.php
ObjectCollection.getPrimaryKeys
public function getPrimaryKeys($usePrefix = true) { $ret = []; /** @var $obj ActiveRecordInterface */ foreach ($this as $key => $obj) { $key = $usePrefix ? ($this->getModel() . '_' . $key) : $key; $ret[$key]= $obj->getPrimaryKey(); } return $ret; ...
php
public function getPrimaryKeys($usePrefix = true) { $ret = []; /** @var $obj ActiveRecordInterface */ foreach ($this as $key => $obj) { $key = $usePrefix ? ($this->getModel() . '_' . $key) : $key; $ret[$key]= $obj->getPrimaryKey(); } return $ret; ...
[ "public", "function", "getPrimaryKeys", "(", "$", "usePrefix", "=", "true", ")", "{", "$", "ret", "=", "[", "]", ";", "/** @var $obj ActiveRecordInterface */", "foreach", "(", "$", "this", "as", "$", "key", "=>", "$", "obj", ")", "{", "$", "key", "=", ...
Get an array of the primary keys of all the objects in the collection @param boolean $usePrefix @return array The list of the primary keys of the collection
[ "Get", "an", "array", "of", "the", "primary", "keys", "of", "all", "the", "objects", "in", "the", "collection" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/ObjectCollection.php#L103-L114
propelorm/Propel2
src/Propel/Runtime/Collection/ObjectCollection.php
ObjectCollection.fromArray
public function fromArray($arr) { $class = $this->getFullyQualifiedModel(); foreach ($arr as $element) { /** @var $obj ActiveRecordInterface */ $obj = new $class(); $obj->fromArray($element); $this->append($obj); } }
php
public function fromArray($arr) { $class = $this->getFullyQualifiedModel(); foreach ($arr as $element) { /** @var $obj ActiveRecordInterface */ $obj = new $class(); $obj->fromArray($element); $this->append($obj); } }
[ "public", "function", "fromArray", "(", "$", "arr", ")", "{", "$", "class", "=", "$", "this", "->", "getFullyQualifiedModel", "(", ")", ";", "foreach", "(", "$", "arr", "as", "$", "element", ")", "{", "/** @var $obj ActiveRecordInterface */", "$", "obj", "...
Populates the collection from an array Each object is populated from an array and the result is stored Does not empty the collection before adding the data from the array @param array $arr
[ "Populates", "the", "collection", "from", "an", "array", "Each", "object", "is", "populated", "from", "an", "array", "and", "the", "result", "is", "stored", "Does", "not", "empty", "the", "collection", "before", "adding", "the", "data", "from", "the", "array...
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/ObjectCollection.php#L123-L132
propelorm/Propel2
src/Propel/Runtime/Collection/ObjectCollection.php
ObjectCollection.toKeyValue
public function toKeyValue($keyColumn = 'PrimaryKey', $valueColumn = null) { $ret = []; $keyGetterMethod = 'get' . $keyColumn; $valueGetterMethod = (null === $valueColumn) ? '__toString' : ('get' . $valueColumn); foreach ($this as $obj) { $ret[$obj->$keyGetterMethod()] = ...
php
public function toKeyValue($keyColumn = 'PrimaryKey', $valueColumn = null) { $ret = []; $keyGetterMethod = 'get' . $keyColumn; $valueGetterMethod = (null === $valueColumn) ? '__toString' : ('get' . $valueColumn); foreach ($this as $obj) { $ret[$obj->$keyGetterMethod()] = ...
[ "public", "function", "toKeyValue", "(", "$", "keyColumn", "=", "'PrimaryKey'", ",", "$", "valueColumn", "=", "null", ")", "{", "$", "ret", "=", "[", "]", ";", "$", "keyGetterMethod", "=", "'get'", ".", "$", "keyColumn", ";", "$", "valueGetterMethod", "=...
Get an associative array representation of the collection The first parameter specifies the column to be used for the key, And the second for the value. <code> $res = $coll->toKeyValue('Id', 'Name'); </code> @param string $keyColumn @param string $valueColumn @return array
[ "Get", "an", "associative", "array", "representation", "of", "the", "collection", "The", "first", "parameter", "specifies", "the", "column", "to", "be", "used", "for", "the", "key", "And", "the", "second", "for", "the", "value", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/ObjectCollection.php#L241-L251
propelorm/Propel2
src/Propel/Runtime/Collection/ObjectCollection.php
ObjectCollection.toKeyIndex
public function toKeyIndex($keyColumn = 'PrimaryKey') { $ret = []; $keyGetterMethod = 'get' . ucfirst($keyColumn); foreach ($this as $obj) { $ret[$obj->$keyGetterMethod()] = $obj; } return $ret; }
php
public function toKeyIndex($keyColumn = 'PrimaryKey') { $ret = []; $keyGetterMethod = 'get' . ucfirst($keyColumn); foreach ($this as $obj) { $ret[$obj->$keyGetterMethod()] = $obj; } return $ret; }
[ "public", "function", "toKeyIndex", "(", "$", "keyColumn", "=", "'PrimaryKey'", ")", "{", "$", "ret", "=", "[", "]", ";", "$", "keyGetterMethod", "=", "'get'", ".", "ucfirst", "(", "$", "keyColumn", ")", ";", "foreach", "(", "$", "this", "as", "$", "...
Get an associative array representation of the collection. The first parameter specifies the column to be used for the key. <code> $res = $userCollection->toKeyIndex('Name'); $res = array( 'peter' => class User #1 {$name => 'peter', ...}, 'hans' => class User #2 {$name => 'hans', ...}, ... ) </code> @param string $k...
[ "Get", "an", "associative", "array", "representation", "of", "the", "collection", ".", "The", "first", "parameter", "specifies", "the", "column", "to", "be", "used", "for", "the", "key", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/ObjectCollection.php#L271-L280
propelorm/Propel2
src/Propel/Runtime/Collection/ObjectCollection.php
ObjectCollection.getColumnValues
public function getColumnValues($columnName = 'PrimaryKey') { $ret = []; $keyGetterMethod = 'get' . ucfirst($columnName); foreach ($this as $obj) { $ret[] = $obj->$keyGetterMethod(); } return $ret; }
php
public function getColumnValues($columnName = 'PrimaryKey') { $ret = []; $keyGetterMethod = 'get' . ucfirst($columnName); foreach ($this as $obj) { $ret[] = $obj->$keyGetterMethod(); } return $ret; }
[ "public", "function", "getColumnValues", "(", "$", "columnName", "=", "'PrimaryKey'", ")", "{", "$", "ret", "=", "[", "]", ";", "$", "keyGetterMethod", "=", "'get'", ".", "ucfirst", "(", "$", "columnName", ")", ";", "foreach", "(", "$", "this", "as", "...
Get an array representation of the column. <code> $res = $userCollection->toKeyIndex('Name'); $res = array( 'peter', 'hans', ... ) </code> @param string $columnName @return array
[ "Get", "an", "array", "representation", "of", "the", "column", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/ObjectCollection.php#L299-L308
propelorm/Propel2
src/Propel/Runtime/Collection/ObjectCollection.php
ObjectCollection.populateRelation
public function populateRelation($relation, $criteria = null, $con = null) { if (!Propel::isInstancePoolingEnabled()) { throw new RuntimeException(__METHOD__ .' needs instance pooling to be enabled prior to populating the collection'); } $relationMap = $this->getFormatter()->getT...
php
public function populateRelation($relation, $criteria = null, $con = null) { if (!Propel::isInstancePoolingEnabled()) { throw new RuntimeException(__METHOD__ .' needs instance pooling to be enabled prior to populating the collection'); } $relationMap = $this->getFormatter()->getT...
[ "public", "function", "populateRelation", "(", "$", "relation", ",", "$", "criteria", "=", "null", ",", "$", "con", "=", "null", ")", "{", "if", "(", "!", "Propel", "::", "isInstancePoolingEnabled", "(", ")", ")", "{", "throw", "new", "RuntimeException", ...
Makes an additional query to populate the objects related to the collection objects by a certain relation @param string $relation Relation name (e.g. 'Book') @param Criteria $criteria Optional Criteria object to filter the related object collection @param ConnectionInterface $con Optional ...
[ "Makes", "an", "additional", "query", "to", "populate", "the", "objects", "related", "to", "the", "collection", "objects", "by", "a", "certain", "relation" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/ObjectCollection.php#L320-L371
propelorm/Propel2
src/Propel/Runtime/Collection/ObjectCollection.php
ObjectCollection.search
public function search($element) { if (isset($this->indexSplHash[$splHash = spl_object_hash($element)])) { return $this->index[$this->indexSplHash[$splHash]]; } $hashCode = $this->getHashCode($element); if (isset($this->index[$hashCode])) { return $this->inde...
php
public function search($element) { if (isset($this->indexSplHash[$splHash = spl_object_hash($element)])) { return $this->index[$this->indexSplHash[$splHash]]; } $hashCode = $this->getHashCode($element); if (isset($this->index[$hashCode])) { return $this->inde...
[ "public", "function", "search", "(", "$", "element", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "indexSplHash", "[", "$", "splHash", "=", "spl_object_hash", "(", "$", "element", ")", "]", ")", ")", "{", "return", "$", "this", "->", "index"...
{@inheritdoc}
[ "{" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/ObjectCollection.php#L376-L388
propelorm/Propel2
src/Propel/Runtime/Collection/ObjectCollection.php
ObjectCollection.contains
public function contains($element) { if (!is_object($element)) { return parent::contains($element); } return isset($this->indexSplHash[spl_object_hash($element)]) || isset($this->index[$this->getHashCode($element)]); }
php
public function contains($element) { if (!is_object($element)) { return parent::contains($element); } return isset($this->indexSplHash[spl_object_hash($element)]) || isset($this->index[$this->getHashCode($element)]); }
[ "public", "function", "contains", "(", "$", "element", ")", "{", "if", "(", "!", "is_object", "(", "$", "element", ")", ")", "{", "return", "parent", "::", "contains", "(", "$", "element", ")", ";", "}", "return", "isset", "(", "$", "this", "->", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/ObjectCollection.php#L479-L486
propelorm/Propel2
src/Propel/Runtime/Collection/ObjectCollection.php
ObjectCollection.getHashCode
protected function getHashCode($object) { if (is_object($object) && is_callable([$object, 'hashCode'])) { return $object->hashCode(); } return spl_object_hash($object); }
php
protected function getHashCode($object) { if (is_object($object) && is_callable([$object, 'hashCode'])) { return $object->hashCode(); } return spl_object_hash($object); }
[ "protected", "function", "getHashCode", "(", "$", "object", ")", "{", "if", "(", "is_object", "(", "$", "object", ")", "&&", "is_callable", "(", "[", "$", "object", ",", "'hashCode'", "]", ")", ")", "{", "return", "$", "object", "->", "hashCode", "(", ...
Returns the result of $object->hashCode() if available or uses spl_object_hash($object). @param mixed $object
[ "Returns", "the", "result", "of", "$object", "-", ">", "hashCode", "()", "if", "available", "or", "uses", "spl_object_hash", "(", "$object", ")", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/ObjectCollection.php#L493-L500
propelorm/Propel2
src/Propel/Generator/Behavior/AggregateColumn/AggregateColumnBehavior.php
AggregateColumnBehavior.modifyTable
public function modifyTable() { $table = $this->getTable(); $columnName = $this->getParameter('name'); if (!$columnName) { throw new \InvalidArgumentException(sprintf('You must define a \'name\' parameter for the \'aggregate_column\' behavior in the \'%s\' table', $table->getName...
php
public function modifyTable() { $table = $this->getTable(); $columnName = $this->getParameter('name'); if (!$columnName) { throw new \InvalidArgumentException(sprintf('You must define a \'name\' parameter for the \'aggregate_column\' behavior in the \'%s\' table', $table->getName...
[ "public", "function", "modifyTable", "(", ")", "{", "$", "table", "=", "$", "this", "->", "getTable", "(", ")", ";", "$", "columnName", "=", "$", "this", "->", "getParameter", "(", "'name'", ")", ";", "if", "(", "!", "$", "columnName", ")", "{", "t...
Add the aggregate key to the current table
[ "Add", "the", "aggregate", "key", "to", "the", "current", "table" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Behavior/AggregateColumn/AggregateColumnBehavior.php#L46-L73
propelorm/Propel2
src/Propel/Runtime/Adapter/Pdo/SqlsrvAdapter.php
SqlsrvAdapter.initConnection
public function initConnection(ConnectionInterface $con, array $settings) { $con->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); $con->setAttribute(\PDO::ATTR_STRINGIFY_FETCHES, false); parent::initConnection($con, $settings); }
php
public function initConnection(ConnectionInterface $con, array $settings) { $con->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); $con->setAttribute(\PDO::ATTR_STRINGIFY_FETCHES, false); parent::initConnection($con, $settings); }
[ "public", "function", "initConnection", "(", "ConnectionInterface", "$", "con", ",", "array", "$", "settings", ")", "{", "$", "con", "->", "setAttribute", "(", "\\", "PDO", "::", "ATTR_ERRMODE", ",", "\\", "PDO", "::", "ERRMODE_EXCEPTION", ")", ";", "$", "...
@see parent::initConnection() @param ConnectionInterface $con @param array $settings An array of settings.
[ "@see", "parent", "::", "initConnection", "()" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Adapter/Pdo/SqlsrvAdapter.php#L33-L39
propelorm/Propel2
src/Propel/Runtime/Adapter/Pdo/SqlsrvAdapter.php
SqlsrvAdapter.setCharset
public function setCharset(ConnectionInterface $con, $charset) { switch (strtolower($charset)) { case 'utf-8': $con->setAttribute(\PDO::SQLSRV_ATTR_ENCODING, \PDO::SQLSRV_ENCODING_UTF8); break; case 'system': $con->setAttribute(\PDO::SQ...
php
public function setCharset(ConnectionInterface $con, $charset) { switch (strtolower($charset)) { case 'utf-8': $con->setAttribute(\PDO::SQLSRV_ATTR_ENCODING, \PDO::SQLSRV_ENCODING_UTF8); break; case 'system': $con->setAttribute(\PDO::SQ...
[ "public", "function", "setCharset", "(", "ConnectionInterface", "$", "con", ",", "$", "charset", ")", "{", "switch", "(", "strtolower", "(", "$", "charset", ")", ")", "{", "case", "'utf-8'", ":", "$", "con", "->", "setAttribute", "(", "\\", "PDO", "::", ...
@see parent::setCharset() @param ConnectionInterface $con @param string $charset @throws \Propel\Runtime\Adapter\Exception\UnsupportedEncodingException
[ "@see", "parent", "::", "setCharset", "()" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Adapter/Pdo/SqlsrvAdapter.php#L49-L61
propelorm/Propel2
src/Propel/Runtime/Adapter/Pdo/SqlsrvAdapter.php
SqlsrvAdapter.cleanupSQL
public function cleanupSQL(&$sql, array &$params, Criteria $values, DatabaseMap $dbMap) { $i = 1; foreach ($params as $param) { $tableName = $param['table']; $columnName = $param['column']; $value = $param['value']; // this is to workaround for a bug ...
php
public function cleanupSQL(&$sql, array &$params, Criteria $values, DatabaseMap $dbMap) { $i = 1; foreach ($params as $param) { $tableName = $param['table']; $columnName = $param['column']; $value = $param['value']; // this is to workaround for a bug ...
[ "public", "function", "cleanupSQL", "(", "&", "$", "sql", ",", "array", "&", "$", "params", ",", "Criteria", "$", "values", ",", "DatabaseMap", "$", "dbMap", ")", "{", "$", "i", "=", "1", ";", "foreach", "(", "$", "params", "as", "$", "param", ")",...
@see parent::cleanupSQL() @param string $sql @param array $params @param Criteria $values @param DatabaseMap $dbMap
[ "@see", "parent", "::", "cleanupSQL", "()" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Adapter/Pdo/SqlsrvAdapter.php#L71-L89
propelorm/Propel2
src/Propel/Generator/Model/ScopedMappingModel.php
ScopedMappingModel.setNamespace
public function setNamespace($namespace) { $namespace = rtrim(trim($namespace), '\\'); if ($namespace === $this->namespace) { return; } $this->namespace = $namespace; if ($namespace && (!$this->package || $this->packageOverridden) && $this->getBuildProperty('gen...
php
public function setNamespace($namespace) { $namespace = rtrim(trim($namespace), '\\'); if ($namespace === $this->namespace) { return; } $this->namespace = $namespace; if ($namespace && (!$this->package || $this->packageOverridden) && $this->getBuildProperty('gen...
[ "public", "function", "setNamespace", "(", "$", "namespace", ")", "{", "$", "namespace", "=", "rtrim", "(", "trim", "(", "$", "namespace", ")", ",", "'\\\\'", ")", ";", "if", "(", "$", "namespace", "===", "$", "this", "->", "namespace", ")", "{", "re...
Sets the namespace. @param string $namespace
[ "Sets", "the", "namespace", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/ScopedMappingModel.php#L77-L90
propelorm/Propel2
src/Propel/Generator/Model/ScopedMappingModel.php
ScopedMappingModel.setPackage
public function setPackage($package) { if ($package === $this->package) { return; } $this->package = $package; $this->packageOverridden = false; }
php
public function setPackage($package) { if ($package === $this->package) { return; } $this->package = $package; $this->packageOverridden = false; }
[ "public", "function", "setPackage", "(", "$", "package", ")", "{", "if", "(", "$", "package", "===", "$", "this", "->", "package", ")", "{", "return", ";", "}", "$", "this", "->", "package", "=", "$", "package", ";", "$", "this", "->", "packageOverri...
Sets the package name. @param string $package
[ "Sets", "the", "package", "name", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/ScopedMappingModel.php#L120-L128
propelorm/Propel2
src/Propel/Generator/Model/ScopedMappingModel.php
ScopedMappingModel.setSchema
public function setSchema($schema) { if ($schema === $this->schema) { return; } $this->schema = $schema; if ($schema && !$this->package && $this->getBuildProperty('schemaAutoPackage')) { $this->package = $schema; $this->packageOverridden = true; ...
php
public function setSchema($schema) { if ($schema === $this->schema) { return; } $this->schema = $schema; if ($schema && !$this->package && $this->getBuildProperty('schemaAutoPackage')) { $this->package = $schema; $this->packageOverridden = true; ...
[ "public", "function", "setSchema", "(", "$", "schema", ")", "{", "if", "(", "$", "schema", "===", "$", "this", "->", "schema", ")", "{", "return", ";", "}", "$", "this", "->", "schema", "=", "$", "schema", ";", "if", "(", "$", "schema", "&&", "!"...
Sets the schema name. @param string $schema
[ "Sets", "the", "schema", "name", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/ScopedMappingModel.php#L145-L160
propelorm/Propel2
src/Propel/Common/Config/Loader/JsonFileLoader.php
JsonFileLoader.load
public function load($file, $type = null) { $json = file_get_contents($this->getPath($file)); $content = []; if ('' !== $json) { $content = json_decode($json, true); $error = json_last_error(); if (JSON_ERROR_NONE !== $error) { throw new...
php
public function load($file, $type = null) { $json = file_get_contents($this->getPath($file)); $content = []; if ('' !== $json) { $content = json_decode($json, true); $error = json_last_error(); if (JSON_ERROR_NONE !== $error) { throw new...
[ "public", "function", "load", "(", "$", "file", ",", "$", "type", "=", "null", ")", "{", "$", "json", "=", "file_get_contents", "(", "$", "this", "->", "getPath", "(", "$", "file", ")", ")", ";", "$", "content", "=", "[", "]", ";", "if", "(", "...
Loads an Json file. @param mixed $file The resource @param string $type The resource type @return array @throws \InvalidArgumentException if configuration file not found @throws \Propel\Common\Config\Exception\JsonParseException if invalid json file @throws \Propel\Common\Config\Excepti...
[ "Loads", "an", "Json", "file", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Common/Config/Loader/JsonFileLoader.php#L34-L52
propelorm/Propel2
src/Propel/Generator/Config/QuickGeneratorConfig.php
QuickGeneratorConfig.getConfiguredBuilder
public function getConfiguredBuilder(Table $table, $type) { $class = $this->getConfigProperty('generator.objectModel.builders.' . $type); if (null === $class) { throw new InvalidArgumentException("Invalid data model builder type `$type`"); } $builder = new $class($table...
php
public function getConfiguredBuilder(Table $table, $type) { $class = $this->getConfigProperty('generator.objectModel.builders.' . $type); if (null === $class) { throw new InvalidArgumentException("Invalid data model builder type `$type`"); } $builder = new $class($table...
[ "public", "function", "getConfiguredBuilder", "(", "Table", "$", "table", ",", "$", "type", ")", "{", "$", "class", "=", "$", "this", "->", "getConfigProperty", "(", "'generator.objectModel.builders.'", ".", "$", "type", ")", ";", "if", "(", "null", "===", ...
Gets a configured data model builder class for specified table and based on type ('ddl', 'sql', etc.). @param Table $table @param string $type @return DataModelBuilder
[ "Gets", "a", "configured", "data", "model", "builder", "class", "for", "specified", "table", "and", "based", "on", "type", "(", "ddl", "sql", "etc", ".", ")", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Config/QuickGeneratorConfig.php#L72-L84
propelorm/Propel2
src/Propel/Runtime/Formatter/AbstractFormatter.php
AbstractFormatter.init
public function init(BaseModelCriteria $criteria, DataFetcherInterface $dataFetcher = null) { $this->dbName = $criteria->getDbName(); $this->setClass($criteria->getModelName()); $this->setWith($criteria->getWith()); $this->asColumns = $criteria->getAsColumns(); $this->hasLimi...
php
public function init(BaseModelCriteria $criteria, DataFetcherInterface $dataFetcher = null) { $this->dbName = $criteria->getDbName(); $this->setClass($criteria->getModelName()); $this->setWith($criteria->getWith()); $this->asColumns = $criteria->getAsColumns(); $this->hasLimi...
[ "public", "function", "init", "(", "BaseModelCriteria", "$", "criteria", ",", "DataFetcherInterface", "$", "dataFetcher", "=", "null", ")", "{", "$", "this", "->", "dbName", "=", "$", "criteria", "->", "getDbName", "(", ")", ";", "$", "this", "->", "setCla...
Define the hydration schema based on a query object. Fills the Formatter's properties using a Criteria as source @param BaseModelCriteria $criteria @param DataFetcherInterface $dataFetcher @return $this|AbstractFormatter The current formatter object
[ "Define", "the", "hydration", "schema", "based", "on", "a", "query", "object", ".", "Fills", "the", "Formatter", "s", "properties", "using", "a", "Criteria", "as", "source" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Formatter/AbstractFormatter.php#L92-L104