repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
propelorm/Propel | generator/lib/platform/DefaultPlatform.php | DefaultPlatform.getBuildProperty | protected function getBuildProperty($name)
{
if ($this->generatorConfig !== null) {
return $this->generatorConfig->getBuildProperty($name);
}
return null;
} | php | protected function getBuildProperty($name)
{
if ($this->generatorConfig !== null) {
return $this->generatorConfig->getBuildProperty($name);
}
return null;
} | [
"protected",
"function",
"getBuildProperty",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"generatorConfig",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"generatorConfig",
"->",
"getBuildProperty",
"(",
"$",
"name",
")",
";",
"}",
... | Gets a specific propel (renamed) property from the build.
@param string $name
@return mixed | [
"Gets",
"a",
"specific",
"propel",
"(",
"renamed",
")",
"property",
"from",
"the",
"build",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/DefaultPlatform.php#L94-L101 |
propelorm/Propel | generator/lib/platform/DefaultPlatform.php | DefaultPlatform.initialize | protected function initialize()
{
$this->schemaDomainMap = array();
foreach (PropelTypes::getPropelTypes() as $type) {
$this->schemaDomainMap[$type] = new Domain($type);
}
// BU_* no longer needed, so map these to the DATE/TIMESTAMP domains
$this->schemaDomainMap[... | php | protected function initialize()
{
$this->schemaDomainMap = array();
foreach (PropelTypes::getPropelTypes() as $type) {
$this->schemaDomainMap[$type] = new Domain($type);
}
// BU_* no longer needed, so map these to the DATE/TIMESTAMP domains
$this->schemaDomainMap[... | [
"protected",
"function",
"initialize",
"(",
")",
"{",
"$",
"this",
"->",
"schemaDomainMap",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"PropelTypes",
"::",
"getPropelTypes",
"(",
")",
"as",
"$",
"type",
")",
"{",
"$",
"this",
"->",
"schemaDomainMap",
"... | Initialize the type -> Domain mapping. | [
"Initialize",
"the",
"type",
"-",
">",
"Domain",
"mapping",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/DefaultPlatform.php#L106-L118 |
propelorm/Propel | generator/lib/platform/DefaultPlatform.php | DefaultPlatform.getDatabaseType | public function getDatabaseType()
{
$clazz = get_class($this);
$pos = strpos($clazz, 'Platform');
return strtolower(substr($clazz, 0, $pos));
} | php | public function getDatabaseType()
{
$clazz = get_class($this);
$pos = strpos($clazz, 'Platform');
return strtolower(substr($clazz, 0, $pos));
} | [
"public",
"function",
"getDatabaseType",
"(",
")",
"{",
"$",
"clazz",
"=",
"get_class",
"(",
"$",
"this",
")",
";",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"clazz",
",",
"'Platform'",
")",
";",
"return",
"strtolower",
"(",
"substr",
"(",
"$",
"clazz",
"... | Returns the short name of the database type that this platform represents.
For example MysqlPlatform->getDatabaseType() returns 'mysql'.
@return string | [
"Returns",
"the",
"short",
"name",
"of",
"the",
"database",
"type",
"that",
"this",
"platform",
"represents",
".",
"For",
"example",
"MysqlPlatform",
"-",
">",
"getDatabaseType",
"()",
"returns",
"mysql",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/DefaultPlatform.php#L136-L142 |
propelorm/Propel | generator/lib/platform/DefaultPlatform.php | DefaultPlatform.getDomainForType | public function getDomainForType($propelType)
{
if (!isset($this->schemaDomainMap[$propelType])) {
throw new EngineException("Cannot map unknown Propel type " . var_export($propelType, true) . " to native database type.");
}
return $this->schemaDomainMap[$propelType];
} | php | public function getDomainForType($propelType)
{
if (!isset($this->schemaDomainMap[$propelType])) {
throw new EngineException("Cannot map unknown Propel type " . var_export($propelType, true) . " to native database type.");
}
return $this->schemaDomainMap[$propelType];
} | [
"public",
"function",
"getDomainForType",
"(",
"$",
"propelType",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"schemaDomainMap",
"[",
"$",
"propelType",
"]",
")",
")",
"{",
"throw",
"new",
"EngineException",
"(",
"\"Cannot map unknown Propel typ... | Returns the db specific domain for a propelType.
@param string $propelType the Propel type name.
@return Domain The db specific domain.
@throws EngineException | [
"Returns",
"the",
"db",
"specific",
"domain",
"for",
"a",
"propelType",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/DefaultPlatform.php#L177-L184 |
propelorm/Propel | generator/lib/platform/DefaultPlatform.php | DefaultPlatform.getSequenceName | public function getSequenceName(Table $table)
{
static $longNamesMap = array();
$result = null;
if ($table->getIdMethod() == IDMethod::NATIVE) {
$idMethodParams = $table->getIdMethodParameters();
$maxIdentifierLength = $this->getMaxColumnNameLength();
if (... | php | public function getSequenceName(Table $table)
{
static $longNamesMap = array();
$result = null;
if ($table->getIdMethod() == IDMethod::NATIVE) {
$idMethodParams = $table->getIdMethodParameters();
$maxIdentifierLength = $this->getMaxColumnNameLength();
if (... | [
"public",
"function",
"getSequenceName",
"(",
"Table",
"$",
"table",
")",
"{",
"static",
"$",
"longNamesMap",
"=",
"array",
"(",
")",
";",
"$",
"result",
"=",
"null",
";",
"if",
"(",
"$",
"table",
"->",
"getIdMethod",
"(",
")",
"==",
"IDMethod",
"::",
... | Gets the name to use for creating a sequence for a table.
This will create a new name or use one specified in an id-method-parameter
tag, if specified.
@param Table $table
@return string Sequence name for this table. | [
"Gets",
"the",
"name",
"to",
"use",
"for",
"creating",
"a",
"sequence",
"for",
"a",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/DefaultPlatform.php#L213-L235 |
propelorm/Propel | generator/lib/platform/DefaultPlatform.php | DefaultPlatform.getDropPrimaryKeyDDL | public function getDropPrimaryKeyDDL(Table $table)
{
$pattern = "
ALTER TABLE %s DROP CONSTRAINT %s;
";
return sprintf($pattern,
$this->quoteIdentifier($table->getName()),
$this->quoteIdentifier($this->getPrimaryKeyName($table))
);
} | php | public function getDropPrimaryKeyDDL(Table $table)
{
$pattern = "
ALTER TABLE %s DROP CONSTRAINT %s;
";
return sprintf($pattern,
$this->quoteIdentifier($table->getName()),
$this->quoteIdentifier($this->getPrimaryKeyName($table))
);
} | [
"public",
"function",
"getDropPrimaryKeyDDL",
"(",
"Table",
"$",
"table",
")",
"{",
"$",
"pattern",
"=",
"\"\nALTER TABLE %s DROP CONSTRAINT %s;\n\"",
";",
"return",
"sprintf",
"(",
"$",
"pattern",
",",
"$",
"this",
"->",
"quoteIdentifier",
"(",
"$",
"table",
"-... | Builds the DDL SQL to drop the primary key of a table.
@param Table $table
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"to",
"drop",
"the",
"primary",
"key",
"of",
"a",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/DefaultPlatform.php#L452-L462 |
propelorm/Propel | generator/lib/platform/DefaultPlatform.php | DefaultPlatform.getAddPrimaryKeyDDL | public function getAddPrimaryKeyDDL(Table $table)
{
$pattern = "
ALTER TABLE %s ADD %s;
";
return sprintf($pattern,
$this->quoteIdentifier($table->getName()),
$this->getPrimaryKeyDDL($table)
);
} | php | public function getAddPrimaryKeyDDL(Table $table)
{
$pattern = "
ALTER TABLE %s ADD %s;
";
return sprintf($pattern,
$this->quoteIdentifier($table->getName()),
$this->getPrimaryKeyDDL($table)
);
} | [
"public",
"function",
"getAddPrimaryKeyDDL",
"(",
"Table",
"$",
"table",
")",
"{",
"$",
"pattern",
"=",
"\"\nALTER TABLE %s ADD %s;\n\"",
";",
"return",
"sprintf",
"(",
"$",
"pattern",
",",
"$",
"this",
"->",
"quoteIdentifier",
"(",
"$",
"table",
"->",
"getNam... | Builds the DDL SQL to add the primary key of a table.
@param Table $table
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"to",
"add",
"the",
"primary",
"key",
"of",
"a",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/DefaultPlatform.php#L471-L481 |
propelorm/Propel | generator/lib/platform/DefaultPlatform.php | DefaultPlatform.getDropIndexDDL | public function getDropIndexDDL(Index $index)
{
$pattern = "
DROP INDEX %s;
";
return sprintf($pattern, $this->quoteIdentifier($index->getName()));
} | php | public function getDropIndexDDL(Index $index)
{
$pattern = "
DROP INDEX %s;
";
return sprintf($pattern, $this->quoteIdentifier($index->getName()));
} | [
"public",
"function",
"getDropIndexDDL",
"(",
"Index",
"$",
"index",
")",
"{",
"$",
"pattern",
"=",
"\"\nDROP INDEX %s;\n\"",
";",
"return",
"sprintf",
"(",
"$",
"pattern",
",",
"$",
"this",
"->",
"quoteIdentifier",
"(",
"$",
"index",
"->",
"getName",
"(",
... | Builds the DDL SQL to drop an Index.
@param Index $index
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"to",
"drop",
"an",
"Index",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/DefaultPlatform.php#L528-L535 |
propelorm/Propel | generator/lib/platform/DefaultPlatform.php | DefaultPlatform.getIndexDDL | public function getIndexDDL(Index $index)
{
return sprintf('%sINDEX %s (%s)', $index->getIsUnique() ? 'UNIQUE ' : '', $this->quoteIdentifier($index->getName()), $this->getColumnListDDL($index->getColumns()));
} | php | public function getIndexDDL(Index $index)
{
return sprintf('%sINDEX %s (%s)', $index->getIsUnique() ? 'UNIQUE ' : '', $this->quoteIdentifier($index->getName()), $this->getColumnListDDL($index->getColumns()));
} | [
"public",
"function",
"getIndexDDL",
"(",
"Index",
"$",
"index",
")",
"{",
"return",
"sprintf",
"(",
"'%sINDEX %s (%s)'",
",",
"$",
"index",
"->",
"getIsUnique",
"(",
")",
"?",
"'UNIQUE '",
":",
"''",
",",
"$",
"this",
"->",
"quoteIdentifier",
"(",
"$",
... | Builds the DDL SQL for an Index object.
@param Index $index
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"for",
"an",
"Index",
"object",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/DefaultPlatform.php#L544-L547 |
propelorm/Propel | generator/lib/platform/DefaultPlatform.php | DefaultPlatform.getDropForeignKeyDDL | public function getDropForeignKeyDDL(ForeignKey $fk)
{
if ($fk->isSkipSql()) {
return;
}
$pattern = "
ALTER TABLE %s DROP CONSTRAINT %s;
";
return sprintf($pattern,
$this->quoteIdentifier($fk->getTable()->getName()),
$this->quoteIdentifier($fk->ge... | php | public function getDropForeignKeyDDL(ForeignKey $fk)
{
if ($fk->isSkipSql()) {
return;
}
$pattern = "
ALTER TABLE %s DROP CONSTRAINT %s;
";
return sprintf($pattern,
$this->quoteIdentifier($fk->getTable()->getName()),
$this->quoteIdentifier($fk->ge... | [
"public",
"function",
"getDropForeignKeyDDL",
"(",
"ForeignKey",
"$",
"fk",
")",
"{",
"if",
"(",
"$",
"fk",
"->",
"isSkipSql",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"pattern",
"=",
"\"\nALTER TABLE %s DROP CONSTRAINT %s;\n\"",
";",
"return",
"sprintf",
... | Builds the DDL SQL to drop a foreign key.
@param ForeignKey $fk
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"to",
"drop",
"a",
"foreign",
"key",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/DefaultPlatform.php#L607-L620 |
propelorm/Propel | generator/lib/platform/DefaultPlatform.php | DefaultPlatform.getForeignKeyDDL | public function getForeignKeyDDL(ForeignKey $fk)
{
if ($fk->isSkipSql()) {
return;
}
$pattern = "CONSTRAINT %s
FOREIGN KEY (%s)
REFERENCES %s (%s)";
$script = sprintf($pattern,
$this->quoteIdentifier($fk->getName()),
$this->getColumnListDDL... | php | public function getForeignKeyDDL(ForeignKey $fk)
{
if ($fk->isSkipSql()) {
return;
}
$pattern = "CONSTRAINT %s
FOREIGN KEY (%s)
REFERENCES %s (%s)";
$script = sprintf($pattern,
$this->quoteIdentifier($fk->getName()),
$this->getColumnListDDL... | [
"public",
"function",
"getForeignKeyDDL",
"(",
"ForeignKey",
"$",
"fk",
")",
"{",
"if",
"(",
"$",
"fk",
"->",
"isSkipSql",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"pattern",
"=",
"\"CONSTRAINT %s\n FOREIGN KEY (%s)\n REFERENCES %s (%s)\"",
";",
"$",
... | Builds the DDL SQL for a ForeignKey object.
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"for",
"a",
"ForeignKey",
"object",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/DefaultPlatform.php#L627-L651 |
propelorm/Propel | generator/lib/platform/DefaultPlatform.php | DefaultPlatform.getModifyDatabaseDDL | public function getModifyDatabaseDDL(PropelDatabaseDiff $databaseDiff)
{
$ret = $this->getBeginDDL();
foreach ($databaseDiff->getRemovedTables() as $table) {
$ret .= $this->getDropTableDDL($table);
}
foreach ($databaseDiff->getRenamedTables() as $fromTableName => $toTab... | php | public function getModifyDatabaseDDL(PropelDatabaseDiff $databaseDiff)
{
$ret = $this->getBeginDDL();
foreach ($databaseDiff->getRemovedTables() as $table) {
$ret .= $this->getDropTableDDL($table);
}
foreach ($databaseDiff->getRenamedTables() as $fromTableName => $toTab... | [
"public",
"function",
"getModifyDatabaseDDL",
"(",
"PropelDatabaseDiff",
"$",
"databaseDiff",
")",
"{",
"$",
"ret",
"=",
"$",
"this",
"->",
"getBeginDDL",
"(",
")",
";",
"foreach",
"(",
"$",
"databaseDiff",
"->",
"getRemovedTables",
"(",
")",
"as",
"$",
"tab... | Builds the DDL SQL to modify a database
based on a PropelDatabaseDiff instance
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"to",
"modify",
"a",
"database",
"based",
"on",
"a",
"PropelDatabaseDiff",
"instance"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/DefaultPlatform.php#L678-L706 |
propelorm/Propel | generator/lib/platform/DefaultPlatform.php | DefaultPlatform.getModifyTableDDL | public function getModifyTableDDL(PropelTableDiff $tableDiff)
{
$ret = '';
// drop indices, foreign keys
if ($tableDiff->hasModifiedPk()) {
$ret .= $this->getDropPrimaryKeyDDL($tableDiff->getFromTable());
}
foreach ($tableDiff->getRemovedFks() as $fk) {
... | php | public function getModifyTableDDL(PropelTableDiff $tableDiff)
{
$ret = '';
// drop indices, foreign keys
if ($tableDiff->hasModifiedPk()) {
$ret .= $this->getDropPrimaryKeyDDL($tableDiff->getFromTable());
}
foreach ($tableDiff->getRemovedFks() as $fk) {
... | [
"public",
"function",
"getModifyTableDDL",
"(",
"PropelTableDiff",
"$",
"tableDiff",
")",
"{",
"$",
"ret",
"=",
"''",
";",
"// drop indices, foreign keys",
"if",
"(",
"$",
"tableDiff",
"->",
"hasModifiedPk",
"(",
")",
")",
"{",
"$",
"ret",
".=",
"$",
"this",... | Builds the DDL SQL to alter a table
based on a PropelTableDiff instance
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"to",
"alter",
"a",
"table",
"based",
"on",
"a",
"PropelTableDiff",
"instance"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/DefaultPlatform.php#L731-L788 |
propelorm/Propel | generator/lib/platform/DefaultPlatform.php | DefaultPlatform.getRenameColumnDDL | public function getRenameColumnDDL($fromColumn, $toColumn)
{
$pattern = "
ALTER TABLE %s RENAME COLUMN %s TO %s;
";
return sprintf($pattern,
$this->quoteIdentifier($fromColumn->getTable()->getName()),
$this->quoteIdentifier($fromColumn->getName()),
$this->quoteId... | php | public function getRenameColumnDDL($fromColumn, $toColumn)
{
$pattern = "
ALTER TABLE %s RENAME COLUMN %s TO %s;
";
return sprintf($pattern,
$this->quoteIdentifier($fromColumn->getTable()->getName()),
$this->quoteIdentifier($fromColumn->getName()),
$this->quoteId... | [
"public",
"function",
"getRenameColumnDDL",
"(",
"$",
"fromColumn",
",",
"$",
"toColumn",
")",
"{",
"$",
"pattern",
"=",
"\"\nALTER TABLE %s RENAME COLUMN %s TO %s;\n\"",
";",
"return",
"sprintf",
"(",
"$",
"pattern",
",",
"$",
"this",
"->",
"quoteIdentifier",
"("... | Builds the DDL SQL to rename a column
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"to",
"rename",
"a",
"column"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/DefaultPlatform.php#L913-L924 |
propelorm/Propel | generator/lib/platform/DefaultPlatform.php | DefaultPlatform.getModifyColumnDDL | public function getModifyColumnDDL(PropelColumnDiff $columnDiff)
{
$toColumn = $columnDiff->getToColumn();
$pattern = "
ALTER TABLE %s MODIFY %s;
";
return sprintf($pattern,
$this->quoteIdentifier($toColumn->getTable()->getName()),
$this->getColumnDDL($toColumn)
... | php | public function getModifyColumnDDL(PropelColumnDiff $columnDiff)
{
$toColumn = $columnDiff->getToColumn();
$pattern = "
ALTER TABLE %s MODIFY %s;
";
return sprintf($pattern,
$this->quoteIdentifier($toColumn->getTable()->getName()),
$this->getColumnDDL($toColumn)
... | [
"public",
"function",
"getModifyColumnDDL",
"(",
"PropelColumnDiff",
"$",
"columnDiff",
")",
"{",
"$",
"toColumn",
"=",
"$",
"columnDiff",
"->",
"getToColumn",
"(",
")",
";",
"$",
"pattern",
"=",
"\"\nALTER TABLE %s MODIFY %s;\n\"",
";",
"return",
"sprintf",
"(",
... | Builds the DDL SQL to modify a column
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"to",
"modify",
"a",
"column"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/DefaultPlatform.php#L931-L942 |
propelorm/Propel | generator/lib/platform/DefaultPlatform.php | DefaultPlatform.getBooleanString | public function getBooleanString($b)
{
$b = ($b === true || strtolower($b) === 'true' || $b === 1 || $b === '1' || strtolower($b) === 'y' || strtolower($b) === 'yes');
return ($b ? '1' : '0');
} | php | public function getBooleanString($b)
{
$b = ($b === true || strtolower($b) === 'true' || $b === 1 || $b === '1' || strtolower($b) === 'y' || strtolower($b) === 'yes');
return ($b ? '1' : '0');
} | [
"public",
"function",
"getBooleanString",
"(",
"$",
"b",
")",
"{",
"$",
"b",
"=",
"(",
"$",
"b",
"===",
"true",
"||",
"strtolower",
"(",
"$",
"b",
")",
"===",
"'true'",
"||",
"$",
"b",
"===",
"1",
"||",
"$",
"b",
"===",
"'1'",
"||",
"strtolower",... | Returns the boolean value for the RDBMS.
This value should match the boolean value that is set
when using Propel's PreparedStatement::setBoolean().
This function is used to set default column values when building
SQL.
@param mixed $tf A boolean or string representation of boolean ('y', 'true').
@return mixed | [
"Returns",
"the",
"boolean",
"value",
"for",
"the",
"RDBMS",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/DefaultPlatform.php#L1165-L1170 |
propelorm/Propel | generator/lib/platform/DefaultPlatform.php | DefaultPlatform.getColumnBindingPHP | public function getColumnBindingPHP($column, $identifier, $columnValueAccessor, $tab = " ")
{
$script = '';
$hasValuePreparation = false;
if ($column->isTemporalType()) {
// nothing special, the internal value was already properly formatted by the setter
} elseif ($colu... | php | public function getColumnBindingPHP($column, $identifier, $columnValueAccessor, $tab = " ")
{
$script = '';
$hasValuePreparation = false;
if ($column->isTemporalType()) {
// nothing special, the internal value was already properly formatted by the setter
} elseif ($colu... | [
"public",
"function",
"getColumnBindingPHP",
"(",
"$",
"column",
",",
"$",
"identifier",
",",
"$",
"columnValueAccessor",
",",
"$",
"tab",
"=",
"\"\t\t\t\"",
")",
"{",
"$",
"script",
"=",
"''",
";",
"$",
"hasValuePreparation",
"=",
"false",
";",
"if",
"(",... | Get the PHP snippet for binding a value to a column.
Warning: duplicates logic from DBAdapter::bindValue().
Any code modification here must be ported there. | [
"Get",
"the",
"PHP",
"snippet",
"for",
"binding",
"a",
"value",
"to",
"a",
"column",
".",
"Warning",
":",
"duplicates",
"logic",
"from",
"DBAdapter",
"::",
"bindValue",
"()",
".",
"Any",
"code",
"modification",
"here",
"must",
"be",
"ported",
"there",
"."
... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/DefaultPlatform.php#L1228-L1252 |
propelorm/Propel | generator/lib/platform/DefaultPlatform.php | DefaultPlatform.getIdentifierPhp | public function getIdentifierPhp($columnValueMutator, $connectionVariableName = '$con', $sequenceName = '', $tab = " ")
{
return sprintf(
"
%s%s = %s->lastInsertId(%s);",
$tab,
$columnValueMutator,
$connectionVariableName,
$sequenceName ? ("'" . ... | php | public function getIdentifierPhp($columnValueMutator, $connectionVariableName = '$con', $sequenceName = '', $tab = " ")
{
return sprintf(
"
%s%s = %s->lastInsertId(%s);",
$tab,
$columnValueMutator,
$connectionVariableName,
$sequenceName ? ("'" . ... | [
"public",
"function",
"getIdentifierPhp",
"(",
"$",
"columnValueMutator",
",",
"$",
"connectionVariableName",
"=",
"'$con'",
",",
"$",
"sequenceName",
"=",
"''",
",",
"$",
"tab",
"=",
"\"\t\t\t\"",
")",
"{",
"return",
"sprintf",
"(",
"\"\n%s%s = %s->lastInsertId(%... | Get the PHP snippet for getting a Pk from the database.
Warning: duplicates logic from DBAdapter::getId().
Any code modification here must be ported there.
Typical output:
<code>
$this->id = $con->lastInsertId();
</code> | [
"Get",
"the",
"PHP",
"snippet",
"for",
"getting",
"a",
"Pk",
"from",
"the",
"database",
".",
"Warning",
":",
"duplicates",
"logic",
"from",
"DBAdapter",
"::",
"getId",
"()",
".",
"Any",
"code",
"modification",
"here",
"must",
"be",
"ported",
"there",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/DefaultPlatform.php#L1264-L1274 |
propelorm/Propel | generator/lib/builder/sql/DataSQLBuilder.php | DataSQLBuilder.buildRowSql | public function buildRowSql(DataRow $row)
{
$sql = "";
$platform = $this->getPlatform();
$table = $this->getTable();
$sql .= "INSERT INTO " . $this->quoteIdentifier($this->getTable()->getName()) . " (";
// add column names to SQL
$colNames = array();
foreach... | php | public function buildRowSql(DataRow $row)
{
$sql = "";
$platform = $this->getPlatform();
$table = $this->getTable();
$sql .= "INSERT INTO " . $this->quoteIdentifier($this->getTable()->getName()) . " (";
// add column names to SQL
$colNames = array();
foreach... | [
"public",
"function",
"buildRowSql",
"(",
"DataRow",
"$",
"row",
")",
"{",
"$",
"sql",
"=",
"\"\"",
";",
"$",
"platform",
"=",
"$",
"this",
"->",
"getPlatform",
"(",
")",
";",
"$",
"table",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
";",
"$",
... | The main method in this class, returns the SQL for INSERTing data into a row.
@param DataRow $row The row to process.
@return string | [
"The",
"main",
"method",
"in",
"this",
"class",
"returns",
"the",
"SQL",
"for",
"INSERTing",
"data",
"into",
"a",
"row",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/sql/DataSQLBuilder.php#L80-L108 |
propelorm/Propel | generator/lib/builder/sql/DataSQLBuilder.php | DataSQLBuilder.getColumnValueSql | protected function getColumnValueSql(ColumnValue $colValue)
{
$column = $colValue->getColumn();
$method = 'get' . $column->getPhpNative() . 'Sql';
return $this->$method($colValue->getValue());
} | php | protected function getColumnValueSql(ColumnValue $colValue)
{
$column = $colValue->getColumn();
$method = 'get' . $column->getPhpNative() . 'Sql';
return $this->$method($colValue->getValue());
} | [
"protected",
"function",
"getColumnValueSql",
"(",
"ColumnValue",
"$",
"colValue",
")",
"{",
"$",
"column",
"=",
"$",
"colValue",
"->",
"getColumn",
"(",
")",
";",
"$",
"method",
"=",
"'get'",
".",
"$",
"column",
"->",
"getPhpNative",
"(",
")",
".",
"'Sq... | Gets the property escaped (and quoted) value for a column.
@param ColumnValue $colValue
@return mixed The proper value to be added to the string. | [
"Gets",
"the",
"property",
"escaped",
"(",
"and",
"quoted",
")",
"value",
"for",
"a",
"column",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/sql/DataSQLBuilder.php#L117-L123 |
propelorm/Propel | generator/lib/builder/sql/DataSQLBuilder.php | DataSQLBuilder.getBlobSql | protected function getBlobSql($blob)
{
// they took magic __toString() out of PHP5.0.0; this sucks
if (is_object($blob)) {
return $this->getPlatform()->quote($blob->__toString());
} else {
return $this->getPlatform()->quote($blob);
}
} | php | protected function getBlobSql($blob)
{
// they took magic __toString() out of PHP5.0.0; this sucks
if (is_object($blob)) {
return $this->getPlatform()->quote($blob->__toString());
} else {
return $this->getPlatform()->quote($blob);
}
} | [
"protected",
"function",
"getBlobSql",
"(",
"$",
"blob",
")",
"{",
"// they took magic __toString() out of PHP5.0.0; this sucks",
"if",
"(",
"is_object",
"(",
"$",
"blob",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getPlatform",
"(",
")",
"->",
"quote",
"(",
... | Gets a representation of a BLOB/LONGVARBINARY value suitable for use in a SQL statement.
@param mixed $blob Blob object or string data.
@return string | [
"Gets",
"a",
"representation",
"of",
"a",
"BLOB",
"/",
"LONGVARBINARY",
"value",
"suitable",
"for",
"use",
"in",
"a",
"SQL",
"statement",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/sql/DataSQLBuilder.php#L145-L153 |
propelorm/Propel | generator/lib/builder/sql/DataSQLBuilder.php | DataSQLBuilder.getClobSql | protected function getClobSql($clob)
{
// they took magic __toString() out of PHP5.0.0; this sucks
if (is_object($clob)) {
return $this->getPlatform()->quote($clob->__toString());
} else {
return $this->getPlatform()->quote($clob);
}
} | php | protected function getClobSql($clob)
{
// they took magic __toString() out of PHP5.0.0; this sucks
if (is_object($clob)) {
return $this->getPlatform()->quote($clob->__toString());
} else {
return $this->getPlatform()->quote($clob);
}
} | [
"protected",
"function",
"getClobSql",
"(",
"$",
"clob",
")",
"{",
"// they took magic __toString() out of PHP5.0.0; this sucks",
"if",
"(",
"is_object",
"(",
"$",
"clob",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getPlatform",
"(",
")",
"->",
"quote",
"(",
... | Gets a representation of a CLOB/LONGVARCHAR value suitable for use in a SQL statement.
@param mixed $clob Clob object or string data.
@return string | [
"Gets",
"a",
"representation",
"of",
"a",
"CLOB",
"/",
"LONGVARCHAR",
"value",
"suitable",
"for",
"use",
"in",
"a",
"SQL",
"statement",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/sql/DataSQLBuilder.php#L162-L170 |
yiisoft/yii2-faker | src/FixtureController.php | FixtureController.beforeAction | public function beforeAction($action)
{
if (parent::beforeAction($action)) {
$this->checkPaths();
$this->addProviders();
return true;
}
return false;
} | php | public function beforeAction($action)
{
if (parent::beforeAction($action)) {
$this->checkPaths();
$this->addProviders();
return true;
}
return false;
} | [
"public",
"function",
"beforeAction",
"(",
"$",
"action",
")",
"{",
"if",
"(",
"parent",
"::",
"beforeAction",
"(",
"$",
"action",
")",
")",
"{",
"$",
"this",
"->",
"checkPaths",
"(",
")",
";",
"$",
"this",
"->",
"addProviders",
"(",
")",
";",
"retur... | {@inheritdoc} | [
"{"
] | train | https://github.com/yiisoft/yii2-faker/blob/2f548188b2961f097c08623214f5190e3cf2f1ac/src/FixtureController.php#L186-L195 |
yiisoft/yii2-faker | src/FixtureController.php | FixtureController.actionTemplates | public function actionTemplates()
{
$foundTemplates = $this->findTemplatesFiles();
if (!$foundTemplates) {
$this->notifyNoTemplatesFound();
} else {
$this->notifyTemplatesCanBeGenerated($foundTemplates);
}
} | php | public function actionTemplates()
{
$foundTemplates = $this->findTemplatesFiles();
if (!$foundTemplates) {
$this->notifyNoTemplatesFound();
} else {
$this->notifyTemplatesCanBeGenerated($foundTemplates);
}
} | [
"public",
"function",
"actionTemplates",
"(",
")",
"{",
"$",
"foundTemplates",
"=",
"$",
"this",
"->",
"findTemplatesFiles",
"(",
")",
";",
"if",
"(",
"!",
"$",
"foundTemplates",
")",
"{",
"$",
"this",
"->",
"notifyNoTemplatesFound",
"(",
")",
";",
"}",
... | Lists all available fixtures template files. | [
"Lists",
"all",
"available",
"fixtures",
"template",
"files",
"."
] | train | https://github.com/yiisoft/yii2-faker/blob/2f548188b2961f097c08623214f5190e3cf2f1ac/src/FixtureController.php#L200-L209 |
yiisoft/yii2-faker | src/FixtureController.php | FixtureController.actionGenerate | public function actionGenerate()
{
$templatesInput = func_get_args();
if (empty($templatesInput)) {
throw new Exception('You should specify input fixtures template files');
}
$foundTemplates = $this->findTemplatesFiles($templatesInput);
$notFoundTemplates = arr... | php | public function actionGenerate()
{
$templatesInput = func_get_args();
if (empty($templatesInput)) {
throw new Exception('You should specify input fixtures template files');
}
$foundTemplates = $this->findTemplatesFiles($templatesInput);
$notFoundTemplates = arr... | [
"public",
"function",
"actionGenerate",
"(",
")",
"{",
"$",
"templatesInput",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"templatesInput",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'You should specify input fixtures template files'"... | Generates fixtures and fill them with Faker data.
For example,
```
//generate fixtures in russian language
yii fixture/generate user --count=5 --language=ru_RU
//generate several fixtures
yii fixture/generate user profile team
```
@throws \yii\base\InvalidParamException
@throws \yii\console\Exception | [
"Generates",
"fixtures",
"and",
"fill",
"them",
"with",
"Faker",
"data",
".",
"For",
"example"
] | train | https://github.com/yiisoft/yii2-faker/blob/2f548188b2961f097c08623214f5190e3cf2f1ac/src/FixtureController.php#L226-L264 |
yiisoft/yii2-faker | src/FixtureController.php | FixtureController.actionGenerateAll | public function actionGenerateAll()
{
$foundTemplates = $this->findTemplatesFiles();
if (!$foundTemplates) {
$this->notifyNoTemplatesFound();
return static::EXIT_CODE_NORMAL;
}
if (!$this->confirmGeneration($foundTemplates)) {
return static::EXIT... | php | public function actionGenerateAll()
{
$foundTemplates = $this->findTemplatesFiles();
if (!$foundTemplates) {
$this->notifyNoTemplatesFound();
return static::EXIT_CODE_NORMAL;
}
if (!$this->confirmGeneration($foundTemplates)) {
return static::EXIT... | [
"public",
"function",
"actionGenerateAll",
"(",
")",
"{",
"$",
"foundTemplates",
"=",
"$",
"this",
"->",
"findTemplatesFiles",
"(",
")",
";",
"if",
"(",
"!",
"$",
"foundTemplates",
")",
"{",
"$",
"this",
"->",
"notifyNoTemplatesFound",
"(",
")",
";",
"retu... | Generates all fixtures template path that can be found. | [
"Generates",
"all",
"fixtures",
"template",
"path",
"that",
"can",
"be",
"found",
"."
] | train | https://github.com/yiisoft/yii2-faker/blob/2f548188b2961f097c08623214f5190e3cf2f1ac/src/FixtureController.php#L269-L295 |
yiisoft/yii2-faker | src/FixtureController.php | FixtureController.notifyNotFoundTemplates | protected function notifyNotFoundTemplates($templatesNames)
{
$this->stdout("The following fixtures templates were NOT found:\n\n", Console::FG_RED);
foreach ($templatesNames as $name) {
$this->stdout("\t * $name \n", Console::FG_GREEN);
}
$this->stdout("\n");
} | php | protected function notifyNotFoundTemplates($templatesNames)
{
$this->stdout("The following fixtures templates were NOT found:\n\n", Console::FG_RED);
foreach ($templatesNames as $name) {
$this->stdout("\t * $name \n", Console::FG_GREEN);
}
$this->stdout("\n");
} | [
"protected",
"function",
"notifyNotFoundTemplates",
"(",
"$",
"templatesNames",
")",
"{",
"$",
"this",
"->",
"stdout",
"(",
"\"The following fixtures templates were NOT found:\\n\\n\"",
",",
"Console",
"::",
"FG_RED",
")",
";",
"foreach",
"(",
"$",
"templatesNames",
"... | Notifies user that given fixtures template files were not found.
@param array $templatesNames
@since 2.0.4 | [
"Notifies",
"user",
"that",
"given",
"fixtures",
"template",
"files",
"were",
"not",
"found",
"."
] | train | https://github.com/yiisoft/yii2-faker/blob/2f548188b2961f097c08623214f5190e3cf2f1ac/src/FixtureController.php#L302-L311 |
yiisoft/yii2-faker | src/FixtureController.php | FixtureController.notifyNoTemplatesFound | protected function notifyNoTemplatesFound()
{
$this->stdout("No fixtures template files matching input conditions were found under the path:\n\n", Console::FG_RED);
$this->stdout("\t " . Yii::getAlias($this->templatePath) . " \n\n", Console::FG_GREEN);
} | php | protected function notifyNoTemplatesFound()
{
$this->stdout("No fixtures template files matching input conditions were found under the path:\n\n", Console::FG_RED);
$this->stdout("\t " . Yii::getAlias($this->templatePath) . " \n\n", Console::FG_GREEN);
} | [
"protected",
"function",
"notifyNoTemplatesFound",
"(",
")",
"{",
"$",
"this",
"->",
"stdout",
"(",
"\"No fixtures template files matching input conditions were found under the path:\\n\\n\"",
",",
"Console",
"::",
"FG_RED",
")",
";",
"$",
"this",
"->",
"stdout",
"(",
"... | Notifies user that there was not found any files matching given input conditions.
@since 2.0.4 | [
"Notifies",
"user",
"that",
"there",
"was",
"not",
"found",
"any",
"files",
"matching",
"given",
"input",
"conditions",
"."
] | train | https://github.com/yiisoft/yii2-faker/blob/2f548188b2961f097c08623214f5190e3cf2f1ac/src/FixtureController.php#L317-L321 |
yiisoft/yii2-faker | src/FixtureController.php | FixtureController.notifyTemplatesGenerated | protected function notifyTemplatesGenerated($templatesNames)
{
$this->stdout("The following fixtures template files were generated:\n\n", Console::FG_YELLOW);
foreach ($templatesNames as $name) {
$this->stdout("\t* " . $name . "\n", Console::FG_GREEN);
}
$this->stdout("... | php | protected function notifyTemplatesGenerated($templatesNames)
{
$this->stdout("The following fixtures template files were generated:\n\n", Console::FG_YELLOW);
foreach ($templatesNames as $name) {
$this->stdout("\t* " . $name . "\n", Console::FG_GREEN);
}
$this->stdout("... | [
"protected",
"function",
"notifyTemplatesGenerated",
"(",
"$",
"templatesNames",
")",
"{",
"$",
"this",
"->",
"stdout",
"(",
"\"The following fixtures template files were generated:\\n\\n\"",
",",
"Console",
"::",
"FG_YELLOW",
")",
";",
"foreach",
"(",
"$",
"templatesNa... | Notifies user that given fixtures template files were generated.
@param array $templatesNames
@since 2.0.4 | [
"Notifies",
"user",
"that",
"given",
"fixtures",
"template",
"files",
"were",
"generated",
"."
] | train | https://github.com/yiisoft/yii2-faker/blob/2f548188b2961f097c08623214f5190e3cf2f1ac/src/FixtureController.php#L328-L337 |
yiisoft/yii2-faker | src/FixtureController.php | FixtureController.notifyTemplatesCanBeGenerated | protected function notifyTemplatesCanBeGenerated($templatesNames)
{
$this->stdout("Template files path: ", Console::FG_YELLOW);
$this->stdout(Yii::getAlias($this->templatePath) . "\n\n", Console::FG_GREEN);
foreach ($templatesNames as $name) {
$this->stdout("\t* " . $name . "\n"... | php | protected function notifyTemplatesCanBeGenerated($templatesNames)
{
$this->stdout("Template files path: ", Console::FG_YELLOW);
$this->stdout(Yii::getAlias($this->templatePath) . "\n\n", Console::FG_GREEN);
foreach ($templatesNames as $name) {
$this->stdout("\t* " . $name . "\n"... | [
"protected",
"function",
"notifyTemplatesCanBeGenerated",
"(",
"$",
"templatesNames",
")",
"{",
"$",
"this",
"->",
"stdout",
"(",
"\"Template files path: \"",
",",
"Console",
"::",
"FG_YELLOW",
")",
";",
"$",
"this",
"->",
"stdout",
"(",
"Yii",
"::",
"getAlias",... | Notifies user about templates which could be generated.
@param array $templatesNames
@since 2.0.4 | [
"Notifies",
"user",
"about",
"templates",
"which",
"could",
"be",
"generated",
"."
] | train | https://github.com/yiisoft/yii2-faker/blob/2f548188b2961f097c08623214f5190e3cf2f1ac/src/FixtureController.php#L344-L354 |
yiisoft/yii2-faker | src/FixtureController.php | FixtureController.findTemplatesFiles | protected function findTemplatesFiles(array $templatesNames = [])
{
$findAll = ($templatesNames == []);
if ($findAll) {
$files = FileHelper::findFiles(Yii::getAlias($this->templatePath), ['only' => ['*.php']]);
} else {
$filesToSearch = [];
foreach ($tem... | php | protected function findTemplatesFiles(array $templatesNames = [])
{
$findAll = ($templatesNames == []);
if ($findAll) {
$files = FileHelper::findFiles(Yii::getAlias($this->templatePath), ['only' => ['*.php']]);
} else {
$filesToSearch = [];
foreach ($tem... | [
"protected",
"function",
"findTemplatesFiles",
"(",
"array",
"$",
"templatesNames",
"=",
"[",
"]",
")",
"{",
"$",
"findAll",
"=",
"(",
"$",
"templatesNames",
"==",
"[",
"]",
")",
";",
"if",
"(",
"$",
"findAll",
")",
"{",
"$",
"files",
"=",
"FileHelper"... | Returns array containing fixtures templates file names. You can specify what files to find
by the given parameter.
@param array $templatesNames template file names to search. If empty then all files will be searched.
@return array
@since 2.0.4 | [
"Returns",
"array",
"containing",
"fixtures",
"templates",
"file",
"names",
".",
"You",
"can",
"specify",
"what",
"files",
"to",
"find",
"by",
"the",
"given",
"parameter",
"."
] | train | https://github.com/yiisoft/yii2-faker/blob/2f548188b2961f097c08623214f5190e3cf2f1ac/src/FixtureController.php#L363-L391 |
yiisoft/yii2-faker | src/FixtureController.php | FixtureController.getGenerator | public function getGenerator()
{
if ($this->_generator === null) {
$language = $this->language === null ? Yii::$app->language : $this->language;
$this->_generator = \Faker\Factory::create(str_replace('-', '_', $language));
}
return $this->_generator;
} | php | public function getGenerator()
{
if ($this->_generator === null) {
$language = $this->language === null ? Yii::$app->language : $this->language;
$this->_generator = \Faker\Factory::create(str_replace('-', '_', $language));
}
return $this->_generator;
} | [
"public",
"function",
"getGenerator",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_generator",
"===",
"null",
")",
"{",
"$",
"language",
"=",
"$",
"this",
"->",
"language",
"===",
"null",
"?",
"Yii",
"::",
"$",
"app",
"->",
"language",
":",
"$",
... | Returns Faker generator instance. Getter for private property.
@return \Faker\Generator | [
"Returns",
"Faker",
"generator",
"instance",
".",
"Getter",
"for",
"private",
"property",
"."
] | train | https://github.com/yiisoft/yii2-faker/blob/2f548188b2961f097c08623214f5190e3cf2f1ac/src/FixtureController.php#L397-L404 |
yiisoft/yii2-faker | src/FixtureController.php | FixtureController.checkPaths | public function checkPaths()
{
$path = Yii::getAlias($this->templatePath, false);
if (!$path || !is_dir($path)) {
throw new Exception("The template path \"{$this->templatePath}\" does not exist");
}
} | php | public function checkPaths()
{
$path = Yii::getAlias($this->templatePath, false);
if (!$path || !is_dir($path)) {
throw new Exception("The template path \"{$this->templatePath}\" does not exist");
}
} | [
"public",
"function",
"checkPaths",
"(",
")",
"{",
"$",
"path",
"=",
"Yii",
"::",
"getAlias",
"(",
"$",
"this",
"->",
"templatePath",
",",
"false",
")",
";",
"if",
"(",
"!",
"$",
"path",
"||",
"!",
"is_dir",
"(",
"$",
"path",
")",
")",
"{",
"thro... | Check if the template path and migrations path exists and writable. | [
"Check",
"if",
"the",
"template",
"path",
"and",
"migrations",
"path",
"exists",
"and",
"writable",
"."
] | train | https://github.com/yiisoft/yii2-faker/blob/2f548188b2961f097c08623214f5190e3cf2f1ac/src/FixtureController.php#L409-L416 |
yiisoft/yii2-faker | src/FixtureController.php | FixtureController.addProviders | public function addProviders()
{
foreach ($this->providers as $provider) {
$this->generator->addProvider(new $provider($this->generator));
}
} | php | public function addProviders()
{
foreach ($this->providers as $provider) {
$this->generator->addProvider(new $provider($this->generator));
}
} | [
"public",
"function",
"addProviders",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"providers",
"as",
"$",
"provider",
")",
"{",
"$",
"this",
"->",
"generator",
"->",
"addProvider",
"(",
"new",
"$",
"provider",
"(",
"$",
"this",
"->",
"generator",
... | Adds users providers to the faker generator. | [
"Adds",
"users",
"providers",
"to",
"the",
"faker",
"generator",
"."
] | train | https://github.com/yiisoft/yii2-faker/blob/2f548188b2961f097c08623214f5190e3cf2f1ac/src/FixtureController.php#L421-L426 |
yiisoft/yii2-faker | src/FixtureController.php | FixtureController.generateFixtureFile | public function generateFixtureFile($templateName, $templatePath, $fixtureDataPath)
{
$fixtures = [];
for ($i = 0; $i < $this->count; $i++) {
$fixtures[$templateName . $i] = $this->generateFixture($templatePath . '/' . $templateName . '.php', $i);
}
$content = $this->ex... | php | public function generateFixtureFile($templateName, $templatePath, $fixtureDataPath)
{
$fixtures = [];
for ($i = 0; $i < $this->count; $i++) {
$fixtures[$templateName . $i] = $this->generateFixture($templatePath . '/' . $templateName . '.php', $i);
}
$content = $this->ex... | [
"public",
"function",
"generateFixtureFile",
"(",
"$",
"templateName",
",",
"$",
"templatePath",
",",
"$",
"fixtureDataPath",
")",
"{",
"$",
"fixtures",
"=",
"[",
"]",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"this",
"->",
"count... | Generates fixture file by the given fixture template file.
@param string $templateName template file name
@param string $templatePath path where templates are stored
@param string $fixtureDataPath fixture data path where generated file should be written | [
"Generates",
"fixture",
"file",
"by",
"the",
"given",
"fixture",
"template",
"file",
"."
] | train | https://github.com/yiisoft/yii2-faker/blob/2f548188b2961f097c08623214f5190e3cf2f1ac/src/FixtureController.php#L457-L476 |
yiisoft/yii2-faker | src/FixtureController.php | FixtureController.confirmGeneration | public function confirmGeneration($files)
{
$this->stdout("Fixtures will be generated under the path: \n", Console::FG_YELLOW);
$this->stdout("\t" . Yii::getAlias($this->fixtureDataPath) . "\n\n", Console::FG_GREEN);
$this->stdout("Templates will be taken from path: \n", Console::FG_YELLOW);... | php | public function confirmGeneration($files)
{
$this->stdout("Fixtures will be generated under the path: \n", Console::FG_YELLOW);
$this->stdout("\t" . Yii::getAlias($this->fixtureDataPath) . "\n\n", Console::FG_GREEN);
$this->stdout("Templates will be taken from path: \n", Console::FG_YELLOW);... | [
"public",
"function",
"confirmGeneration",
"(",
"$",
"files",
")",
"{",
"$",
"this",
"->",
"stdout",
"(",
"\"Fixtures will be generated under the path: \\n\"",
",",
"Console",
"::",
"FG_YELLOW",
")",
";",
"$",
"this",
"->",
"stdout",
"(",
"\"\\t\"",
".",
"Yii",
... | Prompts user with message if he confirm generation with given fixture templates files.
@param array $files
@return bool | [
"Prompts",
"user",
"with",
"message",
"if",
"he",
"confirm",
"generation",
"with",
"given",
"fixture",
"templates",
"files",
"."
] | train | https://github.com/yiisoft/yii2-faker/blob/2f548188b2961f097c08623214f5190e3cf2f1ac/src/FixtureController.php#L483-L495 |
guzzle/guzzle-services | src/RequestLocation/JsonLocation.php | JsonLocation.visit | public function visit(
CommandInterface $command,
RequestInterface $request,
Parameter $param
) {
$this->jsonData[$param->getWireName()] = $this->prepareValue(
$command[$param->getName()],
$param
);
return $request->withBody(Psr7\stream_for(\G... | php | public function visit(
CommandInterface $command,
RequestInterface $request,
Parameter $param
) {
$this->jsonData[$param->getWireName()] = $this->prepareValue(
$command[$param->getName()],
$param
);
return $request->withBody(Psr7\stream_for(\G... | [
"public",
"function",
"visit",
"(",
"CommandInterface",
"$",
"command",
",",
"RequestInterface",
"$",
"request",
",",
"Parameter",
"$",
"param",
")",
"{",
"$",
"this",
"->",
"jsonData",
"[",
"$",
"param",
"->",
"getWireName",
"(",
")",
"]",
"=",
"$",
"th... | @param CommandInterface $command
@param RequestInterface $request
@param Parameter $param
@return RequestInterface | [
"@param",
"CommandInterface",
"$command",
"@param",
"RequestInterface",
"$request",
"@param",
"Parameter",
"$param"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/RequestLocation/JsonLocation.php#L40-L51 |
guzzle/guzzle-services | src/RequestLocation/JsonLocation.php | JsonLocation.after | public function after(
CommandInterface $command,
RequestInterface $request,
Operation $operation
) {
$data = $this->jsonData;
$this->jsonData = [];
// Add additional parameters to the JSON document
$additional = $operation->getAdditionalParameters();
... | php | public function after(
CommandInterface $command,
RequestInterface $request,
Operation $operation
) {
$data = $this->jsonData;
$this->jsonData = [];
// Add additional parameters to the JSON document
$additional = $operation->getAdditionalParameters();
... | [
"public",
"function",
"after",
"(",
"CommandInterface",
"$",
"command",
",",
"RequestInterface",
"$",
"request",
",",
"Operation",
"$",
"operation",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"jsonData",
";",
"$",
"this",
"->",
"jsonData",
"=",
"[",
... | @param CommandInterface $command
@param RequestInterface $request
@param Operation $operation
@return MessageInterface | [
"@param",
"CommandInterface",
"$command",
"@param",
"RequestInterface",
"$request",
"@param",
"Operation",
"$operation"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/RequestLocation/JsonLocation.php#L60-L84 |
guzzle/guzzle-services | src/GuzzleClient.php | GuzzleClient.getCommand | public function getCommand($name, array $args = [])
{
if (!$this->description->hasOperation($name)) {
$name = ucfirst($name);
if (!$this->description->hasOperation($name)) {
throw new \InvalidArgumentException(
"No operation found named {$name}"
... | php | public function getCommand($name, array $args = [])
{
if (!$this->description->hasOperation($name)) {
$name = ucfirst($name);
if (!$this->description->hasOperation($name)) {
throw new \InvalidArgumentException(
"No operation found named {$name}"
... | [
"public",
"function",
"getCommand",
"(",
"$",
"name",
",",
"array",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"description",
"->",
"hasOperation",
"(",
"$",
"name",
")",
")",
"{",
"$",
"name",
"=",
"ucfirst",
"(",
"... | Returns the command if valid; otherwise an Exception
@param string $name
@param array $args
@return CommandInterface
@throws \InvalidArgumentException | [
"Returns",
"the",
"command",
"if",
"valid",
";",
"otherwise",
"an",
"Exception"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/GuzzleClient.php#L67-L82 |
guzzle/guzzle-services | src/GuzzleClient.php | GuzzleClient.getDeserializer | private function getDeserializer($responseToResultTransformer)
{
$process = (! isset($this->config['process']) || $this->config['process'] === true);
return $responseToResultTransformer ==! null
? $responseToResultTransformer
: new Deserializer($this->description, $process);... | php | private function getDeserializer($responseToResultTransformer)
{
$process = (! isset($this->config['process']) || $this->config['process'] === true);
return $responseToResultTransformer ==! null
? $responseToResultTransformer
: new Deserializer($this->description, $process);... | [
"private",
"function",
"getDeserializer",
"(",
"$",
"responseToResultTransformer",
")",
"{",
"$",
"process",
"=",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"config",
"[",
"'process'",
"]",
")",
"||",
"$",
"this",
"->",
"config",
"[",
"'process'",
"]",
"... | Returns the passed Deserializer when set, a new instance otherwise
@param callable|null $responseToResultTransformer
@return \GuzzleHttp\Command\Guzzle\Deserializer | [
"Returns",
"the",
"passed",
"Deserializer",
"when",
"set",
"a",
"new",
"instance",
"otherwise"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/GuzzleClient.php#L113-L120 |
guzzle/guzzle-services | src/GuzzleClient.php | GuzzleClient.processConfig | protected function processConfig(array $config)
{
// set defaults as an array if not provided
if (!isset($config['defaults'])) {
$config['defaults'] = [];
}
// Add the handlers based on the configuration option
$stack = $this->getHandlerStack();
if (!iss... | php | protected function processConfig(array $config)
{
// set defaults as an array if not provided
if (!isset($config['defaults'])) {
$config['defaults'] = [];
}
// Add the handlers based on the configuration option
$stack = $this->getHandlerStack();
if (!iss... | [
"protected",
"function",
"processConfig",
"(",
"array",
"$",
"config",
")",
"{",
"// set defaults as an array if not provided",
"if",
"(",
"!",
"isset",
"(",
"$",
"config",
"[",
"'defaults'",
"]",
")",
")",
"{",
"$",
"config",
"[",
"'defaults'",
"]",
"=",
"[... | Prepares the client based on the configuration settings of the client.
@param array $config Constructor config as an array | [
"Prepares",
"the",
"client",
"based",
"on",
"the",
"configuration",
"settings",
"of",
"the",
"client",
"."
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/GuzzleClient.php#L149-L168 |
guzzle/guzzle-services | src/RequestLocation/XmlLocation.php | XmlLocation.after | public function after(
CommandInterface $command,
RequestInterface $request,
Operation $operation
) {
foreach ($this->buffered as $param) {
$this->visitWithValue(
$command[$param->getName()],
$param,
$operation
)... | php | public function after(
CommandInterface $command,
RequestInterface $request,
Operation $operation
) {
foreach ($this->buffered as $param) {
$this->visitWithValue(
$command[$param->getName()],
$param,
$operation
)... | [
"public",
"function",
"after",
"(",
"CommandInterface",
"$",
"command",
",",
"RequestInterface",
"$",
"request",
",",
"Operation",
"$",
"operation",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"buffered",
"as",
"$",
"param",
")",
"{",
"$",
"this",
"->",
... | @param CommandInterface $command
@param RequestInterface $request
@param Operation $operation
@return RequestInterface | [
"@param",
"CommandInterface",
"$command",
"@param",
"RequestInterface",
"$request",
"@param",
"Operation",
"$operation"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/RequestLocation/XmlLocation.php#L67-L114 |
guzzle/guzzle-services | src/RequestLocation/XmlLocation.php | XmlLocation.addXml | protected function addXml(\XMLWriter $writer, Parameter $param, $value)
{
$value = $param->filter($value);
$type = $param->getType();
$name = $param->getWireName();
$prefix = null;
$namespace = $param->getData('xmlNamespace');
if (false !== strpos($name, ':')) {
... | php | protected function addXml(\XMLWriter $writer, Parameter $param, $value)
{
$value = $param->filter($value);
$type = $param->getType();
$name = $param->getWireName();
$prefix = null;
$namespace = $param->getData('xmlNamespace');
if (false !== strpos($name, ':')) {
... | [
"protected",
"function",
"addXml",
"(",
"\\",
"XMLWriter",
"$",
"writer",
",",
"Parameter",
"$",
"param",
",",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"$",
"param",
"->",
"filter",
"(",
"$",
"value",
")",
";",
"$",
"type",
"=",
"$",
"param",
"->... | Recursively build the XML body
@param \XMLWriter $writer XML to modify
@param Parameter $param API Parameter
@param mixed $value Value to add | [
"Recursively",
"build",
"the",
"XML",
"body"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/RequestLocation/XmlLocation.php#L155-L189 |
guzzle/guzzle-services | src/RequestLocation/XmlLocation.php | XmlLocation.writeAttribute | protected function writeAttribute($writer, $prefix, $name, $namespace, $value)
{
if ($namespace) {
$writer->writeAttributeNS($prefix, $name, $namespace, $value);
} else {
$writer->writeAttribute($name, $value);
}
} | php | protected function writeAttribute($writer, $prefix, $name, $namespace, $value)
{
if ($namespace) {
$writer->writeAttributeNS($prefix, $name, $namespace, $value);
} else {
$writer->writeAttribute($name, $value);
}
} | [
"protected",
"function",
"writeAttribute",
"(",
"$",
"writer",
",",
"$",
"prefix",
",",
"$",
"name",
",",
"$",
"namespace",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"namespace",
")",
"{",
"$",
"writer",
"->",
"writeAttributeNS",
"(",
"$",
"prefix",... | Write an attribute with namespace if used
@param \XMLWriter $writer XMLWriter instance
@param string $prefix Namespace prefix if any
@param string $name Attribute name
@param string $namespace The uri of the namespace
@param string $value The attribute content | [
"Write",
"an",
"attribute",
"with",
"namespace",
"if",
"used"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/RequestLocation/XmlLocation.php#L200-L207 |
guzzle/guzzle-services | src/RequestLocation/XmlLocation.php | XmlLocation.writeElement | protected function writeElement(\XMLWriter $writer, $prefix, $name, $namespace, $value)
{
if ($namespace) {
$writer->startElementNS($prefix, $name, $namespace);
} else {
$writer->startElement($name);
}
if (strpbrk($value, '<>&')) {
$writer->writeCD... | php | protected function writeElement(\XMLWriter $writer, $prefix, $name, $namespace, $value)
{
if ($namespace) {
$writer->startElementNS($prefix, $name, $namespace);
} else {
$writer->startElement($name);
}
if (strpbrk($value, '<>&')) {
$writer->writeCD... | [
"protected",
"function",
"writeElement",
"(",
"\\",
"XMLWriter",
"$",
"writer",
",",
"$",
"prefix",
",",
"$",
"name",
",",
"$",
"namespace",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"namespace",
")",
"{",
"$",
"writer",
"->",
"startElementNS",
"(",... | Write an element with namespace if used
@param \XMLWriter $writer XML writer resource
@param string $prefix Namespace prefix if any
@param string $name Element name
@param string $namespace The uri of the namespace
@param string $value The element content | [
"Write",
"an",
"element",
"with",
"namespace",
"if",
"used"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/RequestLocation/XmlLocation.php#L218-L231 |
guzzle/guzzle-services | src/RequestLocation/XmlLocation.php | XmlLocation.startDocument | protected function startDocument($encoding)
{
$this->writer = new \XMLWriter();
if (!$this->writer->openMemory()) {
throw new \RuntimeException('Unable to open XML document in memory');
}
if (!$this->writer->startDocument('1.0', $encoding)) {
throw new \Runtim... | php | protected function startDocument($encoding)
{
$this->writer = new \XMLWriter();
if (!$this->writer->openMemory()) {
throw new \RuntimeException('Unable to open XML document in memory');
}
if (!$this->writer->startDocument('1.0', $encoding)) {
throw new \Runtim... | [
"protected",
"function",
"startDocument",
"(",
"$",
"encoding",
")",
"{",
"$",
"this",
"->",
"writer",
"=",
"new",
"\\",
"XMLWriter",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"writer",
"->",
"openMemory",
"(",
")",
")",
"{",
"throw",
"new",
... | Create a new xml writer and start a document
@param string $encoding document encoding
@return \XMLWriter the writer resource
@throws \RuntimeException if the document cannot be started | [
"Create",
"a",
"new",
"xml",
"writer",
"and",
"start",
"a",
"document"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/RequestLocation/XmlLocation.php#L241-L252 |
guzzle/guzzle-services | src/ResponseLocation/JsonLocation.php | JsonLocation.before | public function before(
ResultInterface $result,
ResponseInterface $response,
Parameter $model
) {
$body = (string) $response->getBody();
$body = $body ?: "{}";
$this->json = \GuzzleHttp\json_decode($body, true);
// relocate named arrays, so that they have the... | php | public function before(
ResultInterface $result,
ResponseInterface $response,
Parameter $model
) {
$body = (string) $response->getBody();
$body = $body ?: "{}";
$this->json = \GuzzleHttp\json_decode($body, true);
// relocate named arrays, so that they have the... | [
"public",
"function",
"before",
"(",
"ResultInterface",
"$",
"result",
",",
"ResponseInterface",
"$",
"response",
",",
"Parameter",
"$",
"model",
")",
"{",
"$",
"body",
"=",
"(",
"string",
")",
"$",
"response",
"->",
"getBody",
"(",
")",
";",
"$",
"body"... | @param \GuzzleHttp\Command\ResultInterface $result
@param \Psr\Http\Message\ResponseInterface $response
@param \GuzzleHttp\Command\Guzzle\Parameter $model
@return \GuzzleHttp\Command\ResultInterface | [
"@param",
"\\",
"GuzzleHttp",
"\\",
"Command",
"\\",
"ResultInterface",
"$result",
"@param",
"\\",
"Psr",
"\\",
"Http",
"\\",
"Message",
"\\",
"ResponseInterface",
"$response",
"@param",
"\\",
"GuzzleHttp",
"\\",
"Command",
"\\",
"Guzzle",
"\\",
"Parameter",
"$m... | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/ResponseLocation/JsonLocation.php#L34-L49 |
guzzle/guzzle-services | src/ResponseLocation/JsonLocation.php | JsonLocation.recurse | private function recurse(Parameter $param, $value)
{
if (!is_array($value)) {
return $param->filter($value);
}
$result = [];
$type = $param->getType();
if ($type == 'array') {
$items = $param->getItems();
foreach ($value as $val) {
... | php | private function recurse(Parameter $param, $value)
{
if (!is_array($value)) {
return $param->filter($value);
}
$result = [];
$type = $param->getType();
if ($type == 'array') {
$items = $param->getItems();
foreach ($value as $val) {
... | [
"private",
"function",
"recurse",
"(",
"Parameter",
"$",
"param",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"param",
"->",
"filter",
"(",
"$",
"value",
")",
";",
"}",
"$",
"result",
... | Recursively process a parameter while applying filters
@param Parameter $param API parameter being validated
@param mixed $value Value to process.
@return mixed|null | [
"Recursively",
"process",
"a",
"parameter",
"while",
"applying",
"filters"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/ResponseLocation/JsonLocation.php#L128-L175 |
guzzle/guzzle-services | src/QuerySerializer/Rfc3986Serializer.php | Rfc3986Serializer.aggregate | public function aggregate(array $queryParams)
{
$queryString = http_build_query($queryParams, null, '&', PHP_QUERY_RFC3986);
if ($this->removeNumericIndices) {
$queryString = preg_replace('/%5B[0-9]+%5D/simU', '%5B%5D', $queryString);
}
return $queryString;
} | php | public function aggregate(array $queryParams)
{
$queryString = http_build_query($queryParams, null, '&', PHP_QUERY_RFC3986);
if ($this->removeNumericIndices) {
$queryString = preg_replace('/%5B[0-9]+%5D/simU', '%5B%5D', $queryString);
}
return $queryString;
} | [
"public",
"function",
"aggregate",
"(",
"array",
"$",
"queryParams",
")",
"{",
"$",
"queryString",
"=",
"http_build_query",
"(",
"$",
"queryParams",
",",
"null",
",",
"'&'",
",",
"PHP_QUERY_RFC3986",
")",
";",
"if",
"(",
"$",
"this",
"->",
"removeNumericIndi... | {@inheritDoc} | [
"{"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/QuerySerializer/Rfc3986Serializer.php#L23-L32 |
guzzle/guzzle-services | src/ResponseLocation/HeaderLocation.php | HeaderLocation.visit | public function visit(
ResultInterface $result,
ResponseInterface $response,
Parameter $param
) {
// Retrieving a single header by name
$name = $param->getName();
if ($header = $response->getHeader($param->getWireName())) {
if (is_array($header)) {
... | php | public function visit(
ResultInterface $result,
ResponseInterface $response,
Parameter $param
) {
// Retrieving a single header by name
$name = $param->getName();
if ($header = $response->getHeader($param->getWireName())) {
if (is_array($header)) {
... | [
"public",
"function",
"visit",
"(",
"ResultInterface",
"$",
"result",
",",
"ResponseInterface",
"$",
"response",
",",
"Parameter",
"$",
"param",
")",
"{",
"// Retrieving a single header by name",
"$",
"name",
"=",
"$",
"param",
"->",
"getName",
"(",
")",
";",
... | @param ResultInterface $result
@param ResponseInterface $response
@param Parameter $param
@return ResultInterface | [
"@param",
"ResultInterface",
"$result",
"@param",
"ResponseInterface",
"$response",
"@param",
"Parameter",
"$param"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/ResponseLocation/HeaderLocation.php#L31-L46 |
guzzle/guzzle-services | src/RequestLocation/HeaderLocation.php | HeaderLocation.visit | public function visit(
CommandInterface $command,
RequestInterface $request,
Parameter $param
) {
$value = $command[$param->getName()];
return $request->withHeader($param->getWireName(), $param->filter($value));
} | php | public function visit(
CommandInterface $command,
RequestInterface $request,
Parameter $param
) {
$value = $command[$param->getName()];
return $request->withHeader($param->getWireName(), $param->filter($value));
} | [
"public",
"function",
"visit",
"(",
"CommandInterface",
"$",
"command",
",",
"RequestInterface",
"$",
"request",
",",
"Parameter",
"$",
"param",
")",
"{",
"$",
"value",
"=",
"$",
"command",
"[",
"$",
"param",
"->",
"getName",
"(",
")",
"]",
";",
"return"... | @param CommandInterface $command
@param RequestInterface $request
@param Parameter $param
@return MessageInterface | [
"@param",
"CommandInterface",
"$command",
"@param",
"RequestInterface",
"$request",
"@param",
"Parameter",
"$param"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/RequestLocation/HeaderLocation.php#L33-L41 |
guzzle/guzzle-services | src/Operation.php | Operation.getData | public function getData($name = null)
{
if ($name === null) {
return $this->config['data'];
} elseif (isset($this->config['data'][$name])) {
return $this->config['data'][$name];
} else {
return null;
}
} | php | public function getData($name = null)
{
if ($name === null) {
return $this->config['data'];
} elseif (isset($this->config['data'][$name])) {
return $this->config['data'][$name];
} else {
return null;
}
} | [
"public",
"function",
"getData",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"name",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"config",
"[",
"'data'",
"]",
";",
"}",
"elseif",
"(",
"isset",
"(",
"$",
"this",
"->",
"confi... | Get extra data from the operation
@param string $name Name of the data point to retrieve or null to
retrieve all of the extra data.
@return mixed|null | [
"Get",
"extra",
"data",
"from",
"the",
"operation"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/Operation.php#L247-L256 |
guzzle/guzzle-services | src/Operation.php | Operation.resolveParameters | private function resolveParameters()
{
// Parameters need special handling when adding
foreach ($this->config['parameters'] as $name => $param) {
if (!is_array($param)) {
throw new \InvalidArgumentException(
"Parameters must be arrays, {$this->config['... | php | private function resolveParameters()
{
// Parameters need special handling when adding
foreach ($this->config['parameters'] as $name => $param) {
if (!is_array($param)) {
throw new \InvalidArgumentException(
"Parameters must be arrays, {$this->config['... | [
"private",
"function",
"resolveParameters",
"(",
")",
"{",
"// Parameters need special handling when adding",
"foreach",
"(",
"$",
"this",
"->",
"config",
"[",
"'parameters'",
"]",
"as",
"$",
"name",
"=>",
"$",
"param",
")",
"{",
"if",
"(",
"!",
"is_array",
"(... | Process the description and extract the parameter config
@return void | [
"Process",
"the",
"description",
"and",
"extract",
"the",
"parameter",
"config"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/Operation.php#L285-L311 |
guzzle/guzzle-services | src/Serializer.php | Serializer.prepareRequest | protected function prepareRequest(
CommandInterface $command,
RequestInterface $request
) {
$visitedLocations = [];
$operation = $this->description->getOperation($command->getName());
// Visit each actual parameter
foreach ($operation->getParams() as $name => $param)... | php | protected function prepareRequest(
CommandInterface $command,
RequestInterface $request
) {
$visitedLocations = [];
$operation = $this->description->getOperation($command->getName());
// Visit each actual parameter
foreach ($operation->getParams() as $name => $param)... | [
"protected",
"function",
"prepareRequest",
"(",
"CommandInterface",
"$",
"command",
",",
"RequestInterface",
"$",
"request",
")",
"{",
"$",
"visitedLocations",
"=",
"[",
"]",
";",
"$",
"operation",
"=",
"$",
"this",
"->",
"description",
"->",
"getOperation",
"... | Prepares a request for sending using location visitors
@param CommandInterface $command
@param RequestInterface $request Request being created
@return RequestInterface
@throws \RuntimeException If a location cannot be handled | [
"Prepares",
"a",
"request",
"for",
"sending",
"using",
"location",
"visitors"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/Serializer.php#L71-L105 |
guzzle/guzzle-services | src/Serializer.php | Serializer.createRequest | protected function createRequest(CommandInterface $command)
{
$operation = $this->description->getOperation($command->getName());
// If command does not specify a template, assume the client's base URL.
if (null === $operation->getUri()) {
return new Request(
$op... | php | protected function createRequest(CommandInterface $command)
{
$operation = $this->description->getOperation($command->getName());
// If command does not specify a template, assume the client's base URL.
if (null === $operation->getUri()) {
return new Request(
$op... | [
"protected",
"function",
"createRequest",
"(",
"CommandInterface",
"$",
"command",
")",
"{",
"$",
"operation",
"=",
"$",
"this",
"->",
"description",
"->",
"getOperation",
"(",
"$",
"command",
"->",
"getName",
"(",
")",
")",
";",
"// If command does not specify ... | Create a request for the command and operation
@param CommandInterface $command
@return RequestInterface
@throws \RuntimeException | [
"Create",
"a",
"request",
"for",
"the",
"command",
"and",
"operation"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/Serializer.php#L115-L128 |
guzzle/guzzle-services | src/Serializer.php | Serializer.createCommandWithUri | private function createCommandWithUri(
Operation $operation,
CommandInterface $command
) {
// Get the path values and use the client config settings
$variables = [];
foreach ($operation->getParams() as $name => $arg) {
/* @var Parameter $arg */
if ($ar... | php | private function createCommandWithUri(
Operation $operation,
CommandInterface $command
) {
// Get the path values and use the client config settings
$variables = [];
foreach ($operation->getParams() as $name => $arg) {
/* @var Parameter $arg */
if ($ar... | [
"private",
"function",
"createCommandWithUri",
"(",
"Operation",
"$",
"operation",
",",
"CommandInterface",
"$",
"command",
")",
"{",
"// Get the path values and use the client config settings",
"$",
"variables",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"operation",
"... | Create a request for an operation with a uri merged onto a base URI
@param \GuzzleHttp\Command\Guzzle\Operation $operation
@param \GuzzleHttp\Command\CommandInterface $command
@return \GuzzleHttp\Psr7\Request | [
"Create",
"a",
"request",
"for",
"an",
"operation",
"with",
"a",
"uri",
"merged",
"onto",
"a",
"base",
"URI"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/Serializer.php#L138-L163 |
guzzle/guzzle-services | src/RequestLocation/FormParamLocation.php | FormParamLocation.visit | public function visit(
CommandInterface $command,
RequestInterface $request,
Parameter $param
) {
$this->formParamsData['form_params'][$param->getWireName()] = $this->prepareValue(
$command[$param->getName()],
$param
);
return $request;
} | php | public function visit(
CommandInterface $command,
RequestInterface $request,
Parameter $param
) {
$this->formParamsData['form_params'][$param->getWireName()] = $this->prepareValue(
$command[$param->getName()],
$param
);
return $request;
} | [
"public",
"function",
"visit",
"(",
"CommandInterface",
"$",
"command",
",",
"RequestInterface",
"$",
"request",
",",
"Parameter",
"$",
"param",
")",
"{",
"$",
"this",
"->",
"formParamsData",
"[",
"'form_params'",
"]",
"[",
"$",
"param",
"->",
"getWireName",
... | @param CommandInterface $command
@param RequestInterface $request
@param Parameter $param
@return RequestInterface | [
"@param",
"CommandInterface",
"$command",
"@param",
"RequestInterface",
"$request",
"@param",
"Parameter",
"$param"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/RequestLocation/FormParamLocation.php#L38-L49 |
guzzle/guzzle-services | src/RequestLocation/FormParamLocation.php | FormParamLocation.after | public function after(
CommandInterface $command,
RequestInterface $request,
Operation $operation
) {
$data = $this->formParamsData;
$this->formParamsData = [];
$modify = [];
// Add additional parameters to the form_params array
$additional = $operati... | php | public function after(
CommandInterface $command,
RequestInterface $request,
Operation $operation
) {
$data = $this->formParamsData;
$this->formParamsData = [];
$modify = [];
// Add additional parameters to the form_params array
$additional = $operati... | [
"public",
"function",
"after",
"(",
"CommandInterface",
"$",
"command",
",",
"RequestInterface",
"$",
"request",
",",
"Operation",
"$",
"operation",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"formParamsData",
";",
"$",
"this",
"->",
"formParamsData",
"=... | @param CommandInterface $command
@param RequestInterface $request
@param Operation $operation
@return RequestInterface | [
"@param",
"CommandInterface",
"$command",
"@param",
"RequestInterface",
"$request",
"@param",
"Operation",
"$operation"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/RequestLocation/FormParamLocation.php#L58-L83 |
guzzle/guzzle-services | src/Deserializer.php | Deserializer.visit | protected function visit(Parameter $model, ResponseInterface $response)
{
$result = new Result();
$context = ['visitors' => []];
if ($model->getType() === 'object') {
$result = $this->visitOuterObject($model, $result, $response, $context);
} elseif ($model->getType() ===... | php | protected function visit(Parameter $model, ResponseInterface $response)
{
$result = new Result();
$context = ['visitors' => []];
if ($model->getType() === 'object') {
$result = $this->visitOuterObject($model, $result, $response, $context);
} elseif ($model->getType() ===... | [
"protected",
"function",
"visit",
"(",
"Parameter",
"$",
"model",
",",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"result",
"=",
"new",
"Result",
"(",
")",
";",
"$",
"context",
"=",
"[",
"'visitors'",
"=>",
"[",
"]",
"]",
";",
"if",
"(",
"$... | Handles visit() and after() methods of the Response locations
@param Parameter $model
@param ResponseInterface $response
@return Result|ResultInterface|void | [
"Handles",
"visit",
"()",
"and",
"after",
"()",
"methods",
"of",
"the",
"Response",
"locations"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/Deserializer.php#L110-L130 |
guzzle/guzzle-services | src/Deserializer.php | Deserializer.triggerBeforeVisitor | private function triggerBeforeVisitor(
$location,
Parameter $model,
ResultInterface $result,
ResponseInterface $response,
array &$context
) {
if (!isset($this->responseLocations[$location])) {
throw new \RuntimeException("Unknown location: $location");
... | php | private function triggerBeforeVisitor(
$location,
Parameter $model,
ResultInterface $result,
ResponseInterface $response,
array &$context
) {
if (!isset($this->responseLocations[$location])) {
throw new \RuntimeException("Unknown location: $location");
... | [
"private",
"function",
"triggerBeforeVisitor",
"(",
"$",
"location",
",",
"Parameter",
"$",
"model",
",",
"ResultInterface",
"$",
"result",
",",
"ResponseInterface",
"$",
"response",
",",
"array",
"&",
"$",
"context",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
... | Handles the before() method of Response locations
@param string $location
@param Parameter $model
@param ResultInterface $result
@param ResponseInterface $response
@param array $context
@return ResultInterface | [
"Handles",
"the",
"before",
"()",
"method",
"of",
"Response",
"locations"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/Deserializer.php#L142-L162 |
guzzle/guzzle-services | src/Deserializer.php | Deserializer.visitOuterObject | private function visitOuterObject(
Parameter $model,
ResultInterface $result,
ResponseInterface $response,
array &$context
) {
$parentLocation = $model->getLocation();
// If top-level additionalProperties is a schema, then visit it
$additional = $model->getAd... | php | private function visitOuterObject(
Parameter $model,
ResultInterface $result,
ResponseInterface $response,
array &$context
) {
$parentLocation = $model->getLocation();
// If top-level additionalProperties is a schema, then visit it
$additional = $model->getAd... | [
"private",
"function",
"visitOuterObject",
"(",
"Parameter",
"$",
"model",
",",
"ResultInterface",
"$",
"result",
",",
"ResponseInterface",
"$",
"response",
",",
"array",
"&",
"$",
"context",
")",
"{",
"$",
"parentLocation",
"=",
"$",
"model",
"->",
"getLocati... | Visits the outer object
@param Parameter $model
@param ResultInterface $result
@param ResponseInterface $response
@param array $context
@return ResultInterface | [
"Visits",
"the",
"outer",
"object"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/Deserializer.php#L173-L210 |
guzzle/guzzle-services | src/Deserializer.php | Deserializer.visitOuterArray | private function visitOuterArray(
Parameter $model,
ResultInterface $result,
ResponseInterface $response,
array &$context
) {
// Use 'location' defined on the top of the model
if (!($location = $model->getLocation())) {
return;
}
// Trigge... | php | private function visitOuterArray(
Parameter $model,
ResultInterface $result,
ResponseInterface $response,
array &$context
) {
// Use 'location' defined on the top of the model
if (!($location = $model->getLocation())) {
return;
}
// Trigge... | [
"private",
"function",
"visitOuterArray",
"(",
"Parameter",
"$",
"model",
",",
"ResultInterface",
"$",
"result",
",",
"ResponseInterface",
"$",
"response",
",",
"array",
"&",
"$",
"context",
")",
"{",
"// Use 'location' defined on the top of the model",
"if",
"(",
"... | Visits the outer array
@param Parameter $model
@param ResultInterface $result
@param ResponseInterface $response
@param array $context
@return ResultInterface|void | [
"Visits",
"the",
"outer",
"array"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/Deserializer.php#L221-L241 |
guzzle/guzzle-services | src/Deserializer.php | Deserializer.handleErrorResponses | protected function handleErrorResponses(
ResponseInterface $response,
RequestInterface $request,
CommandInterface $command,
Operation $operation
) {
$errors = $operation->getErrorResponses();
// We iterate through each errors in service description. If the descriptor... | php | protected function handleErrorResponses(
ResponseInterface $response,
RequestInterface $request,
CommandInterface $command,
Operation $operation
) {
$errors = $operation->getErrorResponses();
// We iterate through each errors in service description. If the descriptor... | [
"protected",
"function",
"handleErrorResponses",
"(",
"ResponseInterface",
"$",
"response",
",",
"RequestInterface",
"$",
"request",
",",
"CommandInterface",
"$",
"command",
",",
"Operation",
"$",
"operation",
")",
"{",
"$",
"errors",
"=",
"$",
"operation",
"->",
... | Reads the "errorResponses" from commands, and trigger appropriate exceptions
In order for the exception to be properly triggered, all your exceptions must be instance
of "GuzzleHttp\Command\Exception\CommandException". If that's not the case, your exceptions will be wrapped
around a CommandException
@param ResponseIn... | [
"Reads",
"the",
"errorResponses",
"from",
"commands",
"and",
"trigger",
"appropriate",
"exceptions"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/Deserializer.php#L255-L293 |
guzzle/guzzle-services | src/RequestLocation/QueryLocation.php | QueryLocation.visit | public function visit(
CommandInterface $command,
RequestInterface $request,
Parameter $param
) {
$uri = $request->getUri();
$query = Psr7\parse_query($uri->getQuery());
$query[$param->getWireName()] = $this->prepareValue(
$command[$param->getName()],
... | php | public function visit(
CommandInterface $command,
RequestInterface $request,
Parameter $param
) {
$uri = $request->getUri();
$query = Psr7\parse_query($uri->getQuery());
$query[$param->getWireName()] = $this->prepareValue(
$command[$param->getName()],
... | [
"public",
"function",
"visit",
"(",
"CommandInterface",
"$",
"command",
",",
"RequestInterface",
"$",
"request",
",",
"Parameter",
"$",
"param",
")",
"{",
"$",
"uri",
"=",
"$",
"request",
"->",
"getUri",
"(",
")",
";",
"$",
"query",
"=",
"Psr7",
"\\",
... | @param CommandInterface $command
@param RequestInterface $request
@param Parameter $param
@return RequestInterface | [
"@param",
"CommandInterface",
"$command",
"@param",
"RequestInterface",
"$request",
"@param",
"Parameter",
"$param"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/RequestLocation/QueryLocation.php#L42-L58 |
guzzle/guzzle-services | src/RequestLocation/QueryLocation.php | QueryLocation.after | public function after(
CommandInterface $command,
RequestInterface $request,
Operation $operation
) {
$additional = $operation->getAdditionalParameters();
if ($additional && $additional->getLocation() == $this->locationName) {
foreach ($command->toArray() as $key ... | php | public function after(
CommandInterface $command,
RequestInterface $request,
Operation $operation
) {
$additional = $operation->getAdditionalParameters();
if ($additional && $additional->getLocation() == $this->locationName) {
foreach ($command->toArray() as $key ... | [
"public",
"function",
"after",
"(",
"CommandInterface",
"$",
"command",
",",
"RequestInterface",
"$",
"request",
",",
"Operation",
"$",
"operation",
")",
"{",
"$",
"additional",
"=",
"$",
"operation",
"->",
"getAdditionalParameters",
"(",
")",
";",
"if",
"(",
... | @param CommandInterface $command
@param RequestInterface $request
@param Operation $operation
@return RequestInterface | [
"@param",
"CommandInterface",
"$command",
"@param",
"RequestInterface",
"$request",
"@param",
"Operation",
"$operation"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/RequestLocation/QueryLocation.php#L67-L91 |
guzzle/guzzle-services | src/RequestLocation/BodyLocation.php | BodyLocation.visit | public function visit(
CommandInterface $command,
RequestInterface $request,
Parameter $param
) {
$oldValue = $request->getBody()->getContents();
$value = $command[$param->getName()];
$value = $param->getName() . '=' . $param->filter($value);
if ($oldValue !... | php | public function visit(
CommandInterface $command,
RequestInterface $request,
Parameter $param
) {
$oldValue = $request->getBody()->getContents();
$value = $command[$param->getName()];
$value = $param->getName() . '=' . $param->filter($value);
if ($oldValue !... | [
"public",
"function",
"visit",
"(",
"CommandInterface",
"$",
"command",
",",
"RequestInterface",
"$",
"request",
",",
"Parameter",
"$",
"param",
")",
"{",
"$",
"oldValue",
"=",
"$",
"request",
"->",
"getBody",
"(",
")",
"->",
"getContents",
"(",
")",
";",
... | @param CommandInterface $command
@param RequestInterface $request
@param Parameter $param
@return MessageInterface | [
"@param",
"CommandInterface",
"$command",
"@param",
"RequestInterface",
"$request",
"@param",
"Parameter",
"$param"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/RequestLocation/BodyLocation.php#L33-L48 |
guzzle/guzzle-services | src/Parameter.php | Parameter.filter | public function filter($value)
{
// Formats are applied exclusively and supersed filters
if ($this->format) {
if (!$this->serviceDescription) {
throw new \RuntimeException('No service description was set so '
. 'the value cannot be formatted.');
... | php | public function filter($value)
{
// Formats are applied exclusively and supersed filters
if ($this->format) {
if (!$this->serviceDescription) {
throw new \RuntimeException('No service description was set so '
. 'the value cannot be formatted.');
... | [
"public",
"function",
"filter",
"(",
"$",
"value",
")",
"{",
"// Formats are applied exclusively and supersed filters",
"if",
"(",
"$",
"this",
"->",
"format",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"serviceDescription",
")",
"{",
"throw",
"new",
"\\",
... | Run a value through the filters OR format attribute associated with the
parameter.
@param mixed $value Value to filter
@return mixed Returns the filtered value
@throws \RuntimeException when trying to format when no service
description is available. | [
"Run",
"a",
"value",
"through",
"the",
"filters",
"OR",
"format",
"attribute",
"associated",
"with",
"the",
"parameter",
"."
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/Parameter.php#L258-L297 |
guzzle/guzzle-services | src/Parameter.php | Parameter.getProperties | public function getProperties()
{
if (!$this->propertiesCache) {
$this->propertiesCache = [];
foreach (array_keys($this->properties) as $name) {
$this->propertiesCache[$name] = $this->getProperty($name);
}
}
return $this->propertiesCache;
... | php | public function getProperties()
{
if (!$this->propertiesCache) {
$this->propertiesCache = [];
foreach (array_keys($this->properties) as $name) {
$this->propertiesCache[$name] = $this->getProperty($name);
}
}
return $this->propertiesCache;
... | [
"public",
"function",
"getProperties",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"propertiesCache",
")",
"{",
"$",
"this",
"->",
"propertiesCache",
"=",
"[",
"]",
";",
"foreach",
"(",
"array_keys",
"(",
"$",
"this",
"->",
"properties",
")",
"as... | Get the properties of the parameter
@return Parameter[] | [
"Get",
"the",
"properties",
"of",
"the",
"parameter"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/Parameter.php#L498-L508 |
guzzle/guzzle-services | src/Parameter.php | Parameter.getAdditionalProperties | public function getAdditionalProperties()
{
if (is_array($this->additionalProperties)) {
$this->additionalProperties = new static(
$this->additionalProperties,
['description' => $this->serviceDescription]
);
}
return $this->additionalP... | php | public function getAdditionalProperties()
{
if (is_array($this->additionalProperties)) {
$this->additionalProperties = new static(
$this->additionalProperties,
['description' => $this->serviceDescription]
);
}
return $this->additionalP... | [
"public",
"function",
"getAdditionalProperties",
"(",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"additionalProperties",
")",
")",
"{",
"$",
"this",
"->",
"additionalProperties",
"=",
"new",
"static",
"(",
"$",
"this",
"->",
"additionalProperties... | Get the additionalProperties value of the parameter
@return bool|Parameter|null | [
"Get",
"the",
"additionalProperties",
"value",
"of",
"the",
"parameter"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/Parameter.php#L539-L549 |
guzzle/guzzle-services | src/Parameter.php | Parameter.addFilter | private function addFilter($filter)
{
if (is_array($filter)) {
if (!isset($filter['method'])) {
throw new \InvalidArgumentException(
'A [method] value must be specified for each complex filter'
);
}
}
if (!$this->fi... | php | private function addFilter($filter)
{
if (is_array($filter)) {
if (!isset($filter['method'])) {
throw new \InvalidArgumentException(
'A [method] value must be specified for each complex filter'
);
}
}
if (!$this->fi... | [
"private",
"function",
"addFilter",
"(",
"$",
"filter",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"filter",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"filter",
"[",
"'method'",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentExcept... | Add a filter to the parameter
@param string|array $filter Method to filter the value through
@return self
@throws \InvalidArgumentException | [
"Add",
"a",
"filter",
"to",
"the",
"parameter"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/Parameter.php#L623-L640 |
guzzle/guzzle-services | src/Parameter.php | Parameter.has | public function has($var)
{
if (!is_string($var)) {
throw new \InvalidArgumentException('Expected a string. Got: ' . (is_object($var) ? get_class($var) : gettype($var)));
}
return isset($this->{$var}) && !empty($this->{$var});
} | php | public function has($var)
{
if (!is_string($var)) {
throw new \InvalidArgumentException('Expected a string. Got: ' . (is_object($var) ? get_class($var) : gettype($var)));
}
return isset($this->{$var}) && !empty($this->{$var});
} | [
"public",
"function",
"has",
"(",
"$",
"var",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"var",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Expected a string. Got: '",
".",
"(",
"is_object",
"(",
"$",
"var",
")",
"?",
... | Check if a parameter has a specific variable and if it set.
@param string $var
@return bool | [
"Check",
"if",
"a",
"parameter",
"has",
"a",
"specific",
"variable",
"and",
"if",
"it",
"set",
"."
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/Parameter.php#L648-L654 |
guzzle/guzzle-services | src/ResponseLocation/XmlLocation.php | XmlLocation.recursiveProcess | private function recursiveProcess(
Parameter $param,
\SimpleXMLElement $node
) {
$result = [];
$type = $param->getType();
if ($type == 'object') {
$result = $this->processObject($param, $node);
} elseif ($type == 'array') {
$result = $this->pr... | php | private function recursiveProcess(
Parameter $param,
\SimpleXMLElement $node
) {
$result = [];
$type = $param->getType();
if ($type == 'object') {
$result = $this->processObject($param, $node);
} elseif ($type == 'array') {
$result = $this->pr... | [
"private",
"function",
"recursiveProcess",
"(",
"Parameter",
"$",
"param",
",",
"\\",
"SimpleXMLElement",
"$",
"node",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"type",
"=",
"$",
"param",
"->",
"getType",
"(",
")",
";",
"if",
"(",
"$",
"type"... | Recursively process a parameter while applying filters
@param Parameter $param API parameter being processed
@param \SimpleXMLElement $node Node being processed
@return array | [
"Recursively",
"process",
"a",
"parameter",
"while",
"applying",
"filters"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/ResponseLocation/XmlLocation.php#L105-L132 |
guzzle/guzzle-services | src/ResponseLocation/XmlLocation.php | XmlLocation.xmlToArray | private static function xmlToArray(
\SimpleXMLElement $xml,
$ns = null,
$nesting = 0
) {
$result = [];
$children = $xml->children($ns, true);
foreach ($children as $name => $child) {
$attributes = (array) $child->attributes($ns, true);
if (!is... | php | private static function xmlToArray(
\SimpleXMLElement $xml,
$ns = null,
$nesting = 0
) {
$result = [];
$children = $xml->children($ns, true);
foreach ($children as $name => $child) {
$attributes = (array) $child->attributes($ns, true);
if (!is... | [
"private",
"static",
"function",
"xmlToArray",
"(",
"\\",
"SimpleXMLElement",
"$",
"xml",
",",
"$",
"ns",
"=",
"null",
",",
"$",
"nesting",
"=",
"0",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"children",
"=",
"$",
"xml",
"->",
"children",
"... | Convert an XML document to an array.
@param \SimpleXMLElement $xml
@param int $nesting
@param null $ns
@return array | [
"Convert",
"an",
"XML",
"document",
"to",
"an",
"array",
"."
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/ResponseLocation/XmlLocation.php#L252-L310 |
guzzle/guzzle-services | src/Description.php | Description.getOperation | public function getOperation($name)
{
if (!$this->hasOperation($name)) {
throw new \InvalidArgumentException("No operation found named $name");
}
// Lazily create operations as they are retrieved
if (!($this->operations[$name] instanceof Operation)) {
$this->... | php | public function getOperation($name)
{
if (!$this->hasOperation($name)) {
throw new \InvalidArgumentException("No operation found named $name");
}
// Lazily create operations as they are retrieved
if (!($this->operations[$name] instanceof Operation)) {
$this->... | [
"public",
"function",
"getOperation",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasOperation",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"No operation found named $name\"",
")",
";",
"}",
... | Get an API operation by name
@param string $name Name of the command
@return Operation
@throws \InvalidArgumentException if the operation is not found | [
"Get",
"an",
"API",
"operation",
"by",
"name"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/Description.php#L137-L150 |
guzzle/guzzle-services | src/Description.php | Description.getModel | public function getModel($id)
{
if (!$this->hasModel($id)) {
throw new \InvalidArgumentException("No model found named $id");
}
// Lazily create models as they are retrieved
if (!($this->models[$id] instanceof Parameter)) {
$this->models[$id] = new Parameter(... | php | public function getModel($id)
{
if (!$this->hasModel($id)) {
throw new \InvalidArgumentException("No model found named $id");
}
// Lazily create models as they are retrieved
if (!($this->models[$id] instanceof Parameter)) {
$this->models[$id] = new Parameter(... | [
"public",
"function",
"getModel",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasModel",
"(",
"$",
"id",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"No model found named $id\"",
")",
";",
"}",
"// Lazily creat... | Get a shared definition structure.
@param string $id ID/name of the model to retrieve
@return Parameter
@throws \InvalidArgumentException if the model is not found | [
"Get",
"a",
"shared",
"definition",
"structure",
"."
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/Description.php#L160-L175 |
guzzle/guzzle-services | src/Description.php | Description.getModels | public function getModels()
{
$models = [];
foreach ($this->models as $name => $model) {
$models[$name] = $this->getModel($name);
}
return $models;
} | php | public function getModels()
{
$models = [];
foreach ($this->models as $name => $model) {
$models[$name] = $this->getModel($name);
}
return $models;
} | [
"public",
"function",
"getModels",
"(",
")",
"{",
"$",
"models",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"models",
"as",
"$",
"name",
"=>",
"$",
"model",
")",
"{",
"$",
"models",
"[",
"$",
"name",
"]",
"=",
"$",
"this",
"->",
"ge... | Get all models of the service description.
@return array | [
"Get",
"all",
"models",
"of",
"the",
"service",
"description",
"."
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/Description.php#L182-L190 |
guzzle/guzzle-services | src/Description.php | Description.getData | public function getData($key = null)
{
if ($key === null) {
return $this->extraData;
} elseif (isset($this->extraData[$key])) {
return $this->extraData[$key];
} else {
return null;
}
} | php | public function getData($key = null)
{
if ($key === null) {
return $this->extraData;
} elseif (isset($this->extraData[$key])) {
return $this->extraData[$key];
} else {
return null;
}
} | [
"public",
"function",
"getData",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"key",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"extraData",
";",
"}",
"elseif",
"(",
"isset",
"(",
"$",
"this",
"->",
"extraData",
"[",
"$",
"k... | Get arbitrary data from the service description that is not part of the
Guzzle service description specification.
@param string $key Data key to retrieve or null to retrieve all extra
@return null|mixed | [
"Get",
"arbitrary",
"data",
"from",
"the",
"service",
"description",
"that",
"is",
"not",
"part",
"of",
"the",
"Guzzle",
"service",
"description",
"specification",
"."
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/Description.php#L255-L264 |
guzzle/guzzle-services | src/SchemaFormatter.php | SchemaFormatter.format | public function format($format, $value)
{
switch ($format) {
case 'date-time':
return $this->formatDateTime($value);
case 'date-time-http':
return $this->formatDateTimeHttp($value);
case 'date':
return $this->formatDate($val... | php | public function format($format, $value)
{
switch ($format) {
case 'date-time':
return $this->formatDateTime($value);
case 'date-time-http':
return $this->formatDateTimeHttp($value);
case 'date':
return $this->formatDate($val... | [
"public",
"function",
"format",
"(",
"$",
"format",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"format",
")",
"{",
"case",
"'date-time'",
":",
"return",
"$",
"this",
"->",
"formatDateTime",
"(",
"$",
"value",
")",
";",
"case",
"'date-time-http'",
... | Format a value by a registered format name
@param string $format Registered format used to format the value
@param mixed $value Value being formatted
@return mixed | [
"Format",
"a",
"value",
"by",
"a",
"registered",
"format",
"name"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/SchemaFormatter.php#L17-L35 |
guzzle/guzzle-services | src/SchemaFormatter.php | SchemaFormatter.dateFormatter | protected function dateFormatter($dateTime, $format)
{
if (is_numeric($dateTime)) {
return gmdate($format, (int) $dateTime);
}
if (is_string($dateTime)) {
$dateTime = new \DateTime($dateTime);
}
if ($dateTime instanceof \DateTimeInterface) {
... | php | protected function dateFormatter($dateTime, $format)
{
if (is_numeric($dateTime)) {
return gmdate($format, (int) $dateTime);
}
if (is_string($dateTime)) {
$dateTime = new \DateTime($dateTime);
}
if ($dateTime instanceof \DateTimeInterface) {
... | [
"protected",
"function",
"dateFormatter",
"(",
"$",
"dateTime",
",",
"$",
"format",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"dateTime",
")",
")",
"{",
"return",
"gmdate",
"(",
"$",
"format",
",",
"(",
"int",
")",
"$",
"dateTime",
")",
";",
"}",
... | Perform the actual DateTime formatting
@param int|string|\DateTime $dateTime Date time value
@param string $format Format of the result
@return string
@throws \InvalidArgumentException | [
"Perform",
"the",
"actual",
"DateTime",
"formatting"
] | train | https://github.com/guzzle/guzzle-services/blob/9e3abf20161cbf662d616cbb995f2811771759f7/src/SchemaFormatter.php#L46-L66 |
goodby/csv | src/Goodby/CSV/Export/Standard/Exporter.php | Exporter.export | public function export($filename, $rows)
{
$delimiter = $this->config->getDelimiter();
$enclosure = $this->config->getEnclosure();
$enclosure = empty($enclosure) ? "\0" : $enclosure;
$newline = $this->config->getNewline();
$fromCharset = $this->config->get... | php | public function export($filename, $rows)
{
$delimiter = $this->config->getDelimiter();
$enclosure = $this->config->getEnclosure();
$enclosure = empty($enclosure) ? "\0" : $enclosure;
$newline = $this->config->getNewline();
$fromCharset = $this->config->get... | [
"public",
"function",
"export",
"(",
"$",
"filename",
",",
"$",
"rows",
")",
"{",
"$",
"delimiter",
"=",
"$",
"this",
"->",
"config",
"->",
"getDelimiter",
"(",
")",
";",
"$",
"enclosure",
"=",
"$",
"this",
"->",
"config",
"->",
"getEnclosure",
"(",
... | {@inherit}
@throws StrictViolationException | [
"{"
] | train | https://github.com/goodby/csv/blob/079ac7bcd7a55a01a1f7c62cecc0c50497530905/src/Goodby/CSV/Export/Standard/Exporter.php#L50-L85 |
goodby/csv | src/Goodby/CSV/Export/Standard/Exporter.php | Exporter.checkRowConsistency | private function checkRowConsistency($row)
{
if ( $this->strict === false ) {
return;
}
$current = count($row);
if ( $this->rowConsistency === null ) {
$this->rowConsistency = $current;
}
if ( $current !== $this->rowConsistency ) {
... | php | private function checkRowConsistency($row)
{
if ( $this->strict === false ) {
return;
}
$current = count($row);
if ( $this->rowConsistency === null ) {
$this->rowConsistency = $current;
}
if ( $current !== $this->rowConsistency ) {
... | [
"private",
"function",
"checkRowConsistency",
"(",
"$",
"row",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"strict",
"===",
"false",
")",
"{",
"return",
";",
"}",
"$",
"current",
"=",
"count",
"(",
"$",
"row",
")",
";",
"if",
"(",
"$",
"this",
"->",
... | Check if the column count is consistent with comparing other rows
@param array|\Countable $row
@throws Exception\StrictViolationException | [
"Check",
"if",
"the",
"column",
"count",
"is",
"consistent",
"with",
"comparing",
"other",
"rows"
] | train | https://github.com/goodby/csv/blob/079ac7bcd7a55a01a1f7c62cecc0c50497530905/src/Goodby/CSV/Export/Standard/Exporter.php#L92-L109 |
goodby/csv | src/Goodby/CSV/Export/Standard/CsvFileObject.php | CsvFileObject.fputcsv | public function fputcsv($fields, $delimiter = null, $enclosure = null, $escape = null)
{
// Temporary output a line to memory to get line as string
$fp = fopen('php://temp', 'w+');
$arguments = func_get_args();
array_unshift($arguments, $fp);
call_user_func_array('fputcsv', $... | php | public function fputcsv($fields, $delimiter = null, $enclosure = null, $escape = null)
{
// Temporary output a line to memory to get line as string
$fp = fopen('php://temp', 'w+');
$arguments = func_get_args();
array_unshift($arguments, $fp);
call_user_func_array('fputcsv', $... | [
"public",
"function",
"fputcsv",
"(",
"$",
"fields",
",",
"$",
"delimiter",
"=",
"null",
",",
"$",
"enclosure",
"=",
"null",
",",
"$",
"escape",
"=",
"null",
")",
"{",
"// Temporary output a line to memory to get line as string",
"$",
"fp",
"=",
"fopen",
"(",
... | Write a field array as a CSV line
@param array $fields
@param string $delimiter
@param string $enclosure
@param useless $escape THIS PARAM IS UNSED, BUT REQUIRED EXISTS, see https://bugs.php.net/bug.php?id=68479 and https://github.com/goodby/csv/issues/56
@return int|void | [
"Write",
"a",
"field",
"array",
"as",
"a",
"CSV",
"line"
] | train | https://github.com/goodby/csv/blob/079ac7bcd7a55a01a1f7c62cecc0c50497530905/src/Goodby/CSV/Export/Standard/CsvFileObject.php#L50-L84 |
goodby/csv | src/Goodby/CSV/Import/Standard/StreamFilter/ConvertMbstringEncoding.php | ConvertMbstringEncoding.register | public static function register()
{
if ( self::$hasBeenRegistered === true ) {
return;
}
if ( stream_filter_register(self::getFilterName(), __CLASS__) === false ) {
throw new RuntimeException('Failed to register stream filter: '.self::getFilterName());
}
... | php | public static function register()
{
if ( self::$hasBeenRegistered === true ) {
return;
}
if ( stream_filter_register(self::getFilterName(), __CLASS__) === false ) {
throw new RuntimeException('Failed to register stream filter: '.self::getFilterName());
}
... | [
"public",
"static",
"function",
"register",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"hasBeenRegistered",
"===",
"true",
")",
"{",
"return",
";",
"}",
"if",
"(",
"stream_filter_register",
"(",
"self",
"::",
"getFilterName",
"(",
")",
",",
"__CLASS__",
... | Register this class as a stream filter
@throws \RuntimeException | [
"Register",
"this",
"class",
"as",
"a",
"stream",
"filter"
] | train | https://github.com/goodby/csv/blob/079ac7bcd7a55a01a1f7c62cecc0c50497530905/src/Goodby/CSV/Import/Standard/StreamFilter/ConvertMbstringEncoding.php#L43-L54 |
goodby/csv | src/Goodby/CSV/Import/Standard/StreamFilter/ConvertMbstringEncoding.php | ConvertMbstringEncoding.getFilterURL | public static function getFilterURL($filename, $fromCharset, $toCharset = null)
{
if ( $toCharset === null ) {
return sprintf('php://filter/convert.mbstring.encoding.%s/resource=%s', $fromCharset, $filename);
} else {
return sprintf('php://filter/convert.mbstring.encoding.%s:... | php | public static function getFilterURL($filename, $fromCharset, $toCharset = null)
{
if ( $toCharset === null ) {
return sprintf('php://filter/convert.mbstring.encoding.%s/resource=%s', $fromCharset, $filename);
} else {
return sprintf('php://filter/convert.mbstring.encoding.%s:... | [
"public",
"static",
"function",
"getFilterURL",
"(",
"$",
"filename",
",",
"$",
"fromCharset",
",",
"$",
"toCharset",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"toCharset",
"===",
"null",
")",
"{",
"return",
"sprintf",
"(",
"'php://filter/convert.mbstring.encodin... | Return filter URL
@param string $filename
@param string $fromCharset
@param string $toCharset
@return string | [
"Return",
"filter",
"URL"
] | train | https://github.com/goodby/csv/blob/079ac7bcd7a55a01a1f7c62cecc0c50497530905/src/Goodby/CSV/Import/Standard/StreamFilter/ConvertMbstringEncoding.php#L63-L70 |
goodby/csv | src/Goodby/CSV/Import/Standard/Interpreter.php | Interpreter.interpret | public function interpret($line)
{
$this->checkRowConsistency($line);
if (!is_array($line)) {
throw new InvalidLexicalException('line is must be array');
}
$this->notify($line);
} | php | public function interpret($line)
{
$this->checkRowConsistency($line);
if (!is_array($line)) {
throw new InvalidLexicalException('line is must be array');
}
$this->notify($line);
} | [
"public",
"function",
"interpret",
"(",
"$",
"line",
")",
"{",
"$",
"this",
"->",
"checkRowConsistency",
"(",
"$",
"line",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"line",
")",
")",
"{",
"throw",
"new",
"InvalidLexicalException",
"(",
"'line is mu... | interpret line
@param $line
@return void
@throws \Goodby\CSV\Import\Protocol\Exception\InvalidLexicalException | [
"interpret",
"line"
] | train | https://github.com/goodby/csv/blob/079ac7bcd7a55a01a1f7c62cecc0c50497530905/src/Goodby/CSV/Import/Standard/Interpreter.php#L36-L45 |
goodby/csv | src/Goodby/CSV/Import/Standard/Interpreter.php | Interpreter.notify | private function notify($line)
{
$observers = $this->observers;
foreach ($observers as $observer) {
$this->delegate($observer, $line);
}
} | php | private function notify($line)
{
$observers = $this->observers;
foreach ($observers as $observer) {
$this->delegate($observer, $line);
}
} | [
"private",
"function",
"notify",
"(",
"$",
"line",
")",
"{",
"$",
"observers",
"=",
"$",
"this",
"->",
"observers",
";",
"foreach",
"(",
"$",
"observers",
"as",
"$",
"observer",
")",
"{",
"$",
"this",
"->",
"delegate",
"(",
"$",
"observer",
",",
"$",... | notify to observers
@param $line | [
"notify",
"to",
"observers"
] | train | https://github.com/goodby/csv/blob/079ac7bcd7a55a01a1f7c62cecc0c50497530905/src/Goodby/CSV/Import/Standard/Interpreter.php#L69-L76 |
mikehaertl/php-tmpfile | src/File.php | File.send | public function send($filename = null, $contentType, $inline = false)
{
header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Content-Type: '.$contentType);
header('Content-Transfer-Encoding: binary');
... | php | public function send($filename = null, $contentType, $inline = false)
{
header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Content-Type: '.$contentType);
header('Content-Transfer-Encoding: binary');
... | [
"public",
"function",
"send",
"(",
"$",
"filename",
"=",
"null",
",",
"$",
"contentType",
",",
"$",
"inline",
"=",
"false",
")",
"{",
"header",
"(",
"'Pragma: public'",
")",
";",
"header",
"(",
"'Expires: 0'",
")",
";",
"header",
"(",
"'Cache-Control: must... | Send tmp file to client, either inline or as download
@param string|null $filename the filename to send. If empty, the file is streamed inline.
@param string $contentType the Content-Type header
@param bool $inline whether to force inline display of the file, even if filename is present. | [
"Send",
"tmp",
"file",
"to",
"client",
"either",
"inline",
"or",
"as",
"download"
] | train | https://github.com/mikehaertl/php-tmpfile/blob/0ff48ed52ffee46d0f21fc34e8806f15467eb9b1/src/File.php#L70-L90 |
vgrem/phpSPO | src/Runtime/Auth/OAuthTokenProvider.php | OAuthTokenProvider.acquireToken | public function acquireToken($parameters)
{
$request = $this->createRequest($parameters);
$response = Requests::execute($request);
$this->parseToken($response);
} | php | public function acquireToken($parameters)
{
$request = $this->createRequest($parameters);
$response = Requests::execute($request);
$this->parseToken($response);
} | [
"public",
"function",
"acquireToken",
"(",
"$",
"parameters",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"createRequest",
"(",
"$",
"parameters",
")",
";",
"$",
"response",
"=",
"Requests",
"::",
"execute",
"(",
"$",
"request",
")",
";",
"$",
"t... | Acquires the access token
@param array $parameters
@throws \Exception | [
"Acquires",
"the",
"access",
"token"
] | train | https://github.com/vgrem/phpSPO/blob/4ec81109a154f88d188f9e87c7d7f004e91af666/src/Runtime/Auth/OAuthTokenProvider.php#L78-L83 |
vgrem/phpSPO | src/Runtime/Auth/OAuthTokenProvider.php | OAuthTokenProvider.parseToken | private function parseToken($tokenValue)
{
$tokenPayload = json_decode($tokenValue);
if (is_object($tokenPayload)) {
$this->accessToken = $tokenPayload;
if (isset($tokenPayload->id_token)) {
$idToken = $tokenPayload->id_token;
$idTokenPayload =... | php | private function parseToken($tokenValue)
{
$tokenPayload = json_decode($tokenValue);
if (is_object($tokenPayload)) {
$this->accessToken = $tokenPayload;
if (isset($tokenPayload->id_token)) {
$idToken = $tokenPayload->id_token;
$idTokenPayload =... | [
"private",
"function",
"parseToken",
"(",
"$",
"tokenValue",
")",
"{",
"$",
"tokenPayload",
"=",
"json_decode",
"(",
"$",
"tokenValue",
")",
";",
"if",
"(",
"is_object",
"(",
"$",
"tokenPayload",
")",
")",
"{",
"$",
"this",
"->",
"accessToken",
"=",
"$",... | Parse the id token that represents a JWT token that contains information about the user
@param string $tokenValue | [
"Parse",
"the",
"id",
"token",
"that",
"represents",
"a",
"JWT",
"token",
"that",
"contains",
"information",
"about",
"the",
"user"
] | train | https://github.com/vgrem/phpSPO/blob/4ec81109a154f88d188f9e87c7d7f004e91af666/src/Runtime/Auth/OAuthTokenProvider.php#L103-L116 |
vgrem/phpSPO | src/OutlookServices/MessageCollection.php | MessageCollection.createMessage | public function createMessage() {
$message = new Message($this->getContext());
$this->addChild($message);
$qry = new CreateEntityQuery($message);
$this->getContext()->addQuery($qry, $message);
return $message;
} | php | public function createMessage() {
$message = new Message($this->getContext());
$this->addChild($message);
$qry = new CreateEntityQuery($message);
$this->getContext()->addQuery($qry, $message);
return $message;
} | [
"public",
"function",
"createMessage",
"(",
")",
"{",
"$",
"message",
"=",
"new",
"Message",
"(",
"$",
"this",
"->",
"getContext",
"(",
")",
")",
";",
"$",
"this",
"->",
"addChild",
"(",
"$",
"message",
")",
";",
"$",
"qry",
"=",
"new",
"CreateEntity... | Creates a Draft Message resource
@return Message | [
"Creates",
"a",
"Draft",
"Message",
"resource"
] | train | https://github.com/vgrem/phpSPO/blob/4ec81109a154f88d188f9e87c7d7f004e91af666/src/OutlookServices/MessageCollection.php#L17-L23 |
vgrem/phpSPO | src/OutlookServices/EventCollection.php | EventCollection.createEvent | public function createEvent() {
$event = new Event($this->getContext(),null);
$this->addChild($event);
$qry = new CreateEntityQuery($event);
$this->getContext()->addQuery($qry, $event);
return $event;
} | php | public function createEvent() {
$event = new Event($this->getContext(),null);
$this->addChild($event);
$qry = new CreateEntityQuery($event);
$this->getContext()->addQuery($qry, $event);
return $event;
} | [
"public",
"function",
"createEvent",
"(",
")",
"{",
"$",
"event",
"=",
"new",
"Event",
"(",
"$",
"this",
"->",
"getContext",
"(",
")",
",",
"null",
")",
";",
"$",
"this",
"->",
"addChild",
"(",
"$",
"event",
")",
";",
"$",
"qry",
"=",
"new",
"Cre... | Create an event in the user's primary calendar or a specific calendar by posting to the calendar's events endpoint.
@return Event | [
"Create",
"an",
"event",
"in",
"the",
"user",
"s",
"primary",
"calendar",
"or",
"a",
"specific",
"calendar",
"by",
"posting",
"to",
"the",
"calendar",
"s",
"events",
"endpoint",
"."
] | train | https://github.com/vgrem/phpSPO/blob/4ec81109a154f88d188f9e87c7d7f004e91af666/src/OutlookServices/EventCollection.php#L15-L21 |
vgrem/phpSPO | src/SharePoint/SPList.php | SPList.addItem | public function addItem(array $listItemCreationInformation)
{
$items = new ListItemCollection($this->getContext(),
new ResourcePathEntity($this->getContext(),$this->getResourcePath(),"items"));
$listItem = new ListItem($this->getContext());
$listItem->parentCollection = $items;
... | php | public function addItem(array $listItemCreationInformation)
{
$items = new ListItemCollection($this->getContext(),
new ResourcePathEntity($this->getContext(),$this->getResourcePath(),"items"));
$listItem = new ListItem($this->getContext());
$listItem->parentCollection = $items;
... | [
"public",
"function",
"addItem",
"(",
"array",
"$",
"listItemCreationInformation",
")",
"{",
"$",
"items",
"=",
"new",
"ListItemCollection",
"(",
"$",
"this",
"->",
"getContext",
"(",
")",
",",
"new",
"ResourcePathEntity",
"(",
"$",
"this",
"->",
"getContext",... | The recommended way to add a list item is to send a POST request to the ListItemCollection resource endpoint, as shown in ListItemCollection request examples.
@param array $listItemCreationInformation Creation information for a List item
@return ListItem List Item resource | [
"The",
"recommended",
"way",
"to",
"add",
"a",
"list",
"item",
"is",
"to",
"send",
"a",
"POST",
"request",
"to",
"the",
"ListItemCollection",
"resource",
"endpoint",
"as",
"shown",
"in",
"ListItemCollection",
"request",
"examples",
"."
] | train | https://github.com/vgrem/phpSPO/blob/4ec81109a154f88d188f9e87c7d7f004e91af666/src/SharePoint/SPList.php#L22-L35 |
vgrem/phpSPO | src/SharePoint/SPList.php | SPList.getItemById | public function getItemById($id)
{
return new ListItem(
$this->getContext(),
new ResourcePathEntity($this->getContext(),$this->getResourcePath(),"items({$id})")
);
} | php | public function getItemById($id)
{
return new ListItem(
$this->getContext(),
new ResourcePathEntity($this->getContext(),$this->getResourcePath(),"items({$id})")
);
} | [
"public",
"function",
"getItemById",
"(",
"$",
"id",
")",
"{",
"return",
"new",
"ListItem",
"(",
"$",
"this",
"->",
"getContext",
"(",
")",
",",
"new",
"ResourcePathEntity",
"(",
"$",
"this",
"->",
"getContext",
"(",
")",
",",
"$",
"this",
"->",
"getRe... | Returns the list item with the specified list item identifier.
@param integer $id SPList Item id
@return ListItem List Item resource | [
"Returns",
"the",
"list",
"item",
"with",
"the",
"specified",
"list",
"item",
"identifier",
"."
] | train | https://github.com/vgrem/phpSPO/blob/4ec81109a154f88d188f9e87c7d7f004e91af666/src/SharePoint/SPList.php#L42-L48 |
vgrem/phpSPO | src/SharePoint/SPList.php | SPList.getItems | public function getItems(CamlQuery $camlQuery = null)
{
$items = new ListItemCollection($this->getContext(),new ResourcePathEntity($this->getContext(),$this->getResourcePath(),"items"));
if(isset($camlQuery)){
$qry = new InvokePostMethodQuery(
$this->getResourcePath(),
... | php | public function getItems(CamlQuery $camlQuery = null)
{
$items = new ListItemCollection($this->getContext(),new ResourcePathEntity($this->getContext(),$this->getResourcePath(),"items"));
if(isset($camlQuery)){
$qry = new InvokePostMethodQuery(
$this->getResourcePath(),
... | [
"public",
"function",
"getItems",
"(",
"CamlQuery",
"$",
"camlQuery",
"=",
"null",
")",
"{",
"$",
"items",
"=",
"new",
"ListItemCollection",
"(",
"$",
"this",
"->",
"getContext",
"(",
")",
",",
"new",
"ResourcePathEntity",
"(",
"$",
"this",
"->",
"getConte... | Returns a collection of items from the list based on the specified query.
@param CamlQuery $camlQuery
@return ListItemCollection | [
"Returns",
"a",
"collection",
"of",
"items",
"from",
"the",
"list",
"based",
"on",
"the",
"specified",
"query",
"."
] | train | https://github.com/vgrem/phpSPO/blob/4ec81109a154f88d188f9e87c7d7f004e91af666/src/SharePoint/SPList.php#L56-L69 |
vgrem/phpSPO | src/SharePoint/SPList.php | SPList.deleteObject | public function deleteObject()
{
$qry = new DeleteEntityQuery($this);
$this->getContext()->addQuery($qry);
$this->removeFromParentCollection();
} | php | public function deleteObject()
{
$qry = new DeleteEntityQuery($this);
$this->getContext()->addQuery($qry);
$this->removeFromParentCollection();
} | [
"public",
"function",
"deleteObject",
"(",
")",
"{",
"$",
"qry",
"=",
"new",
"DeleteEntityQuery",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"getContext",
"(",
")",
"->",
"addQuery",
"(",
"$",
"qry",
")",
";",
"$",
"this",
"->",
"removeFromParentCo... | The recommended way to delete a list is to send a DELETE request to the List resource endpoint, as shown in List request examples. | [
"The",
"recommended",
"way",
"to",
"delete",
"a",
"list",
"is",
"to",
"send",
"a",
"DELETE",
"request",
"to",
"the",
"List",
"resource",
"endpoint",
"as",
"shown",
"in",
"List",
"request",
"examples",
"."
] | train | https://github.com/vgrem/phpSPO/blob/4ec81109a154f88d188f9e87c7d7f004e91af666/src/SharePoint/SPList.php#L84-L89 |
vgrem/phpSPO | src/SharePoint/SPList.php | SPList.getUserEffectivePermissions | public function getUserEffectivePermissions($loginName)
{
$permissions = new BasePermissions();
$qry = new InvokeMethodQuery(
$this->getResourcePath(),
"GetUserEffectivePermissions",
array(rawurlencode($loginName))
);
$this->getContext()->addQuery(... | php | public function getUserEffectivePermissions($loginName)
{
$permissions = new BasePermissions();
$qry = new InvokeMethodQuery(
$this->getResourcePath(),
"GetUserEffectivePermissions",
array(rawurlencode($loginName))
);
$this->getContext()->addQuery(... | [
"public",
"function",
"getUserEffectivePermissions",
"(",
"$",
"loginName",
")",
"{",
"$",
"permissions",
"=",
"new",
"BasePermissions",
"(",
")",
";",
"$",
"qry",
"=",
"new",
"InvokeMethodQuery",
"(",
"$",
"this",
"->",
"getResourcePath",
"(",
")",
",",
"\"... | Gets the set of permissions for the specified user
@param string $loginName
@return BasePermissions | [
"Gets",
"the",
"set",
"of",
"permissions",
"for",
"the",
"specified",
"user"
] | train | https://github.com/vgrem/phpSPO/blob/4ec81109a154f88d188f9e87c7d7f004e91af666/src/SharePoint/SPList.php#L97-L107 |
vgrem/phpSPO | src/SharePoint/User.php | User.getGroups | public function getGroups()
{
if(!$this->isPropertyAvailable('Groups')){
$this->setProperty("Groups", new GroupCollection($this->getContext(), new ResourcePathEntity($this->getContext(),$this->getResourcePath(), "groups")));
}
return $this->getProperty("Groups");
} | php | public function getGroups()
{
if(!$this->isPropertyAvailable('Groups')){
$this->setProperty("Groups", new GroupCollection($this->getContext(), new ResourcePathEntity($this->getContext(),$this->getResourcePath(), "groups")));
}
return $this->getProperty("Groups");
} | [
"public",
"function",
"getGroups",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isPropertyAvailable",
"(",
"'Groups'",
")",
")",
"{",
"$",
"this",
"->",
"setProperty",
"(",
"\"Groups\"",
",",
"new",
"GroupCollection",
"(",
"$",
"this",
"->",
"getCo... | Gets the collection of groups of which the user is a member.
@return GroupCollection | [
"Gets",
"the",
"collection",
"of",
"groups",
"of",
"which",
"the",
"user",
"is",
"a",
"member",
"."
] | train | https://github.com/vgrem/phpSPO/blob/4ec81109a154f88d188f9e87c7d7f004e91af666/src/SharePoint/User.php#L23-L29 |
vgrem/phpSPO | src/SharePoint/Web.php | Web.getLists | public function getLists()
{
if(!$this->isPropertyAvailable('Lists')){
$this->setProperty("Lists", new ListCollection($this->getContext(),new ResourcePathEntity($this->getContext(),$this->getResourcePath(),"Lists")));
}
return $this->getProperty("Lists");
} | php | public function getLists()
{
if(!$this->isPropertyAvailable('Lists')){
$this->setProperty("Lists", new ListCollection($this->getContext(),new ResourcePathEntity($this->getContext(),$this->getResourcePath(),"Lists")));
}
return $this->getProperty("Lists");
} | [
"public",
"function",
"getLists",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isPropertyAvailable",
"(",
"'Lists'",
")",
")",
"{",
"$",
"this",
"->",
"setProperty",
"(",
"\"Lists\"",
",",
"new",
"ListCollection",
"(",
"$",
"this",
"->",
"getContex... | Gets the collection of all lists that are contained in the Web site available to the current user
based on the permissions of the current user.
@return ListCollection | [
"Gets",
"the",
"collection",
"of",
"all",
"lists",
"that",
"are",
"contained",
"in",
"the",
"Web",
"site",
"available",
"to",
"the",
"current",
"user",
"based",
"on",
"the",
"permissions",
"of",
"the",
"current",
"user",
"."
] | train | https://github.com/vgrem/phpSPO/blob/4ec81109a154f88d188f9e87c7d7f004e91af666/src/SharePoint/Web.php#L114-L120 |
vgrem/phpSPO | src/SharePoint/Web.php | Web.getWebs | public function getWebs()
{
if(!$this->isPropertyAvailable('Webs')){
$this->setProperty("Webs", new WebCollection($this->getContext(),new ResourcePathEntity($this->getContext(),$this->getResourcePath(),"webs")));
}
return $this->getProperty("Webs");
} | php | public function getWebs()
{
if(!$this->isPropertyAvailable('Webs')){
$this->setProperty("Webs", new WebCollection($this->getContext(),new ResourcePathEntity($this->getContext(),$this->getResourcePath(),"webs")));
}
return $this->getProperty("Webs");
} | [
"public",
"function",
"getWebs",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isPropertyAvailable",
"(",
"'Webs'",
")",
")",
"{",
"$",
"this",
"->",
"setProperty",
"(",
"\"Webs\"",
",",
"new",
"WebCollection",
"(",
"$",
"this",
"->",
"getContext",
... | Gets a Web site collection object that represents all Web sites immediately beneath the Web site,
excluding children of those Web sites.
@return WebCollection | [
"Gets",
"a",
"Web",
"site",
"collection",
"object",
"that",
"represents",
"all",
"Web",
"sites",
"immediately",
"beneath",
"the",
"Web",
"site",
"excluding",
"children",
"of",
"those",
"Web",
"sites",
"."
] | train | https://github.com/vgrem/phpSPO/blob/4ec81109a154f88d188f9e87c7d7f004e91af666/src/SharePoint/Web.php#L127-L133 |
vgrem/phpSPO | src/SharePoint/Web.php | Web.getFolders | public function getFolders()
{
if(!isset($this->Folders)){
$this->Folders = new FolderCollection($this->getContext(),new ResourcePathEntity($this->getContext(),$this->getResourcePath(),"folders"));
}
return $this->Folders;
} | php | public function getFolders()
{
if(!isset($this->Folders)){
$this->Folders = new FolderCollection($this->getContext(),new ResourcePathEntity($this->getContext(),$this->getResourcePath(),"folders"));
}
return $this->Folders;
} | [
"public",
"function",
"getFolders",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"Folders",
")",
")",
"{",
"$",
"this",
"->",
"Folders",
"=",
"new",
"FolderCollection",
"(",
"$",
"this",
"->",
"getContext",
"(",
")",
",",
"new",
... | Gets the collection of all first-level folders in the Web site.
@return FolderCollection | [
"Gets",
"the",
"collection",
"of",
"all",
"first",
"-",
"level",
"folders",
"in",
"the",
"Web",
"site",
"."
] | train | https://github.com/vgrem/phpSPO/blob/4ec81109a154f88d188f9e87c7d7f004e91af666/src/SharePoint/Web.php#L151-L157 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.