id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
187,700 | neoxygen/neo4j-neoclient | src/Extension/NeoClientCoreExtension.php | NeoClientCoreExtension.getRoot | public function getRoot($conn = null)
{
$command = $this->invoke('simple_command', $conn);
$httpResponse = $command->execute();
return $this->handleHttpResponse($httpResponse);
} | php | public function getRoot($conn = null)
{
$command = $this->invoke('simple_command', $conn);
$httpResponse = $command->execute();
return $this->handleHttpResponse($httpResponse);
} | [
"public",
"function",
"getRoot",
"(",
"$",
"conn",
"=",
"null",
")",
"{",
"$",
"command",
"=",
"$",
"this",
"->",
"invoke",
"(",
"'simple_command'",
",",
"$",
"conn",
")",
";",
"$",
"httpResponse",
"=",
"$",
"command",
"->",
"execute",
"(",
")",
";",... | Convenience method that returns the root of the Neo4j Api.
@param string|null $conn The alias of the connection to use
@return mixed | [
"Convenience",
"method",
"that",
"returns",
"the",
"root",
"of",
"the",
"Neo4j",
"Api",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Extension/NeoClientCoreExtension.php#L39-L45 |
187,701 | neoxygen/neo4j-neoclient | src/Extension/NeoClientCoreExtension.php | NeoClientCoreExtension.getNeo4jVersion | public function getNeo4jVersion($conn = null)
{
$command = $this->invoke('neo.get_neo4j_version', $conn);
$httpResponse = $command->execute();
$response = $this->handleHttpResponse($httpResponse);
return $response->getBody()['neo4j_version'];
} | php | public function getNeo4jVersion($conn = null)
{
$command = $this->invoke('neo.get_neo4j_version', $conn);
$httpResponse = $command->execute();
$response = $this->handleHttpResponse($httpResponse);
return $response->getBody()['neo4j_version'];
} | [
"public",
"function",
"getNeo4jVersion",
"(",
"$",
"conn",
"=",
"null",
")",
"{",
"$",
"command",
"=",
"$",
"this",
"->",
"invoke",
"(",
"'neo.get_neo4j_version'",
",",
"$",
"conn",
")",
";",
"$",
"httpResponse",
"=",
"$",
"command",
"->",
"execute",
"("... | Convenience method that invoke the GetVersionCommand.
@param string|null $conn The alias of the connection to use
@return mixed | [
"Convenience",
"method",
"that",
"invoke",
"the",
"GetVersionCommand",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Extension/NeoClientCoreExtension.php#L54-L62 |
187,702 | neoxygen/neo4j-neoclient | src/Extension/NeoClientCoreExtension.php | NeoClientCoreExtension.sendCypherQuery | public function sendCypherQuery($query, array $parameters = array(), $conn = null, $queryMode = null)
{
$command = $this->invoke('neo.send_cypher_query', $conn);
if (!is_string($query)) {
throw new CypherException('You need to send a Cypher query as a string. Usage: "$neoclient->sendCyph... | php | public function sendCypherQuery($query, array $parameters = array(), $conn = null, $queryMode = null)
{
$command = $this->invoke('neo.send_cypher_query', $conn);
if (!is_string($query)) {
throw new CypherException('You need to send a Cypher query as a string. Usage: "$neoclient->sendCyph... | [
"public",
"function",
"sendCypherQuery",
"(",
"$",
"query",
",",
"array",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"$",
"conn",
"=",
"null",
",",
"$",
"queryMode",
"=",
"null",
")",
"{",
"$",
"command",
"=",
"$",
"this",
"->",
"invoke",
"(",
... | Convenience method that invoke the sendCypherQueryCommand
and passes given query and parameters arguments.
@param string $query The query to send
@param array $parameters Map of query parameters
@param string|null $conn The alias of the connection to use
@param string|null $queryMode The mode of... | [
"Convenience",
"method",
"that",
"invoke",
"the",
"sendCypherQueryCommand",
"and",
"passes",
"given",
"query",
"and",
"parameters",
"arguments",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Extension/NeoClientCoreExtension.php#L88-L99 |
187,703 | neoxygen/neo4j-neoclient | src/Extension/NeoClientCoreExtension.php | NeoClientCoreExtension.createSchemaIndex | public function createSchemaIndex($label, $property, $conn = null)
{
$statement = 'CREATE INDEX ON :'.$label.'('.$property.')';
$this->sendCypherQuery($statement, array(), $conn = null, self::WRITE_QUERY);
return new Index($label, $property);
} | php | public function createSchemaIndex($label, $property, $conn = null)
{
$statement = 'CREATE INDEX ON :'.$label.'('.$property.')';
$this->sendCypherQuery($statement, array(), $conn = null, self::WRITE_QUERY);
return new Index($label, $property);
} | [
"public",
"function",
"createSchemaIndex",
"(",
"$",
"label",
",",
"$",
"property",
",",
"$",
"conn",
"=",
"null",
")",
"{",
"$",
"statement",
"=",
"'CREATE INDEX ON :'",
".",
"$",
"label",
".",
"'('",
".",
"$",
"property",
".",
"')'",
";",
"$",
"this"... | Creates a Schema Index based on label and property.
@param string $label
@param string $property
@return \Neoxygen\NeoClient\Schema\Index | [
"Creates",
"a",
"Schema",
"Index",
"based",
"on",
"label",
"and",
"property",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Extension/NeoClientCoreExtension.php#L158-L164 |
187,704 | neoxygen/neo4j-neoclient | src/Extension/NeoClientCoreExtension.php | NeoClientCoreExtension.dropSchemaIndex | public function dropSchemaIndex(Index $index, $conn = null)
{
$statement = 'DROP INDEX ON :'.$index->getLabel().'('.$index->getProperty().')';
$this->sendCypherQuery($statement, array(), $conn, self::WRITE_QUERY);
} | php | public function dropSchemaIndex(Index $index, $conn = null)
{
$statement = 'DROP INDEX ON :'.$index->getLabel().'('.$index->getProperty().')';
$this->sendCypherQuery($statement, array(), $conn, self::WRITE_QUERY);
} | [
"public",
"function",
"dropSchemaIndex",
"(",
"Index",
"$",
"index",
",",
"$",
"conn",
"=",
"null",
")",
"{",
"$",
"statement",
"=",
"'DROP INDEX ON :'",
".",
"$",
"index",
"->",
"getLabel",
"(",
")",
".",
"'('",
".",
"$",
"index",
"->",
"getProperty",
... | Removes a Schema Index.
@param \Neoxygen\NeoClient\Schema\Index $index
@param string|null $conn | [
"Removes",
"a",
"Schema",
"Index",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Extension/NeoClientCoreExtension.php#L172-L176 |
187,705 | neoxygen/neo4j-neoclient | src/Extension/NeoClientCoreExtension.php | NeoClientCoreExtension.createIndex | public function createIndex($label, $property)
{
$statements = [];
if (is_array($property)) {
foreach ($property as $prop) {
$statements[] = 'CREATE INDEX ON :'.$label.'('.$prop.')';
}
} else {
$statements[] = 'CREATE INDEX ON :'.$label.'('... | php | public function createIndex($label, $property)
{
$statements = [];
if (is_array($property)) {
foreach ($property as $prop) {
$statements[] = 'CREATE INDEX ON :'.$label.'('.$prop.')';
}
} else {
$statements[] = 'CREATE INDEX ON :'.$label.'('... | [
"public",
"function",
"createIndex",
"(",
"$",
"label",
",",
"$",
"property",
")",
"{",
"$",
"statements",
"=",
"[",
"]",
";",
"if",
"(",
"is_array",
"(",
"$",
"property",
")",
")",
"{",
"foreach",
"(",
"$",
"property",
"as",
"$",
"prop",
")",
"{",... | Creates an index on a label.
@param string $label
@param string|array $property
@return bool
@deprecated will be removed in 4.0 | [
"Creates",
"an",
"index",
"on",
"a",
"label",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Extension/NeoClientCoreExtension.php#L188-L203 |
187,706 | neoxygen/neo4j-neoclient | src/Extension/NeoClientCoreExtension.php | NeoClientCoreExtension.listIndex | public function listIndex($label, $conn = null)
{
$command = $this->invoke('neo.list_index_command', $conn);
$command->setArguments($label);
$httpResponse = $command->execute();
$response = $this->handleHttpResponse($httpResponse);
$propertiesIndexed = [];
foreach ($... | php | public function listIndex($label, $conn = null)
{
$command = $this->invoke('neo.list_index_command', $conn);
$command->setArguments($label);
$httpResponse = $command->execute();
$response = $this->handleHttpResponse($httpResponse);
$propertiesIndexed = [];
foreach ($... | [
"public",
"function",
"listIndex",
"(",
"$",
"label",
",",
"$",
"conn",
"=",
"null",
")",
"{",
"$",
"command",
"=",
"$",
"this",
"->",
"invoke",
"(",
"'neo.list_index_command'",
",",
"$",
"conn",
")",
";",
"$",
"command",
"->",
"setArguments",
"(",
"$"... | Returns the list of indexed properties for a given Label.
@param string $label
@param string|null $conn
@return array | [
"Returns",
"the",
"list",
"of",
"indexed",
"properties",
"for",
"a",
"given",
"Label",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Extension/NeoClientCoreExtension.php#L213-L232 |
187,707 | neoxygen/neo4j-neoclient | src/Extension/NeoClientCoreExtension.php | NeoClientCoreExtension.getSchemaIndexes | public function getSchemaIndexes($conn = null)
{
$indx = [];
$labels = $this->getLabels($conn)->getBody();
foreach ($labels as $label) {
$indexes = $this->listIndex($label, $conn)->getBody();
foreach ($indexes as $property) {
$indx[] = new Index($label... | php | public function getSchemaIndexes($conn = null)
{
$indx = [];
$labels = $this->getLabels($conn)->getBody();
foreach ($labels as $label) {
$indexes = $this->listIndex($label, $conn)->getBody();
foreach ($indexes as $property) {
$indx[] = new Index($label... | [
"public",
"function",
"getSchemaIndexes",
"(",
"$",
"conn",
"=",
"null",
")",
"{",
"$",
"indx",
"=",
"[",
"]",
";",
"$",
"labels",
"=",
"$",
"this",
"->",
"getLabels",
"(",
"$",
"conn",
")",
"->",
"getBody",
"(",
")",
";",
"foreach",
"(",
"$",
"l... | Returns the schema indexes live in the database.
@param null $conn
@return \Neoxygen\NeoClient\Schema\Index[] | [
"Returns",
"the",
"schema",
"indexes",
"live",
"in",
"the",
"database",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Extension/NeoClientCoreExtension.php#L303-L315 |
187,708 | neoxygen/neo4j-neoclient | src/Extension/NeoClientCoreExtension.php | NeoClientCoreExtension.isIndexed | public function isIndexed($label, $propertyKey, $conn = null)
{
$indexes = $this->listIndex($label, $conn)->getBody();
if (in_array($propertyKey, $indexes)) {
return true;
}
return false;
} | php | public function isIndexed($label, $propertyKey, $conn = null)
{
$indexes = $this->listIndex($label, $conn)->getBody();
if (in_array($propertyKey, $indexes)) {
return true;
}
return false;
} | [
"public",
"function",
"isIndexed",
"(",
"$",
"label",
",",
"$",
"propertyKey",
",",
"$",
"conn",
"=",
"null",
")",
"{",
"$",
"indexes",
"=",
"$",
"this",
"->",
"listIndex",
"(",
"$",
"label",
",",
"$",
"conn",
")",
"->",
"getBody",
"(",
")",
";",
... | Checks if a property is indexed for a given label.
@param string $label
@param string $propertyKey
@param string|null $conn
@return bool | [
"Checks",
"if",
"a",
"property",
"is",
"indexed",
"for",
"a",
"given",
"label",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Extension/NeoClientCoreExtension.php#L326-L334 |
187,709 | neoxygen/neo4j-neoclient | src/Extension/NeoClientCoreExtension.php | NeoClientCoreExtension.getUniqueConstraints | public function getUniqueConstraints($conn = null)
{
$command = $this->invoke('neo.get_constraints_command', $conn);
$httpResponse = $command->execute();
$responseO = $this->handleHttpResponse($httpResponse);
$response = $responseO->getBody();
$constraints = [];
fore... | php | public function getUniqueConstraints($conn = null)
{
$command = $this->invoke('neo.get_constraints_command', $conn);
$httpResponse = $command->execute();
$responseO = $this->handleHttpResponse($httpResponse);
$response = $responseO->getBody();
$constraints = [];
fore... | [
"public",
"function",
"getUniqueConstraints",
"(",
"$",
"conn",
"=",
"null",
")",
"{",
"$",
"command",
"=",
"$",
"this",
"->",
"invoke",
"(",
"'neo.get_constraints_command'",
",",
"$",
"conn",
")",
";",
"$",
"httpResponse",
"=",
"$",
"command",
"->",
"exec... | Returns the registered constraints.
@param string|null $conn
@return mixed | [
"Returns",
"the",
"registered",
"constraints",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Extension/NeoClientCoreExtension.php#L343-L364 |
187,710 | neoxygen/neo4j-neoclient | src/Extension/NeoClientCoreExtension.php | NeoClientCoreExtension.createUniqueConstraint | public function createUniqueConstraint($label, $property, $removeIndexIfExist = false)
{
$statements = [];
$identifier = strtolower($label);
if (is_array($property)) {
foreach ($property as $prop) {
$statements[] = 'CREATE CONSTRAINT ON ('.$identifier.':'.$label.'... | php | public function createUniqueConstraint($label, $property, $removeIndexIfExist = false)
{
$statements = [];
$identifier = strtolower($label);
if (is_array($property)) {
foreach ($property as $prop) {
$statements[] = 'CREATE CONSTRAINT ON ('.$identifier.':'.$label.'... | [
"public",
"function",
"createUniqueConstraint",
"(",
"$",
"label",
",",
"$",
"property",
",",
"$",
"removeIndexIfExist",
"=",
"false",
")",
"{",
"$",
"statements",
"=",
"[",
"]",
";",
"$",
"identifier",
"=",
"strtolower",
"(",
"$",
"label",
")",
";",
"if... | Create a unique constraint on a label.
@param string $label
@param string|array $property
@return bool | [
"Create",
"a",
"unique",
"constraint",
"on",
"a",
"label",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Extension/NeoClientCoreExtension.php#L374-L399 |
187,711 | neoxygen/neo4j-neoclient | src/Extension/NeoClientCoreExtension.php | NeoClientCoreExtension.dropSchemaUniqueConstraint | public function dropSchemaUniqueConstraint(UniqueConstraint $constraint, $conn = null)
{
$q = 'DROP CONSTRAINT ON (n:'.$constraint->getLabel().') ASSERT n.'.$constraint->getProperty().' IS UNIQUE';
$this->sendCypherQuery($q);
} | php | public function dropSchemaUniqueConstraint(UniqueConstraint $constraint, $conn = null)
{
$q = 'DROP CONSTRAINT ON (n:'.$constraint->getLabel().') ASSERT n.'.$constraint->getProperty().' IS UNIQUE';
$this->sendCypherQuery($q);
} | [
"public",
"function",
"dropSchemaUniqueConstraint",
"(",
"UniqueConstraint",
"$",
"constraint",
",",
"$",
"conn",
"=",
"null",
")",
"{",
"$",
"q",
"=",
"'DROP CONSTRAINT ON (n:'",
".",
"$",
"constraint",
"->",
"getLabel",
"(",
")",
".",
"') ASSERT n.'",
".",
"... | Drops a Uniqueness constraint from the Schema.
@param \Neoxygen\NeoClient\Schema\UniqueConstraint $constraint
@param null $conn | [
"Drops",
"a",
"Uniqueness",
"constraint",
"from",
"the",
"Schema",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Extension/NeoClientCoreExtension.php#L433-L437 |
187,712 | neoxygen/neo4j-neoclient | src/Extension/NeoClientCoreExtension.php | NeoClientCoreExtension.getSchemaUniqueConstraints | public function getSchemaUniqueConstraints($conn = null)
{
$command = $this->invoke('neo.get_constraints_command', $conn);
$httpResponse = $command->execute();
$responseO = $this->handleHttpResponse($httpResponse);
$response = $responseO->getBody();
$constraints = [];
... | php | public function getSchemaUniqueConstraints($conn = null)
{
$command = $this->invoke('neo.get_constraints_command', $conn);
$httpResponse = $command->execute();
$responseO = $this->handleHttpResponse($httpResponse);
$response = $responseO->getBody();
$constraints = [];
... | [
"public",
"function",
"getSchemaUniqueConstraints",
"(",
"$",
"conn",
"=",
"null",
")",
"{",
"$",
"command",
"=",
"$",
"this",
"->",
"invoke",
"(",
"'neo.get_constraints_command'",
",",
"$",
"conn",
")",
";",
"$",
"httpResponse",
"=",
"$",
"command",
"->",
... | Returns a collection of Uniqueness constraints live in the schema.
@param null $conn
@return \Neoxygen\NeoClient\Schema\UniqueConstraint[] | [
"Returns",
"a",
"collection",
"of",
"Uniqueness",
"constraints",
"live",
"in",
"the",
"schema",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Extension/NeoClientCoreExtension.php#L446-L461 |
187,713 | neoxygen/neo4j-neoclient | src/Extension/NeoClientCoreExtension.php | NeoClientCoreExtension.dropUniqueConstraint | public function dropUniqueConstraint($label, $property)
{
$statements = [];
$identifier = strtolower($label);
if (is_array($property)) {
foreach ($property as $prop) {
$statements[] = 'DROP CONSTRAINT ON ('.$identifier.':'.$label.') ASSERT '.$identifier.'.'.$prop.... | php | public function dropUniqueConstraint($label, $property)
{
$statements = [];
$identifier = strtolower($label);
if (is_array($property)) {
foreach ($property as $prop) {
$statements[] = 'DROP CONSTRAINT ON ('.$identifier.':'.$label.') ASSERT '.$identifier.'.'.$prop.... | [
"public",
"function",
"dropUniqueConstraint",
"(",
"$",
"label",
",",
"$",
"property",
")",
"{",
"$",
"statements",
"=",
"[",
"]",
";",
"$",
"identifier",
"=",
"strtolower",
"(",
"$",
"label",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"property",
")",... | Drops a unique constraint on a label.
@param string $label
@param string|array $property
@return bool | [
"Drops",
"a",
"unique",
"constraint",
"on",
"a",
"label",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Extension/NeoClientCoreExtension.php#L471-L487 |
187,714 | neoxygen/neo4j-neoclient | src/Extension/NeoClientCoreExtension.php | NeoClientCoreExtension.createTransaction | public function createTransaction($conn = null, $queryMode = Client::NEOCLIENT_QUERY_MODE_WRITE)
{
$transaction = new Transaction($conn, $this, $queryMode);
return $transaction;
} | php | public function createTransaction($conn = null, $queryMode = Client::NEOCLIENT_QUERY_MODE_WRITE)
{
$transaction = new Transaction($conn, $this, $queryMode);
return $transaction;
} | [
"public",
"function",
"createTransaction",
"(",
"$",
"conn",
"=",
"null",
",",
"$",
"queryMode",
"=",
"Client",
"::",
"NEOCLIENT_QUERY_MODE_WRITE",
")",
"{",
"$",
"transaction",
"=",
"new",
"Transaction",
"(",
"$",
"conn",
",",
"$",
"this",
",",
"$",
"quer... | Creates a new Transaction Handler.
@param string|null $conn The connection alias
@return Transaction | [
"Creates",
"a",
"new",
"Transaction",
"Handler",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Extension/NeoClientCoreExtension.php#L496-L501 |
187,715 | neoxygen/neo4j-neoclient | src/Extension/NeoClientCoreExtension.php | NeoClientCoreExtension.openTransaction | public function openTransaction($conn = null, $queryMode = self::WRITE_QUERY)
{
$command = $this->invoke('neo.open_transaction', $conn);
$command->setArguments($queryMode);
$httpResponse = $command->execute();
return $this->handleHttpResponse($httpResponse);
} | php | public function openTransaction($conn = null, $queryMode = self::WRITE_QUERY)
{
$command = $this->invoke('neo.open_transaction', $conn);
$command->setArguments($queryMode);
$httpResponse = $command->execute();
return $this->handleHttpResponse($httpResponse);
} | [
"public",
"function",
"openTransaction",
"(",
"$",
"conn",
"=",
"null",
",",
"$",
"queryMode",
"=",
"self",
"::",
"WRITE_QUERY",
")",
"{",
"$",
"command",
"=",
"$",
"this",
"->",
"invoke",
"(",
"'neo.open_transaction'",
",",
"$",
"conn",
")",
";",
"$",
... | Convenience method that invoke the OpenTransactionCommand.
@param string|null $conn The alias of the connection to use
@return mixed | [
"Convenience",
"method",
"that",
"invoke",
"the",
"OpenTransactionCommand",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Extension/NeoClientCoreExtension.php#L510-L517 |
187,716 | neoxygen/neo4j-neoclient | src/Extension/NeoClientCoreExtension.php | NeoClientCoreExtension.rollBackTransaction | public function rollBackTransaction($id, $conn = null)
{
$response = $this->invoke('neo.rollback_transaction', $conn)
->setTransactionId($id)
->execute();
return $this->handleHttpResponse($response);
} | php | public function rollBackTransaction($id, $conn = null)
{
$response = $this->invoke('neo.rollback_transaction', $conn)
->setTransactionId($id)
->execute();
return $this->handleHttpResponse($response);
} | [
"public",
"function",
"rollBackTransaction",
"(",
"$",
"id",
",",
"$",
"conn",
"=",
"null",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"invoke",
"(",
"'neo.rollback_transaction'",
",",
"$",
"conn",
")",
"->",
"setTransactionId",
"(",
"$",
"id",
"... | Convenience method that invoke the RollBackTransactionCommand.
@param int $id The id of the transaction
@param string|null $conn The alias of the connection to use
@return mixed | [
"Convenience",
"method",
"that",
"invoke",
"the",
"RollBackTransactionCommand",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Extension/NeoClientCoreExtension.php#L527-L534 |
187,717 | neoxygen/neo4j-neoclient | src/Extension/NeoClientCoreExtension.php | NeoClientCoreExtension.pushToTransaction | public function pushToTransaction($transactionId, $query, array $parameters = array(), $conn = null, $queryMode = Client::NEOCLIENT_QUERY_MODE_WRITE)
{
$httpResponse = $this->invoke('neo.push_to_transaction', $conn)
->setArguments($transactionId, $query, $parameters, $this->resultDataContent, $que... | php | public function pushToTransaction($transactionId, $query, array $parameters = array(), $conn = null, $queryMode = Client::NEOCLIENT_QUERY_MODE_WRITE)
{
$httpResponse = $this->invoke('neo.push_to_transaction', $conn)
->setArguments($transactionId, $query, $parameters, $this->resultDataContent, $que... | [
"public",
"function",
"pushToTransaction",
"(",
"$",
"transactionId",
",",
"$",
"query",
",",
"array",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"$",
"conn",
"=",
"null",
",",
"$",
"queryMode",
"=",
"Client",
"::",
"NEOCLIENT_QUERY_MODE_WRITE",
")",
... | Convenience method that invoke the PushToTransactionCommand
and passes the query and parameters as arguments.
@param int $transactionId The transaction id
@param string $query The query to send
@param array $parameters Parameters map of the query
@param string|null $conn The alia... | [
"Convenience",
"method",
"that",
"invoke",
"the",
"PushToTransactionCommand",
"and",
"passes",
"the",
"query",
"and",
"parameters",
"as",
"arguments",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Extension/NeoClientCoreExtension.php#L547-L554 |
187,718 | neoxygen/neo4j-neoclient | src/Extension/NeoClientCoreExtension.php | NeoClientCoreExtension.commitTransaction | public function commitTransaction($transactionId, $query = null, array $parameters = array(), $conn = null, $queryMode = self::WRITE_QUERY)
{
$response = $this->invoke('neo.commit_transaction', $conn)
->setArguments($transactionId, $query, $parameters, $this->resultDataContent, $queryMode)
... | php | public function commitTransaction($transactionId, $query = null, array $parameters = array(), $conn = null, $queryMode = self::WRITE_QUERY)
{
$response = $this->invoke('neo.commit_transaction', $conn)
->setArguments($transactionId, $query, $parameters, $this->resultDataContent, $queryMode)
... | [
"public",
"function",
"commitTransaction",
"(",
"$",
"transactionId",
",",
"$",
"query",
"=",
"null",
",",
"array",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"$",
"conn",
"=",
"null",
",",
"$",
"queryMode",
"=",
"self",
"::",
"WRITE_QUERY",
")",
... | Convenience method that commit the transaction
and passes the optional query and parameters as arguments.
@param int $transactionId The transaction id
@param string|null $query The query to send
@param array $parameters Parameters map of the query
@param string|null $conn The alias of... | [
"Convenience",
"method",
"that",
"commit",
"the",
"transaction",
"and",
"passes",
"the",
"optional",
"query",
"and",
"parameters",
"as",
"arguments",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Extension/NeoClientCoreExtension.php#L576-L583 |
187,719 | neoxygen/neo4j-neoclient | src/Extension/NeoClientCoreExtension.php | NeoClientCoreExtension.sendReadQuery | public function sendReadQuery($query, array $parameters = array())
{
return $this->sendCypherQuery($query, $parameters, $this->getReadConnection()->getAlias(), self::READ_QUERY);
} | php | public function sendReadQuery($query, array $parameters = array())
{
return $this->sendCypherQuery($query, $parameters, $this->getReadConnection()->getAlias(), self::READ_QUERY);
} | [
"public",
"function",
"sendReadQuery",
"(",
"$",
"query",
",",
"array",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"sendCypherQuery",
"(",
"$",
"query",
",",
"$",
"parameters",
",",
"$",
"this",
"->",
"getReadConnec... | Convenience method for working with replication
Sends a read only query.
@param string $query
@param array $parameters
@return mixed | [
"Convenience",
"method",
"for",
"working",
"with",
"replication",
"Sends",
"a",
"read",
"only",
"query",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Extension/NeoClientCoreExtension.php#L652-L655 |
187,720 | neoxygen/neo4j-neoclient | src/Extension/NeoClientCoreExtension.php | NeoClientCoreExtension.sendWriteQuery | public function sendWriteQuery($query, array $parameters = array())
{
return $this->sendCypherQuery($query, $parameters, $this->getWriteConnection()->getAlias(), self::WRITE_QUERY);
} | php | public function sendWriteQuery($query, array $parameters = array())
{
return $this->sendCypherQuery($query, $parameters, $this->getWriteConnection()->getAlias(), self::WRITE_QUERY);
} | [
"public",
"function",
"sendWriteQuery",
"(",
"$",
"query",
",",
"array",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"sendCypherQuery",
"(",
"$",
"query",
",",
"$",
"parameters",
",",
"$",
"this",
"->",
"getWriteConn... | Convenience method for working with replication.
@param string $query
@param array $parameters
@return mixed | [
"Convenience",
"method",
"for",
"working",
"with",
"replication",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Extension/NeoClientCoreExtension.php#L665-L668 |
187,721 | neoxygen/neo4j-neoclient | src/Transaction/PreparedTransaction.php | PreparedTransaction.commit | public function commit()
{
if ($this->committed) {
throw new CommandException('The prepared transaction has already been commited');
}
$response = Client::commitPreparedTransaction($this);
$this->committed = true;
return $response;
} | php | public function commit()
{
if ($this->committed) {
throw new CommandException('The prepared transaction has already been commited');
}
$response = Client::commitPreparedTransaction($this);
$this->committed = true;
return $response;
} | [
"public",
"function",
"commit",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"committed",
")",
"{",
"throw",
"new",
"CommandException",
"(",
"'The prepared transaction has already been commited'",
")",
";",
"}",
"$",
"response",
"=",
"Client",
"::",
"commitPrepa... | Commit the prepared transaction.
@return mixed
@throws \Neoxygen\NeoClient\Exception\CommandException if the transaction was already committed | [
"Commit",
"the",
"prepared",
"transaction",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Transaction/PreparedTransaction.php#L122-L132 |
187,722 | neoxygen/neo4j-neoclient | src/ClientBuilder.php | ClientBuilder.loadConfigurationFile | public function loadConfigurationFile($file)
{
if (!file_exists($file)) {
throw new \InvalidArgumentException(sprintf('Configuration file "%s" not found', $file));
}
$this->loadedConfig = Yaml::parse(file_get_contents($file));
return $this;
} | php | public function loadConfigurationFile($file)
{
if (!file_exists($file)) {
throw new \InvalidArgumentException(sprintf('Configuration file "%s" not found', $file));
}
$this->loadedConfig = Yaml::parse(file_get_contents($file));
return $this;
} | [
"public",
"function",
"loadConfigurationFile",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"file",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Configuration file \"%s\" not found'",
",",
"$",
... | Load a configuration from an external YAML file.
@param string $file
@return ClientBuilder | [
"Load",
"a",
"configuration",
"from",
"an",
"external",
"YAML",
"file",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/ClientBuilder.php#L103-L111 |
187,723 | neoxygen/neo4j-neoclient | src/ClientBuilder.php | ClientBuilder.getLogger | public function getLogger($name = null)
{
if (null === $name && !isset($this->loggers['nullLogger'])) {
$this->createNullLogger();
$name = 'nullLogger';
}
return $this->loggers[$name];
} | php | public function getLogger($name = null)
{
if (null === $name && !isset($this->loggers['nullLogger'])) {
$this->createNullLogger();
$name = 'nullLogger';
}
return $this->loggers[$name];
} | [
"public",
"function",
"getLogger",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"name",
"&&",
"!",
"isset",
"(",
"$",
"this",
"->",
"loggers",
"[",
"'nullLogger'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"createNullLogger",
... | Returns a registered Logger.
@param string|null $name The name of the Logger
@return LoggerInterface The logger bounded to the specified name | [
"Returns",
"a",
"registered",
"Logger",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/ClientBuilder.php#L326-L334 |
187,724 | neoxygen/neo4j-neoclient | src/ClientBuilder.php | ClientBuilder.log | public function log($level = 'debug', $message, array $context = array())
{
foreach ($this->getLoggers() as $key => $logger) {
$logger->log($level, $message, $context);
}
} | php | public function log($level = 'debug', $message, array $context = array())
{
foreach ($this->getLoggers() as $key => $logger) {
$logger->log($level, $message, $context);
}
} | [
"public",
"function",
"log",
"(",
"$",
"level",
"=",
"'debug'",
",",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getLoggers",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"logger",
... | Logs a record to the registered loggers.
@param string $level Record logging level
@param string $message Log record message
@param array $context Context of message | [
"Logs",
"a",
"record",
"to",
"the",
"registered",
"loggers",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/ClientBuilder.php#L343-L348 |
187,725 | neoxygen/neo4j-neoclient | src/ClientBuilder.php | ClientBuilder.createDefaultStreamLogger | public function createDefaultStreamLogger($name, $path, $level = Logger::DEBUG)
{
$logger = new Logger($name);
$handler = new \Monolog\Handler\StreamHandler($path, $level);
$logger->pushHandler($handler);
$this->loggers[$name] = $logger;
return $this;
} | php | public function createDefaultStreamLogger($name, $path, $level = Logger::DEBUG)
{
$logger = new Logger($name);
$handler = new \Monolog\Handler\StreamHandler($path, $level);
$logger->pushHandler($handler);
$this->loggers[$name] = $logger;
return $this;
} | [
"public",
"function",
"createDefaultStreamLogger",
"(",
"$",
"name",
",",
"$",
"path",
",",
"$",
"level",
"=",
"Logger",
"::",
"DEBUG",
")",
"{",
"$",
"logger",
"=",
"new",
"Logger",
"(",
"$",
"name",
")",
";",
"$",
"handler",
"=",
"new",
"\\",
"Mono... | Creates an internal stream logger.
@param string $name Logger channel name
@param string $path Path to the log file
@param int|string $level Logging level
@return $this | [
"Creates",
"an",
"internal",
"stream",
"logger",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/ClientBuilder.php#L359-L367 |
187,726 | neoxygen/neo4j-neoclient | src/ClientBuilder.php | ClientBuilder.createDefaultChromePHPLogger | public function createDefaultChromePHPLogger($name, $level = Logger::DEBUG)
{
$logger = new Logger($name);
$handler = new \Monolog\Handler\ChromePHPHandler($level);
$logger->pushHandler($handler);
$this->loggers[$name] = $logger;
return $this;
} | php | public function createDefaultChromePHPLogger($name, $level = Logger::DEBUG)
{
$logger = new Logger($name);
$handler = new \Monolog\Handler\ChromePHPHandler($level);
$logger->pushHandler($handler);
$this->loggers[$name] = $logger;
return $this;
} | [
"public",
"function",
"createDefaultChromePHPLogger",
"(",
"$",
"name",
",",
"$",
"level",
"=",
"Logger",
"::",
"DEBUG",
")",
"{",
"$",
"logger",
"=",
"new",
"Logger",
"(",
"$",
"name",
")",
";",
"$",
"handler",
"=",
"new",
"\\",
"Monolog",
"\\",
"Hand... | Creates an internal chrome php logger.
@param string $name Logger channel name
@param int|string $level Logging level
@return $this | [
"Creates",
"an",
"internal",
"chrome",
"php",
"logger",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/ClientBuilder.php#L377-L385 |
187,727 | neoxygen/neo4j-neoclient | src/ClientBuilder.php | ClientBuilder.build | public function build()
{
if ($this->isCacheEnabled()) {
$file = $this->getCachePath().self::CACHE_FILENAME;
if (file_exists($file)) {
include_once $file;
$this->serviceContainer = new \ProjectServiceContainer();
return new Client($thi... | php | public function build()
{
if ($this->isCacheEnabled()) {
$file = $this->getCachePath().self::CACHE_FILENAME;
if (file_exists($file)) {
include_once $file;
$this->serviceContainer = new \ProjectServiceContainer();
return new Client($thi... | [
"public",
"function",
"build",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isCacheEnabled",
"(",
")",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"getCachePath",
"(",
")",
".",
"self",
"::",
"CACHE_FILENAME",
";",
"if",
"(",
"file_exists",
"(",
... | Builds the service definitions and processes the configuration.
@return \Neoxygen\NeoClient\Client | [
"Builds",
"the",
"service",
"definitions",
"and",
"processes",
"the",
"configuration",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/ClientBuilder.php#L476-L524 |
187,728 | neoxygen/neo4j-neoclient | src/HighAvailibility/HAEnterpriseManager.php | HAEnterpriseManager.onPreSendHAHeaders | public function onPreSendHAHeaders(HttpClientPreSendRequestEvent $event)
{
if ($event->getRequest()->getQueryMode() == 'WRITE') {
$event->getRequest()->setHeader($this->queryModeHeaderName, $this->queryModeWriteQueryHeaderValue);
} elseif ($event->getRequest()->getQueryMode() == 'READ') ... | php | public function onPreSendHAHeaders(HttpClientPreSendRequestEvent $event)
{
if ($event->getRequest()->getQueryMode() == 'WRITE') {
$event->getRequest()->setHeader($this->queryModeHeaderName, $this->queryModeWriteQueryHeaderValue);
} elseif ($event->getRequest()->getQueryMode() == 'READ') ... | [
"public",
"function",
"onPreSendHAHeaders",
"(",
"HttpClientPreSendRequestEvent",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"event",
"->",
"getRequest",
"(",
")",
"->",
"getQueryMode",
"(",
")",
"==",
"'WRITE'",
")",
"{",
"$",
"event",
"->",
"getRequest",
"(",... | Add specific headers to the Request object for helping HA proxies to determine if it is a read or write query.
@param \Neoxygen\NeoClient\Event\HttpClientPreSendRequestEvent $event | [
"Add",
"specific",
"headers",
"to",
"the",
"Request",
"object",
"for",
"helping",
"HA",
"proxies",
"to",
"determine",
"if",
"it",
"is",
"a",
"read",
"or",
"write",
"query",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/HighAvailibility/HAEnterpriseManager.php#L193-L200 |
187,729 | neoxygen/neo4j-neoclient | src/Formatter/ResponseFormatter.php | ResponseFormatter.format | public function format($response)
{
$this->isNew = false;
$responseObject = new Response();
$responseObject->setRawResponse($response);
if ($responseObject->containsResults()) {
$this->extractResults($response);
$this->prepareResultSet();
$this->p... | php | public function format($response)
{
$this->isNew = false;
$responseObject = new Response();
$responseObject->setRawResponse($response);
if ($responseObject->containsResults()) {
$this->extractResults($response);
$this->prepareResultSet();
$this->p... | [
"public",
"function",
"format",
"(",
"$",
"response",
")",
"{",
"$",
"this",
"->",
"isNew",
"=",
"false",
";",
"$",
"responseObject",
"=",
"new",
"Response",
"(",
")",
";",
"$",
"responseObject",
"->",
"setRawResponse",
"(",
"$",
"response",
")",
";",
... | Formats the Neo4j Response.
@param $response
@return Response | [
"Formats",
"the",
"Neo4j",
"Response",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Formatter/ResponseFormatter.php#L86-L121 |
187,730 | neoxygen/neo4j-neoclient | src/Formatter/ResponseFormatter.php | ResponseFormatter.extractResults | private function extractResults($resultSet)
{
foreach ($resultSet['results'] as $result) {
foreach ($result['data'] as $data) {
if (isset($data['graph'])) {
foreach ($data['graph']['nodes'] as $node) {
$this->nodesMap[$node['id']] = $no... | php | private function extractResults($resultSet)
{
foreach ($resultSet['results'] as $result) {
foreach ($result['data'] as $data) {
if (isset($data['graph'])) {
foreach ($data['graph']['nodes'] as $node) {
$this->nodesMap[$node['id']] = $no... | [
"private",
"function",
"extractResults",
"(",
"$",
"resultSet",
")",
"{",
"foreach",
"(",
"$",
"resultSet",
"[",
"'results'",
"]",
"as",
"$",
"result",
")",
"{",
"foreach",
"(",
"$",
"result",
"[",
"'data'",
"]",
"as",
"$",
"data",
")",
"{",
"if",
"(... | Extracts the results from the Neo4j Response.
@param $resultSet | [
"Extracts",
"the",
"results",
"from",
"the",
"Neo4j",
"Response",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Formatter/ResponseFormatter.php#L197-L211 |
187,731 | neoxygen/neo4j-neoclient | src/Formatter/ResponseFormatter.php | ResponseFormatter.reset | public function reset()
{
$this->isNew = true;
$this->nodesMap = array();
$this->relationshipsMap = array();
$this->nodesByLabel = array();
$this->result = new Result();
} | php | public function reset()
{
$this->isNew = true;
$this->nodesMap = array();
$this->relationshipsMap = array();
$this->nodesByLabel = array();
$this->result = new Result();
} | [
"public",
"function",
"reset",
"(",
")",
"{",
"$",
"this",
"->",
"isNew",
"=",
"true",
";",
"$",
"this",
"->",
"nodesMap",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"relationshipsMap",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"nodesByL... | Resets the results collections for next Result process. | [
"Resets",
"the",
"results",
"collections",
"for",
"next",
"Result",
"process",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Formatter/ResponseFormatter.php#L384-L391 |
187,732 | neoxygen/neo4j-neoclient | src/Formatter/Node.php | Node.getLabel | public function getLabel()
{
if (empty($this->labels)) {
return;
}
reset($this->labels);
return current($this->labels);
} | php | public function getLabel()
{
if (empty($this->labels)) {
return;
}
reset($this->labels);
return current($this->labels);
} | [
"public",
"function",
"getLabel",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"labels",
")",
")",
"{",
"return",
";",
"}",
"reset",
"(",
"$",
"this",
"->",
"labels",
")",
";",
"return",
"current",
"(",
"$",
"this",
"->",
"labels",
... | Used when only one label is expected.
@return string|null the label of the node | [
"Used",
"when",
"only",
"one",
"label",
"is",
"expected",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Formatter/Node.php#L100-L108 |
187,733 | neoxygen/neo4j-neoclient | src/Formatter/Result.php | Result.getSingleNode | public function getSingleNode($label = null)
{
$nodes = (null === $label) ? $this->getNodes() : $this->getNodesByLabel($label);
$single = current($nodes);
return $single;
} | php | public function getSingleNode($label = null)
{
$nodes = (null === $label) ? $this->getNodes() : $this->getNodesByLabel($label);
$single = current($nodes);
return $single;
} | [
"public",
"function",
"getSingleNode",
"(",
"$",
"label",
"=",
"null",
")",
"{",
"$",
"nodes",
"=",
"(",
"null",
"===",
"$",
"label",
")",
"?",
"$",
"this",
"->",
"getNodes",
"(",
")",
":",
"$",
"this",
"->",
"getNodesByLabel",
"(",
"$",
"label",
"... | Returns a single node from the nodes collection
Use when you do cypher queries returning only one node.
@param string|null $label Return a node for this label only.
@return Node|null | [
"Returns",
"a",
"single",
"node",
"from",
"the",
"nodes",
"collection",
"Use",
"when",
"you",
"do",
"cypher",
"queries",
"returning",
"only",
"one",
"node",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Formatter/Result.php#L99-L105 |
187,734 | neoxygen/neo4j-neoclient | src/Formatter/Result.php | Result.getSingleNodeByLabel | public function getSingleNodeByLabel($label)
{
foreach ($this->nodes as $node) {
if ($node->hasLabel($label)) {
return $node;
}
}
return;
} | php | public function getSingleNodeByLabel($label)
{
foreach ($this->nodes as $node) {
if ($node->hasLabel($label)) {
return $node;
}
}
return;
} | [
"public",
"function",
"getSingleNodeByLabel",
"(",
"$",
"label",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"nodes",
"as",
"$",
"node",
")",
"{",
"if",
"(",
"$",
"node",
"->",
"hasLabel",
"(",
"$",
"label",
")",
")",
"{",
"return",
"$",
"node",
"... | Returns a single node for a given label.
@param string $label The label to match for
@return Node|null The Node or null if not node found matching the label | [
"Returns",
"a",
"single",
"node",
"for",
"a",
"given",
"label",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Formatter/Result.php#L114-L123 |
187,735 | neoxygen/neo4j-neoclient | src/Formatter/Result.php | Result.getNodesByLabel | public function getNodesByLabel($name, $labelizedKeys = false)
{
$collection = array();
foreach ($this->getNodes() as $node) {
if ($node->hasLabel($name)) {
if ($labelizedKeys) {
$collection[$name] = $node;
} else {
... | php | public function getNodesByLabel($name, $labelizedKeys = false)
{
$collection = array();
foreach ($this->getNodes() as $node) {
if ($node->hasLabel($name)) {
if ($labelizedKeys) {
$collection[$name] = $node;
} else {
... | [
"public",
"function",
"getNodesByLabel",
"(",
"$",
"name",
",",
"$",
"labelizedKeys",
"=",
"false",
")",
"{",
"$",
"collection",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getNodes",
"(",
")",
"as",
"$",
"node",
")",
"{",
"if",
... | Returns all nodes with the given label.
@param string $name
@param bool $labelizedKeys When true, the results are indexed by node
label. Assumes only one node per label.
@return Node[] | [
"Returns",
"all",
"nodes",
"with",
"the",
"given",
"label",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Formatter/Result.php#L134-L148 |
187,736 | neoxygen/neo4j-neoclient | src/Formatter/Result.php | Result.getNodesByLabels | public function getNodesByLabels(array $labels = array(), $labelizedKeys = false)
{
$nodes = [];
foreach ($labels as $label) {
$lnodes = $this->getNodesByLabel($label);
foreach ($lnodes as $node) {
if ($labelizedKeys) {
$nodes[$label] = $no... | php | public function getNodesByLabels(array $labels = array(), $labelizedKeys = false)
{
$nodes = [];
foreach ($labels as $label) {
$lnodes = $this->getNodesByLabel($label);
foreach ($lnodes as $node) {
if ($labelizedKeys) {
$nodes[$label] = $no... | [
"public",
"function",
"getNodesByLabels",
"(",
"array",
"$",
"labels",
"=",
"array",
"(",
")",
",",
"$",
"labelizedKeys",
"=",
"false",
")",
"{",
"$",
"nodes",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"labels",
"as",
"$",
"label",
")",
"{",
"$",
"l... | Returns all nodes with the given labels.
@param array $labels
@param bool $labelizedKeys When true, the results are indexed by node
label. Assumes one node per label.
@return Node[] | [
"Returns",
"all",
"nodes",
"with",
"the",
"given",
"labels",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Formatter/Result.php#L159-L174 |
187,737 | neoxygen/neo4j-neoclient | src/Formatter/Result.php | Result.getSingle | public function getSingle($identifier, $default = null)
{
$get = $this->get($identifier, $default);
if (is_array($get)) {
return array_values($this->identifiers[$identifier])[0];
}
return $get;
} | php | public function getSingle($identifier, $default = null)
{
$get = $this->get($identifier, $default);
if (is_array($get)) {
return array_values($this->identifiers[$identifier])[0];
}
return $get;
} | [
"public",
"function",
"getSingle",
"(",
"$",
"identifier",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"get",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"identifier",
",",
"$",
"default",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"get",
")",
... | Returns a single item bound to the given identifier, or the default if
the identifier is not bound.
@param string $identifier
@param mixed $default A value to return if the identifier is not bound.
@return mixed | [
"Returns",
"a",
"single",
"item",
"bound",
"to",
"the",
"given",
"identifier",
"or",
"the",
"default",
"if",
"the",
"identifier",
"is",
"not",
"bound",
"."
] | ecf4bead8cb19d7d527d5b7e59fbac060778ea99 | https://github.com/neoxygen/neo4j-neoclient/blob/ecf4bead8cb19d7d527d5b7e59fbac060778ea99/src/Formatter/Result.php#L278-L286 |
187,738 | codefog/contao-cookiebar | src/Codefog/Cookiebar/EventListener/TemplateListener.php | TemplateListener.onOutputFrontendTemplate | public function onOutputFrontendTemplate($buffer)
{
if (null !== ($rootPage = PageModel::findByPk($GLOBALS['objPage']->rootId)) && $rootPage->cookiebar_enable) {
$generator = new CookiebarGenerator();
$cookiebar = $generator->createTemplate($rootPage->row())->parse();
if... | php | public function onOutputFrontendTemplate($buffer)
{
if (null !== ($rootPage = PageModel::findByPk($GLOBALS['objPage']->rootId)) && $rootPage->cookiebar_enable) {
$generator = new CookiebarGenerator();
$cookiebar = $generator->createTemplate($rootPage->row())->parse();
if... | [
"public",
"function",
"onOutputFrontendTemplate",
"(",
"$",
"buffer",
")",
"{",
"if",
"(",
"null",
"!==",
"(",
"$",
"rootPage",
"=",
"PageModel",
"::",
"findByPk",
"(",
"$",
"GLOBALS",
"[",
"'objPage'",
"]",
"->",
"rootId",
")",
")",
"&&",
"$",
"rootPage... | On output the frontend template.
@param string $buffer
@return string | [
"On",
"output",
"the",
"frontend",
"template",
"."
] | b99d0b8248b58c4d33a5c93cbc231577112c135e | https://github.com/codefog/contao-cookiebar/blob/b99d0b8248b58c4d33a5c93cbc231577112c135e/src/Codefog/Cookiebar/EventListener/TemplateListener.php#L27-L41 |
187,739 | codefog/contao-cookiebar | src/Codefog/Cookiebar/CookiebarGenerator.php | CookiebarGenerator.createTemplate | public function createTemplate(array $data, $name = 'cookiebar')
{
$template = new FrontendTemplate($name);
$this->setBasicData($template, $data);
$this->setMoreLinkData($template, $data);
$this->setAnalyticsCheckboxData($template, $data);
// Cookie name
$template->c... | php | public function createTemplate(array $data, $name = 'cookiebar')
{
$template = new FrontendTemplate($name);
$this->setBasicData($template, $data);
$this->setMoreLinkData($template, $data);
$this->setAnalyticsCheckboxData($template, $data);
// Cookie name
$template->c... | [
"public",
"function",
"createTemplate",
"(",
"array",
"$",
"data",
",",
"$",
"name",
"=",
"'cookiebar'",
")",
"{",
"$",
"template",
"=",
"new",
"FrontendTemplate",
"(",
"$",
"name",
")",
";",
"$",
"this",
"->",
"setBasicData",
"(",
"$",
"template",
",",
... | Create the cookie bar template.
@param array $data
@param string $name
@return FrontendTemplate | [
"Create",
"the",
"cookie",
"bar",
"template",
"."
] | b99d0b8248b58c4d33a5c93cbc231577112c135e | https://github.com/codefog/contao-cookiebar/blob/b99d0b8248b58c4d33a5c93cbc231577112c135e/src/Codefog/Cookiebar/CookiebarGenerator.php#L27-L38 |
187,740 | codefog/contao-cookiebar | src/Codefog/Cookiebar/CookiebarGenerator.php | CookiebarGenerator.setBasicData | private function setBasicData(FrontendTemplate $template, array $data)
{
foreach ($data as $k => $v) {
if (0 === strpos($k, 'cookiebar_')) {
$template->{substr($k, 10)} = $v;
}
}
$template->raw = $data;
} | php | private function setBasicData(FrontendTemplate $template, array $data)
{
foreach ($data as $k => $v) {
if (0 === strpos($k, 'cookiebar_')) {
$template->{substr($k, 10)} = $v;
}
}
$template->raw = $data;
} | [
"private",
"function",
"setBasicData",
"(",
"FrontendTemplate",
"$",
"template",
",",
"array",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"if",
"(",
"0",
"===",
"strpos",
"(",
"$",
"k",
",",
"'cook... | Automatically set all variables with cookiebar_ prefix.
@param FrontendTemplate $template
@param array $data | [
"Automatically",
"set",
"all",
"variables",
"with",
"cookiebar_",
"prefix",
"."
] | b99d0b8248b58c4d33a5c93cbc231577112c135e | https://github.com/codefog/contao-cookiebar/blob/b99d0b8248b58c4d33a5c93cbc231577112c135e/src/Codefog/Cookiebar/CookiebarGenerator.php#L46-L55 |
187,741 | codefog/contao-cookiebar | src/Codefog/Cookiebar/CookiebarGenerator.php | CookiebarGenerator.setMoreLinkData | private function setMoreLinkData(FrontendTemplate $template, array $data)
{
$template->more = null;
if ($data['cookiebar_url']) {
$template->more = [
'label' => $data['cookiebar_link'] ?: $GLOBALS['TL_LANG']['MSC']['cookiebar.more'],
'url' => $data['cooki... | php | private function setMoreLinkData(FrontendTemplate $template, array $data)
{
$template->more = null;
if ($data['cookiebar_url']) {
$template->more = [
'label' => $data['cookiebar_link'] ?: $GLOBALS['TL_LANG']['MSC']['cookiebar.more'],
'url' => $data['cooki... | [
"private",
"function",
"setMoreLinkData",
"(",
"FrontendTemplate",
"$",
"template",
",",
"array",
"$",
"data",
")",
"{",
"$",
"template",
"->",
"more",
"=",
"null",
";",
"if",
"(",
"$",
"data",
"[",
"'cookiebar_url'",
"]",
")",
"{",
"$",
"template",
"->"... | Set the "more" link data.
@param FrontendTemplate $template
@param array $data | [
"Set",
"the",
"more",
"link",
"data",
"."
] | b99d0b8248b58c4d33a5c93cbc231577112c135e | https://github.com/codefog/contao-cookiebar/blob/b99d0b8248b58c4d33a5c93cbc231577112c135e/src/Codefog/Cookiebar/CookiebarGenerator.php#L63-L73 |
187,742 | codefog/contao-cookiebar | src/Codefog/Cookiebar/CookiebarGenerator.php | CookiebarGenerator.setAnalyticsCheckboxData | private function setAnalyticsCheckboxData(FrontendTemplate $template, array $data)
{
$template->analyticsCheckbox = null;
if ($data['cookiebar_analyticsCheckbox']) {
$template->analyticsCheckbox = [
'label' => $data['cookiebar_analyticsLabel'] ?: $GLOBALS['TL_LANG']['MSC... | php | private function setAnalyticsCheckboxData(FrontendTemplate $template, array $data)
{
$template->analyticsCheckbox = null;
if ($data['cookiebar_analyticsCheckbox']) {
$template->analyticsCheckbox = [
'label' => $data['cookiebar_analyticsLabel'] ?: $GLOBALS['TL_LANG']['MSC... | [
"private",
"function",
"setAnalyticsCheckboxData",
"(",
"FrontendTemplate",
"$",
"template",
",",
"array",
"$",
"data",
")",
"{",
"$",
"template",
"->",
"analyticsCheckbox",
"=",
"null",
";",
"if",
"(",
"$",
"data",
"[",
"'cookiebar_analyticsCheckbox'",
"]",
")"... | Set the "analytics" checkbox data.
@param FrontendTemplate $template
@param array $data | [
"Set",
"the",
"analytics",
"checkbox",
"data",
"."
] | b99d0b8248b58c4d33a5c93cbc231577112c135e | https://github.com/codefog/contao-cookiebar/blob/b99d0b8248b58c4d33a5c93cbc231577112c135e/src/Codefog/Cookiebar/CookiebarGenerator.php#L81-L90 |
187,743 | cargomedia/cm | library/CM/Redis/Client.php | CM_Redis_Client.lPush | public function lPush($key, $value) {
try {
$this->_redis->lPush($key, $value);
} catch (Predis\Response\ServerException $e) {
throw new CM_Exception_Invalid('Cannot push key to list.', null, ['key' => $key]);
}
} | php | public function lPush($key, $value) {
try {
$this->_redis->lPush($key, $value);
} catch (Predis\Response\ServerException $e) {
throw new CM_Exception_Invalid('Cannot push key to list.', null, ['key' => $key]);
}
} | [
"public",
"function",
"lPush",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"_redis",
"->",
"lPush",
"(",
"$",
"key",
",",
"$",
"value",
")",
";",
"}",
"catch",
"(",
"Predis",
"\\",
"Response",
"\\",
"ServerException... | Prepend a value to a list
@param string $key
@param string $value
@throws CM_Exception_Invalid | [
"Prepend",
"a",
"value",
"to",
"a",
"list"
] | 33a663056f3088729c9b362780f6706dad9d7ea4 | https://github.com/cargomedia/cm/blob/33a663056f3088729c9b362780f6706dad9d7ea4/library/CM/Redis/Client.php#L130-L136 |
187,744 | cargomedia/cm | library/CM/Redis/Client.php | CM_Redis_Client.lRange | public function lRange($key, $start = null, $stop = null) {
if (null === $start) {
$start = 0;
}
if (null === $stop) {
$stop = -1;
}
return $this->_redis->lRange($key, $start, $stop);
} | php | public function lRange($key, $start = null, $stop = null) {
if (null === $start) {
$start = 0;
}
if (null === $stop) {
$stop = -1;
}
return $this->_redis->lRange($key, $start, $stop);
} | [
"public",
"function",
"lRange",
"(",
"$",
"key",
",",
"$",
"start",
"=",
"null",
",",
"$",
"stop",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"start",
")",
"{",
"$",
"start",
"=",
"0",
";",
"}",
"if",
"(",
"null",
"===",
"$",
"stop... | Return values from list
@param string $key
@param int|null $start
@param int|null $stop
@return array | [
"Return",
"values",
"from",
"list"
] | 33a663056f3088729c9b362780f6706dad9d7ea4 | https://github.com/cargomedia/cm/blob/33a663056f3088729c9b362780f6706dad9d7ea4/library/CM/Redis/Client.php#L171-L179 |
187,745 | cargomedia/cm | library/CM/Redis/Client.php | CM_Redis_Client.sFlush | public function sFlush($key) {
$this->_redis->multi();
$this->_redis->sMembers($key);
$this->_redis->del($key);
return $this->_redis->exec()[0];
} | php | public function sFlush($key) {
$this->_redis->multi();
$this->_redis->sMembers($key);
$this->_redis->del($key);
return $this->_redis->exec()[0];
} | [
"public",
"function",
"sFlush",
"(",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"_redis",
"->",
"multi",
"(",
")",
";",
"$",
"this",
"->",
"_redis",
"->",
"sMembers",
"(",
"$",
"key",
")",
";",
"$",
"this",
"->",
"_redis",
"->",
"del",
"(",
"$",
... | Remove and return all members of a set
@param string $key
@return string[] | [
"Remove",
"and",
"return",
"all",
"members",
"of",
"a",
"set"
] | 33a663056f3088729c9b362780f6706dad9d7ea4 | https://github.com/cargomedia/cm/blob/33a663056f3088729c9b362780f6706dad9d7ea4/library/CM/Redis/Client.php#L318-L323 |
187,746 | cargomedia/cm | library/CM/Paging/Abstract.php | CM_Paging_Abstract.getItemsRaw | public function getItemsRaw() {
$itemsRaw = $this->_getItemsRaw();
if (null !== $this->_pageSize && count($itemsRaw) > $this->_pageSize) {
$itemsRaw = array_slice($itemsRaw, 0, $this->_pageSize);
}
return $itemsRaw;
} | php | public function getItemsRaw() {
$itemsRaw = $this->_getItemsRaw();
if (null !== $this->_pageSize && count($itemsRaw) > $this->_pageSize) {
$itemsRaw = array_slice($itemsRaw, 0, $this->_pageSize);
}
return $itemsRaw;
} | [
"public",
"function",
"getItemsRaw",
"(",
")",
"{",
"$",
"itemsRaw",
"=",
"$",
"this",
"->",
"_getItemsRaw",
"(",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"_pageSize",
"&&",
"count",
"(",
"$",
"itemsRaw",
")",
">",
"$",
"this",
"->",
... | Return Un-processed, un-filtered items
@return array | [
"Return",
"Un",
"-",
"processed",
"un",
"-",
"filtered",
"items"
] | 33a663056f3088729c9b362780f6706dad9d7ea4 | https://github.com/cargomedia/cm/blob/33a663056f3088729c9b362780f6706dad9d7ea4/library/CM/Paging/Abstract.php#L87-L93 |
187,747 | cargomedia/cm | library/CM/Paging/Abstract.php | CM_Paging_Abstract._change | public function _change() {
if (!$this->_source) {
throw new CM_Exception('Cannot change paging without source');
}
$this->_source->clearCache();
$this->_clearItems();
$this->_clearCount();
} | php | public function _change() {
if (!$this->_source) {
throw new CM_Exception('Cannot change paging without source');
}
$this->_source->clearCache();
$this->_clearItems();
$this->_clearCount();
} | [
"public",
"function",
"_change",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_source",
")",
"{",
"throw",
"new",
"CM_Exception",
"(",
"'Cannot change paging without source'",
")",
";",
"}",
"$",
"this",
"->",
"_source",
"->",
"clearCache",
"(",
")",... | Items in the underlying source have changed | [
"Items",
"in",
"the",
"underlying",
"source",
"have",
"changed"
] | 33a663056f3088729c9b362780f6706dad9d7ea4 | https://github.com/cargomedia/cm/blob/33a663056f3088729c9b362780f6706dad9d7ea4/library/CM/Paging/Abstract.php#L282-L289 |
187,748 | cargomedia/cm | library/CM/Model/Entity/Abstract.php | CM_Model_Entity_Abstract.isOwner | final public function isOwner(CM_Model_User $user = null) {
try {
return $this->getUser()->equals($user);
} catch (CM_Exception_Nonexistent $ex) {
return false;
}
} | php | final public function isOwner(CM_Model_User $user = null) {
try {
return $this->getUser()->equals($user);
} catch (CM_Exception_Nonexistent $ex) {
return false;
}
} | [
"final",
"public",
"function",
"isOwner",
"(",
"CM_Model_User",
"$",
"user",
"=",
"null",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"getUser",
"(",
")",
"->",
"equals",
"(",
"$",
"user",
")",
";",
"}",
"catch",
"(",
"CM_Exception_Nonexistent",
... | Checks if a given user is the entity owner
@param CM_Model_User $user OPTIONAL
@return bool | [
"Checks",
"if",
"a",
"given",
"user",
"is",
"the",
"entity",
"owner"
] | 33a663056f3088729c9b362780f6706dad9d7ea4 | https://github.com/cargomedia/cm/blob/33a663056f3088729c9b362780f6706dad9d7ea4/library/CM/Model/Entity/Abstract.php#L41-L47 |
187,749 | cargomedia/cm | library/CM/QueueAdapter/Redis.php | CM_QueueAdapter_Redis.setTtl | public function setTtl($key, $ttl) {
$redis = $this->_getRedisClient();
$redis->expire($this->_getInternalKey($key), $ttl);
} | php | public function setTtl($key, $ttl) {
$redis = $this->_getRedisClient();
$redis->expire($this->_getInternalKey($key), $ttl);
} | [
"public",
"function",
"setTtl",
"(",
"$",
"key",
",",
"$",
"ttl",
")",
"{",
"$",
"redis",
"=",
"$",
"this",
"->",
"_getRedisClient",
"(",
")",
";",
"$",
"redis",
"->",
"expire",
"(",
"$",
"this",
"->",
"_getInternalKey",
"(",
"$",
"key",
")",
",",
... | Updates the time to live of the whole queue, not of single entries
@param string $key
@param int $ttl | [
"Updates",
"the",
"time",
"to",
"live",
"of",
"the",
"whole",
"queue",
"not",
"of",
"single",
"entries"
] | 33a663056f3088729c9b362780f6706dad9d7ea4 | https://github.com/cargomedia/cm/blob/33a663056f3088729c9b362780f6706dad9d7ea4/library/CM/QueueAdapter/Redis.php#L39-L42 |
187,750 | cargomedia/cm | library/CM/Site/SiteFactory.php | CM_Site_SiteFactory.findSiteByType | public function findSiteByType($type) {
$type = (int) $type;
return \Functional\first($this->_getSiteList(), function (CM_Site_Abstract $site) use ($type) {
return $site->getType() === $type;
});
} | php | public function findSiteByType($type) {
$type = (int) $type;
return \Functional\first($this->_getSiteList(), function (CM_Site_Abstract $site) use ($type) {
return $site->getType() === $type;
});
} | [
"public",
"function",
"findSiteByType",
"(",
"$",
"type",
")",
"{",
"$",
"type",
"=",
"(",
"int",
")",
"$",
"type",
";",
"return",
"\\",
"Functional",
"\\",
"first",
"(",
"$",
"this",
"->",
"_getSiteList",
"(",
")",
",",
"function",
"(",
"CM_Site_Abstr... | These 2 method were temporary added till we resolve ambiguity related to splitting siteId and type
especially for models where type is currently stored.
@param int $type
@return CM_Site_Abstract|null
@deprecated use site `id` when it's possible | [
"These",
"2",
"method",
"were",
"temporary",
"added",
"till",
"we",
"resolve",
"ambiguity",
"related",
"to",
"splitting",
"siteId",
"and",
"type",
"especially",
"for",
"models",
"where",
"type",
"is",
"currently",
"stored",
"."
] | 33a663056f3088729c9b362780f6706dad9d7ea4 | https://github.com/cargomedia/cm/blob/33a663056f3088729c9b362780f6706dad9d7ea4/library/CM/Site/SiteFactory.php#L78-L83 |
187,751 | cargomedia/cm | library/CM/WeightedRandom.php | CM_WeightedRandom.lookup | public function lookup() {
$r = mt_rand() / mt_getrandmax() * $this->_weightTotal;
return $this->_values[$this->_binarySearch($r, $this->_lookup)];
} | php | public function lookup() {
$r = mt_rand() / mt_getrandmax() * $this->_weightTotal;
return $this->_values[$this->_binarySearch($r, $this->_lookup)];
} | [
"public",
"function",
"lookup",
"(",
")",
"{",
"$",
"r",
"=",
"mt_rand",
"(",
")",
"/",
"mt_getrandmax",
"(",
")",
"*",
"$",
"this",
"->",
"_weightTotal",
";",
"return",
"$",
"this",
"->",
"_values",
"[",
"$",
"this",
"->",
"_binarySearch",
"(",
"$",... | Randomly select one of the elements based on their weights.
@return mixed Selected element | [
"Randomly",
"select",
"one",
"of",
"the",
"elements",
"based",
"on",
"their",
"weights",
"."
] | 33a663056f3088729c9b362780f6706dad9d7ea4 | https://github.com/cargomedia/cm/blob/33a663056f3088729c9b362780f6706dad9d7ea4/library/CM/WeightedRandom.php#L48-L51 |
187,752 | cargomedia/cm | library/CM/Elasticsearch/Type/Abstract.php | CM_Elasticsearch_Type_Abstract.updateDocuments | public function updateDocuments($ids = null, $useMaintenance = null, $limit = null, $maxDocsPerRequest = self::MAX_DOCS_PER_REQUEST) {
$this->_updateDocuments($this->getIndexName(), $ids, $useMaintenance, $limit, $maxDocsPerRequest);
} | php | public function updateDocuments($ids = null, $useMaintenance = null, $limit = null, $maxDocsPerRequest = self::MAX_DOCS_PER_REQUEST) {
$this->_updateDocuments($this->getIndexName(), $ids, $useMaintenance, $limit, $maxDocsPerRequest);
} | [
"public",
"function",
"updateDocuments",
"(",
"$",
"ids",
"=",
"null",
",",
"$",
"useMaintenance",
"=",
"null",
",",
"$",
"limit",
"=",
"null",
",",
"$",
"maxDocsPerRequest",
"=",
"self",
"::",
"MAX_DOCS_PER_REQUEST",
")",
"{",
"$",
"this",
"->",
"_updateD... | Update the complete index
@param mixed[] $ids Only update given IDs
@param bool|null $useMaintenance Read data from the maintenance database, if any
@param int $limit Limit query
@param int $maxDocsPerRequest Number of docs per bulk-request | [
"Update",
"the",
"complete",
"index"
] | 33a663056f3088729c9b362780f6706dad9d7ea4 | https://github.com/cargomedia/cm/blob/33a663056f3088729c9b362780f6706dad9d7ea4/library/CM/Elasticsearch/Type/Abstract.php#L169-L171 |
187,753 | cargomedia/cm | library/CM/Util.php | CM_Util.var_line | public static function var_line($expression) {
$line = print_r($expression, true);
$line = str_replace(PHP_EOL, ' ', $line);
$line = trim($line);
return $line;
} | php | public static function var_line($expression) {
$line = print_r($expression, true);
$line = str_replace(PHP_EOL, ' ', $line);
$line = trim($line);
return $line;
} | [
"public",
"static",
"function",
"var_line",
"(",
"$",
"expression",
")",
"{",
"$",
"line",
"=",
"print_r",
"(",
"$",
"expression",
",",
"true",
")",
";",
"$",
"line",
"=",
"str_replace",
"(",
"PHP_EOL",
",",
"' '",
",",
"$",
"line",
")",
";",
"$",
... | Return human-readable information on one line about a variable
@param mixed $expression
@return string | [
"Return",
"human",
"-",
"readable",
"information",
"on",
"one",
"line",
"about",
"a",
"variable"
] | 33a663056f3088729c9b362780f6706dad9d7ea4 | https://github.com/cargomedia/cm/blob/33a663056f3088729c9b362780f6706dad9d7ea4/library/CM/Util.php#L26-L31 |
187,754 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Fields/ChoiceType.php | ChoiceType.createChildren | protected function createChildren()
{
$this->children = [];
$this->determineChoiceField();
$fieldType = $this->formHelper->getFieldType($this->choiceType);
switch ($this->choiceType) {
case 'radio':
case 'checkbox':
$this->buildCheckableChild... | php | protected function createChildren()
{
$this->children = [];
$this->determineChoiceField();
$fieldType = $this->formHelper->getFieldType($this->choiceType);
switch ($this->choiceType) {
case 'radio':
case 'checkbox':
$this->buildCheckableChild... | [
"protected",
"function",
"createChildren",
"(",
")",
"{",
"$",
"this",
"->",
"children",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"determineChoiceField",
"(",
")",
";",
"$",
"fieldType",
"=",
"$",
"this",
"->",
"formHelper",
"->",
"getFieldType",
"(",
"$",... | Create children depending on choice type | [
"Create",
"children",
"depending",
"on",
"choice",
"type"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Fields/ChoiceType.php#L66-L82 |
187,755 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Fields/ChoiceType.php | ChoiceType.buildCheckableChildren | protected function buildCheckableChildren($fieldType)
{
$multiple = $this->getOption('multiple') ? '[]' : '';
foreach ((array)$this->options['choices'] as $key => $choice) {
$id = str_replace('.', '_', $this->getNameKey()) . '_' . $key;
$options = $this->formHelper->mergeOpt... | php | protected function buildCheckableChildren($fieldType)
{
$multiple = $this->getOption('multiple') ? '[]' : '';
foreach ((array)$this->options['choices'] as $key => $choice) {
$id = str_replace('.', '_', $this->getNameKey()) . '_' . $key;
$options = $this->formHelper->mergeOpt... | [
"protected",
"function",
"buildCheckableChildren",
"(",
"$",
"fieldType",
")",
"{",
"$",
"multiple",
"=",
"$",
"this",
"->",
"getOption",
"(",
"'multiple'",
")",
"?",
"'[]'",
":",
"''",
";",
"foreach",
"(",
"(",
"array",
")",
"$",
"this",
"->",
"options"... | Build checkable children fields from choice type
@param string $fieldType | [
"Build",
"checkable",
"children",
"fields",
"from",
"choice",
"type"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Fields/ChoiceType.php#L89-L112 |
187,756 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Fields/FormField.php | FormField.getModelValueAttribute | protected function getModelValueAttribute($model, $name)
{
$transformedName = $this->transformKey($name);
if (is_string($model)) {
return $model;
} elseif (is_object($model)) {
return object_get($model, $transformedName);
} elseif (is_array($model)) {
... | php | protected function getModelValueAttribute($model, $name)
{
$transformedName = $this->transformKey($name);
if (is_string($model)) {
return $model;
} elseif (is_object($model)) {
return object_get($model, $transformedName);
} elseif (is_array($model)) {
... | [
"protected",
"function",
"getModelValueAttribute",
"(",
"$",
"model",
",",
"$",
"name",
")",
"{",
"$",
"transformedName",
"=",
"$",
"this",
"->",
"transformKey",
"(",
"$",
"name",
")",
";",
"if",
"(",
"is_string",
"(",
"$",
"model",
")",
")",
"{",
"ret... | Get the attribute value from the model by name
@param mixed $model
@param string $name
@return mixed | [
"Get",
"the",
"attribute",
"value",
"from",
"the",
"model",
"by",
"name"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Fields/FormField.php#L184-L194 |
187,757 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Fields/FormField.php | FormField.prepareOptions | protected function prepareOptions(array $options = [])
{
$helper = $this->formHelper;
if (array_get($this->options, 'template') !== null) {
$this->template = array_pull($this->options, 'template');
}
$options = $helper->mergeOptions($this->options, $options);
i... | php | protected function prepareOptions(array $options = [])
{
$helper = $this->formHelper;
if (array_get($this->options, 'template') !== null) {
$this->template = array_pull($this->options, 'template');
}
$options = $helper->mergeOptions($this->options, $options);
i... | [
"protected",
"function",
"prepareOptions",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"helper",
"=",
"$",
"this",
"->",
"formHelper",
";",
"if",
"(",
"array_get",
"(",
"$",
"this",
"->",
"options",
",",
"'template'",
")",
"!==",
"null"... | Prepare options for rendering
@param array $options
@return array | [
"Prepare",
"options",
"for",
"rendering"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Fields/FormField.php#L213-L251 |
187,758 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Fields/FormField.php | FormField.allDefaults | private function allDefaults()
{
return [
'wrapper' => ['class' => $this->formHelper->getConfig('defaults.wrapper_class')],
'attr' => ['class' => $this->formHelper->getConfig('defaults.field_class')],
'help_block' => ['text' => null, 'tag' => 'p', 'attr' => [
... | php | private function allDefaults()
{
return [
'wrapper' => ['class' => $this->formHelper->getConfig('defaults.wrapper_class')],
'attr' => ['class' => $this->formHelper->getConfig('defaults.field_class')],
'help_block' => ['text' => null, 'tag' => 'p', 'attr' => [
... | [
"private",
"function",
"allDefaults",
"(",
")",
"{",
"return",
"[",
"'wrapper'",
"=>",
"[",
"'class'",
"=>",
"$",
"this",
"->",
"formHelper",
"->",
"getConfig",
"(",
"'defaults.wrapper_class'",
")",
"]",
",",
"'attr'",
"=>",
"[",
"'class'",
"=>",
"$",
"thi... | Defaults used across all fields
@return array | [
"Defaults",
"used",
"across",
"all",
"fields"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Fields/FormField.php#L394-L409 |
187,759 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Fields/FormField.php | FormField.setTemplate | private function setTemplate()
{
$this->template = $this->formHelper->getConfig($this->getTemplate(), $this->getTemplate());
} | php | private function setTemplate()
{
$this->template = $this->formHelper->getConfig($this->getTemplate(), $this->getTemplate());
} | [
"private",
"function",
"setTemplate",
"(",
")",
"{",
"$",
"this",
"->",
"template",
"=",
"$",
"this",
"->",
"formHelper",
"->",
"getConfig",
"(",
"$",
"this",
"->",
"getTemplate",
"(",
")",
",",
"$",
"this",
"->",
"getTemplate",
"(",
")",
")",
";",
"... | Set the template property on the object | [
"Set",
"the",
"template",
"property",
"on",
"the",
"object"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Fields/FormField.php#L449-L452 |
187,760 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Fields/FormField.php | FormField.addErrorClass | protected function addErrorClass(&$options)
{
$errors = $this->formHelper->getRequest()->getSession()->get('errors');
if ($errors && $errors->has($this->getNameKey())) {
$errorClass = $this->formHelper->getConfig('defaults.wrapper_error_class');
if ($options['wrapper'] && !... | php | protected function addErrorClass(&$options)
{
$errors = $this->formHelper->getRequest()->getSession()->get('errors');
if ($errors && $errors->has($this->getNameKey())) {
$errorClass = $this->formHelper->getConfig('defaults.wrapper_error_class');
if ($options['wrapper'] && !... | [
"protected",
"function",
"addErrorClass",
"(",
"&",
"$",
"options",
")",
"{",
"$",
"errors",
"=",
"$",
"this",
"->",
"formHelper",
"->",
"getRequest",
"(",
")",
"->",
"getSession",
"(",
")",
"->",
"get",
"(",
"'errors'",
")",
";",
"if",
"(",
"$",
"er... | Add error class to wrapper if validation errors exist
@param $options | [
"Add",
"error",
"class",
"to",
"wrapper",
"if",
"validation",
"errors",
"exist"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Fields/FormField.php#L459-L472 |
187,761 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Fields/FormField.php | FormField.setDefaultOptions | protected function setDefaultOptions(array $options = [])
{
$this->options = $this->formHelper->mergeOptions($this->allDefaults(), $this->getDefaults());
$this->options = $this->prepareOptions($options);
} | php | protected function setDefaultOptions(array $options = [])
{
$this->options = $this->formHelper->mergeOptions($this->allDefaults(), $this->getDefaults());
$this->options = $this->prepareOptions($options);
} | [
"protected",
"function",
"setDefaultOptions",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"options",
"=",
"$",
"this",
"->",
"formHelper",
"->",
"mergeOptions",
"(",
"$",
"this",
"->",
"allDefaults",
"(",
")",
",",
"$",
"t... | Merge all defaults with field specific defaults and set template if passed
@param array $options | [
"Merge",
"all",
"defaults",
"with",
"field",
"specific",
"defaults",
"and",
"set",
"template",
"if",
"passed"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Fields/FormField.php#L480-L484 |
187,762 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Fields/FormField.php | FormField.needsLabel | protected function needsLabel(array $options = [])
{
// If field is <select> and child of choice, we don't need label for it
$isChildSelect = $this->type == 'select' && array_get($options, 'is_child') === true;
if ($this->type == 'hidden' || $isChildSelect) {
return false;
... | php | protected function needsLabel(array $options = [])
{
// If field is <select> and child of choice, we don't need label for it
$isChildSelect = $this->type == 'select' && array_get($options, 'is_child') === true;
if ($this->type == 'hidden' || $isChildSelect) {
return false;
... | [
"protected",
"function",
"needsLabel",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"// If field is <select> and child of choice, we don't need label for it",
"$",
"isChildSelect",
"=",
"$",
"this",
"->",
"type",
"==",
"'select'",
"&&",
"array_get",
"(",
"... | Check if fields needs label
@param array $options
@return bool | [
"Check",
"if",
"fields",
"needs",
"label"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Fields/FormField.php#L492-L502 |
187,763 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Fields/StaticType.php | StaticType.setupStaticOptions | private function setupStaticOptions(&$options)
{
$options['elemAttrs'] = $this->formHelper->prepareAttributes($this->getOption('attr'));
$options['labelAttrs'] = $this->formHelper->prepareAttributes($this->getOption('label_attr'));
} | php | private function setupStaticOptions(&$options)
{
$options['elemAttrs'] = $this->formHelper->prepareAttributes($this->getOption('attr'));
$options['labelAttrs'] = $this->formHelper->prepareAttributes($this->getOption('label_attr'));
} | [
"private",
"function",
"setupStaticOptions",
"(",
"&",
"$",
"options",
")",
"{",
"$",
"options",
"[",
"'elemAttrs'",
"]",
"=",
"$",
"this",
"->",
"formHelper",
"->",
"prepareAttributes",
"(",
"$",
"this",
"->",
"getOption",
"(",
"'attr'",
")",
")",
";",
... | Setup static field options | [
"Setup",
"static",
"field",
"options"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Fields/StaticType.php#L14-L18 |
187,764 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/FormBuilder.php | FormBuilder.plain | public function plain(array $options = [], array $data = [])
{
return $this->container
->make('Kris\LaravelFormBuilder\Form')
->setFormHelper($this->formHelper)
->setFormBuilder($this)
->setFormOptions($options)
->addData($data);
} | php | public function plain(array $options = [], array $data = [])
{
return $this->container
->make('Kris\LaravelFormBuilder\Form')
->setFormHelper($this->formHelper)
->setFormBuilder($this)
->setFormOptions($options)
->addData($data);
} | [
"public",
"function",
"plain",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"container",
"->",
"make",
"(",
"'Kris\\LaravelFormBuilder\\Form'",
")",
"->",
"setFormHelper",
"... | Get instance of the empty form which can be modified
@param array $options
@param array $data
@return Form | [
"Get",
"instance",
"of",
"the",
"empty",
"form",
"which",
"can",
"be",
"modified"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/FormBuilder.php#L79-L87 |
187,765 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/FormHelper.php | FormHelper.getFieldType | public function getFieldType($type)
{
$types = array_keys(static::$availableFieldTypes);
if (!$type || trim($type) == '') {
throw new \InvalidArgumentException('Field type must be provided.');
}
if (array_key_exists($type, $this->customTypes)) {
return $this... | php | public function getFieldType($type)
{
$types = array_keys(static::$availableFieldTypes);
if (!$type || trim($type) == '') {
throw new \InvalidArgumentException('Field type must be provided.');
}
if (array_key_exists($type, $this->customTypes)) {
return $this... | [
"public",
"function",
"getFieldType",
"(",
"$",
"type",
")",
"{",
"$",
"types",
"=",
"array_keys",
"(",
"static",
"::",
"$",
"availableFieldTypes",
")",
";",
"if",
"(",
"!",
"$",
"type",
"||",
"trim",
"(",
"$",
"type",
")",
"==",
"''",
")",
"{",
"t... | Get proper class for field type
@param $type
@return string | [
"Get",
"proper",
"class",
"for",
"field",
"type"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/FormHelper.php#L133-L158 |
187,766 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/FormHelper.php | FormHelper.addCustomField | public function addCustomField($name, $class)
{
if (!array_key_exists($name, $this->customTypes)) {
return $this->customTypes[$name] = $class;
}
throw new \InvalidArgumentException('Custom field ['.$name.'] already exists on this form object.');
} | php | public function addCustomField($name, $class)
{
if (!array_key_exists($name, $this->customTypes)) {
return $this->customTypes[$name] = $class;
}
throw new \InvalidArgumentException('Custom field ['.$name.'] already exists on this form object.');
} | [
"public",
"function",
"addCustomField",
"(",
"$",
"name",
",",
"$",
"class",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"customTypes",
")",
")",
"{",
"return",
"$",
"this",
"->",
"customTypes",
"[",
"$",
"... | Add custom field
@param $name
@param $class | [
"Add",
"custom",
"field"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/FormHelper.php#L190-L197 |
187,767 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Form.php | Form.makeField | protected function makeField($name, $type = 'text', array $options = [])
{
$this->setupFieldOptions($name, $options);
$fieldName = $this->getFieldName($name);
$fieldType = $this->getFieldType($type);
return new $fieldType($fieldName, $type, $this, $options);
} | php | protected function makeField($name, $type = 'text', array $options = [])
{
$this->setupFieldOptions($name, $options);
$fieldName = $this->getFieldName($name);
$fieldType = $this->getFieldType($type);
return new $fieldType($fieldName, $type, $this, $options);
} | [
"protected",
"function",
"makeField",
"(",
"$",
"name",
",",
"$",
"type",
"=",
"'text'",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"setupFieldOptions",
"(",
"$",
"name",
",",
"$",
"options",
")",
";",
"$",
"fieldName",... | Create the FormField object
@param string $name
@param string $type
@param array $options
@return FormField | [
"Create",
"the",
"FormField",
"object"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Form.php#L116-L125 |
187,768 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Form.php | Form.add | public function add($name, $type = 'text', array $options = [], $modify = false)
{
if (!$name || trim($name) == '') {
throw new \InvalidArgumentException(
'Please provide valid field name for class ['. get_class($this) .']'
);
}
if ($this->rebuilding ... | php | public function add($name, $type = 'text', array $options = [], $modify = false)
{
if (!$name || trim($name) == '') {
throw new \InvalidArgumentException(
'Please provide valid field name for class ['. get_class($this) .']'
);
}
if ($this->rebuilding ... | [
"public",
"function",
"add",
"(",
"$",
"name",
",",
"$",
"type",
"=",
"'text'",
",",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"modify",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"name",
"||",
"trim",
"(",
"$",
"name",
")",
"==",
"... | Create a new field and add it to the form
@param string $name
@param string $type
@param array $options
@param bool $modify
@return $this | [
"Create",
"a",
"new",
"field",
"and",
"add",
"it",
"to",
"the",
"form"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Form.php#L136-L151 |
187,769 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Form.php | Form.addField | protected function addField(FormField $field, $modify = false)
{
if (!$modify && !$this->rebuilding) {
$this->preventDuplicate($field->getRealName());
}
$this->fields[$field->getRealName()] = $field;
return $this;
} | php | protected function addField(FormField $field, $modify = false)
{
if (!$modify && !$this->rebuilding) {
$this->preventDuplicate($field->getRealName());
}
$this->fields[$field->getRealName()] = $field;
return $this;
} | [
"protected",
"function",
"addField",
"(",
"FormField",
"$",
"field",
",",
"$",
"modify",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"modify",
"&&",
"!",
"$",
"this",
"->",
"rebuilding",
")",
"{",
"$",
"this",
"->",
"preventDuplicate",
"(",
"$",
"fi... | Add a FormField to the form's fields
@param FormField $field
@return $this | [
"Add",
"a",
"FormField",
"to",
"the",
"form",
"s",
"fields"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Form.php#L159-L168 |
187,770 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Form.php | Form.compose | public function compose($class, array $options = [], $modify = false)
{
$options['class'] = $class;
// If we pass a ready made form just extract the fields
if ($class instanceof Form) {
$fields = $class->getFields();
} elseif ($class instanceof Fields\ChildFormType) {
... | php | public function compose($class, array $options = [], $modify = false)
{
$options['class'] = $class;
// If we pass a ready made form just extract the fields
if ($class instanceof Form) {
$fields = $class->getFields();
} elseif ($class instanceof Fields\ChildFormType) {
... | [
"public",
"function",
"compose",
"(",
"$",
"class",
",",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"modify",
"=",
"false",
")",
"{",
"$",
"options",
"[",
"'class'",
"]",
"=",
"$",
"class",
";",
"// If we pass a ready made form just extract the fields... | Take another form and add it's fields directly to this form
@param mixed $class Form to merge
@param array $options
@param boolean $modify
@return $this | [
"Take",
"another",
"form",
"and",
"add",
"it",
"s",
"fields",
"directly",
"to",
"this",
"form"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Form.php#L228-L255 |
187,771 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Form.php | Form.remove | public function remove($name)
{
if ($this->has($name)) {
unset($this->fields[$name]);
return $this;
}
throw new \InvalidArgumentException('Field ['.$name.'] does not exist in '.get_class($this));
} | php | public function remove($name)
{
if ($this->has($name)) {
unset($this->fields[$name]);
return $this;
}
throw new \InvalidArgumentException('Field ['.$name.'] does not exist in '.get_class($this));
} | [
"public",
"function",
"remove",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"name",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"fields",
"[",
"$",
"name",
"]",
")",
";",
"return",
"$",
"this",
";",
"}",
"th... | Remove field with specified name from the form
@param $name
@return $this | [
"Remove",
"field",
"with",
"specified",
"name",
"from",
"the",
"form"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Form.php#L263-L271 |
187,772 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Form.php | Form.renderUntil | public function renderUntil($field_name, $showFormEnd = true, $showFields = true)
{
$fields = $this->getUnrenderedFields();
$i = 1;
foreach ($fields as $key => $value) {
if ($value->getRealName() == $field_name) {
break;
}
$i++;
}
... | php | public function renderUntil($field_name, $showFormEnd = true, $showFields = true)
{
$fields = $this->getUnrenderedFields();
$i = 1;
foreach ($fields as $key => $value) {
if ($value->getRealName() == $field_name) {
break;
}
$i++;
}
... | [
"public",
"function",
"renderUntil",
"(",
"$",
"field_name",
",",
"$",
"showFormEnd",
"=",
"true",
",",
"$",
"showFields",
"=",
"true",
")",
"{",
"$",
"fields",
"=",
"$",
"this",
"->",
"getUnrenderedFields",
"(",
")",
";",
"$",
"i",
"=",
"1",
";",
"f... | Renders the rest of the form up until the specified field name
@param string $field_name
@param bool $showFormEnd
@param bool $showFields
@return string | [
"Renders",
"the",
"rest",
"of",
"the",
"form",
"up",
"until",
"the",
"specified",
"field",
"name"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Form.php#L331-L346 |
187,773 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Form.php | Form.getField | public function getField($name)
{
if ($this->has($name)) {
return $this->fields[$name];
}
throw new \InvalidArgumentException(
'Field with name ['. $name .'] does not exist in class '.get_class($this)
);
} | php | public function getField($name)
{
if ($this->has($name)) {
return $this->fields[$name];
}
throw new \InvalidArgumentException(
'Field with name ['. $name .'] does not exist in class '.get_class($this)
);
} | [
"public",
"function",
"getField",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
"this",
"->",
"fields",
"[",
"$",
"name",
"]",
";",
"}",
"throw",
"new",
"\\",
"InvalidArgumentExcept... | Get single field instance from form object
@param $name
@return FormField | [
"Get",
"single",
"field",
"instance",
"from",
"form",
"object"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Form.php#L354-L363 |
187,774 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Form.php | Form.setFormOptions | public function setFormOptions($formOptions)
{
$this->formOptions = $this->formHelper->mergeOptions($this->formOptions, $formOptions);
$this->getModelFromOptions();
$this->getDataFromOptions();
$this->checkIfNamedForm();
return $this;
} | php | public function setFormOptions($formOptions)
{
$this->formOptions = $this->formHelper->mergeOptions($this->formOptions, $formOptions);
$this->getModelFromOptions();
$this->getDataFromOptions();
$this->checkIfNamedForm();
return $this;
} | [
"public",
"function",
"setFormOptions",
"(",
"$",
"formOptions",
")",
"{",
"$",
"this",
"->",
"formOptions",
"=",
"$",
"this",
"->",
"formHelper",
"->",
"mergeOptions",
"(",
"$",
"this",
"->",
"formOptions",
",",
"$",
"formOptions",
")",
";",
"$",
"this",
... | Set form options
@param array $formOptions
@return $this | [
"Set",
"form",
"options"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Form.php#L419-L430 |
187,775 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Form.php | Form.getData | public function getData($name = null, $default = null)
{
if (is_null($name)) {
return $this->data;
}
return array_get($this->data, $name, $default);
} | php | public function getData($name = null, $default = null)
{
if (is_null($name)) {
return $this->data;
}
return array_get($this->data, $name, $default);
} | [
"public",
"function",
"getData",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
"this",
"->",
"data",
";",
"}",
"return",
"array_get",
"(",
"$",
"th... | Get single additional data
@param string $name
@param null $default
@return mixed | [
"Get",
"single",
"additional",
"data"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Form.php#L610-L617 |
187,776 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Form.php | Form.checkIfNamedForm | protected function checkIfNamedForm()
{
if ($this->getFormOption('name')) {
$this->name = array_pull($this->formOptions, 'name', $this->name);
}
} | php | protected function checkIfNamedForm()
{
if ($this->getFormOption('name')) {
$this->name = array_pull($this->formOptions, 'name', $this->name);
}
} | [
"protected",
"function",
"checkIfNamedForm",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getFormOption",
"(",
"'name'",
")",
")",
"{",
"$",
"this",
"->",
"name",
"=",
"array_pull",
"(",
"$",
"this",
"->",
"formOptions",
",",
"'name'",
",",
"$",
"this... | Check if form is named form | [
"Check",
"if",
"form",
"is",
"named",
"form"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Form.php#L729-L734 |
187,777 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Form.php | Form.setupFieldOptions | protected function setupFieldOptions($name, &$options)
{
if (!$this->getName()) {
return;
}
$options['real_name'] = $name;
if (!isset($options['label'])) {
$options['label'] = $this->formHelper->formatLabel($name);
}
} | php | protected function setupFieldOptions($name, &$options)
{
if (!$this->getName()) {
return;
}
$options['real_name'] = $name;
if (!isset($options['label'])) {
$options['label'] = $this->formHelper->formatLabel($name);
}
} | [
"protected",
"function",
"setupFieldOptions",
"(",
"$",
"name",
",",
"&",
"$",
"options",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getName",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"options",
"[",
"'real_name'",
"]",
"=",
"$",
"name",
";"... | Set up options on single field depending on form options
@param string $name
@param $options | [
"Set",
"up",
"options",
"on",
"single",
"field",
"depending",
"on",
"form",
"options"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Form.php#L742-L753 |
187,778 | kristijanhusak/laravel4-form-builder | src/Kris/LaravelFormBuilder/Form.php | Form.setupNamedModel | protected function setupNamedModel()
{
if (!$this->getModel() || !$this->getName()) {
return;
}
$model = $this->formHelper->convertModelToArray($this->getModel());
if (!array_get($model, $this->getName())) {
$this->model = [
$this->getName() ... | php | protected function setupNamedModel()
{
if (!$this->getModel() || !$this->getName()) {
return;
}
$model = $this->formHelper->convertModelToArray($this->getModel());
if (!array_get($model, $this->getName())) {
$this->model = [
$this->getName() ... | [
"protected",
"function",
"setupNamedModel",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getModel",
"(",
")",
"||",
"!",
"$",
"this",
"->",
"getName",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"model",
"=",
"$",
"this",
"->",
"formHelper",... | Set namespace to model if form is named so the data is bound properly | [
"Set",
"namespace",
"to",
"model",
"if",
"form",
"is",
"named",
"so",
"the",
"data",
"is",
"bound",
"properly"
] | 39df12e37608845fe34f48e9f2abcb94edc2547b | https://github.com/kristijanhusak/laravel4-form-builder/blob/39df12e37608845fe34f48e9f2abcb94edc2547b/src/Kris/LaravelFormBuilder/Form.php#L768-L781 |
187,779 | laravel-notification-channels/facebook | src/FacebookMessage.php | FacebookMessage.text | public function text($text)
{
if (mb_strlen($text) > 320) {
throw CouldNotCreateMessage::textTooLong();
}
$this->text = $text;
$this->hasText = true;
return $this;
} | php | public function text($text)
{
if (mb_strlen($text) > 320) {
throw CouldNotCreateMessage::textTooLong();
}
$this->text = $text;
$this->hasText = true;
return $this;
} | [
"public",
"function",
"text",
"(",
"$",
"text",
")",
"{",
"if",
"(",
"mb_strlen",
"(",
"$",
"text",
")",
">",
"320",
")",
"{",
"throw",
"CouldNotCreateMessage",
"::",
"textTooLong",
"(",
")",
";",
"}",
"$",
"this",
"->",
"text",
"=",
"$",
"text",
"... | Notification text.
@param $text
@throws CouldNotCreateMessage
@return $this | [
"Notification",
"text",
"."
] | 033aaa9782c93146a60c4243cd1440d80202526c | https://github.com/laravel-notification-channels/facebook/blob/033aaa9782c93146a60c4243cd1440d80202526c/src/FacebookMessage.php#L88-L98 |
187,780 | laravel-notification-channels/facebook | src/FacebookMessage.php | FacebookMessage.attach | public function attach($attachmentType, $url)
{
$attachmentTypes = [
AttachmentType::FILE,
AttachmentType::IMAGE,
AttachmentType::VIDEO,
AttachmentType::AUDIO,
];
if (! in_array($attachmentType, $attachmentTypes)) {
throw CouldNotC... | php | public function attach($attachmentType, $url)
{
$attachmentTypes = [
AttachmentType::FILE,
AttachmentType::IMAGE,
AttachmentType::VIDEO,
AttachmentType::AUDIO,
];
if (! in_array($attachmentType, $attachmentTypes)) {
throw CouldNotC... | [
"public",
"function",
"attach",
"(",
"$",
"attachmentType",
",",
"$",
"url",
")",
"{",
"$",
"attachmentTypes",
"=",
"[",
"AttachmentType",
"::",
"FILE",
",",
"AttachmentType",
"::",
"IMAGE",
",",
"AttachmentType",
"::",
"VIDEO",
",",
"AttachmentType",
"::",
... | Add Attachment.
@param $attachmentType
@param $url
@throws CouldNotCreateMessage
@return $this | [
"Add",
"Attachment",
"."
] | 033aaa9782c93146a60c4243cd1440d80202526c | https://github.com/laravel-notification-channels/facebook/blob/033aaa9782c93146a60c4243cd1440d80202526c/src/FacebookMessage.php#L110-L132 |
187,781 | laravel-notification-channels/facebook | src/FacebookMessage.php | FacebookMessage.cards | public function cards(array $cards = [])
{
if (count($cards) > 10) {
throw CouldNotCreateMessage::messageCardsLimitExceeded();
}
$this->cards = $cards;
return $this;
} | php | public function cards(array $cards = [])
{
if (count($cards) > 10) {
throw CouldNotCreateMessage::messageCardsLimitExceeded();
}
$this->cards = $cards;
return $this;
} | [
"public",
"function",
"cards",
"(",
"array",
"$",
"cards",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"cards",
")",
">",
"10",
")",
"{",
"throw",
"CouldNotCreateMessage",
"::",
"messageCardsLimitExceeded",
"(",
")",
";",
"}",
"$",
"this",
... | Add up to 10 cards to be displayed in a carousel.
@param array $cards
@return $this
@throws CouldNotCreateMessage | [
"Add",
"up",
"to",
"10",
"cards",
"to",
"be",
"displayed",
"in",
"a",
"carousel",
"."
] | 033aaa9782c93146a60c4243cd1440d80202526c | https://github.com/laravel-notification-channels/facebook/blob/033aaa9782c93146a60c4243cd1440d80202526c/src/FacebookMessage.php#L156-L165 |
187,782 | laravel-notification-channels/facebook | src/FacebookMessage.php | FacebookMessage.toArray | public function toArray()
{
if ($this->hasAttachment) {
return $this->attachmentMessageToArray();
}
if ($this->hasText) {
//check if has buttons
if (count($this->buttons) > 0) {
return $this->buttonMessageToArray();
}
... | php | public function toArray()
{
if ($this->hasAttachment) {
return $this->attachmentMessageToArray();
}
if ($this->hasText) {
//check if has buttons
if (count($this->buttons) > 0) {
return $this->buttonMessageToArray();
}
... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasAttachment",
")",
"{",
"return",
"$",
"this",
"->",
"attachmentMessageToArray",
"(",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"hasText",
")",
"{",
"//check if has butto... | Returns message payload for JSON conversion.
@throws CouldNotCreateMessage
@return array | [
"Returns",
"message",
"payload",
"for",
"JSON",
"conversion",
"."
] | 033aaa9782c93146a60c4243cd1440d80202526c | https://github.com/laravel-notification-channels/facebook/blob/033aaa9782c93146a60c4243cd1440d80202526c/src/FacebookMessage.php#L193-L213 |
187,783 | laravel-notification-channels/facebook | src/FacebookMessage.php | FacebookMessage.textMessageToArray | protected function textMessageToArray()
{
$message = [];
$message['recipient'] = $this->recipient;
$message['notification_type'] = $this->notificationType;
$message['message']['text'] = $this->text;
return $message;
} | php | protected function textMessageToArray()
{
$message = [];
$message['recipient'] = $this->recipient;
$message['notification_type'] = $this->notificationType;
$message['message']['text'] = $this->text;
return $message;
} | [
"protected",
"function",
"textMessageToArray",
"(",
")",
"{",
"$",
"message",
"=",
"[",
"]",
";",
"$",
"message",
"[",
"'recipient'",
"]",
"=",
"$",
"this",
"->",
"recipient",
";",
"$",
"message",
"[",
"'notification_type'",
"]",
"=",
"$",
"this",
"->",
... | Returns message for simple text message.
@return array | [
"Returns",
"message",
"for",
"simple",
"text",
"message",
"."
] | 033aaa9782c93146a60c4243cd1440d80202526c | https://github.com/laravel-notification-channels/facebook/blob/033aaa9782c93146a60c4243cd1440d80202526c/src/FacebookMessage.php#L220-L228 |
187,784 | laravel-notification-channels/facebook | src/FacebookMessage.php | FacebookMessage.attachmentMessageToArray | protected function attachmentMessageToArray()
{
$message = [];
$message['recipient'] = $this->recipient;
$message['notification_type'] = $this->notificationType;
$message['message']['attachment']['type'] = $this->attachmentType;
$message['message']['attachment']['payload']['u... | php | protected function attachmentMessageToArray()
{
$message = [];
$message['recipient'] = $this->recipient;
$message['notification_type'] = $this->notificationType;
$message['message']['attachment']['type'] = $this->attachmentType;
$message['message']['attachment']['payload']['u... | [
"protected",
"function",
"attachmentMessageToArray",
"(",
")",
"{",
"$",
"message",
"=",
"[",
"]",
";",
"$",
"message",
"[",
"'recipient'",
"]",
"=",
"$",
"this",
"->",
"recipient",
";",
"$",
"message",
"[",
"'notification_type'",
"]",
"=",
"$",
"this",
... | Returns message for attachment message.
@return array | [
"Returns",
"message",
"for",
"attachment",
"message",
"."
] | 033aaa9782c93146a60c4243cd1440d80202526c | https://github.com/laravel-notification-channels/facebook/blob/033aaa9782c93146a60c4243cd1440d80202526c/src/FacebookMessage.php#L235-L244 |
187,785 | laravel-notification-channels/facebook | src/FacebookMessage.php | FacebookMessage.genericMessageToArray | protected function genericMessageToArray()
{
$message = [];
$message['recipient'] = $this->recipient;
$message['notification_type'] = $this->notificationType;
$message['message']['attachment']['type'] = 'template';
$message['message']['attachment']['payload']['template_type']... | php | protected function genericMessageToArray()
{
$message = [];
$message['recipient'] = $this->recipient;
$message['notification_type'] = $this->notificationType;
$message['message']['attachment']['type'] = 'template';
$message['message']['attachment']['payload']['template_type']... | [
"protected",
"function",
"genericMessageToArray",
"(",
")",
"{",
"$",
"message",
"=",
"[",
"]",
";",
"$",
"message",
"[",
"'recipient'",
"]",
"=",
"$",
"this",
"->",
"recipient",
";",
"$",
"message",
"[",
"'notification_type'",
"]",
"=",
"$",
"this",
"->... | Returns message for Generic Template message.
@return array | [
"Returns",
"message",
"for",
"Generic",
"Template",
"message",
"."
] | 033aaa9782c93146a60c4243cd1440d80202526c | https://github.com/laravel-notification-channels/facebook/blob/033aaa9782c93146a60c4243cd1440d80202526c/src/FacebookMessage.php#L251-L261 |
187,786 | laravel-notification-channels/facebook | src/FacebookMessage.php | FacebookMessage.buttonMessageToArray | protected function buttonMessageToArray()
{
$message = [];
$message['recipient'] = $this->recipient;
$message['notification_type'] = $this->notificationType;
$message['message']['attachment']['type'] = 'template';
$message['message']['attachment']['payload']['template_type'] ... | php | protected function buttonMessageToArray()
{
$message = [];
$message['recipient'] = $this->recipient;
$message['notification_type'] = $this->notificationType;
$message['message']['attachment']['type'] = 'template';
$message['message']['attachment']['payload']['template_type'] ... | [
"protected",
"function",
"buttonMessageToArray",
"(",
")",
"{",
"$",
"message",
"=",
"[",
"]",
";",
"$",
"message",
"[",
"'recipient'",
"]",
"=",
"$",
"this",
"->",
"recipient",
";",
"$",
"message",
"[",
"'notification_type'",
"]",
"=",
"$",
"this",
"->"... | Returns message for Button Template message.
@return array | [
"Returns",
"message",
"for",
"Button",
"Template",
"message",
"."
] | 033aaa9782c93146a60c4243cd1440d80202526c | https://github.com/laravel-notification-channels/facebook/blob/033aaa9782c93146a60c4243cd1440d80202526c/src/FacebookMessage.php#L268-L279 |
187,787 | laravel-notification-channels/facebook | src/Components/Button.php | Button.url | public function url($url)
{
if ($this->isNotSetOrEmpty($url)) {
throw CouldNotCreateButton::urlNotProvided();
} elseif (! filter_var($url, FILTER_VALIDATE_URL)) {
throw CouldNotCreateButton::invalidUrlProvided($url);
}
$this->payload['url'] = $url;
$t... | php | public function url($url)
{
if ($this->isNotSetOrEmpty($url)) {
throw CouldNotCreateButton::urlNotProvided();
} elseif (! filter_var($url, FILTER_VALIDATE_URL)) {
throw CouldNotCreateButton::invalidUrlProvided($url);
}
$this->payload['url'] = $url;
$t... | [
"public",
"function",
"url",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isNotSetOrEmpty",
"(",
"$",
"url",
")",
")",
"{",
"throw",
"CouldNotCreateButton",
"::",
"urlNotProvided",
"(",
")",
";",
"}",
"elseif",
"(",
"!",
"filter_var",
"(",... | Set a URL for the button.
@param $url
@return $this
@throws CouldNotCreateButton | [
"Set",
"a",
"URL",
"for",
"the",
"button",
"."
] | 033aaa9782c93146a60c4243cd1440d80202526c | https://github.com/laravel-notification-channels/facebook/blob/033aaa9782c93146a60c4243cd1440d80202526c/src/Components/Button.php#L79-L91 |
187,788 | laravel-notification-channels/facebook | src/Components/Button.php | Button.makePayload | protected function makePayload($data)
{
if ($this->isNotSetOrEmpty($data)) {
return $this;
}
switch ($this->payload['type']) {
case ButtonType::WEB_URL:
$this->url($data);
break;
case ButtonType::PHONE_NUMBER:
... | php | protected function makePayload($data)
{
if ($this->isNotSetOrEmpty($data)) {
return $this;
}
switch ($this->payload['type']) {
case ButtonType::WEB_URL:
$this->url($data);
break;
case ButtonType::PHONE_NUMBER:
... | [
"protected",
"function",
"makePayload",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isNotSetOrEmpty",
"(",
"$",
"data",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"switch",
"(",
"$",
"this",
"->",
"payload",
"[",
"'type'",
"]",
... | Make payload by data and type.
@param mixed $data
@return $this
@throws CouldNotCreateButton | [
"Make",
"payload",
"by",
"data",
"and",
"type",
"."
] | 033aaa9782c93146a60c4243cd1440d80202526c | https://github.com/laravel-notification-channels/facebook/blob/033aaa9782c93146a60c4243cd1440d80202526c/src/Components/Button.php#L203-L226 |
187,789 | laravel-notification-channels/facebook | src/Components/Button.php | Button.toArray | public function toArray()
{
$this->title($this->title);
$this->makePayload($this->data);
return $this->payload;
} | php | public function toArray()
{
$this->title($this->title);
$this->makePayload($this->data);
return $this->payload;
} | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"this",
"->",
"title",
"(",
"$",
"this",
"->",
"title",
")",
";",
"$",
"this",
"->",
"makePayload",
"(",
"$",
"this",
"->",
"data",
")",
";",
"return",
"$",
"this",
"->",
"payload",
";",
"}"
] | Builds payload and returns an array.
@return array
@throws CouldNotCreateButton | [
"Builds",
"payload",
"and",
"returns",
"an",
"array",
"."
] | 033aaa9782c93146a60c4243cd1440d80202526c | https://github.com/laravel-notification-channels/facebook/blob/033aaa9782c93146a60c4243cd1440d80202526c/src/Components/Button.php#L234-L240 |
187,790 | laravel-notification-channels/facebook | src/Traits/HasButtons.php | HasButtons.buttons | public function buttons(array $buttons = [])
{
if (count($buttons) > 3) {
throw CouldNotCreateMessage::messageButtonsLimitExceeded();
}
$this->buttons = $buttons;
return $this;
} | php | public function buttons(array $buttons = [])
{
if (count($buttons) > 3) {
throw CouldNotCreateMessage::messageButtonsLimitExceeded();
}
$this->buttons = $buttons;
return $this;
} | [
"public",
"function",
"buttons",
"(",
"array",
"$",
"buttons",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"buttons",
")",
">",
"3",
")",
"{",
"throw",
"CouldNotCreateMessage",
"::",
"messageButtonsLimitExceeded",
"(",
")",
";",
"}",
"$",
"t... | Add up to 3 call to action buttons.
@param array $buttons
@return $this
@throws CouldNotCreateMessage | [
"Add",
"up",
"to",
"3",
"call",
"to",
"action",
"buttons",
"."
] | 033aaa9782c93146a60c4243cd1440d80202526c | https://github.com/laravel-notification-channels/facebook/blob/033aaa9782c93146a60c4243cd1440d80202526c/src/Traits/HasButtons.php#L20-L29 |
187,791 | laravel-notification-channels/facebook | src/Components/Card.php | Card.subtitle | public function subtitle($subtitle)
{
if (mb_strlen($subtitle) > 80) {
throw CouldNotCreateCard::subtitleLimitExceeded($subtitle);
}
$this->payload['subtitle'] = $subtitle;
return $this;
} | php | public function subtitle($subtitle)
{
if (mb_strlen($subtitle) > 80) {
throw CouldNotCreateCard::subtitleLimitExceeded($subtitle);
}
$this->payload['subtitle'] = $subtitle;
return $this;
} | [
"public",
"function",
"subtitle",
"(",
"$",
"subtitle",
")",
"{",
"if",
"(",
"mb_strlen",
"(",
"$",
"subtitle",
")",
">",
"80",
")",
"{",
"throw",
"CouldNotCreateCard",
"::",
"subtitleLimitExceeded",
"(",
"$",
"subtitle",
")",
";",
"}",
"$",
"this",
"->"... | Set Card Subtitle.
@param $subtitle
@throws CouldNotCreateCard
@return $this | [
"Set",
"Card",
"Subtitle",
"."
] | 033aaa9782c93146a60c4243cd1440d80202526c | https://github.com/laravel-notification-channels/facebook/blob/033aaa9782c93146a60c4243cd1440d80202526c/src/Components/Card.php#L96-L105 |
187,792 | laravel-notification-channels/facebook | src/Components/Card.php | Card.toArray | public function toArray()
{
if (! isset($this->payload['title'])) {
throw CouldNotCreateCard::titleNotProvided();
}
if (count($this->buttons) > 0) {
$this->payload['buttons'] = $this->buttons;
}
return $this->payload;
} | php | public function toArray()
{
if (! isset($this->payload['title'])) {
throw CouldNotCreateCard::titleNotProvided();
}
if (count($this->buttons) > 0) {
$this->payload['buttons'] = $this->buttons;
}
return $this->payload;
} | [
"public",
"function",
"toArray",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"payload",
"[",
"'title'",
"]",
")",
")",
"{",
"throw",
"CouldNotCreateCard",
"::",
"titleNotProvided",
"(",
")",
";",
"}",
"if",
"(",
"count",
"(",
"$",... | Returns a payload for API request.
@return array
@throws CouldNotCreateCard | [
"Returns",
"a",
"payload",
"for",
"API",
"request",
"."
] | 033aaa9782c93146a60c4243cd1440d80202526c | https://github.com/laravel-notification-channels/facebook/blob/033aaa9782c93146a60c4243cd1440d80202526c/src/Components/Card.php#L113-L124 |
187,793 | lexik/LexikPayboxBundle | Paybox/DirectPlus/ParameterResolver.php | ParameterResolver.normalize | protected function normalize(array $parameters)
{
foreach ($parameters as $parameter => $value) {
if (null !== $this->knownParameters[$parameter]) {
$parameters[$parameter] = sprintf($this->knownParameters[$parameter], $value);
}
}
return $parameters;... | php | protected function normalize(array $parameters)
{
foreach ($parameters as $parameter => $value) {
if (null !== $this->knownParameters[$parameter]) {
$parameters[$parameter] = sprintf($this->knownParameters[$parameter], $value);
}
}
return $parameters;... | [
"protected",
"function",
"normalize",
"(",
"array",
"$",
"parameters",
")",
"{",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"parameter",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"knownParameters",
"[",
"$",
"parameter... | Normalizes parameters depending on Paybox's 6.2 parameters specifications.
@param array $parameters
@return array | [
"Normalizes",
"parameters",
"depending",
"on",
"Paybox",
"s",
"6",
".",
"2",
"parameters",
"specifications",
"."
] | ffa35cc2753e69d8b3151aecc5e5b9199fd9c2ac | https://github.com/lexik/LexikPayboxBundle/blob/ffa35cc2753e69d8b3151aecc5e5b9199fd9c2ac/Paybox/DirectPlus/ParameterResolver.php#L188-L197 |
187,794 | lexik/LexikPayboxBundle | Listener/SampleIpnListener.php | SampleIpnListener.onPayboxIpnResponse | public function onPayboxIpnResponse(PayboxResponseEvent $event)
{
$path = sprintf('%s/../data/%s', $this->rootDir, date('Y\/m\/d\/'));
$this->filesystem->mkdir($path);
$content = sprintf('Signature verification : %s%s', $event->isVerified() ? 'OK' : 'KO', PHP_EOL);
foreach ($event->... | php | public function onPayboxIpnResponse(PayboxResponseEvent $event)
{
$path = sprintf('%s/../data/%s', $this->rootDir, date('Y\/m\/d\/'));
$this->filesystem->mkdir($path);
$content = sprintf('Signature verification : %s%s', $event->isVerified() ? 'OK' : 'KO', PHP_EOL);
foreach ($event->... | [
"public",
"function",
"onPayboxIpnResponse",
"(",
"PayboxResponseEvent",
"$",
"event",
")",
"{",
"$",
"path",
"=",
"sprintf",
"(",
"'%s/../data/%s'",
",",
"$",
"this",
"->",
"rootDir",
",",
"date",
"(",
"'Y\\/m\\/d\\/'",
")",
")",
";",
"$",
"this",
"->",
"... | Creates a txt file containing all parameters for each IPN.
@param PayboxResponseEvent $event | [
"Creates",
"a",
"txt",
"file",
"containing",
"all",
"parameters",
"for",
"each",
"IPN",
"."
] | ffa35cc2753e69d8b3151aecc5e5b9199fd9c2ac | https://github.com/lexik/LexikPayboxBundle/blob/ffa35cc2753e69d8b3151aecc5e5b9199fd9c2ac/Listener/SampleIpnListener.php#L42-L56 |
187,795 | lexik/LexikPayboxBundle | Paybox/AbstractRequest.php | AbstractRequest.stringifyParameters | protected function stringifyParameters()
{
if (isset($this->parameters['PBX_HMAC'])) {
unset($this->parameters['PBX_HMAC']);
}
ksort($this->parameters);
return Tools::stringify($this->parameters);
} | php | protected function stringifyParameters()
{
if (isset($this->parameters['PBX_HMAC'])) {
unset($this->parameters['PBX_HMAC']);
}
ksort($this->parameters);
return Tools::stringify($this->parameters);
} | [
"protected",
"function",
"stringifyParameters",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"parameters",
"[",
"'PBX_HMAC'",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"parameters",
"[",
"'PBX_HMAC'",
"]",
")",
";",
"}",
"ksort... | Returns all parameters as a querystring.
@return string | [
"Returns",
"all",
"parameters",
"as",
"a",
"querystring",
"."
] | ffa35cc2753e69d8b3151aecc5e5b9199fd9c2ac | https://github.com/lexik/LexikPayboxBundle/blob/ffa35cc2753e69d8b3151aecc5e5b9199fd9c2ac/Paybox/AbstractRequest.php#L103-L112 |
187,796 | lexik/LexikPayboxBundle | Paybox/AbstractRequest.php | AbstractRequest.computeHmac | protected function computeHmac()
{
$binKey = pack('H*', $this->globals['hmac_key']);
return hash_hmac($this->globals['hmac_algorithm'], $this->stringifyParameters(), $binKey);
} | php | protected function computeHmac()
{
$binKey = pack('H*', $this->globals['hmac_key']);
return hash_hmac($this->globals['hmac_algorithm'], $this->stringifyParameters(), $binKey);
} | [
"protected",
"function",
"computeHmac",
"(",
")",
"{",
"$",
"binKey",
"=",
"pack",
"(",
"'H*'",
",",
"$",
"this",
"->",
"globals",
"[",
"'hmac_key'",
"]",
")",
";",
"return",
"hash_hmac",
"(",
"$",
"this",
"->",
"globals",
"[",
"'hmac_algorithm'",
"]",
... | Computes the hmac hash.
@return string | [
"Computes",
"the",
"hmac",
"hash",
"."
] | ffa35cc2753e69d8b3151aecc5e5b9199fd9c2ac | https://github.com/lexik/LexikPayboxBundle/blob/ffa35cc2753e69d8b3151aecc5e5b9199fd9c2ac/Paybox/AbstractRequest.php#L119-L124 |
187,797 | lexik/LexikPayboxBundle | Paybox/AbstractRequest.php | AbstractRequest.getServer | protected function getServer()
{
$servers = array();
if (isset($this->globals['production']) && (true === $this->globals['production'])) {
$servers[] = $this->servers['primary'];
$servers[] = $this->servers['secondary'];
} else {
$servers[] = $this->serve... | php | protected function getServer()
{
$servers = array();
if (isset($this->globals['production']) && (true === $this->globals['production'])) {
$servers[] = $this->servers['primary'];
$servers[] = $this->servers['secondary'];
} else {
$servers[] = $this->serve... | [
"protected",
"function",
"getServer",
"(",
")",
"{",
"$",
"servers",
"=",
"array",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"globals",
"[",
"'production'",
"]",
")",
"&&",
"(",
"true",
"===",
"$",
"this",
"->",
"globals",
"[",
"'p... | Returns the url of an available server.
@return array
@throws InvalidArgumentException If the specified environment is not valid (dev/prod).
@throws RuntimeException If no server is available. | [
"Returns",
"the",
"url",
"of",
"an",
"available",
"server",
"."
] | ffa35cc2753e69d8b3151aecc5e5b9199fd9c2ac | https://github.com/lexik/LexikPayboxBundle/blob/ffa35cc2753e69d8b3151aecc5e5b9199fd9c2ac/Paybox/AbstractRequest.php#L134-L161 |
187,798 | lexik/LexikPayboxBundle | Paybox/AbstractRequest.php | AbstractRequest.getWebPage | protected function getWebPage($url)
{
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
$output... | php | protected function getWebPage($url)
{
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
$output... | [
"protected",
"function",
"getWebPage",
"(",
"$",
"url",
")",
"{",
"$",
"curl",
"=",
"curl_init",
"(",
")",
";",
"curl_setopt",
"(",
"$",
"curl",
",",
"CURLOPT_URL",
",",
"$",
"url",
")",
";",
"curl_setopt",
"(",
"$",
"curl",
",",
"CURLOPT_RETURNTRANSFER"... | Returns the content of a web resource.
@param string $url
@return string | [
"Returns",
"the",
"content",
"of",
"a",
"web",
"resource",
"."
] | ffa35cc2753e69d8b3151aecc5e5b9199fd9c2ac | https://github.com/lexik/LexikPayboxBundle/blob/ffa35cc2753e69d8b3151aecc5e5b9199fd9c2ac/Paybox/AbstractRequest.php#L170-L182 |
187,799 | lexik/LexikPayboxBundle | Controller/SampleController.php | SampleController.indexAction | public function indexAction()
{
$paybox = $this->get('lexik_paybox.request_handler');
$paybox->setParameters(array(
'PBX_CMD' => 'CMD'.time(),
'PBX_DEVISE' => '978',
'PBX_PORTEUR' => 'test@paybox.com',
'PBX_RETOUR' => 'Mt:M;Re... | php | public function indexAction()
{
$paybox = $this->get('lexik_paybox.request_handler');
$paybox->setParameters(array(
'PBX_CMD' => 'CMD'.time(),
'PBX_DEVISE' => '978',
'PBX_PORTEUR' => 'test@paybox.com',
'PBX_RETOUR' => 'Mt:M;Re... | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"$",
"paybox",
"=",
"$",
"this",
"->",
"get",
"(",
"'lexik_paybox.request_handler'",
")",
";",
"$",
"paybox",
"->",
"setParameters",
"(",
"array",
"(",
"'PBX_CMD'",
"=>",
"'CMD'",
".",
"time",
"(",
")",
... | Index action creates the form for a payment call.
@return Response | [
"Index",
"action",
"creates",
"the",
"form",
"for",
"a",
"payment",
"call",
"."
] | ffa35cc2753e69d8b3151aecc5e5b9199fd9c2ac | https://github.com/lexik/LexikPayboxBundle/blob/ffa35cc2753e69d8b3151aecc5e5b9199fd9c2ac/Controller/SampleController.php#L25-L50 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.