id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
199,100
PatrolServer/patrolsdk-php
lib/Exploit.php
Exploit.all
public function all($scopes = []) { return $this->_get('servers/' . $this->server_id . '/software/' . $this->software_id . '/exploits', null, $scopes); }
php
public function all($scopes = []) { return $this->_get('servers/' . $this->server_id . '/software/' . $this->software_id . '/exploits', null, $scopes); }
[ "public", "function", "all", "(", "$", "scopes", "=", "[", "]", ")", "{", "return", "$", "this", "->", "_get", "(", "'servers/'", ".", "$", "this", "->", "server_id", ".", "'/software/'", ".", "$", "this", "->", "software_id", ".", "'/exploits'", ",", ...
Gets a list of all exploits of this particular software @param array $scopes optional @return array List of PatrolSdk\Exploit
[ "Gets", "a", "list", "of", "all", "exploits", "of", "this", "particular", "software" ]
2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2
https://github.com/PatrolServer/patrolsdk-php/blob/2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2/lib/Exploit.php#L38-L40
199,101
Stinger-Soft/DoctrineCommons
src/StingerSoft/DoctrineCommons/Utils/Helper/ImportListener.php
ImportListener.tableExists
protected function tableExists($tableName) { if(isset($this->nonExistingTables[$tableName])) return false; if(isset($this->existingTables[$tableName])) return true; $exists = $this->schemaManager->tablesExist(array( $tableName )); if(!$exists) { $this->nonExistingTables[$tableName] = 1; } else ...
php
protected function tableExists($tableName) { if(isset($this->nonExistingTables[$tableName])) return false; if(isset($this->existingTables[$tableName])) return true; $exists = $this->schemaManager->tablesExist(array( $tableName )); if(!$exists) { $this->nonExistingTables[$tableName] = 1; } else ...
[ "protected", "function", "tableExists", "(", "$", "tableName", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "nonExistingTables", "[", "$", "tableName", "]", ")", ")", "return", "false", ";", "if", "(", "isset", "(", "$", "this", "->", "existin...
Checks if the given table exists @param string $tableName The table name to check @return boolean Returns true if the table exists, otherwise false
[ "Checks", "if", "the", "given", "table", "exists" ]
1f0dd56a94654c8de63927d7eec2175aab3cf809
https://github.com/Stinger-Soft/DoctrineCommons/blob/1f0dd56a94654c8de63927d7eec2175aab3cf809/src/StingerSoft/DoctrineCommons/Utils/Helper/ImportListener.php#L257-L271
199,102
cloudtek/dynamodm
lib/Cloudtek/DynamoDM/Expression/Condition/Operator/Operator.php
Operator.validateMappings
protected function validateMappings($mappings, $allowAssociations) { $type = null; foreach ($mappings as $mapping) { //compatible date or number types are identical for our purposes here switch ($mapping->type) { case Type::TIMESTAMP: $this...
php
protected function validateMappings($mappings, $allowAssociations) { $type = null; foreach ($mappings as $mapping) { //compatible date or number types are identical for our purposes here switch ($mapping->type) { case Type::TIMESTAMP: $this...
[ "protected", "function", "validateMappings", "(", "$", "mappings", ",", "$", "allowAssociations", ")", "{", "$", "type", "=", "null", ";", "foreach", "(", "$", "mappings", "as", "$", "mapping", ")", "{", "//compatible date or number types are identical for our purpo...
Validate that the provided mappings use compatible serialization strategies. Adhere to the fail-fast principle by throwing exceptions here rather than processing nonsensical queries that return misleading results. @param PropertyMetadata[] $mappings @param bool $allowAssociations @return void @throws ...
[ "Validate", "that", "the", "provided", "mappings", "use", "compatible", "serialization", "strategies", "." ]
119d355e2c5cbaef1f867970349b4432f5704fcd
https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Expression/Condition/Operator/Operator.php#L79-L162
199,103
ibonly/Potato-ORM
src/Database/DatabaseQuery.php
DatabaseQuery.checkTableExist
public function checkTableExist($table, $con=NULL) { $connection = $this->checkConnection($con); $query = $connection->query("SELECT 1 FROM {$table} LIMIT 1"); if($query !== false) { return true; } }
php
public function checkTableExist($table, $con=NULL) { $connection = $this->checkConnection($con); $query = $connection->query("SELECT 1 FROM {$table} LIMIT 1"); if($query !== false) { return true; } }
[ "public", "function", "checkTableExist", "(", "$", "table", ",", "$", "con", "=", "NULL", ")", "{", "$", "connection", "=", "$", "this", "->", "checkConnection", "(", "$", "con", ")", ";", "$", "query", "=", "$", "connection", "->", "query", "(", "\"...
checkTableExist Check if table already in the database @param $tablename @param $con @return bool
[ "checkTableExist", "Check", "if", "table", "already", "in", "the", "database" ]
644962a99e1c0191b732d7729cd466d52c5d8652
https://github.com/ibonly/Potato-ORM/blob/644962a99e1c0191b732d7729cd466d52c5d8652/src/Database/DatabaseQuery.php#L128-L136
199,104
ibonly/Potato-ORM
src/Database/DatabaseQuery.php
DatabaseQuery.checkTableName
protected static function checkTableName($tableName, $con=NULL) { $connection = self::checkConnection($con); $query = $connection->query("SELECT 1 FROM {$tableName} LIMIT 1"); if($query !== false) { return $tableName; } throw new TableDoesNotExistExceptio...
php
protected static function checkTableName($tableName, $con=NULL) { $connection = self::checkConnection($con); $query = $connection->query("SELECT 1 FROM {$tableName} LIMIT 1"); if($query !== false) { return $tableName; } throw new TableDoesNotExistExceptio...
[ "protected", "static", "function", "checkTableName", "(", "$", "tableName", ",", "$", "con", "=", "NULL", ")", "{", "$", "connection", "=", "self", "::", "checkConnection", "(", "$", "con", ")", ";", "$", "query", "=", "$", "connection", "->", "query", ...
checkTableName Return the table name @param $tablename @param $con @return string
[ "checkTableName", "Return", "the", "table", "name" ]
644962a99e1c0191b732d7729cd466d52c5d8652
https://github.com/ibonly/Potato-ORM/blob/644962a99e1c0191b732d7729cd466d52c5d8652/src/Database/DatabaseQuery.php#L146-L156
199,105
ibonly/Potato-ORM
src/Database/DatabaseQuery.php
DatabaseQuery.checkColumn
protected static function checkColumn($tableName, $columnName, $con=NULL) { $connection = self::checkConnection($con); $result = $connection->prepare("SELECT {$columnName} FROM {$tableName}"); $result->execute(); if (! $result->columnCount()) { ...
php
protected static function checkColumn($tableName, $columnName, $con=NULL) { $connection = self::checkConnection($con); $result = $connection->prepare("SELECT {$columnName} FROM {$tableName}"); $result->execute(); if (! $result->columnCount()) { ...
[ "protected", "static", "function", "checkColumn", "(", "$", "tableName", ",", "$", "columnName", ",", "$", "con", "=", "NULL", ")", "{", "$", "connection", "=", "self", "::", "checkConnection", "(", "$", "con", ")", ";", "$", "result", "=", "$", "conne...
checkColumn Check if column exist in table @param $tableName @param $columnName @param $con @return string
[ "checkColumn", "Check", "if", "column", "exist", "in", "table" ]
644962a99e1c0191b732d7729cd466d52c5d8652
https://github.com/ibonly/Potato-ORM/blob/644962a99e1c0191b732d7729cd466d52c5d8652/src/Database/DatabaseQuery.php#L167-L178
199,106
ibonly/Potato-ORM
src/Database/DatabaseQuery.php
DatabaseQuery.buildColumn
protected static function buildColumn($data) { $counter = 0; $insertQuery = ""; $arraySize = count($data); foreach ($data as $key => $value) { $counter++; $insertQuery .= self::sanitize($key); if($arraySize > $counter) $ins...
php
protected static function buildColumn($data) { $counter = 0; $insertQuery = ""; $arraySize = count($data); foreach ($data as $key => $value) { $counter++; $insertQuery .= self::sanitize($key); if($arraySize > $counter) $ins...
[ "protected", "static", "function", "buildColumn", "(", "$", "data", ")", "{", "$", "counter", "=", "0", ";", "$", "insertQuery", "=", "\"\"", ";", "$", "arraySize", "=", "count", "(", "$", "data", ")", ";", "foreach", "(", "$", "data", "as", "$", "...
buildColumn Build the column name @param $data @return string
[ "buildColumn", "Build", "the", "column", "name" ]
644962a99e1c0191b732d7729cd466d52c5d8652
https://github.com/ibonly/Potato-ORM/blob/644962a99e1c0191b732d7729cd466d52c5d8652/src/Database/DatabaseQuery.php#L187-L201
199,107
ibonly/Potato-ORM
src/Database/DatabaseQuery.php
DatabaseQuery.buildClause
protected static function buildClause($tableName, $data) { $counter = 0; $updateQuery = ""; $arraySize = count($data); foreach ($data as $key => $value) { $counter++; $columnName = self::checkColumn($tableName, self::sanitize($key)); $upda...
php
protected static function buildClause($tableName, $data) { $counter = 0; $updateQuery = ""; $arraySize = count($data); foreach ($data as $key => $value) { $counter++; $columnName = self::checkColumn($tableName, self::sanitize($key)); $upda...
[ "protected", "static", "function", "buildClause", "(", "$", "tableName", ",", "$", "data", ")", "{", "$", "counter", "=", "0", ";", "$", "updateQuery", "=", "\"\"", ";", "$", "arraySize", "=", "count", "(", "$", "data", ")", ";", "foreach", "(", "$",...
buildClause Build the clause value @param $data @return string
[ "buildClause", "Build", "the", "clause", "value" ]
644962a99e1c0191b732d7729cd466d52c5d8652
https://github.com/ibonly/Potato-ORM/blob/644962a99e1c0191b732d7729cd466d52c5d8652/src/Database/DatabaseQuery.php#L233-L250
199,108
ibonly/Potato-ORM
src/Database/DatabaseQuery.php
DatabaseQuery.fields
protected function fields() { if (isset($this->fillables)) { $this->output = (sizeof($this->fillables) > 0) ? implode($this->fillables, ',') : '*'; } else { $this->output = '*'; } return $this->output; }
php
protected function fields() { if (isset($this->fillables)) { $this->output = (sizeof($this->fillables) > 0) ? implode($this->fillables, ',') : '*'; } else { $this->output = '*'; } return $this->output; }
[ "protected", "function", "fields", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "fillables", ")", ")", "{", "$", "this", "->", "output", "=", "(", "sizeof", "(", "$", "this", "->", "fillables", ")", ">", "0", ")", "?", "implode", "(...
Get the fields to be fillables defined in the model @return string
[ "Get", "the", "fields", "to", "be", "fillables", "defined", "in", "the", "model" ]
644962a99e1c0191b732d7729cd466d52c5d8652
https://github.com/ibonly/Potato-ORM/blob/644962a99e1c0191b732d7729cd466d52c5d8652/src/Database/DatabaseQuery.php#L257-L266
199,109
Wedeto/DB
src/Migrate/Repository.php
Repository.addModule
public function addModule(Module $module) { if ($this->db !== $module->getDB()) throw new MigrationException("The DB instances should be the same"); $name = self::normalizeModule($module->getModule()); $this->modules[$name] = $module; return $this; }
php
public function addModule(Module $module) { if ($this->db !== $module->getDB()) throw new MigrationException("The DB instances should be the same"); $name = self::normalizeModule($module->getModule()); $this->modules[$name] = $module; return $this; }
[ "public", "function", "addModule", "(", "Module", "$", "module", ")", "{", "if", "(", "$", "this", "->", "db", "!==", "$", "module", "->", "getDB", "(", ")", ")", "throw", "new", "MigrationException", "(", "\"The DB instances should be the same\"", ")", ";",...
Register a module that has already been instantiated @param $module The module to register @return Repository Provide fluent interface
[ "Register", "a", "module", "that", "has", "already", "been", "instantiated" ]
715f8f2e3ae6b53c511c40b620921cb9c87e6f62
https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Migrate/Repository.php#L63-L71
199,110
Wedeto/DB
src/Migrate/Repository.php
Repository.addMigration
public function addMigration(string $module, string $path) { $module = self::normalizeModule($module); if (isset($this->modules[$module])) throw new MigrationException("Duplicate module: " . $module); $instance = new Module($module, $path, $this->db); $this->modules[$mod...
php
public function addMigration(string $module, string $path) { $module = self::normalizeModule($module); if (isset($this->modules[$module])) throw new MigrationException("Duplicate module: " . $module); $instance = new Module($module, $path, $this->db); $this->modules[$mod...
[ "public", "function", "addMigration", "(", "string", "$", "module", ",", "string", "$", "path", ")", "{", "$", "module", "=", "self", "::", "normalizeModule", "(", "$", "module", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "modules", "[", "...
Add a new migration using a module name and a path The module object will be instantiated and registered. @return Module The module instance
[ "Add", "a", "new", "migration", "using", "a", "module", "name", "and", "a", "path" ]
715f8f2e3ae6b53c511c40b620921cb9c87e6f62
https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Migrate/Repository.php#L80-L89
199,111
wb-crowdfusion/crowdfusion
system/core/classes/systemdb/version/VersionService.php
VersionService.getDeploymentRevision
public function getDeploymentRevision() { if ($this->version === false) { $version = $this->cache->get('DeploymentRevision'); if ($version === false) { $version = $this->versionDao->getSystemVersion(); if ($version === false) $ve...
php
public function getDeploymentRevision() { if ($this->version === false) { $version = $this->cache->get('DeploymentRevision'); if ($version === false) { $version = $this->versionDao->getSystemVersion(); if ($version === false) $ve...
[ "public", "function", "getDeploymentRevision", "(", ")", "{", "if", "(", "$", "this", "->", "version", "===", "false", ")", "{", "$", "version", "=", "$", "this", "->", "cache", "->", "get", "(", "'DeploymentRevision'", ")", ";", "if", "(", "$", "versi...
Returns the current system version @return integer
[ "Returns", "the", "current", "system", "version" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/version/VersionService.php#L58-L77
199,112
wb-crowdfusion/crowdfusion
system/core/classes/systemdb/version/VersionService.php
VersionService.incrementDeploymentRevision
public function incrementDeploymentRevision($details = null) { if (!$this->incrementedOnce) { $backtrace = null;//serialize(debug_backtrace()); $version = $this->versionDao->insertSystemVersion($details, $backtrace); $this->Events->trigger('SystemVersion.increment', $v...
php
public function incrementDeploymentRevision($details = null) { if (!$this->incrementedOnce) { $backtrace = null;//serialize(debug_backtrace()); $version = $this->versionDao->insertSystemVersion($details, $backtrace); $this->Events->trigger('SystemVersion.increment', $v...
[ "public", "function", "incrementDeploymentRevision", "(", "$", "details", "=", "null", ")", "{", "if", "(", "!", "$", "this", "->", "incrementedOnce", ")", "{", "$", "backtrace", "=", "null", ";", "//serialize(debug_backtrace());", "$", "version", "=", "$", ...
Increases the current SystemVersion by one should invalidate all cached object which use this version number in their key details are stored in log; details describe circumstance of version update @param string $details A string explaining the reason for the new version @return integer The new version
[ "Increases", "the", "current", "SystemVersion", "by", "one" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/version/VersionService.php#L112-L132
199,113
rmatil/SAX
lib/Sax/SuffixTree/SuffixTree.php
SuffixTree.build
private function build( $pString ) { for ( $i=0; $i < strlen( $pString ); $i++ ) { $this->addChar( $pString[$i] ); } }
php
private function build( $pString ) { for ( $i=0; $i < strlen( $pString ); $i++ ) { $this->addChar( $pString[$i] ); } }
[ "private", "function", "build", "(", "$", "pString", ")", "{", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "strlen", "(", "$", "pString", ")", ";", "$", "i", "++", ")", "{", "$", "this", "->", "addChar", "(", "$", "pString", "[", "$",...
Builds the suffix tree off the given string @param string $pString String to build the suffix tree of
[ "Builds", "the", "suffix", "tree", "off", "the", "given", "string" ]
f42cb97300c9f8e87c66644ccc236309db2396e2
https://github.com/rmatil/SAX/blob/f42cb97300c9f8e87c66644ccc236309db2396e2/lib/Sax/SuffixTree/SuffixTree.php#L106-L110
199,114
rmatil/SAX
lib/Sax/SuffixTree/SuffixTree.php
SuffixTree.addSuffixLink
private function addSuffixLink( $pNode ) { if ( $this->needSuffixLink > 0 ) { $this->nodes[$this->needSuffixLink]->link = $pNode; } $this->needSuffixLink = $pNode; }
php
private function addSuffixLink( $pNode ) { if ( $this->needSuffixLink > 0 ) { $this->nodes[$this->needSuffixLink]->link = $pNode; } $this->needSuffixLink = $pNode; }
[ "private", "function", "addSuffixLink", "(", "$", "pNode", ")", "{", "if", "(", "$", "this", "->", "needSuffixLink", ">", "0", ")", "{", "$", "this", "->", "nodes", "[", "$", "this", "->", "needSuffixLink", "]", "->", "link", "=", "$", "pNode", ";", ...
Adds the given node as target of the current suffix link @param integer $pNode Index of target node of the suffix link
[ "Adds", "the", "given", "node", "as", "target", "of", "the", "current", "suffix", "link" ]
f42cb97300c9f8e87c66644ccc236309db2396e2
https://github.com/rmatil/SAX/blob/f42cb97300c9f8e87c66644ccc236309db2396e2/lib/Sax/SuffixTree/SuffixTree.php#L118-L123
199,115
rmatil/SAX
lib/Sax/SuffixTree/SuffixTree.php
SuffixTree.newNode
private function newNode( $pStart, $pEnd ) { $this->nodes[++$this->currentNode] = new Node( $pStart, $pEnd, $this->currentNode ); return $this->currentNode; }
php
private function newNode( $pStart, $pEnd ) { $this->nodes[++$this->currentNode] = new Node( $pStart, $pEnd, $this->currentNode ); return $this->currentNode; }
[ "private", "function", "newNode", "(", "$", "pStart", ",", "$", "pEnd", ")", "{", "$", "this", "->", "nodes", "[", "++", "$", "this", "->", "currentNode", "]", "=", "new", "Node", "(", "$", "pStart", ",", "$", "pEnd", ",", "$", "this", "->", "cur...
Creates as new node with given start and end indexes. Increases the current node by one. @param integer $pStart Start index of node in string represented by this tree @param integer $pEnd End index of node in string represented by this tree @return integer Index of the current node
[ "Creates", "as", "new", "node", "with", "given", "start", "and", "end", "indexes", ".", "Increases", "the", "current", "node", "by", "one", "." ]
f42cb97300c9f8e87c66644ccc236309db2396e2
https://github.com/rmatil/SAX/blob/f42cb97300c9f8e87c66644ccc236309db2396e2/lib/Sax/SuffixTree/SuffixTree.php#L159-L163
199,116
rmatil/SAX
lib/Sax/SuffixTree/SuffixTree.php
SuffixTree.addChar
private function addChar( $pChar ) { $this->text[++$this->position] = $pChar; $this->needSuffixLink = -1; $this->remainder++; while( $this->remainder > 0 ) { if ( $this->activeLength === 0 ) { $this->activeEdge = $this->position; } ...
php
private function addChar( $pChar ) { $this->text[++$this->position] = $pChar; $this->needSuffixLink = -1; $this->remainder++; while( $this->remainder > 0 ) { if ( $this->activeLength === 0 ) { $this->activeEdge = $this->position; } ...
[ "private", "function", "addChar", "(", "$", "pChar", ")", "{", "$", "this", "->", "text", "[", "++", "$", "this", "->", "position", "]", "=", "$", "pChar", ";", "$", "this", "->", "needSuffixLink", "=", "-", "1", ";", "$", "this", "->", "remainder"...
Adds a single character to the suffix tree. Updates edges as well as nodes @param string $pChar A single character
[ "Adds", "a", "single", "character", "to", "the", "suffix", "tree", ".", "Updates", "edges", "as", "well", "as", "nodes" ]
f42cb97300c9f8e87c66644ccc236309db2396e2
https://github.com/rmatil/SAX/blob/f42cb97300c9f8e87c66644ccc236309db2396e2/lib/Sax/SuffixTree/SuffixTree.php#L171-L218
199,117
rmatil/SAX
lib/Sax/SuffixTree/SuffixTree.php
SuffixTree.getAllSurpriseValues
public function getAllSurpriseValues() { $allSurprises = array(); foreach ( $this->nodes as $node ) { if ( $node->start != -1 && $node->end != -1 ) { $allSurprises[] = $node->surpriseValue; } } return $allSurprises; }
php
public function getAllSurpriseValues() { $allSurprises = array(); foreach ( $this->nodes as $node ) { if ( $node->start != -1 && $node->end != -1 ) { $allSurprises[] = $node->surpriseValue; } } return $allSurprises; }
[ "public", "function", "getAllSurpriseValues", "(", ")", "{", "$", "allSurprises", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "nodes", "as", "$", "node", ")", "{", "if", "(", "$", "node", "->", "start", "!=", "-", "1", "&&", "$"...
Returns an array containing the surprise values of each node of this tree. @return array The array
[ "Returns", "an", "array", "containing", "the", "surprise", "values", "of", "each", "node", "of", "this", "tree", "." ]
f42cb97300c9f8e87c66644ccc236309db2396e2
https://github.com/rmatil/SAX/blob/f42cb97300c9f8e87c66644ccc236309db2396e2/lib/Sax/SuffixTree/SuffixTree.php#L236-L244
199,118
rmatil/SAX
lib/Sax/SuffixTree/SuffixTree.php
SuffixTree.findSurpriseValue
private function findSurpriseValue( Node $pNode, $pSubstring ) { $length = $pNode->end - $pNode->start; $text = implode('', $this->text); if ( ($pNode->start != -1 && $pNode->end != -1 ) ) { // node is not the root node if ( substr( $text , $pNode->start, $length ) ===...
php
private function findSurpriseValue( Node $pNode, $pSubstring ) { $length = $pNode->end - $pNode->start; $text = implode('', $this->text); if ( ($pNode->start != -1 && $pNode->end != -1 ) ) { // node is not the root node if ( substr( $text , $pNode->start, $length ) ===...
[ "private", "function", "findSurpriseValue", "(", "Node", "$", "pNode", ",", "$", "pSubstring", ")", "{", "$", "length", "=", "$", "pNode", "->", "end", "-", "$", "pNode", "->", "start", ";", "$", "text", "=", "implode", "(", "''", ",", "$", "this", ...
Tries to find the surprise value of the given substring in the given node. If not successfull for the given string and a child node starts with the first letter of the given string, it will try its corresponding child. Used in a recursive manner with given node representing the root node at the begin @param Node $p...
[ "Tries", "to", "find", "the", "surprise", "value", "of", "the", "given", "substring", "in", "the", "given", "node", ".", "If", "not", "successfull", "for", "the", "given", "string", "and", "a", "child", "node", "starts", "with", "the", "first", "letter", ...
f42cb97300c9f8e87c66644ccc236309db2396e2
https://github.com/rmatil/SAX/blob/f42cb97300c9f8e87c66644ccc236309db2396e2/lib/Sax/SuffixTree/SuffixTree.php#L257-L303
199,119
rmatil/SAX
lib/Sax/SuffixTree/SuffixTree.php
SuffixTree.hasSubstring
public function hasSubstring( $pSubstring ) { if ( strlen( $pSubstring ) < 1 ) { return -1; } return $this->findSubstring( $this->nodes[$this->root], $pSubstring ); }
php
public function hasSubstring( $pSubstring ) { if ( strlen( $pSubstring ) < 1 ) { return -1; } return $this->findSubstring( $this->nodes[$this->root], $pSubstring ); }
[ "public", "function", "hasSubstring", "(", "$", "pSubstring", ")", "{", "if", "(", "strlen", "(", "$", "pSubstring", ")", "<", "1", ")", "{", "return", "-", "1", ";", "}", "return", "$", "this", "->", "findSubstring", "(", "$", "this", "->", "nodes",...
Scan tree for occurences of the given substring. @param string $pSubstring String to check whether it is contained or not @return integer Returns 1 if found, -1 if not
[ "Scan", "tree", "for", "occurences", "of", "the", "given", "substring", "." ]
f42cb97300c9f8e87c66644ccc236309db2396e2
https://github.com/rmatil/SAX/blob/f42cb97300c9f8e87c66644ccc236309db2396e2/lib/Sax/SuffixTree/SuffixTree.php#L372-L378
199,120
rafrsr/generic-api
src/Client/RequestOptions.php
RequestOptions.setSSLKey
public function setSSLKey($certificateFile, $password = null) { if ($password) { $this->options[GuzzleRequestOptions::SSL_KEY] = [$certificateFile, $password]; } else { $this->options[GuzzleRequestOptions::SSL_KEY] = $certificateFile; } }
php
public function setSSLKey($certificateFile, $password = null) { if ($password) { $this->options[GuzzleRequestOptions::SSL_KEY] = [$certificateFile, $password]; } else { $this->options[GuzzleRequestOptions::SSL_KEY] = $certificateFile; } }
[ "public", "function", "setSSLKey", "(", "$", "certificateFile", ",", "$", "password", "=", "null", ")", "{", "if", "(", "$", "password", ")", "{", "$", "this", "->", "options", "[", "GuzzleRequestOptions", "::", "SSL_KEY", "]", "=", "[", "$", "certificat...
Specify the path to a file containing a private SSL key in PEM format. @param string $certificateFile @param null $password
[ "Specify", "the", "path", "to", "a", "file", "containing", "a", "private", "SSL", "key", "in", "PEM", "format", "." ]
2572d3dcc32e03914cf710f0229d72e1c09ea65b
https://github.com/rafrsr/generic-api/blob/2572d3dcc32e03914cf710f0229d72e1c09ea65b/src/Client/RequestOptions.php#L83-L90
199,121
rafrsr/generic-api
src/Client/RequestOptions.php
RequestOptions.setCertificate
public function setCertificate($certificateFile, $password = null) { if ($password) { $this->options[GuzzleRequestOptions::CERT] = [$certificateFile, $password]; } else { $this->options[GuzzleRequestOptions::CERT] = $certificateFile; } }
php
public function setCertificate($certificateFile, $password = null) { if ($password) { $this->options[GuzzleRequestOptions::CERT] = [$certificateFile, $password]; } else { $this->options[GuzzleRequestOptions::CERT] = $certificateFile; } }
[ "public", "function", "setCertificate", "(", "$", "certificateFile", ",", "$", "password", "=", "null", ")", "{", "if", "(", "$", "password", ")", "{", "$", "this", "->", "options", "[", "GuzzleRequestOptions", "::", "CERT", "]", "=", "[", "$", "certific...
Set to a string to specify the path to a file containing a PEM formatted client side certificate @param string $certificateFile @param null $password
[ "Set", "to", "a", "string", "to", "specify", "the", "path", "to", "a", "file", "containing", "a", "PEM", "formatted", "client", "side", "certificate" ]
2572d3dcc32e03914cf710f0229d72e1c09ea65b
https://github.com/rafrsr/generic-api/blob/2572d3dcc32e03914cf710f0229d72e1c09ea65b/src/Client/RequestOptions.php#L98-L105
199,122
rafrsr/generic-api
src/Client/RequestOptions.php
RequestOptions.addHeader
public function addHeader($key, $value) { $this->options[GuzzleRequestOptions::HEADERS][$key] = $value; return $this; }
php
public function addHeader($key, $value) { $this->options[GuzzleRequestOptions::HEADERS][$key] = $value; return $this; }
[ "public", "function", "addHeader", "(", "$", "key", ",", "$", "value", ")", "{", "$", "this", "->", "options", "[", "GuzzleRequestOptions", "::", "HEADERS", "]", "[", "$", "key", "]", "=", "$", "value", ";", "return", "$", "this", ";", "}" ]
Headers to add to the request. @param $key @param $value @return $this
[ "Headers", "to", "add", "to", "the", "request", "." ]
2572d3dcc32e03914cf710f0229d72e1c09ea65b
https://github.com/rafrsr/generic-api/blob/2572d3dcc32e03914cf710f0229d72e1c09ea65b/src/Client/RequestOptions.php#L174-L179
199,123
rafrsr/generic-api
src/Client/RequestOptions.php
RequestOptions.addQuery
public function addQuery($param, $value) { if (!isset($this->options[GuzzleRequestOptions::QUERY])) { $this->options[GuzzleRequestOptions::QUERY] = []; } if (!is_array($this->options[GuzzleRequestOptions::QUERY])) { throw new \LogicException('The query has been set ...
php
public function addQuery($param, $value) { if (!isset($this->options[GuzzleRequestOptions::QUERY])) { $this->options[GuzzleRequestOptions::QUERY] = []; } if (!is_array($this->options[GuzzleRequestOptions::QUERY])) { throw new \LogicException('The query has been set ...
[ "public", "function", "addQuery", "(", "$", "param", ",", "$", "value", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "options", "[", "GuzzleRequestOptions", "::", "QUERY", "]", ")", ")", "{", "$", "this", "->", "options", "[", "GuzzleRe...
Add Query string parameter @param string $param @param mixed $value @return $this
[ "Add", "Query", "string", "parameter" ]
2572d3dcc32e03914cf710f0229d72e1c09ea65b
https://github.com/rafrsr/generic-api/blob/2572d3dcc32e03914cf710f0229d72e1c09ea65b/src/Client/RequestOptions.php#L189-L202
199,124
rafrsr/generic-api
src/Client/RequestOptions.php
RequestOptions.setAuth
public function setAuth($username, $password, $type = 'basic') { $this->options[GuzzleRequestOptions::AUTH] = [$username, $password, $type]; return $this; }
php
public function setAuth($username, $password, $type = 'basic') { $this->options[GuzzleRequestOptions::AUTH] = [$username, $password, $type]; return $this; }
[ "public", "function", "setAuth", "(", "$", "username", ",", "$", "password", ",", "$", "type", "=", "'basic'", ")", "{", "$", "this", "->", "options", "[", "GuzzleRequestOptions", "::", "AUTH", "]", "=", "[", "$", "username", ",", "$", "password", ",",...
Specifies HTTP authorization parameters to use with the request This is currently only supported when using the cURL handler. @param string $username @param string $password @param string $type authentication type: "basic" (default), "digest" @return $this
[ "Specifies", "HTTP", "authorization", "parameters", "to", "use", "with", "the", "request" ]
2572d3dcc32e03914cf710f0229d72e1c09ea65b
https://github.com/rafrsr/generic-api/blob/2572d3dcc32e03914cf710f0229d72e1c09ea65b/src/Client/RequestOptions.php#L595-L600
199,125
rafrsr/generic-api
src/Client/RequestOptions.php
RequestOptions.get
public function get($option) { return (isset($this->options[$option]) ? $this->options[$option] : null); }
php
public function get($option) { return (isset($this->options[$option]) ? $this->options[$option] : null); }
[ "public", "function", "get", "(", "$", "option", ")", "{", "return", "(", "isset", "(", "$", "this", "->", "options", "[", "$", "option", "]", ")", "?", "$", "this", "->", "options", "[", "$", "option", "]", ":", "null", ")", ";", "}" ]
Get a option value @param $option @return null
[ "Get", "a", "option", "value" ]
2572d3dcc32e03914cf710f0229d72e1c09ea65b
https://github.com/rafrsr/generic-api/blob/2572d3dcc32e03914cf710f0229d72e1c09ea65b/src/Client/RequestOptions.php#L620-L623
199,126
kambalabs/KmbDomain
src/KmbDomain/Model/GroupClass.php
GroupClass.dump
public function dump() { $dump = []; if ($this->hasParameters()) { foreach ($this->parameters as $parameter) { $dump[$parameter->getName()] = $parameter->dump(); } } return $dump; }
php
public function dump() { $dump = []; if ($this->hasParameters()) { foreach ($this->parameters as $parameter) { $dump[$parameter->getName()] = $parameter->dump(); } } return $dump; }
[ "public", "function", "dump", "(", ")", "{", "$", "dump", "=", "[", "]", ";", "if", "(", "$", "this", "->", "hasParameters", "(", ")", ")", "{", "foreach", "(", "$", "this", "->", "parameters", "as", "$", "parameter", ")", "{", "$", "dump", "[", ...
Dump parameters. @return array
[ "Dump", "parameters", "." ]
b1631bd936c6c6798076b51dfaebd706e1bdc8c2
https://github.com/kambalabs/KmbDomain/blob/b1631bd936c6c6798076b51dfaebd706e1bdc8c2/src/KmbDomain/Model/GroupClass.php#L226-L235
199,127
agentmedia/phine-core
src/Core/Logic/Installation/InstallUtil/Content.php
Content.ClassFile
private function ClassFile() { if (!$this->classFile) { $class = new \ReflectionClass($this); $this->classFile = $class->getFileName(); } return $this->classFile; }
php
private function ClassFile() { if (!$this->classFile) { $class = new \ReflectionClass($this); $this->classFile = $class->getFileName(); } return $this->classFile; }
[ "private", "function", "ClassFile", "(", ")", "{", "if", "(", "!", "$", "this", "->", "classFile", ")", "{", "$", "class", "=", "new", "\\", "ReflectionClass", "(", "$", "this", ")", ";", "$", "this", "->", "classFile", "=", "$", "class", "->", "ge...
The class definition file @return string Returns the path of the file where the content is defined
[ "The", "class", "definition", "file" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Installation/InstallUtil/Content.php#L50-L59
199,128
agentmedia/phine-core
src/Core/Logic/Installation/InstallUtil/Content.php
Content.Render
function Render() { $templateDir = Path::Combine(__DIR__, 'Templates'); $templateFile = Path::AddExtension(Path::Filename($this->ClassFile()), 'phtml', true); ob_start(); require Path::Combine($templateDir, $templateFile); return ob_get_clean(); }
php
function Render() { $templateDir = Path::Combine(__DIR__, 'Templates'); $templateFile = Path::AddExtension(Path::Filename($this->ClassFile()), 'phtml', true); ob_start(); require Path::Combine($templateDir, $templateFile); return ob_get_clean(); }
[ "function", "Render", "(", ")", "{", "$", "templateDir", "=", "Path", "::", "Combine", "(", "__DIR__", ",", "'Templates'", ")", ";", "$", "templateFile", "=", "Path", "::", "AddExtension", "(", "Path", "::", "Filename", "(", "$", "this", "->", "ClassFile...
Renders and returns the html output @return string Returns the html of the content
[ "Renders", "and", "returns", "the", "html", "output" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Installation/InstallUtil/Content.php#L81-L88
199,129
agentmedia/phine-core
src/Core/Logic/Installation/InstallUtil/Content.php
Content.Value
function Value($field, $trim = true) { $result = Request::IsPost() ? Request::PostData($field) : $this->DefaultValue($field); if ($trim) { return trim($result); } return $result; }
php
function Value($field, $trim = true) { $result = Request::IsPost() ? Request::PostData($field) : $this->DefaultValue($field); if ($trim) { return trim($result); } return $result; }
[ "function", "Value", "(", "$", "field", ",", "$", "trim", "=", "true", ")", "{", "$", "result", "=", "Request", "::", "IsPost", "(", ")", "?", "Request", "::", "PostData", "(", "$", "field", ")", ":", "$", "this", "->", "DefaultValue", "(", "$", ...
Gets the value of a field @param string $field The field name @param bool $trim True if the value shall be trimmed by whitespace characters
[ "Gets", "the", "value", "of", "a", "field" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Installation/InstallUtil/Content.php#L138-L146
199,130
agentmedia/phine-core
src/Core/Logic/Installation/InstallUtil/Content.php
Content.GotoNext
function GotoNext() { $next = Page::NextStep($this->Step()); Response::Redirect(Path::AddExtension($next, 'php')); }
php
function GotoNext() { $next = Page::NextStep($this->Step()); Response::Redirect(Path::AddExtension($next, 'php')); }
[ "function", "GotoNext", "(", ")", "{", "$", "next", "=", "Page", "::", "NextStep", "(", "$", "this", "->", "Step", "(", ")", ")", ";", "Response", "::", "Redirect", "(", "Path", "::", "AddExtension", "(", "$", "next", ",", "'php'", ")", ")", ";", ...
Redirects to the next step
[ "Redirects", "to", "the", "next", "step" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Installation/InstallUtil/Content.php#L160-L164
199,131
fardus/CRUDBundle
Fardus/Bundle/CrudBundle/Generator/FardusCrudGenerator.php
FardusCrudGenerator.generateDeleteView
protected function generateDeleteView($dir) { $this->renderFile('crud/views/delete.html.twig.twig', $dir.'/delete.html.twig', [ 'route_prefix' => $this->routePrefix, 'route_name_prefix' => $this->routeNamePrefix, 'entity' => $this->entity, 'bun...
php
protected function generateDeleteView($dir) { $this->renderFile('crud/views/delete.html.twig.twig', $dir.'/delete.html.twig', [ 'route_prefix' => $this->routePrefix, 'route_name_prefix' => $this->routeNamePrefix, 'entity' => $this->entity, 'bun...
[ "protected", "function", "generateDeleteView", "(", "$", "dir", ")", "{", "$", "this", "->", "renderFile", "(", "'crud/views/delete.html.twig.twig'", ",", "$", "dir", ".", "'/delete.html.twig'", ",", "[", "'route_prefix'", "=>", "$", "this", "->", "routePrefix", ...
Generates the delete.html.twig template in the final bundle. @param string $dir The path to the folder that hosts templates in the bundle
[ "Generates", "the", "delete", ".", "html", ".", "twig", "template", "in", "the", "final", "bundle", "." ]
5d4180f2a1f30da0fc4cbb16a70f656e9e083c5c
https://github.com/fardus/CRUDBundle/blob/5d4180f2a1f30da0fc4cbb16a70f656e9e083c5c/Fardus/Bundle/CrudBundle/Generator/FardusCrudGenerator.php#L156-L165
199,132
FuzeWorks/Core
src/FuzeWorks/Models.php
Models.get
public function get($modelName, $directory = null) { if (empty($modelName)) { throw new ModelException("Could not load model. No name provided", 1); } // First get the directories where the model can be located $directories = (is_null($directory) ? $this->modelPa...
php
public function get($modelName, $directory = null) { if (empty($modelName)) { throw new ModelException("Could not load model. No name provided", 1); } // First get the directories where the model can be located $directories = (is_null($directory) ? $this->modelPa...
[ "public", "function", "get", "(", "$", "modelName", ",", "$", "directory", "=", "null", ")", "{", "if", "(", "empty", "(", "$", "modelName", ")", ")", "{", "throw", "new", "ModelException", "(", "\"Could not load model. No name provided\"", ",", "1", ")", ...
Get a model. Supply the name and the model will be loaded from the supplied directory, or from one of the modelPaths (which you can add). @param string $modelName Name of the model @param string|null $directory Directory to load the model from, will ignore $modelPaths @return ModelAbstract|bool The M...
[ "Get", "a", "model", "." ]
051c64fdaa3a648174cbd54557d05ad553dd826b
https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Models.php#L75-L98
199,133
FuzeWorks/Core
src/FuzeWorks/Models.php
Models.loadModel
protected function loadModel($modelName, $directories): ModelAbstract { if (empty($directories)) { throw new ModelException("Could not load model. No directories provided", 1); } // Now figure out the className and subdir $class = trim($modelName, '/'); i...
php
protected function loadModel($modelName, $directories): ModelAbstract { if (empty($directories)) { throw new ModelException("Could not load model. No directories provided", 1); } // Now figure out the className and subdir $class = trim($modelName, '/'); i...
[ "protected", "function", "loadModel", "(", "$", "modelName", ",", "$", "directories", ")", ":", "ModelAbstract", "{", "if", "(", "empty", "(", "$", "directories", ")", ")", "{", "throw", "new", "ModelException", "(", "\"Could not load model. No directories provide...
Load and return a model. Supply the name and the model will be loaded from one of the supplied directories @param string $modelName Name of the model @param array $directories Directories to try and load the model from @return ModelAbstract The Model object
[ "Load", "and", "return", "a", "model", "." ]
051c64fdaa3a648174cbd54557d05ad553dd826b
https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Models.php#L109-L161
199,134
FuzeWorks/Core
src/FuzeWorks/Models.php
Models.removeModelPath
public function removeModelPath($directory) { if (($key = array_search($directory, $this->modelPaths)) !== false) { unset($this->modelPaths[$key]); } }
php
public function removeModelPath($directory) { if (($key = array_search($directory, $this->modelPaths)) !== false) { unset($this->modelPaths[$key]); } }
[ "public", "function", "removeModelPath", "(", "$", "directory", ")", "{", "if", "(", "(", "$", "key", "=", "array_search", "(", "$", "directory", ",", "$", "this", "->", "modelPaths", ")", ")", "!==", "false", ")", "{", "unset", "(", "$", "this", "->...
Remove a path where models can be found @param string $directory The directory @return void
[ "Remove", "a", "path", "where", "models", "can", "be", "found" ]
051c64fdaa3a648174cbd54557d05ad553dd826b
https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Models.php#L183-L189
199,135
perryflynn/PerrysLambda
src/PerrysLambda/StringProperty.php
StringProperty.setDefaultEncoding
public static function setDefaultEncoding($encoding=null) { if(!is_null($encoding) && is_string($encoding) && !empty($encoding)) { self::$defaultencoding = $encoding; } else { self::$defaultencoding = null; } }
php
public static function setDefaultEncoding($encoding=null) { if(!is_null($encoding) && is_string($encoding) && !empty($encoding)) { self::$defaultencoding = $encoding; } else { self::$defaultencoding = null; } }
[ "public", "static", "function", "setDefaultEncoding", "(", "$", "encoding", "=", "null", ")", "{", "if", "(", "!", "is_null", "(", "$", "encoding", ")", "&&", "is_string", "(", "$", "encoding", ")", "&&", "!", "empty", "(", "$", "encoding", ")", ")", ...
Set global default encoding @param string $encoding
[ "Set", "global", "default", "encoding" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/StringProperty.php#L17-L27
199,136
perryflynn/PerrysLambda
src/PerrysLambda/StringProperty.php
StringProperty.newInstance
public function newInstance($value = null) { $class = $this->getClassName(); $o = new $class($value, $this->encoding); return $o; }
php
public function newInstance($value = null) { $class = $this->getClassName(); $o = new $class($value, $this->encoding); return $o; }
[ "public", "function", "newInstance", "(", "$", "value", "=", "null", ")", "{", "$", "class", "=", "$", "this", "->", "getClassName", "(", ")", ";", "$", "o", "=", "new", "$", "class", "(", "$", "value", ",", "$", "this", "->", "encoding", ")", ";...
Creates new instance of current class type @return \PerrysLambda\StringProperty
[ "Creates", "new", "instance", "of", "current", "class", "type" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/StringProperty.php#L57-L62
199,137
perryflynn/PerrysLambda
src/PerrysLambda/StringProperty.php
StringProperty.getEncoding
protected function getEncoding($encoding=null) { if(is_null($encoding)) { if(!is_null($this->encoding)) { return $this->encoding; } return self::getDefaultEncoding(); } return $encoding; }
php
protected function getEncoding($encoding=null) { if(is_null($encoding)) { if(!is_null($this->encoding)) { return $this->encoding; } return self::getDefaultEncoding(); } return $encoding; }
[ "protected", "function", "getEncoding", "(", "$", "encoding", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "encoding", ")", ")", "{", "if", "(", "!", "is_null", "(", "$", "this", "->", "encoding", ")", ")", "{", "return", "$", "this", "->...
Helper function to set default encoding @param string $encoding @return string
[ "Helper", "function", "to", "set", "default", "encoding" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/StringProperty.php#L97-L108
199,138
perryflynn/PerrysLambda
src/PerrysLambda/StringProperty.php
StringProperty.substr
public function substr($start, $length=null) { return $this->newInstance(mb_substr($this->toString(), $start, $length, $this->getEncoding())); }
php
public function substr($start, $length=null) { return $this->newInstance(mb_substr($this->toString(), $start, $length, $this->getEncoding())); }
[ "public", "function", "substr", "(", "$", "start", ",", "$", "length", "=", "null", ")", "{", "return", "$", "this", "->", "newInstance", "(", "mb_substr", "(", "$", "this", "->", "toString", "(", ")", ",", "$", "start", ",", "$", "length", ",", "$...
Return a substring of value @param int $start @param int $length @return \PerrysLambda\StringProperty
[ "Return", "a", "substring", "of", "value" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/StringProperty.php#L221-L224
199,139
perryflynn/PerrysLambda
src/PerrysLambda/StringProperty.php
StringProperty.split
public function split($separator) { $temp = explode($separator, $this->toString()); $list = ArrayList::asType($this->getClassName(), $temp); return $list; }
php
public function split($separator) { $temp = explode($separator, $this->toString()); $list = ArrayList::asType($this->getClassName(), $temp); return $list; }
[ "public", "function", "split", "(", "$", "separator", ")", "{", "$", "temp", "=", "explode", "(", "$", "separator", ",", "$", "this", "->", "toString", "(", ")", ")", ";", "$", "list", "=", "ArrayList", "::", "asType", "(", "$", "this", "->", "getC...
Split string by separator @param string $separator @return \PerrysLambda\ArrayList
[ "Split", "string", "by", "separator" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/StringProperty.php#L231-L236
199,140
perryflynn/PerrysLambda
src/PerrysLambda/StringProperty.php
StringProperty.padDynamic
protected function padDynamic($padstr, $length, $type) { return $this->newInstance(str_pad($this->toString(), $length, $padstr, $type)); }
php
protected function padDynamic($padstr, $length, $type) { return $this->newInstance(str_pad($this->toString(), $length, $padstr, $type)); }
[ "protected", "function", "padDynamic", "(", "$", "padstr", ",", "$", "length", ",", "$", "type", ")", "{", "return", "$", "this", "->", "newInstance", "(", "str_pad", "(", "$", "this", "->", "toString", "(", ")", ",", "$", "length", ",", "$", "padstr...
Helper function for string padding @param string $padstr @param int $length @param int $type @return \PerrysLambda\StringProperty
[ "Helper", "function", "for", "string", "padding" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/StringProperty.php#L245-L248
199,141
perryflynn/PerrysLambda
src/PerrysLambda/StringProperty.php
StringProperty.indexOfDyamic
protected function indexOfDyamic($function, $needle, $offset) { $r = $function($this->toString(), $needle, $offset, $this->getEncoding()); return ($r===false ? -1 : $r); }
php
protected function indexOfDyamic($function, $needle, $offset) { $r = $function($this->toString(), $needle, $offset, $this->getEncoding()); return ($r===false ? -1 : $r); }
[ "protected", "function", "indexOfDyamic", "(", "$", "function", ",", "$", "needle", ",", "$", "offset", ")", "{", "$", "r", "=", "$", "function", "(", "$", "this", "->", "toString", "(", ")", ",", "$", "needle", ",", "$", "offset", ",", "$", "this"...
Helper function for strpos @param string $function @param string $needle @param int $offset @return int
[ "Helper", "function", "for", "strpos" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/StringProperty.php#L290-L294
199,142
perryflynn/PerrysLambda
src/PerrysLambda/StringProperty.php
StringProperty.lastIndexOfDynamic
protected function lastIndexOfDynamic($function, $needle, $offset=0) { $r = $function($this->toString(), $needle, $offset, $this->getEncoding()); return ($r===false ? -1 : $r); }
php
protected function lastIndexOfDynamic($function, $needle, $offset=0) { $r = $function($this->toString(), $needle, $offset, $this->getEncoding()); return ($r===false ? -1 : $r); }
[ "protected", "function", "lastIndexOfDynamic", "(", "$", "function", ",", "$", "needle", ",", "$", "offset", "=", "0", ")", "{", "$", "r", "=", "$", "function", "(", "$", "this", "->", "toString", "(", ")", ",", "$", "needle", ",", "$", "offset", "...
Helper function for strrpos @param string $function @param string $needle @param int $offset @return int
[ "Helper", "function", "for", "strrpos" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/StringProperty.php#L327-L331
199,143
perryflynn/PerrysLambda
src/PerrysLambda/StringProperty.php
StringProperty.endsWithDynamic
protected function endsWithDynamic($function, $needle) { $enc = $this->getEncoding(); $strlen = $this->length($enc); $testlen = mb_strlen($needle, $enc); if ($testlen <= $strlen) { return ($function($this->toString(), $needle, ($strlen-$testlen), $enc)!==false); ...
php
protected function endsWithDynamic($function, $needle) { $enc = $this->getEncoding(); $strlen = $this->length($enc); $testlen = mb_strlen($needle, $enc); if ($testlen <= $strlen) { return ($function($this->toString(), $needle, ($strlen-$testlen), $enc)!==false); ...
[ "protected", "function", "endsWithDynamic", "(", "$", "function", ",", "$", "needle", ")", "{", "$", "enc", "=", "$", "this", "->", "getEncoding", "(", ")", ";", "$", "strlen", "=", "$", "this", "->", "length", "(", "$", "enc", ")", ";", "$", "test...
Helper function for endsWith @param string $function @param string $needle @return boolean
[ "Helper", "function", "for", "endsWith" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/StringProperty.php#L403-L414
199,144
perryflynn/PerrysLambda
src/PerrysLambda/StringProperty.php
StringProperty.match
public function match($regex) { $match = array(); if($this->isValidRegex($regex) && preg_match($regex, $this->toString(), $match)===1) { return new ObjectArray($match); } return null; }
php
public function match($regex) { $match = array(); if($this->isValidRegex($regex) && preg_match($regex, $this->toString(), $match)===1) { return new ObjectArray($match); } return null; }
[ "public", "function", "match", "(", "$", "regex", ")", "{", "$", "match", "=", "array", "(", ")", ";", "if", "(", "$", "this", "->", "isValidRegex", "(", "$", "regex", ")", "&&", "preg_match", "(", "$", "regex", ",", "$", "this", "->", "toString", ...
Match value against regex @param string $regex @return \PerrysLambda\ObjectArray
[ "Match", "value", "against", "regex" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/StringProperty.php#L461-L469
199,145
perryflynn/PerrysLambda
src/PerrysLambda/StringProperty.php
StringProperty.matchAll
public function matchAll($regex) { $matches = array(); $result = preg_match_all($regex, $this->toString(), $matches, PREG_SET_ORDER); if($this->isValidRegex($regex) && $result!==false && $result>0) { return ArrayList::asObjectArray($matches); } return null...
php
public function matchAll($regex) { $matches = array(); $result = preg_match_all($regex, $this->toString(), $matches, PREG_SET_ORDER); if($this->isValidRegex($regex) && $result!==false && $result>0) { return ArrayList::asObjectArray($matches); } return null...
[ "public", "function", "matchAll", "(", "$", "regex", ")", "{", "$", "matches", "=", "array", "(", ")", ";", "$", "result", "=", "preg_match_all", "(", "$", "regex", ",", "$", "this", "->", "toString", "(", ")", ",", "$", "matches", ",", "PREG_SET_ORD...
Get all matches by regex @param string $regex @return \PerrysLambda\ArrayList
[ "Get", "all", "matches", "by", "regex" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/StringProperty.php#L476-L485
199,146
lasallecms/lasallecms-l5-installedpackages-pkg
src/CreateInstalledPackagesArray.php
CreateInstalledPackagesArray.CreateArray
public function CreateArray() { $allPackages = $this->allLaSalleSoftwarePackages(); $installedPackages = []; foreach ($allPackages as $class) { if ( defined("\\".$class."\\Version::VERSION") ) { $installedPackages[] = [ 'class' => $class...
php
public function CreateArray() { $allPackages = $this->allLaSalleSoftwarePackages(); $installedPackages = []; foreach ($allPackages as $class) { if ( defined("\\".$class."\\Version::VERSION") ) { $installedPackages[] = [ 'class' => $class...
[ "public", "function", "CreateArray", "(", ")", "{", "$", "allPackages", "=", "$", "this", "->", "allLaSalleSoftwarePackages", "(", ")", ";", "$", "installedPackages", "=", "[", "]", ";", "foreach", "(", "$", "allPackages", "as", "$", "class", ")", "{", "...
What LaSalle Software packages are installed? @return array
[ "What", "LaSalle", "Software", "packages", "are", "installed?" ]
165fb63ab424fd716aaa43057ee6efc6d8929755
https://github.com/lasallecms/lasallecms-l5-installedpackages-pkg/blob/165fb63ab424fd716aaa43057ee6efc6d8929755/src/CreateInstalledPackagesArray.php#L45-L64
199,147
itcreator/custom-cmf
Module/View/src/Cmf/View/Helper/Style.php
Style.addStyle
public function addStyle($href, $path = null) { $key = $this->calculateKey($href, $path); $this->styles[$key] = 1; return $this; }
php
public function addStyle($href, $path = null) { $key = $this->calculateKey($href, $path); $this->styles[$key] = 1; return $this; }
[ "public", "function", "addStyle", "(", "$", "href", ",", "$", "path", "=", "null", ")", "{", "$", "key", "=", "$", "this", "->", "calculateKey", "(", "$", "href", ",", "$", "path", ")", ";", "$", "this", "->", "styles", "[", "$", "key", "]", "=...
this method add css file @param string $href @param string $path @return Style
[ "this", "method", "add", "css", "file" ]
42fc0535dfa0f641856f06673f6ab596b2020c40
https://github.com/itcreator/custom-cmf/blob/42fc0535dfa0f641856f06673f6ab596b2020c40/Module/View/src/Cmf/View/Helper/Style.php#L35-L41
199,148
itcreator/custom-cmf
Module/View/src/Cmf/View/Helper/Style.php
Style.deleteStyle
public function deleteStyle($href, $path = null) { $key = $this->calculateKey($href, $path); if (isset($this->styles[$key])) { unset($this->styles[$key]); } return $this; }
php
public function deleteStyle($href, $path = null) { $key = $this->calculateKey($href, $path); if (isset($this->styles[$key])) { unset($this->styles[$key]); } return $this; }
[ "public", "function", "deleteStyle", "(", "$", "href", ",", "$", "path", "=", "null", ")", "{", "$", "key", "=", "$", "this", "->", "calculateKey", "(", "$", "href", ",", "$", "path", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "styles"...
This method remove css file from list @param string $href @param string $path @return Style
[ "This", "method", "remove", "css", "file", "from", "list" ]
42fc0535dfa0f641856f06673f6ab596b2020c40
https://github.com/itcreator/custom-cmf/blob/42fc0535dfa0f641856f06673f6ab596b2020c40/Module/View/src/Cmf/View/Helper/Style.php#L50-L58
199,149
itcreator/custom-cmf
Module/View/src/Cmf/View/Helper/Style.php
Style.buildCode
public function buildCode() { $res = ''; foreach ($this->styles as $href => $val) { $res .= '<link href="' . $href . '" rel="stylesheet" type="text/css" />' . "\r\n"; } return $res; }
php
public function buildCode() { $res = ''; foreach ($this->styles as $href => $val) { $res .= '<link href="' . $href . '" rel="stylesheet" type="text/css" />' . "\r\n"; } return $res; }
[ "public", "function", "buildCode", "(", ")", "{", "$", "res", "=", "''", ";", "foreach", "(", "$", "this", "->", "styles", "as", "$", "href", "=>", "$", "val", ")", "{", "$", "res", ".=", "'<link href=\"'", ".", "$", "href", ".", "'\" rel=\"styleshee...
This method generate code for include css files @return string
[ "This", "method", "generate", "code", "for", "include", "css", "files" ]
42fc0535dfa0f641856f06673f6ab596b2020c40
https://github.com/itcreator/custom-cmf/blob/42fc0535dfa0f641856f06673f6ab596b2020c40/Module/View/src/Cmf/View/Helper/Style.php#L77-L85
199,150
bseddon/XPath20
Value/QNameValue.php
QNameValue.fromQName
public static function fromQName( $qn ) { $qname = new QNameValue(); $qname->LocalName = $qn->localName; $qname->Prefix = $qn->prefix; $qname->NamespaceUri = $qn->namespaceURI; if ( strlen( $qn->localName ) == 0 || ! preg_match( "/^" . NameValue::$ncName . "$/u", $qn->localName ) || ( strle...
php
public static function fromQName( $qn ) { $qname = new QNameValue(); $qname->LocalName = $qn->localName; $qname->Prefix = $qn->prefix; $qname->NamespaceUri = $qn->namespaceURI; if ( strlen( $qn->localName ) == 0 || ! preg_match( "/^" . NameValue::$ncName . "$/u", $qn->localName ) || ( strle...
[ "public", "static", "function", "fromQName", "(", "$", "qn", ")", "{", "$", "qname", "=", "new", "QNameValue", "(", ")", ";", "$", "qname", "->", "LocalName", "=", "$", "qn", "->", "localName", ";", "$", "qname", "->", "Prefix", "=", "$", "qn", "->...
Create a QNameValue from a QName @param QName $qn
[ "Create", "a", "QNameValue", "from", "a", "QName" ]
69882b6efffaa5470a819d5fdd2f6473ddeb046d
https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/Value/QNameValue.php#L216-L232
199,151
bseddon/XPath20
Value/QNameValue.php
QNameValue.fromXPathNavigator
public static function fromXPathNavigator( $node ) { return QNameValue::fromQName( new \lyquidity\xml\qname( $node->getPrefix(), $node->getNamespaceURI(), $node->getLocalName() ) ); }
php
public static function fromXPathNavigator( $node ) { return QNameValue::fromQName( new \lyquidity\xml\qname( $node->getPrefix(), $node->getNamespaceURI(), $node->getLocalName() ) ); }
[ "public", "static", "function", "fromXPathNavigator", "(", "$", "node", ")", "{", "return", "QNameValue", "::", "fromQName", "(", "new", "\\", "lyquidity", "\\", "xml", "\\", "qname", "(", "$", "node", "->", "getPrefix", "(", ")", ",", "$", "node", "->",...
Create a QNameValue instance fron an XPathNavigator instance @param XPathNavigator $node @return QNameValue
[ "Create", "a", "QNameValue", "instance", "fron", "an", "XPathNavigator", "instance" ]
69882b6efffaa5470a819d5fdd2f6473ddeb046d
https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/Value/QNameValue.php#L239-L242
199,152
pluf/discount
src/Discount/Engine.php
Discount_Engine.isValid
public function isValid($discount, $request) { $code = $this->validate($discount, $request); if ($code == Discount_Engine::VALIDATION_CODE_VALID) return true; return false; }
php
public function isValid($discount, $request) { $code = $this->validate($discount, $request); if ($code == Discount_Engine::VALIDATION_CODE_VALID) return true; return false; }
[ "public", "function", "isValid", "(", "$", "discount", ",", "$", "request", ")", "{", "$", "code", "=", "$", "this", "->", "validate", "(", "$", "discount", ",", "$", "request", ")", ";", "if", "(", "$", "code", "==", "Discount_Engine", "::", "VALIDA...
Check if give discount is valid or not. @param Discount_Discount $discount @param Pluf_HTTP_Request $request
[ "Check", "if", "give", "discount", "is", "valid", "or", "not", "." ]
b0006d6b25dd61241f51b5b098d7d546b470de26
https://github.com/pluf/discount/blob/b0006d6b25dd61241f51b5b098d7d546b470de26/src/Discount/Engine.php#L109-L115
199,153
effem/sabnzbd-api
Sabnzbd.php
Sabnzbd.buildUrl
private function buildUrl($mode, $params = []) { $urlParams = array_merge(['mode' => $mode, 'apikey' => $this->apiKey, 'output' => 'json'], $params); return 'http://' . $this->url . ':' . $this->port . "/api?" . http_build_query($urlParams); }
php
private function buildUrl($mode, $params = []) { $urlParams = array_merge(['mode' => $mode, 'apikey' => $this->apiKey, 'output' => 'json'], $params); return 'http://' . $this->url . ':' . $this->port . "/api?" . http_build_query($urlParams); }
[ "private", "function", "buildUrl", "(", "$", "mode", ",", "$", "params", "=", "[", "]", ")", "{", "$", "urlParams", "=", "array_merge", "(", "[", "'mode'", "=>", "$", "mode", ",", "'apikey'", "=>", "$", "this", "->", "apiKey", ",", "'output'", "=>", ...
Url builder helper @param String $mode @param array $params @return string
[ "Url", "builder", "helper" ]
fb173bd6a755f0fe88df23dd20af27e8ebde9f21
https://github.com/effem/sabnzbd-api/blob/fb173bd6a755f0fe88df23dd20af27e8ebde9f21/Sabnzbd.php#L52-L56
199,154
effem/sabnzbd-api
Sabnzbd.php
Sabnzbd.queue
public function queue($start = 0, $limit = 100) { $url = $this->buildUrl('queue', [ 'start' => $start, 'limit' => $limit ]); $request = $this->guzzle->request('GET', $url); return json_decode($request->getBody(), true)['queue']; }
php
public function queue($start = 0, $limit = 100) { $url = $this->buildUrl('queue', [ 'start' => $start, 'limit' => $limit ]); $request = $this->guzzle->request('GET', $url); return json_decode($request->getBody(), true)['queue']; }
[ "public", "function", "queue", "(", "$", "start", "=", "0", ",", "$", "limit", "=", "100", ")", "{", "$", "url", "=", "$", "this", "->", "buildUrl", "(", "'queue'", ",", "[", "'start'", "=>", "$", "start", ",", "'limit'", "=>", "$", "limit", "]",...
Returns all items currently in the queue and some additional information @param int $start @param int $limit @return array
[ "Returns", "all", "items", "currently", "in", "the", "queue", "and", "some", "additional", "information" ]
fb173bd6a755f0fe88df23dd20af27e8ebde9f21
https://github.com/effem/sabnzbd-api/blob/fb173bd6a755f0fe88df23dd20af27e8ebde9f21/Sabnzbd.php#L66-L75
199,155
effem/sabnzbd-api
Sabnzbd.php
Sabnzbd.history
public function history($category = '', $start = 0, $limit = 100, $failedOnly = false) { $url = $this->buildUrl('history', [ 'start' => $start, 'limit' => $limit, 'failed_only' => $failedOnly, 'category' => $category ]); $request...
php
public function history($category = '', $start = 0, $limit = 100, $failedOnly = false) { $url = $this->buildUrl('history', [ 'start' => $start, 'limit' => $limit, 'failed_only' => $failedOnly, 'category' => $category ]); $request...
[ "public", "function", "history", "(", "$", "category", "=", "''", ",", "$", "start", "=", "0", ",", "$", "limit", "=", "100", ",", "$", "failedOnly", "=", "false", ")", "{", "$", "url", "=", "$", "this", "->", "buildUrl", "(", "'history'", ",", "...
Returns all items in the history and some additional information @param string $category @param int $start @param int $limit @param bool $failedOnly @return array
[ "Returns", "all", "items", "in", "the", "history", "and", "some", "additional", "information" ]
fb173bd6a755f0fe88df23dd20af27e8ebde9f21
https://github.com/effem/sabnzbd-api/blob/fb173bd6a755f0fe88df23dd20af27e8ebde9f21/Sabnzbd.php#L87-L98
199,156
effem/sabnzbd-api
Sabnzbd.php
Sabnzbd.deleteQueueEntries
public function deleteQueueEntries($entries) { $url = $this->buildUrl('queue', [ 'name' => 'delete', 'value' => implode(',', $entries) ]); $request = $this->guzzle->request('GET', $url); return json_decode($request->getBody(), true)['status']; }
php
public function deleteQueueEntries($entries) { $url = $this->buildUrl('queue', [ 'name' => 'delete', 'value' => implode(',', $entries) ]); $request = $this->guzzle->request('GET', $url); return json_decode($request->getBody(), true)['status']; }
[ "public", "function", "deleteQueueEntries", "(", "$", "entries", ")", "{", "$", "url", "=", "$", "this", "->", "buildUrl", "(", "'queue'", ",", "[", "'name'", "=>", "'delete'", ",", "'value'", "=>", "implode", "(", "','", ",", "$", "entries", ")", "]",...
Deletes multiple entries with the given ids from the queue @param array $entries @return boolean
[ "Deletes", "multiple", "entries", "with", "the", "given", "ids", "from", "the", "queue" ]
fb173bd6a755f0fe88df23dd20af27e8ebde9f21
https://github.com/effem/sabnzbd-api/blob/fb173bd6a755f0fe88df23dd20af27e8ebde9f21/Sabnzbd.php#L181-L190
199,157
effem/sabnzbd-api
Sabnzbd.php
Sabnzbd.switchQueueEntries
public function switchQueueEntries($first, $second) { $url = $this->buildUrl('switch', [ 'value' => $first, 'value2' => $second ]); $request = $this->guzzle->request('GET', $url); return json_decode($request->getBody(), true)['result']; }
php
public function switchQueueEntries($first, $second) { $url = $this->buildUrl('switch', [ 'value' => $first, 'value2' => $second ]); $request = $this->guzzle->request('GET', $url); return json_decode($request->getBody(), true)['result']; }
[ "public", "function", "switchQueueEntries", "(", "$", "first", ",", "$", "second", ")", "{", "$", "url", "=", "$", "this", "->", "buildUrl", "(", "'switch'", ",", "[", "'value'", "=>", "$", "first", ",", "'value2'", "=>", "$", "second", "]", ")", ";"...
Switches two entries in the queue @param string $first @param string $second @return boolean
[ "Switches", "two", "entries", "in", "the", "queue" ]
fb173bd6a755f0fe88df23dd20af27e8ebde9f21
https://github.com/effem/sabnzbd-api/blob/fb173bd6a755f0fe88df23dd20af27e8ebde9f21/Sabnzbd.php#L216-L225
199,158
effem/sabnzbd-api
Sabnzbd.php
Sabnzbd.pauseQueue
public function pauseQueue() { $url = $this->buildUrl('set_pause'); $request = $this->guzzle->request('GET', $url); return json_decode($request->getBody(), true)['status']; }
php
public function pauseQueue() { $url = $this->buildUrl('set_pause'); $request = $this->guzzle->request('GET', $url); return json_decode($request->getBody(), true)['status']; }
[ "public", "function", "pauseQueue", "(", ")", "{", "$", "url", "=", "$", "this", "->", "buildUrl", "(", "'set_pause'", ")", ";", "$", "request", "=", "$", "this", "->", "guzzle", "->", "request", "(", "'GET'", ",", "$", "url", ")", ";", "return", "...
Pauses the whole queue @return boolean
[ "Pauses", "the", "whole", "queue" ]
fb173bd6a755f0fe88df23dd20af27e8ebde9f21
https://github.com/effem/sabnzbd-api/blob/fb173bd6a755f0fe88df23dd20af27e8ebde9f21/Sabnzbd.php#L232-L238
199,159
effem/sabnzbd-api
Sabnzbd.php
Sabnzbd.pauseQueueTemporary
public function pauseQueueTemporary($time) { $url = $this->buildUrl('config', [ 'name' => 'set_pause', 'value' => $time ]); $request = $this->guzzle->request('GET', $url); return json_decode($request->getBody(), true)['status']; }
php
public function pauseQueueTemporary($time) { $url = $this->buildUrl('config', [ 'name' => 'set_pause', 'value' => $time ]); $request = $this->guzzle->request('GET', $url); return json_decode($request->getBody(), true)['status']; }
[ "public", "function", "pauseQueueTemporary", "(", "$", "time", ")", "{", "$", "url", "=", "$", "this", "->", "buildUrl", "(", "'config'", ",", "[", "'name'", "=>", "'set_pause'", ",", "'value'", "=>", "$", "time", "]", ")", ";", "$", "request", "=", ...
Pauses the queue temporarely for the given amount of time. $time is the number of minutes the queue ist paused @param integer $time @return boolean
[ "Pauses", "the", "queue", "temporarely", "for", "the", "given", "amount", "of", "time", "." ]
fb173bd6a755f0fe88df23dd20af27e8ebde9f21
https://github.com/effem/sabnzbd-api/blob/fb173bd6a755f0fe88df23dd20af27e8ebde9f21/Sabnzbd.php#L249-L259
199,160
effem/sabnzbd-api
Sabnzbd.php
Sabnzbd.addUrl
public function addUrl($url, $niceName = null, $priority = -100, $category = '', $postProcessing = 3, $script = '') { $params = [ 'name' => $url, 'priority' => $priority, 'category' => $category, 'pp' => $postProcessing, 'script' => $sc...
php
public function addUrl($url, $niceName = null, $priority = -100, $category = '', $postProcessing = 3, $script = '') { $params = [ 'name' => $url, 'priority' => $priority, 'category' => $category, 'pp' => $postProcessing, 'script' => $sc...
[ "public", "function", "addUrl", "(", "$", "url", ",", "$", "niceName", "=", "null", ",", "$", "priority", "=", "-", "100", ",", "$", "category", "=", "''", ",", "$", "postProcessing", "=", "3", ",", "$", "script", "=", "''", ")", "{", "$", "param...
Adds a file to the queue via the given link to the file @param string $url @param string|null $niceName @param int $priority @param string $category @param int $postProcessing @param string $script @return array
[ "Adds", "a", "file", "to", "the", "queue", "via", "the", "given", "link", "to", "the", "file" ]
fb173bd6a755f0fe88df23dd20af27e8ebde9f21
https://github.com/effem/sabnzbd-api/blob/fb173bd6a755f0fe88df23dd20af27e8ebde9f21/Sabnzbd.php#L286-L303
199,161
effem/sabnzbd-api
Sabnzbd.php
Sabnzbd.deleteHistoryEntries
public function deleteHistoryEntries($ids, $withFiles = true) { $params = [ 'name' => 'delete', 'del_files' => $withFiles, 'value' => implode(',', $ids) ]; $url = $this->buildUrl('history', $params); $request = $this->guzzle->request('GET...
php
public function deleteHistoryEntries($ids, $withFiles = true) { $params = [ 'name' => 'delete', 'del_files' => $withFiles, 'value' => implode(',', $ids) ]; $url = $this->buildUrl('history', $params); $request = $this->guzzle->request('GET...
[ "public", "function", "deleteHistoryEntries", "(", "$", "ids", ",", "$", "withFiles", "=", "true", ")", "{", "$", "params", "=", "[", "'name'", "=>", "'delete'", ",", "'del_files'", "=>", "$", "withFiles", ",", "'value'", "=>", "implode", "(", "','", ","...
Deletes the history entry with the given id @param string $ids @param bool $withFiles @return array
[ "Deletes", "the", "history", "entry", "with", "the", "given", "id" ]
fb173bd6a755f0fe88df23dd20af27e8ebde9f21
https://github.com/effem/sabnzbd-api/blob/fb173bd6a755f0fe88df23dd20af27e8ebde9f21/Sabnzbd.php#L383-L395
199,162
effem/sabnzbd-api
Sabnzbd.php
Sabnzbd.deleteAllHistoryEntries
public function deleteAllHistoryEntries($withFiles = true) { $params = [ 'name' => 'delete', 'del_files' => $withFiles, 'value' => 'all' ]; $url = $this->buildUrl('history', $params); $request = $this->guzzle->request('GET', $url); ...
php
public function deleteAllHistoryEntries($withFiles = true) { $params = [ 'name' => 'delete', 'del_files' => $withFiles, 'value' => 'all' ]; $url = $this->buildUrl('history', $params); $request = $this->guzzle->request('GET', $url); ...
[ "public", "function", "deleteAllHistoryEntries", "(", "$", "withFiles", "=", "true", ")", "{", "$", "params", "=", "[", "'name'", "=>", "'delete'", ",", "'del_files'", "=>", "$", "withFiles", ",", "'value'", "=>", "'all'", "]", ";", "$", "url", "=", "$",...
Deletes all history entries @param bool $withFiles @return array
[ "Deletes", "all", "history", "entries" ]
fb173bd6a755f0fe88df23dd20af27e8ebde9f21
https://github.com/effem/sabnzbd-api/blob/fb173bd6a755f0fe88df23dd20af27e8ebde9f21/Sabnzbd.php#L404-L416
199,163
ARCANESOFT/Blog
src/Models/Presenters/PostPresenter.php
PostPresenter.getLocaleNativeAttribute
public function getLocaleNativeAttribute() { $locale = $this->getAttributeFromArray('locale'); try { return localization() ->getSupportedLocales() ->get($locale) ->native(); } catch (\Exception $e) { return strt...
php
public function getLocaleNativeAttribute() { $locale = $this->getAttributeFromArray('locale'); try { return localization() ->getSupportedLocales() ->get($locale) ->native(); } catch (\Exception $e) { return strt...
[ "public", "function", "getLocaleNativeAttribute", "(", ")", "{", "$", "locale", "=", "$", "this", "->", "getAttributeFromArray", "(", "'locale'", ")", ";", "try", "{", "return", "localization", "(", ")", "->", "getSupportedLocales", "(", ")", "->", "get", "(...
Get the locale's native name. @return string
[ "Get", "the", "locale", "s", "native", "name", "." ]
2078fdfdcbccda161c02899b9e1f344f011b2859
https://github.com/ARCANESOFT/Blog/blob/2078fdfdcbccda161c02899b9e1f344f011b2859/src/Models/Presenters/PostPresenter.php#L29-L42
199,164
t3v/t3v_datamapper
Classes/Service/ExtensionService.php
ExtensionService.runningInStrictMode
public function runningInStrictMode(): bool { $strictMode = true; $settings = $this->getSettings(); if (is_array($settings) && !empty($settings)) { $mode = $settings['mode']; if ($mode != self::STRICT_MODE) { $strictMode = false; } } return $strictMode; }
php
public function runningInStrictMode(): bool { $strictMode = true; $settings = $this->getSettings(); if (is_array($settings) && !empty($settings)) { $mode = $settings['mode']; if ($mode != self::STRICT_MODE) { $strictMode = false; } } return $strictMode; }
[ "public", "function", "runningInStrictMode", "(", ")", ":", "bool", "{", "$", "strictMode", "=", "true", ";", "$", "settings", "=", "$", "this", "->", "getSettings", "(", ")", ";", "if", "(", "is_array", "(", "$", "settings", ")", "&&", "!", "empty", ...
Checks if T3v DataMapper is running in `strict` mode. @return bool If T3v DataMapper is running in `strict` mode
[ "Checks", "if", "T3v", "DataMapper", "is", "running", "in", "strict", "mode", "." ]
bab2de90f467936fbe4270cd133cb4109d1108eb
https://github.com/t3v/t3v_datamapper/blob/bab2de90f467936fbe4270cd133cb4109d1108eb/Classes/Service/ExtensionService.php#L25-L38
199,165
t3v/t3v_datamapper
Classes/Service/ExtensionService.php
ExtensionService.runningInFallbackMode
public function runningInFallbackMode(): bool { $fallbackMode = false; $settings = $this->getSettings(); if (is_array($settings) && !empty($settings)) { $mode = $settings['mode']; if ($mode === self::FALLBACK_MODE) { $fallbackMode = true; } } return $fallbackMode; ...
php
public function runningInFallbackMode(): bool { $fallbackMode = false; $settings = $this->getSettings(); if (is_array($settings) && !empty($settings)) { $mode = $settings['mode']; if ($mode === self::FALLBACK_MODE) { $fallbackMode = true; } } return $fallbackMode; ...
[ "public", "function", "runningInFallbackMode", "(", ")", ":", "bool", "{", "$", "fallbackMode", "=", "false", ";", "$", "settings", "=", "$", "this", "->", "getSettings", "(", ")", ";", "if", "(", "is_array", "(", "$", "settings", ")", "&&", "!", "empt...
Checks if T3v DataMapper is running in `fallback` mode. @return bool If T3v DataMapper is running in `fallback` mode
[ "Checks", "if", "T3v", "DataMapper", "is", "running", "in", "fallback", "mode", "." ]
bab2de90f467936fbe4270cd133cb4109d1108eb
https://github.com/t3v/t3v_datamapper/blob/bab2de90f467936fbe4270cd133cb4109d1108eb/Classes/Service/ExtensionService.php#L45-L58
199,166
squareproton/Bond
src/Bond/Entity/Base.php
Base.__initInputValidate
protected function __initInputValidate( array &$data ) { // $data must be a array if( !is_array( $data ) ) { throw \Exception( "Entity\Base expects a array for it's first argument" ); } // check to see if any keys exist in $this->data that don't in $data switch(...
php
protected function __initInputValidate( array &$data ) { // $data must be a array if( !is_array( $data ) ) { throw \Exception( "Entity\Base expects a array for it's first argument" ); } // check to see if any keys exist in $this->data that don't in $data switch(...
[ "protected", "function", "__initInputValidate", "(", "array", "&", "$", "data", ")", "{", "// $data must be a array", "if", "(", "!", "is_array", "(", "$", "data", ")", ")", "{", "throw", "\\", "Exception", "(", "\"Entity\\Base expects a array for it's first argumen...
Constructor input validation. External to the constructor so that the constructor may itself be overloaded more easily. Does base input validation for the constructor. Checks, that $data is a array. Performs input validation as per the entity constructs in static::$inputValidate @return bool Success
[ "Constructor", "input", "validation", ".", "External", "to", "the", "constructor", "so", "that", "the", "constructor", "may", "itself", "be", "overloaded", "more", "easily", "." ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/Base.php#L217-L251
199,167
squareproton/Bond
src/Bond/Entity/Base.php
Base.copy
public function copy( $deep = false ) { $data = $this->data; foreach( static::$keyProperties as $key ) { $data[$key] = null; } foreach( $data as $key => $value ) { if( is_object( $value ) and !( $value instanceof self ) ) { $data[$key] = clone...
php
public function copy( $deep = false ) { $data = $this->data; foreach( static::$keyProperties as $key ) { $data[$key] = null; } foreach( $data as $key => $value ) { if( is_object( $value ) and !( $value instanceof self ) ) { $data[$key] = clone...
[ "public", "function", "copy", "(", "$", "deep", "=", "false", ")", "{", "$", "data", "=", "$", "this", "->", "data", ";", "foreach", "(", "static", "::", "$", "keyProperties", "as", "$", "key", ")", "{", "$", "data", "[", "$", "key", "]", "=", ...
Make a shallow copy of a object clearing it's key fields @param bool # TODO. Pete/ This should probably be Bond\Schema property @return Base
[ "Make", "a", "shallow", "copy", "of", "a", "object", "clearing", "it", "s", "key", "fields" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/Base.php#L258-L284
199,168
squareproton/Bond
src/Bond/Entity/Base.php
Base.markDeleted
public function markDeleted() { try { if( $repository = $this->r() ) { $repository->detach( $this ); } } catch ( EntityMissingEntityManagerException $e ) { } $this->checksum = null; return $this; }
php
public function markDeleted() { try { if( $repository = $this->r() ) { $repository->detach( $this ); } } catch ( EntityMissingEntityManagerException $e ) { } $this->checksum = null; return $this; }
[ "public", "function", "markDeleted", "(", ")", "{", "try", "{", "if", "(", "$", "repository", "=", "$", "this", "->", "r", "(", ")", ")", "{", "$", "repository", "->", "detach", "(", "$", "this", ")", ";", "}", "}", "catch", "(", "EntityMissingEnti...
Mark a entity as deleted @return void
[ "Mark", "a", "entity", "as", "deleted" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/Base.php#L411-L421
199,169
squareproton/Bond
src/Bond/Entity/Base.php
Base.markPersisted
public function markPersisted() { try { if( $repository = $this->r() ) { $repository->isNew( $this, false ); } } catch ( EntityMissingEntityManagerException $e ) { } $this->checksumReset(); $this->clearDataInitialStore(); return...
php
public function markPersisted() { try { if( $repository = $this->r() ) { $repository->isNew( $this, false ); } } catch ( EntityMissingEntityManagerException $e ) { } $this->checksumReset(); $this->clearDataInitialStore(); return...
[ "public", "function", "markPersisted", "(", ")", "{", "try", "{", "if", "(", "$", "repository", "=", "$", "this", "->", "r", "(", ")", ")", "{", "$", "repository", "->", "isNew", "(", "$", "this", ",", "false", ")", ";", "}", "}", "catch", "(", ...
Mark a entity as persisted @return void
[ "Mark", "a", "entity", "as", "persisted" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/Base.php#L427-L438
199,170
squareproton/Bond
src/Bond/Entity/Base.php
Base.uidGet
public function uidGet() { // got uid if( isset( $this->uid ) ) { return $this->uid->key; // got key } elseif( $key = $this->keyGet( $this ) ) { return $key; } $this->uid = new Uid( $this ); return $this->uid->key; }
php
public function uidGet() { // got uid if( isset( $this->uid ) ) { return $this->uid->key; // got key } elseif( $key = $this->keyGet( $this ) ) { return $key; } $this->uid = new Uid( $this ); return $this->uid->key; }
[ "public", "function", "uidGet", "(", ")", "{", "// got uid", "if", "(", "isset", "(", "$", "this", "->", "uid", ")", ")", "{", "return", "$", "this", "->", "uid", "->", "key", ";", "// got key", "}", "elseif", "(", "$", "key", "=", "$", "this", "...
Get a uid for a object. This uid has the following properties. 1. Two different objects won't share the same uid simultaneously 2. In normal script usage a object's uid won't change in the script lifecycle. To fiddle this you'd need to diddling hard with setDirect and the only thing that should be doing that is the re...
[ "Get", "a", "uid", "for", "a", "object", ".", "This", "uid", "has", "the", "following", "properties", "." ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/Base.php#L501-L519
199,171
squareproton/Bond
src/Bond/Entity/Base.php
Base.readOnlySafetyCheck
protected function readOnlySafetyCheck() { switch( static::$isReadOnly ) { case self::FULL_ACCESS: return false; case self::READONLY_DISABLE: return true; case self::READONLY_EXCEPTION: throw new ReadonlyException( "Entity...
php
protected function readOnlySafetyCheck() { switch( static::$isReadOnly ) { case self::FULL_ACCESS: return false; case self::READONLY_DISABLE: return true; case self::READONLY_EXCEPTION: throw new ReadonlyException( "Entity...
[ "protected", "function", "readOnlySafetyCheck", "(", ")", "{", "switch", "(", "static", "::", "$", "isReadOnly", ")", "{", "case", "self", "::", "FULL_ACCESS", ":", "return", "false", ";", "case", "self", "::", "READONLY_DISABLE", ":", "return", "true", ";",...
Is this object readonly? @return int|booly
[ "Is", "this", "object", "readonly?" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/Base.php#L652-L674
199,172
squareproton/Bond
src/Bond/Entity/Base.php
Base.initalPropertySet
public function initalPropertySet( $key, $value) { // Is this one of our initialProperties // Is it different. Should we store it? if( is_array( $this->dataInitial ) and $repository = $this->r() and in_array( $key, $repository->initialProperties ) ) { $initialValue = $this->get...
php
public function initalPropertySet( $key, $value) { // Is this one of our initialProperties // Is it different. Should we store it? if( is_array( $this->dataInitial ) and $repository = $this->r() and in_array( $key, $repository->initialProperties ) ) { $initialValue = $this->get...
[ "public", "function", "initalPropertySet", "(", "$", "key", ",", "$", "value", ")", "{", "// Is this one of our initialProperties", "// Is it different. Should we store it?", "if", "(", "is_array", "(", "$", "this", "->", "dataInitial", ")", "and", "$", "repository", ...
InitialPropertiesSet helper method
[ "InitialPropertiesSet", "helper", "method" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/Base.php#L769-L788
199,173
squareproton/Bond
src/Bond/Entity/Base.php
Base.keyGet
public static function keyGet( $data ) { // Is a Entity object ? $class = get_called_class(); if( $data instanceof $class ) { $keys = array(); foreach( static::$keyProperties as $property ) { $value = $data->get($property); // resol...
php
public static function keyGet( $data ) { // Is a Entity object ? $class = get_called_class(); if( $data instanceof $class ) { $keys = array(); foreach( static::$keyProperties as $property ) { $value = $data->get($property); // resol...
[ "public", "static", "function", "keyGet", "(", "$", "data", ")", "{", "// Is a Entity object ?", "$", "class", "=", "get_called_class", "(", ")", ";", "if", "(", "$", "data", "instanceof", "$", "class", ")", "{", "$", "keys", "=", "array", "(", ")", ";...
Key entity `key` @param array|Entity\Base $data @return array
[ "Key", "entity", "key" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/Base.php#L929-L973
199,174
squareproton/Bond
src/Bond/Entity/Base.php
Base.canValidateProperty
public function canValidateProperty( $key ) { return isset( $this->data[$key] ) and is_object( $this->data[$key] ) and $this->data[$key] instanceof Base; }
php
public function canValidateProperty( $key ) { return isset( $this->data[$key] ) and is_object( $this->data[$key] ) and $this->data[$key] instanceof Base; }
[ "public", "function", "canValidateProperty", "(", "$", "key", ")", "{", "return", "isset", "(", "$", "this", "->", "data", "[", "$", "key", "]", ")", "and", "is_object", "(", "$", "this", "->", "data", "[", "$", "key", "]", ")", "and", "$", "this",...
Has validation property?
[ "Has", "validation", "property?" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/Base.php#L993-L996
199,175
jenskooij/cloudcontrol
src/search/CharacterFilter.php
CharacterFilter.filterSpecialCharacters
private function filterSpecialCharacters($string) { $string = str_replace('<', ' <', $string); // This is need, otherwise this: <h1>something</h1><h2>something</h2> will result in somethingsomething $string = strip_tags($string); $string = trim($string); $string = iconv('...
php
private function filterSpecialCharacters($string) { $string = str_replace('<', ' <', $string); // This is need, otherwise this: <h1>something</h1><h2>something</h2> will result in somethingsomething $string = strip_tags($string); $string = trim($string); $string = iconv('...
[ "private", "function", "filterSpecialCharacters", "(", "$", "string", ")", "{", "$", "string", "=", "str_replace", "(", "'<'", ",", "' <'", ",", "$", "string", ")", ";", "// This is need, otherwise this: <h1>something</h1><h2>something</h2> will result in somethingsomething...
Filter out all special characters, like punctuation and characters with accents @param $string @return mixed|string
[ "Filter", "out", "all", "special", "characters", "like", "punctuation", "and", "characters", "with", "accents" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/search/CharacterFilter.php#L48-L63
199,176
zfegg/zfegg-admin
src/V1/Rest/UserRoles/UserRolesResource.php
UserRolesResource.fetchAll
public function fetchAll($params = []) { return $this->table->select( function (Select $select) { $select->columns([]); $select->join( $this->roleTableName, sprintf('%s.role_id=%s.role_id', $this->roleTableName, $this->table...
php
public function fetchAll($params = []) { return $this->table->select( function (Select $select) { $select->columns([]); $select->join( $this->roleTableName, sprintf('%s.role_id=%s.role_id', $this->roleTableName, $this->table...
[ "public", "function", "fetchAll", "(", "$", "params", "=", "[", "]", ")", "{", "return", "$", "this", "->", "table", "->", "select", "(", "function", "(", "Select", "$", "select", ")", "{", "$", "select", "->", "columns", "(", "[", "]", ")", ";", ...
Fetch all or a subset of resources @param array $params @return \Zend\Db\ResultSet\ResultSet
[ "Fetch", "all", "or", "a", "subset", "of", "resources" ]
4e8363eac54f090f84cf511be351f0cc46902b63
https://github.com/zfegg/zfegg-admin/blob/4e8363eac54f090f84cf511be351f0cc46902b63/src/V1/Rest/UserRoles/UserRolesResource.php#L45-L60
199,177
rollerworks/search-core
Extension/Core/DataTransformer/MoneyToLocalizedStringTransformer.php
MoneyToLocalizedStringTransformer.addCurrencySymbol
private function addCurrencySymbol(string $value, ?string $currency = null): string { $currency = $currency ?? $this->defaultCurrency; $locale = \Locale::getDefault(); if (!isset(self::$patterns[$locale])) { self::$patterns[$locale] = []; } if (!isset(self::$pat...
php
private function addCurrencySymbol(string $value, ?string $currency = null): string { $currency = $currency ?? $this->defaultCurrency; $locale = \Locale::getDefault(); if (!isset(self::$patterns[$locale])) { self::$patterns[$locale] = []; } if (!isset(self::$pat...
[ "private", "function", "addCurrencySymbol", "(", "string", "$", "value", ",", "?", "string", "$", "currency", "=", "null", ")", ":", "string", "{", "$", "currency", "=", "$", "currency", "??", "$", "this", "->", "defaultCurrency", ";", "$", "locale", "="...
Adds the currency symbol when missing. ICU cannot parse() without a currency, and decimal doesn't include scale when 0.
[ "Adds", "the", "currency", "symbol", "when", "missing", "." ]
6b5671b8c4d6298906ded768261b0a59845140fb
https://github.com/rollerworks/search-core/blob/6b5671b8c4d6298906ded768261b0a59845140fb/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformer.php#L149-L182
199,178
rollerworks/search-core
Extension/Core/DataTransformer/MoneyToLocalizedStringTransformer.php
MoneyToLocalizedStringTransformer.removeCurrencySymbol
private function removeCurrencySymbol(string $value, string $currency): string { $locale = \Locale::getDefault(); if (!isset(self::$patterns[$locale][$currency])) { // Initialize the cache, ignore return. $this->addCurrencySymbol('123', $currency); } return ...
php
private function removeCurrencySymbol(string $value, string $currency): string { $locale = \Locale::getDefault(); if (!isset(self::$patterns[$locale][$currency])) { // Initialize the cache, ignore return. $this->addCurrencySymbol('123', $currency); } return ...
[ "private", "function", "removeCurrencySymbol", "(", "string", "$", "value", ",", "string", "$", "currency", ")", ":", "string", "{", "$", "locale", "=", "\\", "Locale", "::", "getDefault", "(", ")", ";", "if", "(", "!", "isset", "(", "self", "::", "$",...
Removes the currency symbol. ICU cannot format() with currency, as this produces a number with the `¤` symbol. And, decimal doesn't include scale when 0.
[ "Removes", "the", "currency", "symbol", "." ]
6b5671b8c4d6298906ded768261b0a59845140fb
https://github.com/rollerworks/search-core/blob/6b5671b8c4d6298906ded768261b0a59845140fb/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformer.php#L191-L201
199,179
judus/minimal-database
src/QueryBuilder.php
QueryBuilder.getFirst
public function getFirst($sql = null) { if ($sql) { $this->setLastQuery($sql); try { $result = $this->db->query($sql); } catch (\PDOException $e) { throw new DatabaseException($e->getMessage() . '<br>' . $this->getLastQuery()[0]); ...
php
public function getFirst($sql = null) { if ($sql) { $this->setLastQuery($sql); try { $result = $this->db->query($sql); } catch (\PDOException $e) { throw new DatabaseException($e->getMessage() . '<br>' . $this->getLastQuery()[0]); ...
[ "public", "function", "getFirst", "(", "$", "sql", "=", "null", ")", "{", "if", "(", "$", "sql", ")", "{", "$", "this", "->", "setLastQuery", "(", "$", "sql", ")", ";", "try", "{", "$", "result", "=", "$", "this", "->", "db", "->", "query", "("...
Return the first the matching row @param null $sql Optional query string @return array|null @throws DatabaseException
[ "Return", "the", "first", "the", "matching", "row" ]
e6f8cb46eab41c3f1b6cabe0da5ccd0926727279
https://github.com/judus/minimal-database/blob/e6f8cb46eab41c3f1b6cabe0da5ccd0926727279/src/QueryBuilder.php#L740-L761
199,180
judus/minimal-database
src/QueryBuilder.php
QueryBuilder.getById
public function getById($id) { $sql = "SELECT * FROM " . $this->getTable() . " WHERE " . $this->getPrimaryKey() . " = " . intval($id) . ";"; try { $result = $this->db->query($sql); } catch (\PDOException $e) { throw new DatabaseException($e->getMessage() . '<br>' . $...
php
public function getById($id) { $sql = "SELECT * FROM " . $this->getTable() . " WHERE " . $this->getPrimaryKey() . " = " . intval($id) . ";"; try { $result = $this->db->query($sql); } catch (\PDOException $e) { throw new DatabaseException($e->getMessage() . '<br>' . $...
[ "public", "function", "getById", "(", "$", "id", ")", "{", "$", "sql", "=", "\"SELECT * FROM \"", ".", "$", "this", "->", "getTable", "(", ")", ".", "\" WHERE \"", ".", "$", "this", "->", "getPrimaryKey", "(", ")", ".", "\" = \"", ".", "intval", "(", ...
Select a row by id from this table @param $id @return array|null @throws DatabaseException
[ "Select", "a", "row", "by", "id", "from", "this", "table" ]
e6f8cb46eab41c3f1b6cabe0da5ccd0926727279
https://github.com/judus/minimal-database/blob/e6f8cb46eab41c3f1b6cabe0da5ccd0926727279/src/QueryBuilder.php#L771-L782
199,181
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/MySQLDatabase.php
MySQLDatabase.setConnectionInfo
public function setConnectionInfo(array $connections) { foreach($connections as $connectionInfo) { if (empty($connectionInfo['hostname'])) $connectionInfo['hostname'] = 'localhost'; if (empty($connectionInfo['port'])) $connectionInfo['port'] ...
php
public function setConnectionInfo(array $connections) { foreach($connections as $connectionInfo) { if (empty($connectionInfo['hostname'])) $connectionInfo['hostname'] = 'localhost'; if (empty($connectionInfo['port'])) $connectionInfo['port'] ...
[ "public", "function", "setConnectionInfo", "(", "array", "$", "connections", ")", "{", "foreach", "(", "$", "connections", "as", "$", "connectionInfo", ")", "{", "if", "(", "empty", "(", "$", "connectionInfo", "[", "'hostname'", "]", ")", ")", "$", "connec...
Validates required values are present for a database connection. @param array $connectionInfo Connection info. See {@link __construct(...)} for details on keys and values. @return void @throws Exception If the required parameters aren't passed
[ "Validates", "required", "values", "are", "present", "for", "a", "database", "connection", "." ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/MySQLDatabase.php#L68-L94
199,182
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/MySQLDatabase.php
MySQLDatabase.getConnection
public function getConnection() { if (empty($this->connection)) { if (empty($this->connectionConfig) || !is_array($this->connectionConfig)) throw new DatabaseException("Connection config is empty or not an array."); $connCount = count($this->connectionConfig); ...
php
public function getConnection() { if (empty($this->connection)) { if (empty($this->connectionConfig) || !is_array($this->connectionConfig)) throw new DatabaseException("Connection config is empty or not an array."); $connCount = count($this->connectionConfig); ...
[ "public", "function", "getConnection", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "connection", ")", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "connectionConfig", ")", "||", "!", "is_array", "(", "$", "this", "->", "connec...
Gets the current PDO connection object @return PDO MySQL PDO Connection
[ "Gets", "the", "current", "PDO", "connection", "object" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/MySQLDatabase.php#L101-L167
199,183
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/MySQLDatabase.php
MySQLDatabase.readField
public function readField($sql) { $result = $this->read($sql); $result->setFetchMode(PDO::FETCH_COLUMN, 0); $row = $result->fetch(); //$this->convertDatesInRows($result, $row); unset($result); return $row; }
php
public function readField($sql) { $result = $this->read($sql); $result->setFetchMode(PDO::FETCH_COLUMN, 0); $row = $result->fetch(); //$this->convertDatesInRows($result, $row); unset($result); return $row; }
[ "public", "function", "readField", "(", "$", "sql", ")", "{", "$", "result", "=", "$", "this", "->", "read", "(", "$", "sql", ")", ";", "$", "result", "->", "setFetchMode", "(", "PDO", "::", "FETCH_COLUMN", ",", "0", ")", ";", "$", "row", "=", "$...
Returns the first column of the first row of the result set NOTE: It is expected that all DATETIME or TIMESTAMP or other native date column types should automatically be converted to StorageDate. @param string $sql SELECT statement @return string|StorageDate
[ "Returns", "the", "first", "column", "of", "the", "first", "row", "of", "the", "result", "set" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/MySQLDatabase.php#L309-L317
199,184
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/MySQLDatabase.php
MySQLDatabase.readCol
public function readCol($sql) { $result = $this->read($sql); $row = $result->fetchAll(PDO::FETCH_COLUMN, 0); //$this->convertDatesInRows($result, $row); unset($result); return $row; }
php
public function readCol($sql) { $result = $this->read($sql); $row = $result->fetchAll(PDO::FETCH_COLUMN, 0); //$this->convertDatesInRows($result, $row); unset($result); return $row; }
[ "public", "function", "readCol", "(", "$", "sql", ")", "{", "$", "result", "=", "$", "this", "->", "read", "(", "$", "sql", ")", ";", "$", "row", "=", "$", "result", "->", "fetchAll", "(", "PDO", "::", "FETCH_COLUMN", ",", "0", ")", ";", "//$this...
Returns an array of values for the first column of the result set <code> $result = $this->readCol('SELECT col FROM table'); ... array( 0 => 'value1', 1 => 'value2', 2 => 'value3' ) </code> @param string $sql SELECT statement @return array Single dimension array of values for the column
[ "Returns", "an", "array", "of", "values", "for", "the", "first", "column", "of", "the", "result", "set" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/MySQLDatabase.php#L338-L345
199,185
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/MySQLDatabase.php
MySQLDatabase.readOne
public function readOne($sql) { $result = $this->readAll($sql, false); if (count($result) > 0) { return $result[0]; } }
php
public function readOne($sql) { $result = $this->readAll($sql, false); if (count($result) > 0) { return $result[0]; } }
[ "public", "function", "readOne", "(", "$", "sql", ")", "{", "$", "result", "=", "$", "this", "->", "readAll", "(", "$", "sql", ",", "false", ")", ";", "if", "(", "count", "(", "$", "result", ")", ">", "0", ")", "{", "return", "$", "result", "["...
Returns the first row of the result set as an associative array, regardless of the overall number of rows <code> $result = $this->readOne('SELECT col1, col2 FROM table'); ... array( 'col1' => 'value of col1', 'col2' => 'value of col2' ) </code> @param string $sql SELECT statement @return array Single dimension ar...
[ "Returns", "the", "first", "row", "of", "the", "result", "set", "as", "an", "associative", "array", "regardless", "of", "the", "overall", "number", "of", "rows" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/MySQLDatabase.php#L368-L374
199,186
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/MySQLDatabase.php
MySQLDatabase.readAll
public function readAll($sql, $calcFoundRows = false) { $result = $this->read($calcFoundRows ? $this->insertPagingFlag($sql) : $sql); $rows = $result->fetchAll(PDO::FETCH_ASSOC); //$this->convertDatesInRows($result, $rows); unset($result); unset($sql); return $rows; ...
php
public function readAll($sql, $calcFoundRows = false) { $result = $this->read($calcFoundRows ? $this->insertPagingFlag($sql) : $sql); $rows = $result->fetchAll(PDO::FETCH_ASSOC); //$this->convertDatesInRows($result, $rows); unset($result); unset($sql); return $rows; ...
[ "public", "function", "readAll", "(", "$", "sql", ",", "$", "calcFoundRows", "=", "false", ")", "{", "$", "result", "=", "$", "this", "->", "read", "(", "$", "calcFoundRows", "?", "$", "this", "->", "insertPagingFlag", "(", "$", "sql", ")", ":", "$",...
Returns an associative array of rows and columns <code> $result = $this->readAll('SELECT id, col1 FROM table'); ... array( 0 => array( 'id' => '1', 'col1' => 'value'), 1 => array( 'id' => '2', 'col1' => 'value'), ... ) </code> @param string $sql SELECT statement @param boolean $calcFoundRows Flag to indi...
[ "Returns", "an", "associative", "array", "of", "rows", "and", "columns" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/MySQLDatabase.php#L399-L407
199,187
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/MySQLDatabase.php
MySQLDatabase.bulkInsertRecords
public function bulkInsertRecords($tablename, $parameters, $limit = 25) { if(empty($parameters)) throw new DatabaseException('bulkInsertRecords: no parameters.'); $count = 0; $tcount = 0; $totalcount = count($parameters); foreach ($parameters as $value)...
php
public function bulkInsertRecords($tablename, $parameters, $limit = 25) { if(empty($parameters)) throw new DatabaseException('bulkInsertRecords: no parameters.'); $count = 0; $tcount = 0; $totalcount = count($parameters); foreach ($parameters as $value)...
[ "public", "function", "bulkInsertRecords", "(", "$", "tablename", ",", "$", "parameters", ",", "$", "limit", "=", "25", ")", "{", "if", "(", "empty", "(", "$", "parameters", ")", ")", "throw", "new", "DatabaseException", "(", "'bulkInsertRecords: no parameters...
Inserts multiple records utilizing less INSERT statements. This function will execute as many statements as necessary to insert all the data supplied by the array {@link $parameters} inserting {@link $limit} records per statement. {@link $limit} is useful for preventing max query size errors. @param string $tablenam...
[ "Inserts", "multiple", "records", "utilizing", "less", "INSERT", "statements", "." ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/MySQLDatabase.php#L518-L549
199,188
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/MySQLDatabase.php
MySQLDatabase.insertRecord
public function insertRecord($tablename, $parameters, $ignore = false) { if (empty($parameters)) throw new DatabaseException('insertRecord: no parameters.'); $insert_fields = array(); $insert_values = array(); foreach ($parameters as $name => $value) { $inse...
php
public function insertRecord($tablename, $parameters, $ignore = false) { if (empty($parameters)) throw new DatabaseException('insertRecord: no parameters.'); $insert_fields = array(); $insert_values = array(); foreach ($parameters as $name => $value) { $inse...
[ "public", "function", "insertRecord", "(", "$", "tablename", ",", "$", "parameters", ",", "$", "ignore", "=", "false", ")", "{", "if", "(", "empty", "(", "$", "parameters", ")", ")", "throw", "new", "DatabaseException", "(", "'insertRecord: no parameters.'", ...
Provides a convenience method for inserting an single row of columns and values into a database table @param string $tablename Table to insert record @param array $parameters Associative array of columns and values, ex. <code> array( 'col1' => 'value of col1', 'col2' => 'value of col2' ) </code> @param boolean $ig...
[ "Provides", "a", "convenience", "method", "for", "inserting", "an", "single", "row", "of", "columns", "and", "values", "into", "a", "database", "table" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/MySQLDatabase.php#L568-L587
199,189
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/MySQLDatabase.php
MySQLDatabase.updateRecord
public function updateRecord($tablename, $parameters, $where) { $update = array(); foreach ($parameters as $name => $value) { $update[] = "$name = " . $this->quote($value) . ""; } $sql = "UPDATE ". $tablename ." SET ". implode(",", $update) . " WHERE " . $where; ...
php
public function updateRecord($tablename, $parameters, $where) { $update = array(); foreach ($parameters as $name => $value) { $update[] = "$name = " . $this->quote($value) . ""; } $sql = "UPDATE ". $tablename ." SET ". implode(",", $update) . " WHERE " . $where; ...
[ "public", "function", "updateRecord", "(", "$", "tablename", ",", "$", "parameters", ",", "$", "where", ")", "{", "$", "update", "=", "array", "(", ")", ";", "foreach", "(", "$", "parameters", "as", "$", "name", "=>", "$", "value", ")", "{", "$", "...
Provides convenience method for updating columns on a table for 1 or many records matching a WHERE clause @param string $tablename Table to update @param array $parameters Associative array of columns and values, ex. <code> array( 'col1' => 'value of col1', 'col2' => 'value of col2' ) </code> @param string $where ...
[ "Provides", "convenience", "method", "for", "updating", "columns", "on", "a", "table", "for", "1", "or", "many", "records", "matching", "a", "WHERE", "clause" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/MySQLDatabase.php#L607-L618
199,190
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/MySQLDatabase.php
MySQLDatabase.deleteRecord
public function deleteRecord($tablename, $where) { if (!empty($tablename) && !empty($where)) { $sql = "DELETE FROM ".$tablename." WHERE ".$where; return $this->write($sql, DatabaseInterface::AFFECTED_ROWS); } }
php
public function deleteRecord($tablename, $where) { if (!empty($tablename) && !empty($where)) { $sql = "DELETE FROM ".$tablename." WHERE ".$where; return $this->write($sql, DatabaseInterface::AFFECTED_ROWS); } }
[ "public", "function", "deleteRecord", "(", "$", "tablename", ",", "$", "where", ")", "{", "if", "(", "!", "empty", "(", "$", "tablename", ")", "&&", "!", "empty", "(", "$", "where", ")", ")", "{", "$", "sql", "=", "\"DELETE FROM \"", ".", "$", "tab...
Provides convenience method for deleting records matching a WHERE clause @param string $tablename Table to delete from @param string $where Where clause used to find the records to delete, ex. "id = '2'", "title LIKE '%example%' AND status = '2'" @return int Number of affected rows @throws DatabaseException if ta...
[ "Provides", "convenience", "method", "for", "deleting", "records", "matching", "a", "WHERE", "clause" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/MySQLDatabase.php#L630-L636
199,191
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/MySQLDatabase.php
MySQLDatabase.quote
public function quote($var) { if(is_null($var) || strtoupper($var) == 'NULL') return 'NULL'; if ($var instanceof Date) $var = $this->DateFactory->toStorageDate($var)->toMySQLDate(); return $this->getConnection()->quote($var); }
php
public function quote($var) { if(is_null($var) || strtoupper($var) == 'NULL') return 'NULL'; if ($var instanceof Date) $var = $this->DateFactory->toStorageDate($var)->toMySQLDate(); return $this->getConnection()->quote($var); }
[ "public", "function", "quote", "(", "$", "var", ")", "{", "if", "(", "is_null", "(", "$", "var", ")", "||", "strtoupper", "(", "$", "var", ")", "==", "'NULL'", ")", "return", "'NULL'", ";", "if", "(", "$", "var", "instanceof", "Date", ")", "$", "...
Returns escaped value automatically wrapped in single quotes NOTE: Will convert Date types into strings for database entry @param mixed $var Value to escape and quote @return string Escaped and quoted string value ready for a SQL statement
[ "Returns", "escaped", "value", "automatically", "wrapped", "in", "single", "quotes" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/MySQLDatabase.php#L647-L656
199,192
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/MySQLDatabase.php
MySQLDatabase.read
public function read($sql) { $sql = (string)$sql; $conn = $this->getConnection(); $this->Benchmark->start('sql-query'); try { // if(!substr($sql, 0, 4) == 'SHOW') { // // $explain = $conn->query("EXPLAIN ".$sql); // // $explainresults = $ex...
php
public function read($sql) { $sql = (string)$sql; $conn = $this->getConnection(); $this->Benchmark->start('sql-query'); try { // if(!substr($sql, 0, 4) == 'SHOW') { // // $explain = $conn->query("EXPLAIN ".$sql); // // $explainresults = $ex...
[ "public", "function", "read", "(", "$", "sql", ")", "{", "$", "sql", "=", "(", "string", ")", "$", "sql", ";", "$", "conn", "=", "$", "this", "->", "getConnection", "(", ")", ";", "$", "this", "->", "Benchmark", "->", "start", "(", "'sql-query'", ...
Runs the SQL query in read-only mode from the database @param string $sql The SQL query to run @return PDOStatement The query result @see http://us.php.net/manual/en/pdo.query.php
[ "Runs", "the", "SQL", "query", "in", "read", "-", "only", "mode", "from", "the", "database" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/MySQLDatabase.php#L722-L807
199,193
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/MySQLDatabase.php
MySQLDatabase.import
public function import($filename) { // TODO: Wrap this in a transaction! if (!file_exists($filename)) { throw new Exception("File not found: $filename"); } $sql_queries = file_get_contents($filename); $sql_queries = $this->_removeRemarks($sql_queries); $s...
php
public function import($filename) { // TODO: Wrap this in a transaction! if (!file_exists($filename)) { throw new Exception("File not found: $filename"); } $sql_queries = file_get_contents($filename); $sql_queries = $this->_removeRemarks($sql_queries); $s...
[ "public", "function", "import", "(", "$", "filename", ")", "{", "// TODO: Wrap this in a transaction!", "if", "(", "!", "file_exists", "(", "$", "filename", ")", ")", "{", "throw", "new", "Exception", "(", "\"File not found: $filename\"", ")", ";", "}", "$", "...
Imports and runs sql contained in the specified file. The file must contain only valid sql. @param string $filename The filename to load @return void
[ "Imports", "and", "runs", "sql", "contained", "in", "the", "specified", "file", ".", "The", "file", "must", "contain", "only", "valid", "sql", "." ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/MySQLDatabase.php#L867-L884
199,194
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/MySQLDatabase.php
MySQLDatabase._removeRemarks
private function _removeRemarks($sql) { $sql = preg_replace('/\n{2,}/', "\n", preg_replace('/^[-].*$/m', "\n", $sql)); $sql = preg_replace('/\n{2,}/', "\n", preg_replace('/^#.*$/m', "\n", $sql)); return $sql; }
php
private function _removeRemarks($sql) { $sql = preg_replace('/\n{2,}/', "\n", preg_replace('/^[-].*$/m', "\n", $sql)); $sql = preg_replace('/\n{2,}/', "\n", preg_replace('/^#.*$/m', "\n", $sql)); return $sql; }
[ "private", "function", "_removeRemarks", "(", "$", "sql", ")", "{", "$", "sql", "=", "preg_replace", "(", "'/\\n{2,}/'", ",", "\"\\n\"", ",", "preg_replace", "(", "'/^[-].*$/m'", ",", "\"\\n\"", ",", "$", "sql", ")", ")", ";", "$", "sql", "=", "preg_repl...
remove_remarks will strip the sql comment lines out of an uploaded sql file @param string $sql The sql to process @return string the SQL with the remarks removed
[ "remove_remarks", "will", "strip", "the", "sql", "comment", "lines", "out", "of", "an", "uploaded", "sql", "file" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/MySQLDatabase.php#L893-L898
199,195
mossphp/moss-storage
Moss/Storage/Query/Accessor/Accessor.php
Accessor.identifyEntity
public function identifyEntity(ModelInterface $model, &$entity, $identifier) { $primaryKeys = $model->primaryFields(); if (count($primaryKeys) !== 1) { return; } $field = reset($primaryKeys)->name(); $this->setPropertyValue($entity, $field, $identifier); }
php
public function identifyEntity(ModelInterface $model, &$entity, $identifier) { $primaryKeys = $model->primaryFields(); if (count($primaryKeys) !== 1) { return; } $field = reset($primaryKeys)->name(); $this->setPropertyValue($entity, $field, $identifier); }
[ "public", "function", "identifyEntity", "(", "ModelInterface", "$", "model", ",", "&", "$", "entity", ",", "$", "identifier", ")", "{", "$", "primaryKeys", "=", "$", "model", "->", "primaryFields", "(", ")", ";", "if", "(", "count", "(", "$", "primaryKey...
Assigns passed identifier to primary key Possible only when entity has one primary key @param ModelInterface $model @param mixed $entity @param int|string $identifier @return void
[ "Assigns", "passed", "identifier", "to", "primary", "key", "Possible", "only", "when", "entity", "has", "one", "primary", "key" ]
0d123e7ae6bbfce1e2a18e73bf70997277b430c1
https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Query/Accessor/Accessor.php#L36-L46
199,196
mossphp/moss-storage
Moss/Storage/Query/Accessor/Accessor.php
Accessor.getPropertyValue
public function getPropertyValue($entity, $field, $default = null) { $this->assertEntity($entity); if (is_array($entity) || $entity instanceof \ArrayAccess) { return isset($entity[$field]) ? $entity[$field] : $default; } $ref = $this->getReflection($entity); if ...
php
public function getPropertyValue($entity, $field, $default = null) { $this->assertEntity($entity); if (is_array($entity) || $entity instanceof \ArrayAccess) { return isset($entity[$field]) ? $entity[$field] : $default; } $ref = $this->getReflection($entity); if ...
[ "public", "function", "getPropertyValue", "(", "$", "entity", ",", "$", "field", ",", "$", "default", "=", "null", ")", "{", "$", "this", "->", "assertEntity", "(", "$", "entity", ")", ";", "if", "(", "is_array", "(", "$", "entity", ")", "||", "$", ...
Returns property value @param array|object $entity @param string $field @param mixed $default @return mixed @throws AccessorException
[ "Returns", "property", "value" ]
0d123e7ae6bbfce1e2a18e73bf70997277b430c1
https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Query/Accessor/Accessor.php#L58-L72
199,197
mossphp/moss-storage
Moss/Storage/Query/Accessor/Accessor.php
Accessor.setPropertyValue
public function setPropertyValue(&$entity, $field, $value) { $this->assertEntity($entity); if (is_array($entity) || $entity instanceof \ArrayAccess) { $entity[$field] = $value; return; } $ref = $this->getReflection($entity); if (!$ref->hasProperty($...
php
public function setPropertyValue(&$entity, $field, $value) { $this->assertEntity($entity); if (is_array($entity) || $entity instanceof \ArrayAccess) { $entity[$field] = $value; return; } $ref = $this->getReflection($entity); if (!$ref->hasProperty($...
[ "public", "function", "setPropertyValue", "(", "&", "$", "entity", ",", "$", "field", ",", "$", "value", ")", "{", "$", "this", "->", "assertEntity", "(", "$", "entity", ")", ";", "if", "(", "is_array", "(", "$", "entity", ")", "||", "$", "entity", ...
Sets property value @param array|object $entity @param string $field @param mixed $value @throws AccessorException
[ "Sets", "property", "value" ]
0d123e7ae6bbfce1e2a18e73bf70997277b430c1
https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Query/Accessor/Accessor.php#L83-L101
199,198
mossphp/moss-storage
Moss/Storage/Query/Accessor/Accessor.php
Accessor.getReflection
private function getReflection($object) { $key = get_class($object); if (!array_key_exists($key, $this->buffer)) { $this->buffer[$key] = new \ReflectionClass($object); } return $this->buffer[$key]; }
php
private function getReflection($object) { $key = get_class($object); if (!array_key_exists($key, $this->buffer)) { $this->buffer[$key] = new \ReflectionClass($object); } return $this->buffer[$key]; }
[ "private", "function", "getReflection", "(", "$", "object", ")", "{", "$", "key", "=", "get_class", "(", "$", "object", ")", ";", "if", "(", "!", "array_key_exists", "(", "$", "key", ",", "$", "this", "->", "buffer", ")", ")", "{", "$", "this", "->...
Returns object reflection instance @param object $object @return \ReflectionClass
[ "Returns", "object", "reflection", "instance" ]
0d123e7ae6bbfce1e2a18e73bf70997277b430c1
https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Query/Accessor/Accessor.php#L124-L133
199,199
mossphp/moss-storage
Moss/Storage/Query/Accessor/Accessor.php
Accessor.getProperty
private function getProperty(\ReflectionClass $ref, $property) { $prop = $ref->getProperty($property); $prop->setAccessible(true); return $prop; }
php
private function getProperty(\ReflectionClass $ref, $property) { $prop = $ref->getProperty($property); $prop->setAccessible(true); return $prop; }
[ "private", "function", "getProperty", "(", "\\", "ReflectionClass", "$", "ref", ",", "$", "property", ")", "{", "$", "prop", "=", "$", "ref", "->", "getProperty", "(", "$", "property", ")", ";", "$", "prop", "->", "setAccessible", "(", "true", ")", ";"...
Returns object property instance @param \ReflectionClass $ref @param string $property @return \ReflectionProperty
[ "Returns", "object", "property", "instance" ]
0d123e7ae6bbfce1e2a18e73bf70997277b430c1
https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Query/Accessor/Accessor.php#L143-L149