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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
222,900 | meysampg/intldate | IntlDateTrait.php | IntlDateTrait.parseDateTime | private function parseDateTime($datetimeArray)
{
$finalDatetimeArray = [];
if (!is_array($datetimeArray)) {
throw new Exception('DateTime information must be an array in [year, month, day, hours, minutes, seconds] format.');
}
$finalDatetimeArray[0] = isset($datetimeArr... | php | private function parseDateTime($datetimeArray)
{
$finalDatetimeArray = [];
if (!is_array($datetimeArray)) {
throw new Exception('DateTime information must be an array in [year, month, day, hours, minutes, seconds] format.');
}
$finalDatetimeArray[0] = isset($datetimeArr... | [
"private",
"function",
"parseDateTime",
"(",
"$",
"datetimeArray",
")",
"{",
"$",
"finalDatetimeArray",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"datetimeArray",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'DateTime information must be a... | Parse DateTime information array to be in correct format.
@param array $datetimeArray array contains information of DateTime in
`year, month, day, hour, minute, day` order. This parameter can be a
either associative or non-associative array. For the former, keys must
be compitiable with http://php.net/manual/en/functi... | [
"Parse",
"DateTime",
"information",
"array",
"to",
"be",
"in",
"correct",
"format",
"."
] | cb5abc65562f6151520f640480d14cc9a31c18e0 | https://github.com/meysampg/intldate/blob/cb5abc65562f6151520f640480d14cc9a31c18e0/IntlDateTrait.php#L617-L633 |
222,901 | sgpatil/oriquent | src/Sgpatil/Orientdb/Connection.php | Connection.createConnection | public function createConnection() {
// below code is used to create connection usinf Orientdb
$client = new OriClient($this->getHost(), $this->getPort(), $this->getDatabase());
$client->getTransport()->setAuth($this->getUsername(), $this->getPassword());
return $client;
} | php | public function createConnection() {
// below code is used to create connection usinf Orientdb
$client = new OriClient($this->getHost(), $this->getPort(), $this->getDatabase());
$client->getTransport()->setAuth($this->getUsername(), $this->getPassword());
return $client;
} | [
"public",
"function",
"createConnection",
"(",
")",
"{",
"// below code is used to create connection usinf Orientdb",
"$",
"client",
"=",
"new",
"OriClient",
"(",
"$",
"this",
"->",
"getHost",
"(",
")",
",",
"$",
"this",
"->",
"getPort",
"(",
")",
",",
"$",
"t... | Create a new Orientdb client
@return | [
"Create",
"a",
"new",
"Orientdb",
"client"
] | cf0f2ba688496260946f569a20c351e91f287c32 | https://github.com/sgpatil/oriquent/blob/cf0f2ba688496260946f569a20c351e91f287c32/src/Sgpatil/Orientdb/Connection.php#L73-L78 |
222,902 | sgpatil/oriquent | src/Sgpatil/Orientdb/Connection.php | Connection.getBatchQuery | public function getBatchQuery($query, array $bindings) {
return new BatchQuery($this->getClient(), $query, $this->prepareBindings($bindings));
} | php | public function getBatchQuery($query, array $bindings) {
return new BatchQuery($this->getClient(), $query, $this->prepareBindings($bindings));
} | [
"public",
"function",
"getBatchQuery",
"(",
"$",
"query",
",",
"array",
"$",
"bindings",
")",
"{",
"return",
"new",
"BatchQuery",
"(",
"$",
"this",
"->",
"getClient",
"(",
")",
",",
"$",
"query",
",",
"$",
"this",
"->",
"prepareBindings",
"(",
"$",
"bi... | Make a query out of a Batch statement
and the bindings values
@param string $query
@param array $bindings | [
"Make",
"a",
"query",
"out",
"of",
"a",
"Batch",
"statement",
"and",
"the",
"bindings",
"values"
] | cf0f2ba688496260946f569a20c351e91f287c32 | https://github.com/sgpatil/oriquent/blob/cf0f2ba688496260946f569a20c351e91f287c32/src/Sgpatil/Orientdb/Connection.php#L260-L262 |
222,903 | sgpatil/oriquent | src/Sgpatil/Orientdb/Connection.php | Connection.table | public function table($table) {
$query = new Builder($this, $this->getQueryGrammar());
return $query->from($table);
} | php | public function table($table) {
$query = new Builder($this, $this->getQueryGrammar());
return $query->from($table);
} | [
"public",
"function",
"table",
"(",
"$",
"table",
")",
"{",
"$",
"query",
"=",
"new",
"Builder",
"(",
"$",
"this",
",",
"$",
"this",
"->",
"getQueryGrammar",
"(",
")",
")",
";",
"return",
"$",
"query",
"->",
"from",
"(",
"$",
"table",
")",
";",
"... | Begin a fluent query against a database table.
In Orientdb's terminologies this is a node.
@param string $table
@return \Sgpatil\Orientdb\Query\Builder | [
"Begin",
"a",
"fluent",
"query",
"against",
"a",
"database",
"table",
".",
"In",
"Orientdb",
"s",
"terminologies",
"this",
"is",
"a",
"node",
"."
] | cf0f2ba688496260946f569a20c351e91f287c32 | https://github.com/sgpatil/oriquent/blob/cf0f2ba688496260946f569a20c351e91f287c32/src/Sgpatil/Orientdb/Connection.php#L421-L425 |
222,904 | sgpatil/oriquent | src/Sgpatil/Orientdb/Connection.php | Connection.run | protected function run($query, $bindings, Closure $callback) {
$start = microtime(true);
// To execute the statement, we'll simply call the callback, which will actually
// run the Cypher against the Orientdb connection. Then we can calculate the time it
// took to execute and log the q... | php | protected function run($query, $bindings, Closure $callback) {
$start = microtime(true);
// To execute the statement, we'll simply call the callback, which will actually
// run the Cypher against the Orientdb connection. Then we can calculate the time it
// took to execute and log the q... | [
"protected",
"function",
"run",
"(",
"$",
"query",
",",
"$",
"bindings",
",",
"Closure",
"$",
"callback",
")",
"{",
"$",
"start",
"=",
"microtime",
"(",
"true",
")",
";",
"// To execute the statement, we'll simply call the callback, which will actually",
"// run the C... | Run a Cypher statement and log its execution context.
@param string $query
@param array $bindings
@param Closure $callback
@return mixed
@throws QueryException | [
"Run",
"a",
"Cypher",
"statement",
"and",
"log",
"its",
"execution",
"context",
"."
] | cf0f2ba688496260946f569a20c351e91f287c32 | https://github.com/sgpatil/oriquent/blob/cf0f2ba688496260946f569a20c351e91f287c32/src/Sgpatil/Orientdb/Connection.php#L437-L462 |
222,905 | ajfranzoia/cakephp-mailgun | Lib/Network/Email/MailgunTransport.php | MailgunTransport.send | public function send(CakeEmail $email) {
if (Configure::read('Mailgun.preventManyToRecipients') !== false && count($email->to()) > 1) {
throw new Exception('More than one "to" recipient not allowed (set Mailgun.preventManyToRecipients = false to disable check)');
}
$mgClient = new M... | php | public function send(CakeEmail $email) {
if (Configure::read('Mailgun.preventManyToRecipients') !== false && count($email->to()) > 1) {
throw new Exception('More than one "to" recipient not allowed (set Mailgun.preventManyToRecipients = false to disable check)');
}
$mgClient = new M... | [
"public",
"function",
"send",
"(",
"CakeEmail",
"$",
"email",
")",
"{",
"if",
"(",
"Configure",
"::",
"read",
"(",
"'Mailgun.preventManyToRecipients'",
")",
"!==",
"false",
"&&",
"count",
"(",
"$",
"email",
"->",
"to",
"(",
")",
")",
">",
"1",
")",
"{"... | Send email via Mailgun
@param CakeEmail $email
@return array
@throws Exception | [
"Send",
"email",
"via",
"Mailgun"
] | 0393f9a12e9a1f71181d6d68f2105a433cbc041d | https://github.com/ajfranzoia/cakephp-mailgun/blob/0393f9a12e9a1f71181d6d68f2105a433cbc041d/Lib/Network/Email/MailgunTransport.php#L80-L114 |
222,906 | digiaonline/lumen-dynamodb | src/Console/DeleteTablesCommand.php | DeleteTablesCommand.deleteTables | protected function deleteTables()
{
if (empty( self::$tables )) {
throw new \Exception('Cannot delete tables, as no configuration file given, or the ::$tables is not overridden.');
}
$client = $this->dynamoDb->getClient();
$defaultAnswer = $this->input->getOption(... | php | protected function deleteTables()
{
if (empty( self::$tables )) {
throw new \Exception('Cannot delete tables, as no configuration file given, or the ::$tables is not overridden.');
}
$client = $this->dynamoDb->getClient();
$defaultAnswer = $this->input->getOption(... | [
"protected",
"function",
"deleteTables",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"self",
"::",
"$",
"tables",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Cannot delete tables, as no configuration file given, or the ::$tables is not overridden.'",
")",
";"... | Deletes the tables defined in configuration file, or overridden.
@throws \Exception | [
"Deletes",
"the",
"tables",
"defined",
"in",
"configuration",
"file",
"or",
"overridden",
"."
] | d29edefbe461af0bc902037e397cc8586a2ec87c | https://github.com/digiaonline/lumen-dynamodb/blob/d29edefbe461af0bc902037e397cc8586a2ec87c/src/Console/DeleteTablesCommand.php#L61-L97 |
222,907 | sgpatil/oriquent | src/Sgpatil/Orientdb/Query/Grammars/CypherGrammar.php | CypherGrammar.compileEdge | public function compileEdge(Builder $query, $parent, $related, $relationship = 'E', $values = [])
{
// Essentially we will force every insert to be treated as a batch insert which
// simply makes creating the SQL easier for us since we can utilize the same
// basic routine regardless of an a... | php | public function compileEdge(Builder $query, $parent, $related, $relationship = 'E', $values = [])
{
// Essentially we will force every insert to be treated as a batch insert which
// simply makes creating the SQL easier for us since we can utilize the same
// basic routine regardless of an a... | [
"public",
"function",
"compileEdge",
"(",
"Builder",
"$",
"query",
",",
"$",
"parent",
",",
"$",
"related",
",",
"$",
"relationship",
"=",
"'E'",
",",
"$",
"values",
"=",
"[",
"]",
")",
"{",
"// Essentially we will force every insert to be treated as a batch inser... | Compile an Edge statement into SQL.
@param \Illuminate\Database\Query\Builder $query
@param array $values
@return string | [
"Compile",
"an",
"Edge",
"statement",
"into",
"SQL",
"."
] | cf0f2ba688496260946f569a20c351e91f287c32 | https://github.com/sgpatil/oriquent/blob/cf0f2ba688496260946f569a20c351e91f287c32/src/Sgpatil/Orientdb/Query/Grammars/CypherGrammar.php#L735-L756 |
222,908 | coderity/wallet | src/Billable.php | Billable.addCard | public function addCard($params, $setAsDefault = false)
{
if (is_array($params)) {
$result = $this->generateToken($params);
if ($result['status'] === 'error') {
return $result;
}
$token = $result['token'];
} else {
$token ... | php | public function addCard($params, $setAsDefault = false)
{
if (is_array($params)) {
$result = $this->generateToken($params);
if ($result['status'] === 'error') {
return $result;
}
$token = $result['token'];
} else {
$token ... | [
"public",
"function",
"addCard",
"(",
"$",
"params",
",",
"$",
"setAsDefault",
"=",
"false",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"params",
")",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"generateToken",
"(",
"$",
"params",
")",
";",
"... | Adds a card
@param mixed Either an array of params as per the generateToken method or simply a token
@param bool $setAsDefault
@return array | [
"Adds",
"a",
"card"
] | 9b64a12f3679379be10353d134d687abec464013 | https://github.com/coderity/wallet/blob/9b64a12f3679379be10353d134d687abec464013/src/Billable.php#L18-L66 |
222,909 | coderity/wallet | src/Billable.php | Billable.deleteCard | public function deleteCard($cardId)
{
if (!$this->stripe_id) {
return [
'status' => 'error',
'message' => 'Invalid StripeId'
];
}
try {
$stripe = new Stripe(Billable::getStripeKey());
$card = $stripe->cards()
... | php | public function deleteCard($cardId)
{
if (!$this->stripe_id) {
return [
'status' => 'error',
'message' => 'Invalid StripeId'
];
}
try {
$stripe = new Stripe(Billable::getStripeKey());
$card = $stripe->cards()
... | [
"public",
"function",
"deleteCard",
"(",
"$",
"cardId",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"stripe_id",
")",
"{",
"return",
"[",
"'status'",
"=>",
"'error'",
",",
"'message'",
"=>",
"'Invalid StripeId'",
"]",
";",
"}",
"try",
"{",
"$",
"strip... | Deletes a card
@param string $cardId
@return array | [
"Deletes",
"a",
"card"
] | 9b64a12f3679379be10353d134d687abec464013 | https://github.com/coderity/wallet/blob/9b64a12f3679379be10353d134d687abec464013/src/Billable.php#L106-L131 |
222,910 | coderity/wallet | src/Billable.php | Billable.generateToken | public function generateToken(array $params)
{
$stripe = new Stripe(Billable::getStripeKey());
try {
$attributes = [
'card' => [
'number' => $params['cardNumber'],
'exp_month' => $params['expiryMonth'],
'cvc'... | php | public function generateToken(array $params)
{
$stripe = new Stripe(Billable::getStripeKey());
try {
$attributes = [
'card' => [
'number' => $params['cardNumber'],
'exp_month' => $params['expiryMonth'],
'cvc'... | [
"public",
"function",
"generateToken",
"(",
"array",
"$",
"params",
")",
"{",
"$",
"stripe",
"=",
"new",
"Stripe",
"(",
"Billable",
"::",
"getStripeKey",
"(",
")",
")",
";",
"try",
"{",
"$",
"attributes",
"=",
"[",
"'card'",
"=>",
"[",
"'number'",
"=>"... | Generates a Stripe Token
@param array $params Expects: cardNumber, expiryMonth, expiryYear, cvc
@return array | [
"Generates",
"a",
"Stripe",
"Token"
] | 9b64a12f3679379be10353d134d687abec464013 | https://github.com/coderity/wallet/blob/9b64a12f3679379be10353d134d687abec464013/src/Billable.php#L138-L164 |
222,911 | coderity/wallet | src/Billable.php | Billable.getCard | public function getCard($cardId)
{
if (!$this->stripe_id) {
return null;
}
$customer = $this->asStripeCustomer();
foreach ($customer->sources->data as $card) {
if ($card->id === $cardId) {
return $card;
}
}
return... | php | public function getCard($cardId)
{
if (!$this->stripe_id) {
return null;
}
$customer = $this->asStripeCustomer();
foreach ($customer->sources->data as $card) {
if ($card->id === $cardId) {
return $card;
}
}
return... | [
"public",
"function",
"getCard",
"(",
"$",
"cardId",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"stripe_id",
")",
"{",
"return",
"null",
";",
"}",
"$",
"customer",
"=",
"$",
"this",
"->",
"asStripeCustomer",
"(",
")",
";",
"foreach",
"(",
"$",
"c... | Gets a card
@param string $cardId
@return Laravel\Cashier\Stripe\Card | [
"Gets",
"a",
"card"
] | 9b64a12f3679379be10353d134d687abec464013 | https://github.com/coderity/wallet/blob/9b64a12f3679379be10353d134d687abec464013/src/Billable.php#L171-L186 |
222,912 | coderity/wallet | src/Billable.php | Billable.getDefaultCard | public function getDefaultCard()
{
if (!$this->stripe_id) {
return null;
}
$customer = $this->asStripeCustomer();
foreach ($customer->sources->data as $card) {
if ($card->id === $customer->default_source) {
return $card;
}
... | php | public function getDefaultCard()
{
if (!$this->stripe_id) {
return null;
}
$customer = $this->asStripeCustomer();
foreach ($customer->sources->data as $card) {
if ($card->id === $customer->default_source) {
return $card;
}
... | [
"public",
"function",
"getDefaultCard",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"stripe_id",
")",
"{",
"return",
"null",
";",
"}",
"$",
"customer",
"=",
"$",
"this",
"->",
"asStripeCustomer",
"(",
")",
";",
"foreach",
"(",
"$",
"customer",
... | Returns the default card
@return Laravel\Cashier\Stripe\Card | [
"Returns",
"the",
"default",
"card"
] | 9b64a12f3679379be10353d134d687abec464013 | https://github.com/coderity/wallet/blob/9b64a12f3679379be10353d134d687abec464013/src/Billable.php#L192-L207 |
222,913 | coderity/wallet | src/Billable.php | Billable.getStripeId | public function getStripeId()
{
if ($this->stripe_id) {
return $this->stripe_id;
}
$customer = $this->createAsStripeCustomer(null);
return $customer->id;
} | php | public function getStripeId()
{
if ($this->stripe_id) {
return $this->stripe_id;
}
$customer = $this->createAsStripeCustomer(null);
return $customer->id;
} | [
"public",
"function",
"getStripeId",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"stripe_id",
")",
"{",
"return",
"$",
"this",
"->",
"stripe_id",
";",
"}",
"$",
"customer",
"=",
"$",
"this",
"->",
"createAsStripeCustomer",
"(",
"null",
")",
";",
"retu... | Gets a users stripeId
Or generates a new one if the user doesn't have one
@return string | [
"Gets",
"a",
"users",
"stripeId",
"Or",
"generates",
"a",
"new",
"one",
"if",
"the",
"user",
"doesn",
"t",
"have",
"one"
] | 9b64a12f3679379be10353d134d687abec464013 | https://github.com/coderity/wallet/blob/9b64a12f3679379be10353d134d687abec464013/src/Billable.php#L214-L223 |
222,914 | coderity/wallet | src/Billable.php | Billable.updateDefaultCard | public function updateDefaultCard($cardId)
{
// first lets update the default source for the stripe customer
$customer = $this->asStripeCustomer();
$customer->default_source = $cardId;
$result = $customer->save();
// now lets update the users default card
$card = $th... | php | public function updateDefaultCard($cardId)
{
// first lets update the default source for the stripe customer
$customer = $this->asStripeCustomer();
$customer->default_source = $cardId;
$result = $customer->save();
// now lets update the users default card
$card = $th... | [
"public",
"function",
"updateDefaultCard",
"(",
"$",
"cardId",
")",
"{",
"// first lets update the default source for the stripe customer",
"$",
"customer",
"=",
"$",
"this",
"->",
"asStripeCustomer",
"(",
")",
";",
"$",
"customer",
"->",
"default_source",
"=",
"$",
... | Updates the default card
@param string $cardId The cardId to update to the default card
@return $this | [
"Updates",
"the",
"default",
"card"
] | 9b64a12f3679379be10353d134d687abec464013 | https://github.com/coderity/wallet/blob/9b64a12f3679379be10353d134d687abec464013/src/Billable.php#L242-L258 |
222,915 | corneltek/FormKit | src/Widget/TextareaInput.php | TextareaInput.render | public function render($attributes = null)
{
if($attributes)
$this->setAttributes( $attributes );
return '<textarea'
. $this->renderAttributes()
. '>'
. htmlspecialchars($this->value, ENT_NOQUOTES, 'UTF-8')
. '</textarea>';
} | php | public function render($attributes = null)
{
if($attributes)
$this->setAttributes( $attributes );
return '<textarea'
. $this->renderAttributes()
. '>'
. htmlspecialchars($this->value, ENT_NOQUOTES, 'UTF-8')
. '</textarea>';
} | [
"public",
"function",
"render",
"(",
"$",
"attributes",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"attributes",
")",
"$",
"this",
"->",
"setAttributes",
"(",
"$",
"attributes",
")",
";",
"return",
"'<textarea'",
".",
"$",
"this",
"->",
"renderAttributes",
"... | Render Widget with attributes
@param array $attributes
@param string HTML string | [
"Render",
"Widget",
"with",
"attributes"
] | c8963d494b8bd7d7f63928002057db86e5873c26 | https://github.com/corneltek/FormKit/blob/c8963d494b8bd7d7f63928002057db86e5873c26/src/Widget/TextareaInput.php#L16-L26 |
222,916 | joomla-framework/image | src/Image.php | Image.getImageFileProperties | public static function getImageFileProperties($path)
{
// Make sure the file exists.
if (!file_exists($path))
{
throw new \InvalidArgumentException('The image file does not exist.');
}
// Get the image file information.
$info = getimagesize($path);
if (!$info)
{
// @codeCoverageIgnoreStart
t... | php | public static function getImageFileProperties($path)
{
// Make sure the file exists.
if (!file_exists($path))
{
throw new \InvalidArgumentException('The image file does not exist.');
}
// Get the image file information.
$info = getimagesize($path);
if (!$info)
{
// @codeCoverageIgnoreStart
t... | [
"public",
"static",
"function",
"getImageFileProperties",
"(",
"$",
"path",
")",
"{",
"// Make sure the file exists.",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The image file does not ex... | Method to return a properties object for an image given a filesystem path.
The result object has values for image width, height, type, attributes, mime type, bits, and channels.
@param string $path The filesystem path to the image for which to get properties.
@return \stdClass
@since 1.0
@throws \InvalidArg... | [
"Method",
"to",
"return",
"a",
"properties",
"object",
"for",
"an",
"image",
"given",
"a",
"filesystem",
"path",
"."
] | f393328f2fae287991afb554e3bc3146c5da0ffc | https://github.com/joomla-framework/image/blob/f393328f2fae287991afb554e3bc3146c5da0ffc/src/Image.php#L213-L246 |
222,917 | joomla-framework/image | src/Image.php | Image.getOrientationString | private static function getOrientationString($width, $height)
{
switch (true)
{
case $width > $height :
return self::ORIENTATION_LANDSCAPE;
case $width < $height :
return self::ORIENTATION_PORTRAIT;
default:
return self::ORIENTATION_SQUARE;
}
} | php | private static function getOrientationString($width, $height)
{
switch (true)
{
case $width > $height :
return self::ORIENTATION_LANDSCAPE;
case $width < $height :
return self::ORIENTATION_PORTRAIT;
default:
return self::ORIENTATION_SQUARE;
}
} | [
"private",
"static",
"function",
"getOrientationString",
"(",
"$",
"width",
",",
"$",
"height",
")",
"{",
"switch",
"(",
"true",
")",
"{",
"case",
"$",
"width",
">",
"$",
"height",
":",
"return",
"self",
"::",
"ORIENTATION_LANDSCAPE",
";",
"case",
"$",
"... | Compare width and height integers to determine image orientation.
@param integer $width The width value to use for calculation
@param integer $height The height value to use for calculation
@return string Orientation string
@since 1.2.0 | [
"Compare",
"width",
"and",
"height",
"integers",
"to",
"determine",
"image",
"orientation",
"."
] | f393328f2fae287991afb554e3bc3146c5da0ffc | https://github.com/joomla-framework/image/blob/f393328f2fae287991afb554e3bc3146c5da0ffc/src/Image.php#L275-L288 |
222,918 | joomla-framework/image | src/Image.php | Image.createThumbs | public function createThumbs($thumbSizes, $creationMethod = self::SCALE_INSIDE, $thumbsFolder = null)
{
// Make sure the resource handle is valid.
if (!$this->isLoaded())
{
throw new \LogicException('No valid image was loaded.');
}
// No thumbFolder set -> we will create a thumbs folder in the current im... | php | public function createThumbs($thumbSizes, $creationMethod = self::SCALE_INSIDE, $thumbsFolder = null)
{
// Make sure the resource handle is valid.
if (!$this->isLoaded())
{
throw new \LogicException('No valid image was loaded.');
}
// No thumbFolder set -> we will create a thumbs folder in the current im... | [
"public",
"function",
"createThumbs",
"(",
"$",
"thumbSizes",
",",
"$",
"creationMethod",
"=",
"self",
"::",
"SCALE_INSIDE",
",",
"$",
"thumbsFolder",
"=",
"null",
")",
"{",
"// Make sure the resource handle is valid.",
"if",
"(",
"!",
"$",
"this",
"->",
"isLoad... | Method to create thumbnails from the current image and save them to disk. It allows creation by resizing
or cropping the original image.
@param mixed $thumbSizes string or array of strings. Example: $thumbSizes = array('150x75','250x150');
@param integer $creationMethod 1-3 resize $scaleMethod | 4 create... | [
"Method",
"to",
"create",
"thumbnails",
"from",
"the",
"current",
"image",
"and",
"save",
"them",
"to",
"disk",
".",
"It",
"allows",
"creation",
"by",
"resizing",
"or",
"cropping",
"the",
"original",
"image",
"."
] | f393328f2fae287991afb554e3bc3146c5da0ffc | https://github.com/joomla-framework/image/blob/f393328f2fae287991afb554e3bc3146c5da0ffc/src/Image.php#L377-L429 |
222,919 | joomla-framework/image | src/Image.php | Image.loadFile | public function loadFile($path)
{
// Destroy the current image handle if it exists
$this->destroy();
// Make sure the file exists.
if (!file_exists($path))
{
throw new \InvalidArgumentException('The image file does not exist.');
}
// Get the image properties.
$properties = static::getImageFileProp... | php | public function loadFile($path)
{
// Destroy the current image handle if it exists
$this->destroy();
// Make sure the file exists.
if (!file_exists($path))
{
throw new \InvalidArgumentException('The image file does not exist.');
}
// Get the image properties.
$properties = static::getImageFileProp... | [
"public",
"function",
"loadFile",
"(",
"$",
"path",
")",
"{",
"// Destroy the current image handle if it exists",
"$",
"this",
"->",
"destroy",
"(",
")",
";",
"// Make sure the file exists.",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
"throw... | Method to load a file into the Image object as the resource.
@param string $path The filesystem path to load as an image.
@return void
@since 1.0
@throws \InvalidArgumentException
@throws \RuntimeException | [
"Method",
"to",
"load",
"a",
"file",
"into",
"the",
"Image",
"object",
"as",
"the",
"resource",
"."
] | f393328f2fae287991afb554e3bc3146c5da0ffc | https://github.com/joomla-framework/image/blob/f393328f2fae287991afb554e3bc3146c5da0ffc/src/Image.php#L624-L730 |
222,920 | joomla-framework/image | src/Image.php | Image.cropResize | public function cropResize($width, $height, $createNew = true)
{
$width = $this->sanitizeWidth($width, $height);
$height = $this->sanitizeHeight($height, $width);
$resizewidth = $width;
$resizeheight = $height;
if (($this->getWidth() / $width) < ($this->getHeight() / $height))
{
$resizeheight = 0;... | php | public function cropResize($width, $height, $createNew = true)
{
$width = $this->sanitizeWidth($width, $height);
$height = $this->sanitizeHeight($height, $width);
$resizewidth = $width;
$resizeheight = $height;
if (($this->getWidth() / $width) < ($this->getHeight() / $height))
{
$resizeheight = 0;... | [
"public",
"function",
"cropResize",
"(",
"$",
"width",
",",
"$",
"height",
",",
"$",
"createNew",
"=",
"true",
")",
"{",
"$",
"width",
"=",
"$",
"this",
"->",
"sanitizeWidth",
"(",
"$",
"width",
",",
"$",
"height",
")",
";",
"$",
"height",
"=",
"$"... | Method to crop an image after resizing it to maintain
proportions without having to do all the set up work.
@param integer $width The desired width of the image in pixels or a percentage.
@param integer $height The desired height of the image in pixels or a percentage.
@param integer $createNew If t... | [
"Method",
"to",
"crop",
"an",
"image",
"after",
"resizing",
"it",
"to",
"maintain",
"proportions",
"without",
"having",
"to",
"do",
"all",
"the",
"set",
"up",
"work",
"."
] | f393328f2fae287991afb554e3bc3146c5da0ffc | https://github.com/joomla-framework/image/blob/f393328f2fae287991afb554e3bc3146c5da0ffc/src/Image.php#L858-L876 |
222,921 | joomla-framework/image | src/Image.php | Image.flip | public function flip($mode, $createNew = true)
{
// Create the new truecolor image handle.
$handle = imagecreatetruecolor($this->getWidth(), $this->getHeight());
// Copy the image
imagecopy($handle, $this->getHandle(), 0, 0, 0, 0, $this->getWidth(), $this->getHeight());
// Flip the image
if (!imageflip($... | php | public function flip($mode, $createNew = true)
{
// Create the new truecolor image handle.
$handle = imagecreatetruecolor($this->getWidth(), $this->getHeight());
// Copy the image
imagecopy($handle, $this->getHandle(), 0, 0, 0, 0, $this->getWidth(), $this->getHeight());
// Flip the image
if (!imageflip($... | [
"public",
"function",
"flip",
"(",
"$",
"mode",
",",
"$",
"createNew",
"=",
"true",
")",
"{",
"// Create the new truecolor image handle.",
"$",
"handle",
"=",
"imagecreatetruecolor",
"(",
"$",
"this",
"->",
"getWidth",
"(",
")",
",",
"$",
"this",
"->",
"getH... | Method to flip the current image.
@param integer $mode The flip mode for flipping the image {@link https://www.php.net/imageflip#refsect1-function.imageflip-parameters}
@param boolean $createNew If true the current image will be cloned, flipped and returned; else
the current image will be flipped and retu... | [
"Method",
"to",
"flip",
"the",
"current",
"image",
"."
] | f393328f2fae287991afb554e3bc3146c5da0ffc | https://github.com/joomla-framework/image/blob/f393328f2fae287991afb554e3bc3146c5da0ffc/src/Image.php#L944-L974 |
222,922 | joomla-framework/image | src/Image.php | Image.watermark | public function watermark(Image $watermark, $transparency = 50, $bottomMargin = 0, $rightMargin = 0)
{
imagecopymerge(
$this->getHandle(),
$watermark->getHandle(),
$this->getWidth() - $watermark->getWidth() - $rightMargin,
$this->getHeight() - $watermark->getHeight() - $bottomMargin,
0,
0,
$wate... | php | public function watermark(Image $watermark, $transparency = 50, $bottomMargin = 0, $rightMargin = 0)
{
imagecopymerge(
$this->getHandle(),
$watermark->getHandle(),
$this->getWidth() - $watermark->getWidth() - $rightMargin,
$this->getHeight() - $watermark->getHeight() - $bottomMargin,
0,
0,
$wate... | [
"public",
"function",
"watermark",
"(",
"Image",
"$",
"watermark",
",",
"$",
"transparency",
"=",
"50",
",",
"$",
"bottomMargin",
"=",
"0",
",",
"$",
"rightMargin",
"=",
"0",
")",
"{",
"imagecopymerge",
"(",
"$",
"this",
"->",
"getHandle",
"(",
")",
",... | Watermark the image
@param Image $watermark The Image object containing the watermark graphic
@param integer $transparency The transparency to use for the watermark graphic
@param integer $bottomMargin The margin from the bottom of this image
@param integer $rightMargin The margin from the right ... | [
"Watermark",
"the",
"image"
] | f393328f2fae287991afb554e3bc3146c5da0ffc | https://github.com/joomla-framework/image/blob/f393328f2fae287991afb554e3bc3146c5da0ffc/src/Image.php#L989-L1004 |
222,923 | joomla-framework/image | src/Image.php | Image.sanitizeWidth | protected function sanitizeWidth($width, $height)
{
// If no width was given we will assume it is a square and use the height.
$width = ($width === null) ? $height : $width;
// If we were given a percentage, calculate the integer value.
if (preg_match('/^[0-9]+(\.[0-9]+)?\%$/', $width))
{
$width = (int) ... | php | protected function sanitizeWidth($width, $height)
{
// If no width was given we will assume it is a square and use the height.
$width = ($width === null) ? $height : $width;
// If we were given a percentage, calculate the integer value.
if (preg_match('/^[0-9]+(\.[0-9]+)?\%$/', $width))
{
$width = (int) ... | [
"protected",
"function",
"sanitizeWidth",
"(",
"$",
"width",
",",
"$",
"height",
")",
"{",
"// If no width was given we will assume it is a square and use the height.",
"$",
"width",
"=",
"(",
"$",
"width",
"===",
"null",
")",
"?",
"$",
"height",
":",
"$",
"width"... | Method to sanitize a width value.
@param mixed $width The input width value to sanitize.
@param mixed $height The input height value for reference.
@return integer
@since 1.0 | [
"Method",
"to",
"sanitize",
"a",
"width",
"value",
"."
] | f393328f2fae287991afb554e3bc3146c5da0ffc | https://github.com/joomla-framework/image/blob/f393328f2fae287991afb554e3bc3146c5da0ffc/src/Image.php#L1183-L1200 |
222,924 | awakenweb/livedocx | src/Document.php | Document.getAvailableFormats | public function getAvailableFormats()
{
try {
$ret = array();
$result = $this->getSoapClient()->GetDocumentFormats();
if ( isset($result->GetDocumentFormatsResult->string) ) {
$ret = $result->GetDocumentFormatsResult->string;
$ret = arra... | php | public function getAvailableFormats()
{
try {
$ret = array();
$result = $this->getSoapClient()->GetDocumentFormats();
if ( isset($result->GetDocumentFormatsResult->string) ) {
$ret = $result->GetDocumentFormatsResult->string;
$ret = arra... | [
"public",
"function",
"getAvailableFormats",
"(",
")",
"{",
"try",
"{",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"GetDocumentFormats",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$"... | Return a list of all available return formats you can ask for when generating the
document
@return array
@throws StatusException | [
"Return",
"a",
"list",
"of",
"all",
"available",
"return",
"formats",
"you",
"can",
"ask",
"for",
"when",
"generating",
"the",
"document"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Document.php#L85-L99 |
222,925 | awakenweb/livedocx | src/Document.php | Document.setPassword | public function setPassword($password)
{
try {
$this->getSoapClient()->SetDocumentPassword(array(
'password' => $password ,
));
return $this;
} catch ( SoapException $ex ) {
throw new PasswordException('Error while setting a password f... | php | public function setPassword($password)
{
try {
$this->getSoapClient()->SetDocumentPassword(array(
'password' => $password ,
));
return $this;
} catch ( SoapException $ex ) {
throw new PasswordException('Error while setting a password f... | [
"public",
"function",
"setPassword",
"(",
"$",
"password",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"SetDocumentPassword",
"(",
"array",
"(",
"'password'",
"=>",
"$",
"password",
",",
")",
")",
";",
"return",
"$",
"this",... | Set a password for the generated document
@param string $password
@return Document
@throws PasswordException | [
"Set",
"a",
"password",
"for",
"the",
"generated",
"document"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Document.php#L110-L121 |
222,926 | awakenweb/livedocx | src/Document.php | Document.setPermissions | public function setPermissions($permissions , $password)
{
if ( ! is_array($permissions) || ! is_string($password) || $password === '' ) {
throw new InvalidException('Permissions and password must be respectively an array and a string');
}
try {
$this->getSoapClient()... | php | public function setPermissions($permissions , $password)
{
if ( ! is_array($permissions) || ! is_string($password) || $password === '' ) {
throw new InvalidException('Permissions and password must be respectively an array and a string');
}
try {
$this->getSoapClient()... | [
"public",
"function",
"setPermissions",
"(",
"$",
"permissions",
",",
"$",
"password",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"permissions",
")",
"||",
"!",
"is_string",
"(",
"$",
"password",
")",
"||",
"$",
"password",
"===",
"''",
")",
"{",
... | Set a master password and a list of features accessible without this password
@param array $permissions
@param string $password
@throws PermissionsException
@throws InvalidException | [
"Set",
"a",
"master",
"password",
"and",
"a",
"list",
"of",
"features",
"accessible",
"without",
"this",
"password"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Document.php#L132-L147 |
222,927 | awakenweb/livedocx | src/Document.php | Document.getAccessOptions | public function getAccessOptions()
{
try {
$ret = array();
$result = $this->getSoapClient()->GetDocumentAccessOptions();
if ( isset($result->GetDocumentAccessOptionsResult->string) ) {
$ret = $result->GetDocumentAccessOptionsResult->string;
... | php | public function getAccessOptions()
{
try {
$ret = array();
$result = $this->getSoapClient()->GetDocumentAccessOptions();
if ( isset($result->GetDocumentAccessOptionsResult->string) ) {
$ret = $result->GetDocumentAccessOptionsResult->string;
... | [
"public",
"function",
"getAccessOptions",
"(",
")",
"{",
"try",
"{",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"GetDocumentAccessOptions",
"(",
")",
";",
"if",
"(",
"isset",
"(",
... | Return a list of permissions you can use in setPermissions
@return array
@throws PermissionsException | [
"Return",
"a",
"list",
"of",
"permissions",
"you",
"can",
"use",
"in",
"setPermissions"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Document.php#L156-L169 |
222,928 | awakenweb/livedocx | src/Document.php | Document.retrieve | public function retrieve($format = null)
{
if ( is_null($format) ) {
$format = $this->format;
}
if ( is_null($format) ) {
throw new InvalidException('You must provide a format to retrieve the document');
}
$format = strtolower($format);
try {
... | php | public function retrieve($format = null)
{
if ( is_null($format) ) {
$format = $this->format;
}
if ( is_null($format) ) {
throw new InvalidException('You must provide a format to retrieve the document');
}
$format = strtolower($format);
try {
... | [
"public",
"function",
"retrieve",
"(",
"$",
"format",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"format",
")",
")",
"{",
"$",
"format",
"=",
"$",
"this",
"->",
"format",
";",
"}",
"if",
"(",
"is_null",
"(",
"$",
"format",
")",
")",
... | Retrieve the final document from Livedocx service.
If you didn't provide a format for retrieval using the setFormat method, you can do it here.
@param string|null $format
@return string
@throws InvalidException
@throws RetrieveException | [
"Retrieve",
"the",
"final",
"document",
"from",
"Livedocx",
"service",
".",
"If",
"you",
"didn",
"t",
"provide",
"a",
"format",
"for",
"retrieval",
"using",
"the",
"setFormat",
"method",
"you",
"can",
"do",
"it",
"here",
"."
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Document.php#L200-L220 |
222,929 | awakenweb/livedocx | src/Document.php | Document.getPaginatedMetaFiles | protected function getPaginatedMetaFiles($from , $to)
{
if ( $from > $to ) {
throw new InvalidException('Start page for metafiles must be inferior to end page');
}
$ret = array();
try {
$result = $this->getSoapClient()->GetMetafiles(array(
'fr... | php | protected function getPaginatedMetaFiles($from , $to)
{
if ( $from > $to ) {
throw new InvalidException('Start page for metafiles must be inferior to end page');
}
$ret = array();
try {
$result = $this->getSoapClient()->GetMetafiles(array(
'fr... | [
"protected",
"function",
"getPaginatedMetaFiles",
"(",
"$",
"from",
",",
"$",
"to",
")",
"{",
"if",
"(",
"$",
"from",
">",
"$",
"to",
")",
"{",
"throw",
"new",
"InvalidException",
"(",
"'Start page for metafiles must be inferior to end page'",
")",
";",
"}",
"... | Get a paginated list of document as Metafile images.
@param int $from
@param int $to
@return array
@throws MetafilesException
@throws InvalidException | [
"Get",
"a",
"paginated",
"list",
"of",
"document",
"as",
"Metafile",
"images",
"."
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Document.php#L257-L285 |
222,930 | awakenweb/livedocx | src/Document.php | Document.getAllMetafiles | protected function getAllMetafiles()
{
$ret = array();
try {
$result = $this->getSoapClient()->GetAllMetafiles();
} catch ( SoapException $ex ) {
throw new MetafilesException('Error while retrieving the document from Livedocx service' , $ex);
}
if ( is... | php | protected function getAllMetafiles()
{
$ret = array();
try {
$result = $this->getSoapClient()->GetAllMetafiles();
} catch ( SoapException $ex ) {
throw new MetafilesException('Error while retrieving the document from Livedocx service' , $ex);
}
if ( is... | [
"protected",
"function",
"getAllMetafiles",
"(",
")",
"{",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"try",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"GetAllMetafiles",
"(",
")",
";",
"}",
"catch",
"(",
"SoapException"... | Get a complete list of document as Metafile images.
@return array
@throws MetafilesException | [
"Get",
"a",
"complete",
"list",
"of",
"document",
"as",
"Metafile",
"images",
"."
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Document.php#L294-L315 |
222,931 | awakenweb/livedocx | src/Document.php | Document.getPaginatedBitmaps | protected function getPaginatedBitmaps($zoomFactor , $format , $from , $to)
{
if ( $from > $to ) {
throw new InvalidException('Start page for bitmaps must be inferior to end page');
}
$ret = array();
try {
$result = $this->getSoapClient()->GetBitmaps(array(
... | php | protected function getPaginatedBitmaps($zoomFactor , $format , $from , $to)
{
if ( $from > $to ) {
throw new InvalidException('Start page for bitmaps must be inferior to end page');
}
$ret = array();
try {
$result = $this->getSoapClient()->GetBitmaps(array(
... | [
"protected",
"function",
"getPaginatedBitmaps",
"(",
"$",
"zoomFactor",
",",
"$",
"format",
",",
"$",
"from",
",",
"$",
"to",
")",
"{",
"if",
"(",
"$",
"from",
">",
"$",
"to",
")",
"{",
"throw",
"new",
"InvalidException",
"(",
"'Start page for bitmaps must... | Retrieve the final document as a list of paginated bitmap files
@param int $zoomFactor
@param string $format
@return array
@throws BitmapsException
@throws InvalidException | [
"Retrieve",
"the",
"final",
"document",
"as",
"a",
"list",
"of",
"paginated",
"bitmap",
"files"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Document.php#L357-L387 |
222,932 | awakenweb/livedocx | src/Document.php | Document.getAllBitmaps | protected function getAllBitmaps($zoomFactor , $format)
{
$ret = array();
try {
$result = $this->getSoapClient()->GetAllBitmaps(array(
'zoomFactor' => ( integer ) $zoomFactor ,
'format' => ( string ) $format ,
));
} catch ( SoapExce... | php | protected function getAllBitmaps($zoomFactor , $format)
{
$ret = array();
try {
$result = $this->getSoapClient()->GetAllBitmaps(array(
'zoomFactor' => ( integer ) $zoomFactor ,
'format' => ( string ) $format ,
));
} catch ( SoapExce... | [
"protected",
"function",
"getAllBitmaps",
"(",
"$",
"zoomFactor",
",",
"$",
"format",
")",
"{",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"try",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"GetAllBitmaps",
"(",
"array",
... | Retrieve the final document as a list of bitmap files
@param int $zoomFactor
@param string $format
@return array
@throws BitmapsException | [
"Retrieve",
"the",
"final",
"document",
"as",
"a",
"list",
"of",
"bitmap",
"files"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Document.php#L399-L424 |
222,933 | mongator/mongator | src/Mongator/Query/CachedQuery.php | CachedQuery.getDataCache | public function getDataCache()
{
$key = $this->generateKey();
return $this->getRepository()->getMongator()->getDataCache()->get($key);
} | php | public function getDataCache()
{
$key = $this->generateKey();
return $this->getRepository()->getMongator()->getDataCache()->get($key);
} | [
"public",
"function",
"getDataCache",
"(",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"generateKey",
"(",
")",
";",
"return",
"$",
"this",
"->",
"getRepository",
"(",
")",
"->",
"getMongator",
"(",
")",
"->",
"getDataCache",
"(",
")",
"->",
"get",
... | Returns the data in cache.
@return array|null The fields in cache, or null if there is not. | [
"Returns",
"the",
"data",
"in",
"cache",
"."
] | c29b94989677597a84dc5d3907224bf608967c26 | https://github.com/mongator/mongator/blob/c29b94989677597a84dc5d3907224bf608967c26/src/Mongator/Query/CachedQuery.php#L23-L28 |
222,934 | lcache/lcache | src/Entry.php | Entry.getTTL | public function getTTL()
{
if (is_null($this->expiration)) {
return null;
}
if ($this->expiration > $_SERVER['REQUEST_TIME']) {
return $this->expiration - $_SERVER['REQUEST_TIME'];
}
return 0;
} | php | public function getTTL()
{
if (is_null($this->expiration)) {
return null;
}
if ($this->expiration > $_SERVER['REQUEST_TIME']) {
return $this->expiration - $_SERVER['REQUEST_TIME'];
}
return 0;
} | [
"public",
"function",
"getTTL",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"expiration",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"expiration",
">",
"$",
"_SERVER",
"[",
"'REQUEST_TIME'",
"]",
")",
... | Return the time-to-live for this entry.
@return integer | [
"Return",
"the",
"time",
"-",
"to",
"-",
"live",
"for",
"this",
"entry",
"."
] | 275282b60811d58d9aaa3c2c752ff01e48d02f6d | https://github.com/lcache/lcache/blob/275282b60811d58d9aaa3c2c752ff01e48d02f6d/src/Entry.php#L39-L48 |
222,935 | mongator/mongator | src/Mongator/Document/AbstractDocument.php | AbstractDocument.clearEmbeddedsOneChanged | public function clearEmbeddedsOneChanged()
{
if (isset($this->data['embeddedsOne'])) {
foreach ($this->data['embeddedsOne'] as $name => $embedded) {
$this->getArchive()->remove('embedded_one.'.$name);
}
}
} | php | public function clearEmbeddedsOneChanged()
{
if (isset($this->data['embeddedsOne'])) {
foreach ($this->data['embeddedsOne'] as $name => $embedded) {
$this->getArchive()->remove('embedded_one.'.$name);
}
}
} | [
"public",
"function",
"clearEmbeddedsOneChanged",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"'embeddedsOne'",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"data",
"[",
"'embeddedsOne'",
"]",
"as",
"$",
"name",
"=... | Clear the embedded ones changed, that is, they will not be changed apart from here.
@api | [
"Clear",
"the",
"embedded",
"ones",
"changed",
"that",
"is",
"they",
"will",
"not",
"be",
"changed",
"apart",
"from",
"here",
"."
] | c29b94989677597a84dc5d3907224bf608967c26 | https://github.com/mongator/mongator/blob/c29b94989677597a84dc5d3907224bf608967c26/src/Mongator/Document/AbstractDocument.php#L361-L368 |
222,936 | webtoolsnz/yii2-admin-lte | src/Theme.php | Theme.init | public function init()
{
$this->basePath = __DIR__;
AdminLteAsset::$skin = $this->skin;
AdminLteAsset::$customSkin = $this->customSkin;
if (!$this->pathMap) {
$this->createPathMap();
}
} | php | public function init()
{
$this->basePath = __DIR__;
AdminLteAsset::$skin = $this->skin;
AdminLteAsset::$customSkin = $this->customSkin;
if (!$this->pathMap) {
$this->createPathMap();
}
} | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"basePath",
"=",
"__DIR__",
";",
"AdminLteAsset",
"::",
"$",
"skin",
"=",
"$",
"this",
"->",
"skin",
";",
"AdminLteAsset",
"::",
"$",
"customSkin",
"=",
"$",
"this",
"->",
"customSkin",
";... | Set the basePath of the theme, the | [
"Set",
"the",
"basePath",
"of",
"the",
"theme",
"the"
] | 6c08456503421b2a6c67109beb2df2f1fbfea875 | https://github.com/webtoolsnz/yii2-admin-lte/blob/6c08456503421b2a6c67109beb2df2f1fbfea875/src/Theme.php#L62-L71 |
222,937 | webtoolsnz/yii2-admin-lte | src/widgets/Menu.php | Menu.getItemOptions | protected function getItemOptions($items, $index)
{
$options = array_merge(
$this->itemOptions,
ArrayHelper::getValue($items[$index], 'options', [])
);
Html::addCssClass($options, $this->generateItemClass($items, $index));
return $options;
} | php | protected function getItemOptions($items, $index)
{
$options = array_merge(
$this->itemOptions,
ArrayHelper::getValue($items[$index], 'options', [])
);
Html::addCssClass($options, $this->generateItemClass($items, $index));
return $options;
} | [
"protected",
"function",
"getItemOptions",
"(",
"$",
"items",
",",
"$",
"index",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"itemOptions",
",",
"ArrayHelper",
"::",
"getValue",
"(",
"$",
"items",
"[",
"$",
"index",
"]",
",",
... | Generates options for the item
@param $items
@param $index
@return array | [
"Generates",
"options",
"for",
"the",
"item"
] | 6c08456503421b2a6c67109beb2df2f1fbfea875 | https://github.com/webtoolsnz/yii2-admin-lte/blob/6c08456503421b2a6c67109beb2df2f1fbfea875/src/widgets/Menu.php#L91-L101 |
222,938 | lcache/lcache | src/L1CacheFactory.php | L1CacheFactory.create | public function create($driverName = null, $customPool = null)
{
// Normalize input.
$pool = $this->getPool($customPool);
$driver = mb_convert_case($driverName, MB_CASE_LOWER);
$factoryName = 'create' . $driver;
if (!method_exists($this, $factoryName)) {
// TODO:... | php | public function create($driverName = null, $customPool = null)
{
// Normalize input.
$pool = $this->getPool($customPool);
$driver = mb_convert_case($driverName, MB_CASE_LOWER);
$factoryName = 'create' . $driver;
if (!method_exists($this, $factoryName)) {
// TODO:... | [
"public",
"function",
"create",
"(",
"$",
"driverName",
"=",
"null",
",",
"$",
"customPool",
"=",
"null",
")",
"{",
"// Normalize input.",
"$",
"pool",
"=",
"$",
"this",
"->",
"getPool",
"(",
"$",
"customPool",
")",
";",
"$",
"driver",
"=",
"mb_convert_c... | L1 cache drivers const
@todo Change the return value to L1CacheInterface
@param string $driverName
Name of the L1 driver implementation to create. One of the DRIVER_*
class constants.
@param string $customPool
Pool ID to use for the data separation.
@return L1
Concrete instance that confirms to an L1 interface. | [
"L1",
"cache",
"drivers",
"const"
] | 275282b60811d58d9aaa3c2c752ff01e48d02f6d | https://github.com/lcache/lcache/blob/275282b60811d58d9aaa3c2c752ff01e48d02f6d/src/L1CacheFactory.php#L31-L45 |
222,939 | lcache/lcache | src/L1CacheFactory.php | L1CacheFactory.createSQLite | protected function createSQLite($pool)
{
$hasApcu = function_exists('apcu_fetch');
// TODO: Maybe implement StateL1SQLite class instead of NULL one.
$state = $hasApcu ? new StateL1APCu("sqlite-$pool") : new StateL1Static();
$cache = new SQLiteL1($pool, $state);
return $cache;... | php | protected function createSQLite($pool)
{
$hasApcu = function_exists('apcu_fetch');
// TODO: Maybe implement StateL1SQLite class instead of NULL one.
$state = $hasApcu ? new StateL1APCu("sqlite-$pool") : new StateL1Static();
$cache = new SQLiteL1($pool, $state);
return $cache;... | [
"protected",
"function",
"createSQLite",
"(",
"$",
"pool",
")",
"{",
"$",
"hasApcu",
"=",
"function_exists",
"(",
"'apcu_fetch'",
")",
";",
"// TODO: Maybe implement StateL1SQLite class instead of NULL one.",
"$",
"state",
"=",
"$",
"hasApcu",
"?",
"new",
"StateL1APCu... | Factory method for the L1 SQLite driver.
@param string $pool
@return \LCache\SQLiteL1 | [
"Factory",
"method",
"for",
"the",
"L1",
"SQLite",
"driver",
"."
] | 275282b60811d58d9aaa3c2c752ff01e48d02f6d | https://github.com/lcache/lcache/blob/275282b60811d58d9aaa3c2c752ff01e48d02f6d/src/L1CacheFactory.php#L86-L93 |
222,940 | lcache/lcache | src/L1CacheFactory.php | L1CacheFactory.getPool | protected function getPool($pool = null)
{
if (!is_null($pool)) {
$result = (string) $pool;
} elseif (isset($_SERVER['SERVER_ADDR']) && isset($_SERVER['SERVER_PORT'])) {
$result = $_SERVER['SERVER_ADDR'] . '-' . $_SERVER['SERVER_PORT'];
} else {
$result = ... | php | protected function getPool($pool = null)
{
if (!is_null($pool)) {
$result = (string) $pool;
} elseif (isset($_SERVER['SERVER_ADDR']) && isset($_SERVER['SERVER_PORT'])) {
$result = $_SERVER['SERVER_ADDR'] . '-' . $_SERVER['SERVER_PORT'];
} else {
$result = ... | [
"protected",
"function",
"getPool",
"(",
"$",
"pool",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"pool",
")",
")",
"{",
"$",
"result",
"=",
"(",
"string",
")",
"$",
"pool",
";",
"}",
"elseif",
"(",
"isset",
"(",
"$",
"_SERVER",
... | Pool generator utility.
@param string $pool
Custom pool to use. Defaults to NULL. If the default is uesed, it will
atempt to generate a pool value for use.
@return string
Pool value based on input and/or environment variables / state. | [
"Pool",
"generator",
"utility",
"."
] | 275282b60811d58d9aaa3c2c752ff01e48d02f6d | https://github.com/lcache/lcache/blob/275282b60811d58d9aaa3c2c752ff01e48d02f6d/src/L1CacheFactory.php#L105-L115 |
222,941 | awakenweb/livedocx | src/Livedocx.php | Livedocx.prepare | public function prepare()
{
$blocks = $this->container->getBlocks();
$fields = array_merge($this->container->getFields() , $this->container->getImages());
$this->declareListOfBlocks($blocks)
->declareListOfValues($fields);
return $this->createDocument();
} | php | public function prepare()
{
$blocks = $this->container->getBlocks();
$fields = array_merge($this->container->getFields() , $this->container->getImages());
$this->declareListOfBlocks($blocks)
->declareListOfValues($fields);
return $this->createDocument();
} | [
"public",
"function",
"prepare",
"(",
")",
"{",
"$",
"blocks",
"=",
"$",
"this",
"->",
"container",
"->",
"getBlocks",
"(",
")",
";",
"$",
"fields",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"container",
"->",
"getFields",
"(",
")",
",",
"$",
"this... | Prepare the merging of the fields and return a document
@param Container $container
@return Document | [
"Prepare",
"the",
"merging",
"of",
"the",
"fields",
"and",
"return",
"a",
"document"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Livedocx.php#L135-L145 |
222,942 | awakenweb/livedocx | src/Livedocx.php | Livedocx.declareListOfBlocks | protected function declareListOfBlocks($blocks)
{
foreach ( $blocks as $block ) {
try {
$this->getSoapClient()->SetBlockFieldValues(array(
'blockName' => $block->getName() ,
'blockFieldValues' => $this->getSoapClient()->convertArray(... | php | protected function declareListOfBlocks($blocks)
{
foreach ( $blocks as $block ) {
try {
$this->getSoapClient()->SetBlockFieldValues(array(
'blockName' => $block->getName() ,
'blockFieldValues' => $this->getSoapClient()->convertArray(... | [
"protected",
"function",
"declareListOfBlocks",
"(",
"$",
"blocks",
")",
"{",
"foreach",
"(",
"$",
"blocks",
"as",
"$",
"block",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"SetBlockFieldValues",
"(",
"array",
"(",
"'blockName... | Send the list of all block values to Livedocx service to prepare the merging
@param array $blocks
@return Livedocx
@throws DeclarationException | [
"Send",
"the",
"list",
"of",
"all",
"block",
"values",
"to",
"Livedocx",
"service",
"to",
"prepare",
"the",
"merging"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Livedocx.php#L156-L173 |
222,943 | awakenweb/livedocx | src/Livedocx.php | Livedocx.declareListOfValues | protected function declareListOfValues($fields)
{
try {
$this->getSoapClient()->SetFieldValues(array(
'fieldValues' => $this->getSoapClient()->convertArray($fields)
));
} catch ( SoapException $e ) {
throw new DeclarationException('Error while send... | php | protected function declareListOfValues($fields)
{
try {
$this->getSoapClient()->SetFieldValues(array(
'fieldValues' => $this->getSoapClient()->convertArray($fields)
));
} catch ( SoapException $e ) {
throw new DeclarationException('Error while send... | [
"protected",
"function",
"declareListOfValues",
"(",
"$",
"fields",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"SetFieldValues",
"(",
"array",
"(",
"'fieldValues'",
"=>",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"c... | Send the list of all field values to Livedocx service to prepare the merging
@param array $fields
@return Livedocx
@throws DeclarationException | [
"Send",
"the",
"list",
"of",
"all",
"field",
"values",
"to",
"Livedocx",
"service",
"to",
"prepare",
"the",
"merging"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Livedocx.php#L184-L195 |
222,944 | lcache/lcache | src/DatabaseL2.php | DatabaseL2.getEvent | public function getEvent($event_id)
{
$sth = $this->dbh->prepare('SELECT * FROM ' . $this->prefixTable('lcache_events') .' WHERE event_id = :event_id');
$sth->bindValue(':event_id', $event_id, \PDO::PARAM_INT);
$sth->execute();
$event = $sth->fetchObject();
if (false === $eve... | php | public function getEvent($event_id)
{
$sth = $this->dbh->prepare('SELECT * FROM ' . $this->prefixTable('lcache_events') .' WHERE event_id = :event_id');
$sth->bindValue(':event_id', $event_id, \PDO::PARAM_INT);
$sth->execute();
$event = $sth->fetchObject();
if (false === $eve... | [
"public",
"function",
"getEvent",
"(",
"$",
"event_id",
")",
"{",
"$",
"sth",
"=",
"$",
"this",
"->",
"dbh",
"->",
"prepare",
"(",
"'SELECT * FROM '",
".",
"$",
"this",
"->",
"prefixTable",
"(",
"'lcache_events'",
")",
".",
"' WHERE event_id = :event_id'",
"... | Returns the event entry. Currently used only for testing. | [
"Returns",
"the",
"event",
"entry",
".",
"Currently",
"used",
"only",
"for",
"testing",
"."
] | 275282b60811d58d9aaa3c2c752ff01e48d02f6d | https://github.com/lcache/lcache/blob/275282b60811d58d9aaa3c2c752ff01e48d02f6d/src/DatabaseL2.php#L189-L200 |
222,945 | awakenweb/livedocx | src/Template.php | Template.listAll | public function listAll()
{
try {
$ret = array();
$result = $this->getSoapClient()->ListTemplates();
if ( isset($result->ListTemplatesResult) ) {
$ret = $this->getSoapClient()->backendListArrayToMultiAssocArray($result->ListTemplatesResult);
... | php | public function listAll()
{
try {
$ret = array();
$result = $this->getSoapClient()->ListTemplates();
if ( isset($result->ListTemplatesResult) ) {
$ret = $this->getSoapClient()->backendListArrayToMultiAssocArray($result->ListTemplatesResult);
... | [
"public",
"function",
"listAll",
"(",
")",
"{",
"try",
"{",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"ListTemplates",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"result",
"... | Return the list of all templates uploaded to the Livedocx service
@return type
@throws StatusException | [
"Return",
"the",
"list",
"of",
"all",
"templates",
"uploaded",
"to",
"the",
"Livedocx",
"service"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Template.php#L73-L86 |
222,946 | awakenweb/livedocx | src/Template.php | Template.getAcceptedTemplateFormats | public function getAcceptedTemplateFormats()
{
try {
$ret = array();
$result = $this->getSoapClient()->GetTemplateFormats();
if ( isset($result->GetTemplateFormatsResult->string) ) {
$ret = $result->GetTemplateFormatsResult->string;
$ret... | php | public function getAcceptedTemplateFormats()
{
try {
$ret = array();
$result = $this->getSoapClient()->GetTemplateFormats();
if ( isset($result->GetTemplateFormatsResult->string) ) {
$ret = $result->GetTemplateFormatsResult->string;
$ret... | [
"public",
"function",
"getAcceptedTemplateFormats",
"(",
")",
"{",
"try",
"{",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"GetTemplateFormats",
"(",
")",
";",
"if",
"(",
"isset",
"("... | Return a list of all the accepted template formats you can use to generate your document
@return array
@throws StatusException | [
"Return",
"a",
"list",
"of",
"all",
"the",
"accepted",
"template",
"formats",
"you",
"can",
"use",
"to",
"generate",
"your",
"document"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Template.php#L95-L109 |
222,947 | awakenweb/livedocx | src/Template.php | Template.getAvailableFonts | public function getAvailableFonts()
{
try {
$ret = array();
$result = $this->getSoapClient()->GetFontNames();
if ( isset($result->GetFontNamesResult->string) ) {
$ret = $result->GetFontNamesResult->string;
}
return $ret;
... | php | public function getAvailableFonts()
{
try {
$ret = array();
$result = $this->getSoapClient()->GetFontNames();
if ( isset($result->GetFontNamesResult->string) ) {
$ret = $result->GetFontNamesResult->string;
}
return $ret;
... | [
"public",
"function",
"getAvailableFonts",
"(",
")",
"{",
"try",
"{",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"GetFontNames",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"res... | Get the list of all available fonts on the Livedocx service
@return type
@throws StatusException | [
"Get",
"the",
"list",
"of",
"all",
"available",
"fonts",
"on",
"the",
"Livedocx",
"service"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Template.php#L118-L131 |
222,948 | awakenweb/livedocx | src/Template.php | Template.ignoreAllSubTemplates | public function ignoreAllSubTemplates($state = true)
{
$state = ( bool ) $state;
try {
$this->getSoapClient()->SetIgnoreSubTemplates(array(
'ignoreSubTemplates' => $state ,
));
return $this;
} catch ( SoapException $ex ) {
thro... | php | public function ignoreAllSubTemplates($state = true)
{
$state = ( bool ) $state;
try {
$this->getSoapClient()->SetIgnoreSubTemplates(array(
'ignoreSubTemplates' => $state ,
));
return $this;
} catch ( SoapException $ex ) {
thro... | [
"public",
"function",
"ignoreAllSubTemplates",
"(",
"$",
"state",
"=",
"true",
")",
"{",
"$",
"state",
"=",
"(",
"bool",
")",
"$",
"state",
";",
"try",
"{",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"SetIgnoreSubTemplates",
"(",
"array",
"(",
... | Tell the Livedocx service to ignore included subtemplates when generating the final
document
@param boolean $state
@return Template
@throws IgnoreException | [
"Tell",
"the",
"Livedocx",
"service",
"to",
"ignore",
"included",
"subtemplates",
"when",
"generating",
"the",
"final",
"document"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Template.php#L143-L155 |
222,949 | awakenweb/livedocx | src/Template.php | Template.ignoreListOfSubTemplates | public function ignoreListOfSubTemplates($subtemplates_list)
{
if ( ! is_array($subtemplates_list) ) {
throw new InvalidException('List of subtemplate filenames must be an array');
}
$filenames = array_values($subtemplates_list);
try {
$this->getSoapClient()->... | php | public function ignoreListOfSubTemplates($subtemplates_list)
{
if ( ! is_array($subtemplates_list) ) {
throw new InvalidException('List of subtemplate filenames must be an array');
}
$filenames = array_values($subtemplates_list);
try {
$this->getSoapClient()->... | [
"public",
"function",
"ignoreListOfSubTemplates",
"(",
"$",
"subtemplates_list",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"subtemplates_list",
")",
")",
"{",
"throw",
"new",
"InvalidException",
"(",
"'List of subtemplate filenames must be an array'",
")",
";",
... | Define a list of subtemplates to ignore when generating the final document
@param array $subtemplates_list
@return Template
@throws IgnoreException
@throws InvalidException | [
"Define",
"a",
"list",
"of",
"subtemplates",
"to",
"ignore",
"when",
"generating",
"the",
"final",
"document"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Template.php#L167-L182 |
222,950 | lcache/lcache | src/LX.php | LX.get | public function get(Address $address)
{
$entry = $this->getEntry($address);
if (is_null($entry)) {
return null;
}
return $entry->value;
} | php | public function get(Address $address)
{
$entry = $this->getEntry($address);
if (is_null($entry)) {
return null;
}
return $entry->value;
} | [
"public",
"function",
"get",
"(",
"Address",
"$",
"address",
")",
"{",
"$",
"entry",
"=",
"$",
"this",
"->",
"getEntry",
"(",
"$",
"address",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"entry",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
... | Fetch a value from the cache.
@param Address $address
@return string|null | [
"Fetch",
"a",
"value",
"from",
"the",
"cache",
"."
] | 275282b60811d58d9aaa3c2c752ff01e48d02f6d | https://github.com/lcache/lcache/blob/275282b60811d58d9aaa3c2c752ff01e48d02f6d/src/LX.php#L19-L26 |
222,951 | mongator/mongator | src/Mongator/Group/AbstractGroup.php | AbstractGroup.markAllSaved | public function markAllSaved()
{
$this->saved = $this->all();
foreach ($this->saved as $document) {
$document->clearModified();
$rap = $document->getRootAndPath();
$rap['path'] = str_replace('._add', '.', $rap['path']);
$document->setRootAndPath($rap['... | php | public function markAllSaved()
{
$this->saved = $this->all();
foreach ($this->saved as $document) {
$document->clearModified();
$rap = $document->getRootAndPath();
$rap['path'] = str_replace('._add', '.', $rap['path']);
$document->setRootAndPath($rap['... | [
"public",
"function",
"markAllSaved",
"(",
")",
"{",
"$",
"this",
"->",
"saved",
"=",
"$",
"this",
"->",
"all",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"saved",
"as",
"$",
"document",
")",
"{",
"$",
"document",
"->",
"clearModified",
"(",
... | Marks everything as saved, removes pending add and delete arrays | [
"Marks",
"everything",
"as",
"saved",
"removes",
"pending",
"add",
"and",
"delete",
"arrays"
] | c29b94989677597a84dc5d3907224bf608967c26 | https://github.com/mongator/mongator/blob/c29b94989677597a84dc5d3907224bf608967c26/src/Mongator/Group/AbstractGroup.php#L154-L165 |
222,952 | mongator/mongator | src/Mongator/Archive.php | Archive.set | public function set($key, $value)
{
$this->keys[$key] = true;
$this->archive[$key] = $value;
} | php | public function set($key, $value)
{
$this->keys[$key] = true;
$this->archive[$key] = $value;
} | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"keys",
"[",
"$",
"key",
"]",
"=",
"true",
";",
"$",
"this",
"->",
"archive",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
";",
"}"
] | Set a key value.
@param string $key The key.
@param mixed $value The value. | [
"Set",
"a",
"key",
"value",
"."
] | c29b94989677597a84dc5d3907224bf608967c26 | https://github.com/mongator/mongator/blob/c29b94989677597a84dc5d3907224bf608967c26/src/Mongator/Archive.php#L56-L60 |
222,953 | mongator/mongator | src/Mongator/Archive.php | Archive.remove | public function remove($key)
{
if (!$this->has($key)) {
return;
}
unset($this->archive[$key]);
unset($this->keys[$key]);
} | php | public function remove($key)
{
if (!$this->has($key)) {
return;
}
unset($this->archive[$key]);
unset($this->keys[$key]);
} | [
"public",
"function",
"remove",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"return",
";",
"}",
"unset",
"(",
"$",
"this",
"->",
"archive",
"[",
"$",
"key",
"]",
")",
";",
"unset",
"(",... | Remove a key.
@param string $key The key. | [
"Remove",
"a",
"key",
"."
] | c29b94989677597a84dc5d3907224bf608967c26 | https://github.com/mongator/mongator/blob/c29b94989677597a84dc5d3907224bf608967c26/src/Mongator/Archive.php#L67-L76 |
222,954 | mongator/mongator | src/Mongator/Archive.php | Archive.& | public function &getByRef($key, $default = null)
{
if (!$this->has($key)) {
$this->set($key, $default);
}
return $this->archive[$key];
} | php | public function &getByRef($key, $default = null)
{
if (!$this->has($key)) {
$this->set($key, $default);
}
return $this->archive[$key];
} | [
"public",
"function",
"&",
"getByRef",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"key",
",",
"$",
"default",
")",... | Returns a key by reference. It creates the key if the key does not exist.
@param string $key The key.
@param mixed $default The default value, used to create the key if it does not exist (null by default).
@return mixed The object key value. | [
"Returns",
"a",
"key",
"by",
"reference",
".",
"It",
"creates",
"the",
"key",
"if",
"the",
"key",
"does",
"not",
"exist",
"."
] | c29b94989677597a84dc5d3907224bf608967c26 | https://github.com/mongator/mongator/blob/c29b94989677597a84dc5d3907224bf608967c26/src/Mongator/Archive.php#L86-L93 |
222,955 | mongator/mongator | src/Mongator/Type/Container.php | Container.get | public static function get($name)
{
if (!isset(static::$types[$name])) {
if (!static::has($name)) {
throw new \InvalidArgumentException(sprintf('The type "%s" does not exists.', $name));
}
static::$types[$name] = new static::$map[$name];
}
... | php | public static function get($name)
{
if (!isset(static::$types[$name])) {
if (!static::has($name)) {
throw new \InvalidArgumentException(sprintf('The type "%s" does not exists.', $name));
}
static::$types[$name] = new static::$map[$name];
}
... | [
"public",
"static",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"static",
"::",
"$",
"types",
"[",
"$",
"name",
"]",
")",
")",
"{",
"if",
"(",
"!",
"static",
"::",
"has",
"(",
"$",
"name",
")",
")",
"{",
"thro... | Returns a type.
@param string $name The type name.
@return \Mongator\Type\Type The type.
@throws \InvalidArgumentException If the type does not exists.
@api | [
"Returns",
"a",
"type",
"."
] | c29b94989677597a84dc5d3907224bf608967c26 | https://github.com/mongator/mongator/blob/c29b94989677597a84dc5d3907224bf608967c26/src/Mongator/Type/Container.php#L88-L99 |
222,956 | mongator/mongator | src/Mongator/Type/Container.php | Container.remove | public static function remove($name)
{
if (!static::has($name)) {
throw new \InvalidArgumentException(sprintf('The type "%s" does not exists.', $name));
}
unset(static::$map[$name], static::$types[$name]);
} | php | public static function remove($name)
{
if (!static::has($name)) {
throw new \InvalidArgumentException(sprintf('The type "%s" does not exists.', $name));
}
unset(static::$map[$name], static::$types[$name]);
} | [
"public",
"static",
"function",
"remove",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"static",
"::",
"has",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'The type \"%s\" does not exists.'",
",",
... | Remove a type.
@param string $name The type name.
@throws \InvalidArgumentException If the type does not exists.
@api | [
"Remove",
"a",
"type",
"."
] | c29b94989677597a84dc5d3907224bf608967c26 | https://github.com/mongator/mongator/blob/c29b94989677597a84dc5d3907224bf608967c26/src/Mongator/Type/Container.php#L110-L117 |
222,957 | awakenweb/livedocx | src/Templates/Remote.php | Remote.setAsActive | public function setAsActive()
{
if ( ! $this->exists() ) {
throw new FileExistException('Remote template does not exist');
}
try {
$this->getSoapClient()->SetRemoteTemplate(['filename' => $this->getName() ]);
$this->isActive = true;
return $t... | php | public function setAsActive()
{
if ( ! $this->exists() ) {
throw new FileExistException('Remote template does not exist');
}
try {
$this->getSoapClient()->SetRemoteTemplate(['filename' => $this->getName() ]);
$this->isActive = true;
return $t... | [
"public",
"function",
"setAsActive",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"exists",
"(",
")",
")",
"{",
"throw",
"new",
"FileExistException",
"(",
"'Remote template does not exist'",
")",
";",
"}",
"try",
"{",
"$",
"this",
"->",
"getSoapClient... | Set the remote template as active to be used when generating the final document
@return Remote
@throws ActiveException
@throws InvalidException | [
"Set",
"the",
"remote",
"template",
"as",
"active",
"to",
"be",
"used",
"when",
"generating",
"the",
"final",
"document"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Templates/Remote.php#L56-L70 |
222,958 | awakenweb/livedocx | src/Templates/Remote.php | Remote.exists | public function exists()
{
try {
$result = $this->soapClient->templateExists(['filename' => $this->getName() ]);
return ( bool ) $result->TemplateExistsResult;
} catch ( SoapException $ex ) {
throw new StatusException('Error while verifying the existence of a rem... | php | public function exists()
{
try {
$result = $this->soapClient->templateExists(['filename' => $this->getName() ]);
return ( bool ) $result->TemplateExistsResult;
} catch ( SoapException $ex ) {
throw new StatusException('Error while verifying the existence of a rem... | [
"public",
"function",
"exists",
"(",
")",
"{",
"try",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"soapClient",
"->",
"templateExists",
"(",
"[",
"'filename'",
"=>",
"$",
"this",
"->",
"getName",
"(",
")",
"]",
")",
";",
"return",
"(",
"bool",
")",
... | Check if a remote template exists on the Livedocx service
@return boolean
@throw StatusException | [
"Check",
"if",
"a",
"remote",
"template",
"exists",
"on",
"the",
"Livedocx",
"service"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Templates/Remote.php#L84-L93 |
222,959 | awakenweb/livedocx | src/Templates/Remote.php | Remote.getFieldNames | public function getFieldNames()
{
if ( ! $this->isActive ) {
throw new NonActiveException('You can only get the field names of the active template');
}
$ret = array();
try {
$result = $this->getSoapClient()->GetFieldNames();
} catch ( SoapException $... | php | public function getFieldNames()
{
if ( ! $this->isActive ) {
throw new NonActiveException('You can only get the field names of the active template');
}
$ret = array();
try {
$result = $this->getSoapClient()->GetFieldNames();
} catch ( SoapException $... | [
"public",
"function",
"getFieldNames",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isActive",
")",
"{",
"throw",
"new",
"NonActiveException",
"(",
"'You can only get the field names of the active template'",
")",
";",
"}",
"$",
"ret",
"=",
"array",
"(",
... | Return the list of all fields in the active template
@return array
@throws StatusException
@throws NonActiveException | [
"Return",
"the",
"list",
"of",
"all",
"fields",
"in",
"the",
"active",
"template"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Templates/Remote.php#L103-L126 |
222,960 | awakenweb/livedocx | src/Templates/Remote.php | Remote.download | public function download()
{
if ( ! $this->exists() ) {
throw new FileExistException('Remote template does not exist');
}
try {
$result = $this->getSoapClient()->DownloadTemplate(array(
'filename' => basename($this->getName()) ));
return ... | php | public function download()
{
if ( ! $this->exists() ) {
throw new FileExistException('Remote template does not exist');
}
try {
$result = $this->getSoapClient()->DownloadTemplate(array(
'filename' => basename($this->getName()) ));
return ... | [
"public",
"function",
"download",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"exists",
"(",
")",
")",
"{",
"throw",
"new",
"FileExistException",
"(",
"'Remote template does not exist'",
")",
";",
"}",
"try",
"{",
"$",
"result",
"=",
"$",
"this",
... | Download a remote template from the Livedocx service
@throws TemplateException
@throws FileExistException | [
"Download",
"a",
"remote",
"template",
"from",
"the",
"Livedocx",
"service"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Templates/Remote.php#L134-L148 |
222,961 | awakenweb/livedocx | src/Templates/Remote.php | Remote.delete | public function delete()
{
try {
$this->getSoapClient()->DeleteTemplate(array(
'filename' => basename($this->getName())
));
return $this;
} catch ( SoapException $ex ) {
throw new DeleteException('Error while deleting the remote templa... | php | public function delete()
{
try {
$this->getSoapClient()->DeleteTemplate(array(
'filename' => basename($this->getName())
));
return $this;
} catch ( SoapException $ex ) {
throw new DeleteException('Error while deleting the remote templa... | [
"public",
"function",
"delete",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"DeleteTemplate",
"(",
"array",
"(",
"'filename'",
"=>",
"basename",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
")",
")",
")",
";",
"retu... | Delete a remote template from the Livedocx service.
@return Remote
@throws TemplateException | [
"Delete",
"a",
"remote",
"template",
"from",
"the",
"Livedocx",
"service",
"."
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Templates/Remote.php#L157-L168 |
222,962 | mongator/mongator | src/Mongator/Group/EmbeddedGroup.php | EmbeddedGroup.setRootAndPath | public function setRootAndPath(Document $root, $path)
{
$this->getArchive()->set('root_and_path', array('root' => $root, 'path' => $path));
foreach ($this->getAdd() as $key => $document) {
$document->setRootAndPath($root, $path.'._add'.$key);
}
} | php | public function setRootAndPath(Document $root, $path)
{
$this->getArchive()->set('root_and_path', array('root' => $root, 'path' => $path));
foreach ($this->getAdd() as $key => $document) {
$document->setRootAndPath($root, $path.'._add'.$key);
}
} | [
"public",
"function",
"setRootAndPath",
"(",
"Document",
"$",
"root",
",",
"$",
"path",
")",
"{",
"$",
"this",
"->",
"getArchive",
"(",
")",
"->",
"set",
"(",
"'root_and_path'",
",",
"array",
"(",
"'root'",
"=>",
"$",
"root",
",",
"'path'",
"=>",
"$",
... | Set the root and path of the embedded group.
@param \Mongator\Document\Document $root The root document.
@param string $path The path.
@api | [
"Set",
"the",
"root",
"and",
"path",
"of",
"the",
"embedded",
"group",
"."
] | c29b94989677597a84dc5d3907224bf608967c26 | https://github.com/mongator/mongator/blob/c29b94989677597a84dc5d3907224bf608967c26/src/Mongator/Group/EmbeddedGroup.php#L34-L41 |
222,963 | awakenweb/livedocx | src/Image.php | Image.setFilename | public function setFilename($filename , $directory = null)
{
$this->filename = $filename;
$this->directory = $directory;
} | php | public function setFilename($filename , $directory = null)
{
$this->filename = $filename;
$this->directory = $directory;
} | [
"public",
"function",
"setFilename",
"(",
"$",
"filename",
",",
"$",
"directory",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"filename",
"=",
"$",
"filename",
";",
"$",
"this",
"->",
"directory",
"=",
"$",
"directory",
";",
"}"
] | Define the file and the working directory for a localfile
@param string $filename
@param string|null $directory | [
"Define",
"the",
"file",
"and",
"the",
"working",
"directory",
"for",
"a",
"localfile"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Image.php#L64-L68 |
222,964 | awakenweb/livedocx | src/Image.php | Image.listAll | public function listAll()
{
try {
$return = [ ];
$result = $this->getSoapClient()->ListImages();
if ( isset($result->ListImagesResult) ) {
$return = $this->getSoapClient()->backendListArrayToMultiAssocArray($result->ListImagesResult);
}
... | php | public function listAll()
{
try {
$return = [ ];
$result = $this->getSoapClient()->ListImages();
if ( isset($result->ListImagesResult) ) {
$return = $this->getSoapClient()->backendListArrayToMultiAssocArray($result->ListImagesResult);
}
... | [
"public",
"function",
"listAll",
"(",
")",
"{",
"try",
"{",
"$",
"return",
"=",
"[",
"]",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"ListImages",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"result",
"->",
"Lis... | Return a list of all images present on the Livedocx service
@return array
@throws StatusException | [
"Return",
"a",
"list",
"of",
"all",
"images",
"present",
"on",
"the",
"Livedocx",
"service"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Image.php#L95-L108 |
222,965 | awakenweb/livedocx | src/Image.php | Image.getAcceptedFormats | public function getAcceptedFormats()
{
try {
$ret = array();
$result = $this->getSoapClient()->GetImageImportFormats();
if ( isset($result->GetImageImportFormatsResult->string) ) {
$ret = $result->GetImageImportFormatsResult->string;
$re... | php | public function getAcceptedFormats()
{
try {
$ret = array();
$result = $this->getSoapClient()->GetImageImportFormats();
if ( isset($result->GetImageImportFormatsResult->string) ) {
$ret = $result->GetImageImportFormatsResult->string;
$re... | [
"public",
"function",
"getAcceptedFormats",
"(",
")",
"{",
"try",
"{",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"GetImageImportFormats",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"... | Get the list of accepted images format for upload
@return array
@throws StatusException | [
"Get",
"the",
"list",
"of",
"accepted",
"images",
"format",
"for",
"upload"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Image.php#L117-L131 |
222,966 | awakenweb/livedocx | src/Image.php | Image.getAvailableReturnFormats | public function getAvailableReturnFormats()
{
try {
$ret = array();
$result = $this->getSoapClient()->GetImageExportFormats();
if ( isset($result->GetImageExportFormatsResult->string) ) {
$ret = $result->GetImageExportFormatsResult->string;
... | php | public function getAvailableReturnFormats()
{
try {
$ret = array();
$result = $this->getSoapClient()->GetImageExportFormats();
if ( isset($result->GetImageExportFormatsResult->string) ) {
$ret = $result->GetImageExportFormatsResult->string;
... | [
"public",
"function",
"getAvailableReturnFormats",
"(",
")",
"{",
"try",
"{",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"GetImageExportFormats",
"(",
")",
";",
"if",
"(",
"isset",
"... | Get the list of accepted formats for image generation
@return array
@throws StatusException | [
"Get",
"the",
"list",
"of",
"accepted",
"formats",
"for",
"image",
"generation"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Image.php#L140-L154 |
222,967 | awakenweb/livedocx | src/Image.php | Image.upload | public function upload()
{
$filename = $this->getName(true);
if ( ! is_readable($filename) ) {
throw new FileExistException('Image file from disk is not readable');
}
try {
$this->getSoapClient()->UploadImage(array(
'image' => base64_encod... | php | public function upload()
{
$filename = $this->getName(true);
if ( ! is_readable($filename) ) {
throw new FileExistException('Image file from disk is not readable');
}
try {
$this->getSoapClient()->UploadImage(array(
'image' => base64_encod... | [
"public",
"function",
"upload",
"(",
")",
"{",
"$",
"filename",
"=",
"$",
"this",
"->",
"getName",
"(",
"true",
")",
";",
"if",
"(",
"!",
"is_readable",
"(",
"$",
"filename",
")",
")",
"{",
"throw",
"new",
"FileExistException",
"(",
"'Image file from dis... | Upload the active image on the livedocx server
@return Image
@throws UploadException
@throws FileExistException | [
"Upload",
"the",
"active",
"image",
"on",
"the",
"livedocx",
"server"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Image.php#L164-L182 |
222,968 | awakenweb/livedocx | src/Image.php | Image.download | public function download()
{
try {
$result = $this->getSoapClient()->DownloadImage(array(
'filename' => basename($this->filename) ,
));
return base64_decode($result->DownloadImageResult);
} catch ( SoapException $e ) {
throw new Downlo... | php | public function download()
{
try {
$result = $this->getSoapClient()->DownloadImage(array(
'filename' => basename($this->filename) ,
));
return base64_decode($result->DownloadImageResult);
} catch ( SoapException $e ) {
throw new Downlo... | [
"public",
"function",
"download",
"(",
")",
"{",
"try",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"DownloadImage",
"(",
"array",
"(",
"'filename'",
"=>",
"basename",
"(",
"$",
"this",
"->",
"filename",
")",
",",
")",
... | Download an image file from Livedocx
@return string
@throws DownloadException | [
"Download",
"an",
"image",
"file",
"from",
"Livedocx"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Image.php#L191-L202 |
222,969 | awakenweb/livedocx | src/Image.php | Image.exists | public function exists()
{
try {
$result = $this->getSoapClient()->ImageExists(array(
'filename' => basename($this->filename) ,
));
return ( boolean ) $result->ImageExistsResult;
} catch ( SoapException $e ) {
throw new StatusException... | php | public function exists()
{
try {
$result = $this->getSoapClient()->ImageExists(array(
'filename' => basename($this->filename) ,
));
return ( boolean ) $result->ImageExistsResult;
} catch ( SoapException $e ) {
throw new StatusException... | [
"public",
"function",
"exists",
"(",
")",
"{",
"try",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"ImageExists",
"(",
"array",
"(",
"'filename'",
"=>",
"basename",
"(",
"$",
"this",
"->",
"filename",
")",
",",
")",
")... | Check if an image exists on the Livedocx service
@return boolean
@throws StatusException | [
"Check",
"if",
"an",
"image",
"exists",
"on",
"the",
"Livedocx",
"service"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Image.php#L211-L222 |
222,970 | awakenweb/livedocx | src/Image.php | Image.delete | public function delete()
{
try {
$this->getSoapClient()->DeleteImage([
'filename' => basename($this->getName(true)) ,
]);
return $this;
} catch ( SoapException $e ) {
throw new DeleteException('Error while deleting the image' , $e);
... | php | public function delete()
{
try {
$this->getSoapClient()->DeleteImage([
'filename' => basename($this->getName(true)) ,
]);
return $this;
} catch ( SoapException $e ) {
throw new DeleteException('Error while deleting the image' , $e);
... | [
"public",
"function",
"delete",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"DeleteImage",
"(",
"[",
"'filename'",
"=>",
"basename",
"(",
"$",
"this",
"->",
"getName",
"(",
"true",
")",
")",
",",
"]",
")",
";",
"r... | Delete the file from the Livedocx service
@return Image
@throws DeleteException | [
"Delete",
"the",
"file",
"from",
"the",
"Livedocx",
"service"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Image.php#L231-L242 |
222,971 | mongator/mongator | src/Mongator/Repository.php | Repository.text | public function text($search, array $filter = array(), $fields = array(), $limit = null, $language = null, $options = array())
{
$command = array(
'text' => $this->getCollectionName(),
'search' => $search,
'filter' => $filter,
'project' => $fields,
... | php | public function text($search, array $filter = array(), $fields = array(), $limit = null, $language = null, $options = array())
{
$command = array(
'text' => $this->getCollectionName(),
'search' => $search,
'filter' => $filter,
'project' => $fields,
... | [
"public",
"function",
"text",
"(",
"$",
"search",
",",
"array",
"$",
"filter",
"=",
"array",
"(",
")",
",",
"$",
"fields",
"=",
"array",
"(",
")",
",",
"$",
"limit",
"=",
"null",
",",
"$",
"language",
"=",
"null",
",",
"$",
"options",
"=",
"array... | Search text content stored in the text index.
@param string $search A string of terms that MongoDB parses and uses to query the text index.
@param array $filter (optional) A query array, you can use any valid MongoDB query
@param array $fields (optional) Allows you to limit the fields returned by the query ... | [
"Search",
"text",
"content",
"stored",
"in",
"the",
"text",
"index",
"."
] | c29b94989677597a84dc5d3907224bf608967c26 | https://github.com/mongator/mongator/blob/c29b94989677597a84dc5d3907224bf608967c26/src/Mongator/Repository.php#L379-L391 |
222,972 | mongator/mongator | src/Mongator/Repository.php | Repository.mapReduce | public function mapReduce(
$map, $reduce, array $out, array $query = array(),
array $command = array(), $options = array())
{
$command = array_merge($command, array(
'mapreduce' => $this->getCollectionName(),
'map' => is_string($map) ? new \MongoCode($ma... | php | public function mapReduce(
$map, $reduce, array $out, array $query = array(),
array $command = array(), $options = array())
{
$command = array_merge($command, array(
'mapreduce' => $this->getCollectionName(),
'map' => is_string($map) ? new \MongoCode($ma... | [
"public",
"function",
"mapReduce",
"(",
"$",
"map",
",",
"$",
"reduce",
",",
"array",
"$",
"out",
",",
"array",
"$",
"query",
"=",
"array",
"(",
")",
",",
"array",
"$",
"command",
"=",
"array",
"(",
")",
",",
"$",
"options",
"=",
"array",
"(",
")... | Shortcut to make map reduce.
@param mixed $map The map function.
@param mixed $reduce The reduce function.
@param array $out The out.
@param array $query The query (optional).
@param array $options Extra options for the command (optional).
@return array With the
@throws \RuntimeException If the database r... | [
"Shortcut",
"to",
"make",
"map",
"reduce",
"."
] | c29b94989677597a84dc5d3907224bf608967c26 | https://github.com/mongator/mongator/blob/c29b94989677597a84dc5d3907224bf608967c26/src/Mongator/Repository.php#L406-L425 |
222,973 | mongator/mongator | src/Mongator/Repository.php | Repository.aggregate | public function aggregate(array $pipeline, array $options = array())
{
$command = array(
'aggregate' => $this->getCollectionName(),
'pipeline' => $pipeline
);
$result = $this->command($command, $options);
return $result['result'];
} | php | public function aggregate(array $pipeline, array $options = array())
{
$command = array(
'aggregate' => $this->getCollectionName(),
'pipeline' => $pipeline
);
$result = $this->command($command, $options);
return $result['result'];
} | [
"public",
"function",
"aggregate",
"(",
"array",
"$",
"pipeline",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"command",
"=",
"array",
"(",
"'aggregate'",
"=>",
"$",
"this",
"->",
"getCollectionName",
"(",
")",
",",
"'pipeline'",... | Shortcut to make an aggregation.
@param array $pipeline The pipeline for aggregation
@param array $options Extra options for the command (optional).
@return array With the aggregation
@throws \RuntimeException If the database returns an error. | [
"Shortcut",
"to",
"make",
"an",
"aggregation",
"."
] | c29b94989677597a84dc5d3907224bf608967c26 | https://github.com/mongator/mongator/blob/c29b94989677597a84dc5d3907224bf608967c26/src/Mongator/Repository.php#L437-L446 |
222,974 | stil/cool-captcha | src/Captcha.php | Captcha.createImage | public function createImage()
{
$ini = microtime(true);
/** Initialization */
$this->imageAllocate();
/** Text insertion */
$text = $this->getCaptchaText();
$fontcfg = $this->fonts[array_rand($this->fonts)];
$this->writeText($text, $fontcfg);
... | php | public function createImage()
{
$ini = microtime(true);
/** Initialization */
$this->imageAllocate();
/** Text insertion */
$text = $this->getCaptchaText();
$fontcfg = $this->fonts[array_rand($this->fonts)];
$this->writeText($text, $fontcfg);
... | [
"public",
"function",
"createImage",
"(",
")",
"{",
"$",
"ini",
"=",
"microtime",
"(",
"true",
")",
";",
"/** Initialization */",
"$",
"this",
"->",
"imageAllocate",
"(",
")",
";",
"/** Text insertion */",
"$",
"text",
"=",
"$",
"this",
"->",
"getCaptchaText... | Generates captcha and outputs it to the browser.
@return string Text answer of generated captcha | [
"Generates",
"captcha",
"and",
"outputs",
"it",
"to",
"the",
"browser",
"."
] | 9883c01a8135dddf22e3fd76075e4d21bd059195 | https://github.com/stil/cool-captcha/blob/9883c01a8135dddf22e3fd76075e4d21bd059195/src/Captcha.php#L159-L197 |
222,975 | stil/cool-captcha | src/Captcha.php | Captcha.imageAllocate | protected function imageAllocate()
{
// Cleanup
if (!empty($this->im)) {
imagedestroy($this->im);
}
$this->im = imagecreatetruecolor($this->width*$this->scale, $this->height*$this->scale);
// Background color
$this->GdBgColor = imagecolorallocate(
... | php | protected function imageAllocate()
{
// Cleanup
if (!empty($this->im)) {
imagedestroy($this->im);
}
$this->im = imagecreatetruecolor($this->width*$this->scale, $this->height*$this->scale);
// Background color
$this->GdBgColor = imagecolorallocate(
... | [
"protected",
"function",
"imageAllocate",
"(",
")",
"{",
"// Cleanup",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"im",
")",
")",
"{",
"imagedestroy",
"(",
"$",
"this",
"->",
"im",
")",
";",
"}",
"$",
"this",
"->",
"im",
"=",
"imagecreatetrueco... | Creates the image resources | [
"Creates",
"the",
"image",
"resources"
] | 9883c01a8135dddf22e3fd76075e4d21bd059195 | https://github.com/stil/cool-captcha/blob/9883c01a8135dddf22e3fd76075e4d21bd059195/src/Captcha.php#L202-L233 |
222,976 | stil/cool-captcha | src/Captcha.php | Captcha.getRandomCaptchaText | protected function getRandomCaptchaText($length = null)
{
if (empty($length)) {
$length = rand($this->minWordLength, $this->maxWordLength);
}
$words = "abcdefghijlmnopqrstvwyz";
$vocals = "aeiou";
$text = "";
$vocal = rand(0, 1);
for ($i=0; $i<... | php | protected function getRandomCaptchaText($length = null)
{
if (empty($length)) {
$length = rand($this->minWordLength, $this->maxWordLength);
}
$words = "abcdefghijlmnopqrstvwyz";
$vocals = "aeiou";
$text = "";
$vocal = rand(0, 1);
for ($i=0; $i<... | [
"protected",
"function",
"getRandomCaptchaText",
"(",
"$",
"length",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"length",
")",
")",
"{",
"$",
"length",
"=",
"rand",
"(",
"$",
"this",
"->",
"minWordLength",
",",
"$",
"this",
"->",
"maxWordLeng... | Random text generation
@param int|null Text length
@return string Text | [
"Random",
"text",
"generation"
] | 9883c01a8135dddf22e3fd76075e4d21bd059195 | https://github.com/stil/cool-captcha/blob/9883c01a8135dddf22e3fd76075e4d21bd059195/src/Captcha.php#L255-L275 |
222,977 | stil/cool-captcha | src/Captcha.php | Captcha.getDictionaryCaptchaText | public function getDictionaryCaptchaText($extended = false)
{
if (empty($this->wordsFile)) {
return false;
}
// Full path of words file
if (substr($this->wordsFile, 0, 1) == '/') {
$wordsfile = $this->wordsFile;
} else {
$wordsfile = $this... | php | public function getDictionaryCaptchaText($extended = false)
{
if (empty($this->wordsFile)) {
return false;
}
// Full path of words file
if (substr($this->wordsFile, 0, 1) == '/') {
$wordsfile = $this->wordsFile;
} else {
$wordsfile = $this... | [
"public",
"function",
"getDictionaryCaptchaText",
"(",
"$",
"extended",
"=",
"false",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"wordsFile",
")",
")",
"{",
"return",
"false",
";",
"}",
"// Full path of words file",
"if",
"(",
"substr",
"(",
"$"... | Random dictionary word generation
@param boolean $extended Add extended "fake" words
@return string Word | [
"Random",
"dictionary",
"word",
"generation"
] | 9883c01a8135dddf22e3fd76075e4d21bd059195 | https://github.com/stil/cool-captcha/blob/9883c01a8135dddf22e3fd76075e4d21bd059195/src/Captcha.php#L283-L326 |
222,978 | stil/cool-captcha | src/Captcha.php | Captcha.writeLine | protected function writeLine()
{
$x1 = $this->width*$this->scale*.15;
$x2 = $this->textFinalX;
$y1 = rand($this->height*$this->scale*.40, $this->height*$this->scale*.65);
$y2 = rand($this->height*$this->scale*.40, $this->height*$this->scale*.65);
$width = $this->lineWidth/2*$... | php | protected function writeLine()
{
$x1 = $this->width*$this->scale*.15;
$x2 = $this->textFinalX;
$y1 = rand($this->height*$this->scale*.40, $this->height*$this->scale*.65);
$y2 = rand($this->height*$this->scale*.40, $this->height*$this->scale*.65);
$width = $this->lineWidth/2*$... | [
"protected",
"function",
"writeLine",
"(",
")",
"{",
"$",
"x1",
"=",
"$",
"this",
"->",
"width",
"*",
"$",
"this",
"->",
"scale",
"*",
".15",
";",
"$",
"x2",
"=",
"$",
"this",
"->",
"textFinalX",
";",
"$",
"y1",
"=",
"rand",
"(",
"$",
"this",
"... | Horizontal line insertion | [
"Horizontal",
"line",
"insertion"
] | 9883c01a8135dddf22e3fd76075e4d21bd059195 | https://github.com/stil/cool-captcha/blob/9883c01a8135dddf22e3fd76075e4d21bd059195/src/Captcha.php#L331-L342 |
222,979 | stil/cool-captcha | src/Captcha.php | Captcha.reduceImage | protected function reduceImage()
{
$imResampled = imagecreatetruecolor($this->width, $this->height);
imagecopyresampled($imResampled, $this->im,
0, 0, 0, 0,
$this->width, $this->height,
$this->width*$this->scale, $this->height*$this->scale
);
image... | php | protected function reduceImage()
{
$imResampled = imagecreatetruecolor($this->width, $this->height);
imagecopyresampled($imResampled, $this->im,
0, 0, 0, 0,
$this->width, $this->height,
$this->width*$this->scale, $this->height*$this->scale
);
image... | [
"protected",
"function",
"reduceImage",
"(",
")",
"{",
"$",
"imResampled",
"=",
"imagecreatetruecolor",
"(",
"$",
"this",
"->",
"width",
",",
"$",
"this",
"->",
"height",
")",
";",
"imagecopyresampled",
"(",
"$",
"imResampled",
",",
"$",
"this",
"->",
"im"... | Reduce the image to the final size | [
"Reduce",
"the",
"image",
"to",
"the",
"final",
"size"
] | 9883c01a8135dddf22e3fd76075e4d21bd059195 | https://github.com/stil/cool-captcha/blob/9883c01a8135dddf22e3fd76075e4d21bd059195/src/Captcha.php#L426-L436 |
222,980 | fiunchinho/rabbitmq-service-provider | src/fiunchinho/Silex/Provider/RabbitServiceProvider.php | RabbitServiceProvider.getConnection | private function getConnection($app, $options, $connections)
{
$connection_name = @$options['connection']?: self::DEFAULT_CONNECTION;
if (!isset($connections[$connection_name])) {
throw new \InvalidArgumentException('Configuration for connection [' . $connection_name . '] not found');
... | php | private function getConnection($app, $options, $connections)
{
$connection_name = @$options['connection']?: self::DEFAULT_CONNECTION;
if (!isset($connections[$connection_name])) {
throw new \InvalidArgumentException('Configuration for connection [' . $connection_name . '] not found');
... | [
"private",
"function",
"getConnection",
"(",
"$",
"app",
",",
"$",
"options",
",",
"$",
"connections",
")",
"{",
"$",
"connection_name",
"=",
"@",
"$",
"options",
"[",
"'connection'",
"]",
"?",
":",
"self",
"::",
"DEFAULT_CONNECTION",
";",
"if",
"(",
"!"... | Return the name of the connection to use.
@param array $options Options for the Producer or Consumer.
@param array $connections Connections defined in the config file.
@return string The connection name that will be used | [
"Return",
"the",
"name",
"of",
"the",
"connection",
"to",
"use",
"."
] | 89e0226c3dc7dbd4bf173c2ee8c5e9369beb1970 | https://github.com/fiunchinho/rabbitmq-service-provider/blob/89e0226c3dc7dbd4bf173c2ee8c5e9369beb1970/src/fiunchinho/Silex/Provider/RabbitServiceProvider.php#L43-L52 |
222,981 | mongator/mongator | src/Mongator/Cache/AbstractCache.php | AbstractCache.get | public function get($key)
{
if ( !$content = $this->info($key) ) {
return null;
}
return $this->unpack($content);
} | php | public function get($key)
{
if ( !$content = $this->info($key) ) {
return null;
}
return $this->unpack($content);
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"content",
"=",
"$",
"this",
"->",
"info",
"(",
"$",
"key",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"$",
"this",
"->",
"unpack",
"(",
"$",
"content",
")",... | Returns the value for a key.
@param string $key A unique key.
@return mixed The value for a key. | [
"Returns",
"the",
"value",
"for",
"a",
"key",
"."
] | c29b94989677597a84dc5d3907224bf608967c26 | https://github.com/mongator/mongator/blob/c29b94989677597a84dc5d3907224bf608967c26/src/Mongator/Cache/AbstractCache.php#L40-L47 |
222,982 | mongator/mongator | src/Mongator/Cache/AbstractCache.php | AbstractCache.pack | protected function pack($key, $value, $ttl = 0)
{
$content = array(
'key' => $key,
'time' => time(),
'ttl' => $ttl,
'value' => $value
);
return $content;
} | php | protected function pack($key, $value, $ttl = 0)
{
$content = array(
'key' => $key,
'time' => time(),
'ttl' => $ttl,
'value' => $value
);
return $content;
} | [
"protected",
"function",
"pack",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"ttl",
"=",
"0",
")",
"{",
"$",
"content",
"=",
"array",
"(",
"'key'",
"=>",
"$",
"key",
",",
"'time'",
"=>",
"time",
"(",
")",
",",
"'ttl'",
"=>",
"$",
"ttl",
",",
... | Pack the value in array with metadata
@param string $key A unique key.
@param mixed $value The value to be cached.
@param integer $ttl (optional) time to life in seconds.
@return bool Whether the cache has a key. | [
"Pack",
"the",
"value",
"in",
"array",
"with",
"metadata"
] | c29b94989677597a84dc5d3907224bf608967c26 | https://github.com/mongator/mongator/blob/c29b94989677597a84dc5d3907224bf608967c26/src/Mongator/Cache/AbstractCache.php#L87-L97 |
222,983 | mongator/mongator | src/Mongator/Cache/AbstractCache.php | AbstractCache.unpack | protected function unpack($content)
{
if ( !is_array($content) ) return null;
if ( $content['ttl'] > 0 && time() >= $content['time'] + $content['ttl'] ) {
$this->remove($content['key']);
return null;
}
return $content['value'];
} | php | protected function unpack($content)
{
if ( !is_array($content) ) return null;
if ( $content['ttl'] > 0 && time() >= $content['time'] + $content['ttl'] ) {
$this->remove($content['key']);
return null;
}
return $content['value'];
} | [
"protected",
"function",
"unpack",
"(",
"$",
"content",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"content",
")",
")",
"return",
"null",
";",
"if",
"(",
"$",
"content",
"[",
"'ttl'",
"]",
">",
"0",
"&&",
"time",
"(",
")",
">=",
"$",
"conten... | Unpack the data from cache, and unserialize the value. If ttl is ussed and is expired false is return
@param array $content Data from cache.
@return mixed | [
"Unpack",
"the",
"data",
"from",
"cache",
"and",
"unserialize",
"the",
"value",
".",
"If",
"ttl",
"is",
"ussed",
"and",
"is",
"expired",
"false",
"is",
"return"
] | c29b94989677597a84dc5d3907224bf608967c26 | https://github.com/mongator/mongator/blob/c29b94989677597a84dc5d3907224bf608967c26/src/Mongator/Cache/AbstractCache.php#L106-L117 |
222,984 | awakenweb/livedocx | src/Block.php | Block.bind | public function bind($values)
{
if ( ! is_array($values) ) {
throw new InvalidException('Values assigned to a block must be an array');
}
// only one value
if ( ! $this->isArrayMulti($values) ) {
$this->bindings[] = $values;
return $this;
... | php | public function bind($values)
{
if ( ! is_array($values) ) {
throw new InvalidException('Values assigned to a block must be an array');
}
// only one value
if ( ! $this->isArrayMulti($values) ) {
$this->bindings[] = $values;
return $this;
... | [
"public",
"function",
"bind",
"(",
"$",
"values",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"values",
")",
")",
"{",
"throw",
"new",
"InvalidException",
"(",
"'Values assigned to a block must be an array'",
")",
";",
"}",
"// only one value",
"if",
"(",
... | Bind a set of values to a block fieldname
@param array $values
@return Block
@throws InvalidException
@api | [
"Bind",
"a",
"set",
"of",
"values",
"to",
"a",
"block",
"fieldname"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Block.php#L82-L100 |
222,985 | awakenweb/livedocx | src/Block.php | Block.getAllBlockNames | public function getAllBlockNames()
{
$ret = [ ];
try {
$result = $this->getSoapClient()->GetBlockNames();
} catch ( SoapException $ex ) {
throw new StatusException('Error while getting the list of all blocks in the active template' , $ex);
}
if ( isset... | php | public function getAllBlockNames()
{
$ret = [ ];
try {
$result = $this->getSoapClient()->GetBlockNames();
} catch ( SoapException $ex ) {
throw new StatusException('Error while getting the list of all blocks in the active template' , $ex);
}
if ( isset... | [
"public",
"function",
"getAllBlockNames",
"(",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"try",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"GetBlockNames",
"(",
")",
";",
"}",
"catch",
"(",
"SoapException",
"$",
"ex"... | Return the names of all blocks included in the active template
@return array
@throws StatusException
@api | [
"Return",
"the",
"names",
"of",
"all",
"blocks",
"included",
"in",
"the",
"active",
"template"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Block.php#L137-L154 |
222,986 | awakenweb/livedocx | src/Block.php | Block.getFieldNames | public function getFieldNames()
{
$ret = [ ];
try {
$result = $this->getSoapClient()->GetBlockFieldNames([
'blockName' => $this->getName() ,
]);
} catch ( SoapException $ex ) {
throw new StatusException('Error while getting the list of all ... | php | public function getFieldNames()
{
$ret = [ ];
try {
$result = $this->getSoapClient()->GetBlockFieldNames([
'blockName' => $this->getName() ,
]);
} catch ( SoapException $ex ) {
throw new StatusException('Error while getting the list of all ... | [
"public",
"function",
"getFieldNames",
"(",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"try",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"GetBlockFieldNames",
"(",
"[",
"'blockName'",
"=>",
"$",
"this",
"->",
"getName",... | Return the list of all fields contained in this block inside the active template
@return array
@throws StatusException
@throws NameException @see Block::getName
@api | [
"Return",
"the",
"list",
"of",
"all",
"fields",
"contained",
"in",
"this",
"block",
"inside",
"the",
"active",
"template"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Block.php#L166-L186 |
222,987 | awakenweb/livedocx | src/Soap/Client.php | Client.connect | public function connect($username , $password)
{
if ( ! $this->isConnected ) {
try {
$this->client->LogIn([ 'username' => $username , 'password' => $password ]);
$this->isConnected = true;
} catch ( SoapFault $ex ) {
throw new ConnectEx... | php | public function connect($username , $password)
{
if ( ! $this->isConnected ) {
try {
$this->client->LogIn([ 'username' => $username , 'password' => $password ]);
$this->isConnected = true;
} catch ( SoapFault $ex ) {
throw new ConnectEx... | [
"public",
"function",
"connect",
"(",
"$",
"username",
",",
"$",
"password",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isConnected",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"client",
"->",
"LogIn",
"(",
"[",
"'username'",
"=>",
"$",
"username",
... | Create a session on Livedocx service
@param string $username
@param string $password
@return Client
@throws SoapException
@api | [
"Create",
"a",
"session",
"on",
"Livedocx",
"service"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Soap/Client.php#L79-L90 |
222,988 | awakenweb/livedocx | src/Soap/Client.php | Client.assocArrayToArrayOfArrayOfString | protected function assocArrayToArrayOfArrayOfString($assoc)
{
$arrayKeys = array_keys($assoc);
$arrayValues = array_values($assoc);
return array( $arrayKeys , $arrayValues );
} | php | protected function assocArrayToArrayOfArrayOfString($assoc)
{
$arrayKeys = array_keys($assoc);
$arrayValues = array_values($assoc);
return array( $arrayKeys , $arrayValues );
} | [
"protected",
"function",
"assocArrayToArrayOfArrayOfString",
"(",
"$",
"assoc",
")",
"{",
"$",
"arrayKeys",
"=",
"array_keys",
"(",
"$",
"assoc",
")",
";",
"$",
"arrayValues",
"=",
"array_values",
"(",
"$",
"assoc",
")",
";",
"return",
"array",
"(",
"$",
"... | Convert an associative PHP array to an array of array of strings
@param array $assoc
@return array
@internal | [
"Convert",
"an",
"associative",
"PHP",
"array",
"to",
"an",
"array",
"of",
"array",
"of",
"strings"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Soap/Client.php#L169-L175 |
222,989 | awakenweb/livedocx | src/Soap/Client.php | Client.multiAssocArrayToArrayOfArrayOfString | protected function multiAssocArrayToArrayOfArrayOfString($multi)
{
$arrayKeys = array_keys($multi[ 0 ]);
$arrayValues = array();
foreach ( $multi as $v ) {
$arrayValues[] = array_values($v);
}
$_arrayKeys = array();
$_arrayKeys[ 0 ] = $arrayKeys;
... | php | protected function multiAssocArrayToArrayOfArrayOfString($multi)
{
$arrayKeys = array_keys($multi[ 0 ]);
$arrayValues = array();
foreach ( $multi as $v ) {
$arrayValues[] = array_values($v);
}
$_arrayKeys = array();
$_arrayKeys[ 0 ] = $arrayKeys;
... | [
"protected",
"function",
"multiAssocArrayToArrayOfArrayOfString",
"(",
"$",
"multi",
")",
"{",
"$",
"arrayKeys",
"=",
"array_keys",
"(",
"$",
"multi",
"[",
"0",
"]",
")",
";",
"$",
"arrayValues",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"multi",
... | Convert a multidimensional PHP array to an array of array of arrays of
strings
@param array $multi
@return array
@internal | [
"Convert",
"a",
"multidimensional",
"PHP",
"array",
"to",
"an",
"array",
"of",
"array",
"of",
"arrays",
"of",
"strings"
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Soap/Client.php#L187-L200 |
222,990 | awakenweb/livedocx | src/Soap/Client.php | Client.backendListArrayToMultiAssocArray | public function backendListArrayToMultiAssocArray(stdClass $list)
{
$ret = array();
if ( isset($list->ArrayOfString) ) {
foreach ( $list->ArrayOfString as $a ) {
if ( is_array($a) ) { // 1 template only
$o = new StdClass();
... | php | public function backendListArrayToMultiAssocArray(stdClass $list)
{
$ret = array();
if ( isset($list->ArrayOfString) ) {
foreach ( $list->ArrayOfString as $a ) {
if ( is_array($a) ) { // 1 template only
$o = new StdClass();
... | [
"public",
"function",
"backendListArrayToMultiAssocArray",
"(",
"stdClass",
"$",
"list",
")",
"{",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"list",
"->",
"ArrayOfString",
")",
")",
"{",
"foreach",
"(",
"$",
"list",
"->",
"... | Convert LiveDocx service return value from list methods to consistent
PHP array.
@param stdClass $list
@return array
@internal | [
"Convert",
"LiveDocx",
"service",
"return",
"value",
"from",
"list",
"methods",
"to",
"consistent",
"PHP",
"array",
"."
] | e83abb0df1c122ed1fed67d799fd3643ca134a59 | https://github.com/awakenweb/livedocx/blob/e83abb0df1c122ed1fed67d799fd3643ca134a59/src/Soap/Client.php#L212-L241 |
222,991 | lcache/lcache | src/Address.php | Address.isMatch | public function isMatch(Address $address)
{
if (!is_null($address->getBin()) && !is_null($this->bin) && $address->getBin() !== $this->bin) {
return false;
}
if (!is_null($address->getKey()) && !is_null($this->key) && $address->getKey() !== $this->key) {
return false;
... | php | public function isMatch(Address $address)
{
if (!is_null($address->getBin()) && !is_null($this->bin) && $address->getBin() !== $this->bin) {
return false;
}
if (!is_null($address->getKey()) && !is_null($this->key) && $address->getKey() !== $this->key) {
return false;
... | [
"public",
"function",
"isMatch",
"(",
"Address",
"$",
"address",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"address",
"->",
"getBin",
"(",
")",
")",
"&&",
"!",
"is_null",
"(",
"$",
"this",
"->",
"bin",
")",
"&&",
"$",
"address",
"->",
"getBin"... | Return true if this object refers to any of the same objects as the
provided Address object.
@param Address $address
@return boolean | [
"Return",
"true",
"if",
"this",
"object",
"refers",
"to",
"any",
"of",
"the",
"same",
"objects",
"as",
"the",
"provided",
"Address",
"object",
"."
] | 275282b60811d58d9aaa3c2c752ff01e48d02f6d | https://github.com/lcache/lcache/blob/275282b60811d58d9aaa3c2c752ff01e48d02f6d/src/Address.php#L71-L80 |
222,992 | lcache/lcache | src/Address.php | Address.serialize | public function serialize()
{
if (is_null($this->bin)) {
return '';
}
$length_prefixed_bin = strlen($this->bin) . ':' . $this->bin;
if (is_null($this->key)) {
return $length_prefixed_bin . ':';
}
return $length_prefixed_bin . ':' . $this->key... | php | public function serialize()
{
if (is_null($this->bin)) {
return '';
}
$length_prefixed_bin = strlen($this->bin) . ':' . $this->bin;
if (is_null($this->key)) {
return $length_prefixed_bin . ':';
}
return $length_prefixed_bin . ':' . $this->key... | [
"public",
"function",
"serialize",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"bin",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"length_prefixed_bin",
"=",
"strlen",
"(",
"$",
"this",
"->",
"bin",
")",
".",
"':'",
".",
"$",
"... | Serialize this object, returning a string representing this address.
The serialized form must:
- Place the bin first
- Return a prefix matching all entries in a bin with a NULL key
- Return a prefix matching all entries with a NULL bin
@return string | [
"Serialize",
"this",
"object",
"returning",
"a",
"string",
"representing",
"this",
"address",
"."
] | 275282b60811d58d9aaa3c2c752ff01e48d02f6d | https://github.com/lcache/lcache/blob/275282b60811d58d9aaa3c2c752ff01e48d02f6d/src/Address.php#L93-L105 |
222,993 | lcache/lcache | src/Address.php | Address.unserialize | public function unserialize($serialized)
{
$entries = explode(':', $serialized, 2);
$this->bin = null;
$this->key = null;
if (count($entries) === 2) {
list($bin_length, $bin_and_key) = $entries;
$bin_length = intval($bin_length);
$this->bin = subst... | php | public function unserialize($serialized)
{
$entries = explode(':', $serialized, 2);
$this->bin = null;
$this->key = null;
if (count($entries) === 2) {
list($bin_length, $bin_and_key) = $entries;
$bin_length = intval($bin_length);
$this->bin = subst... | [
"public",
"function",
"unserialize",
"(",
"$",
"serialized",
")",
"{",
"$",
"entries",
"=",
"explode",
"(",
"':'",
",",
"$",
"serialized",
",",
"2",
")",
";",
"$",
"this",
"->",
"bin",
"=",
"null",
";",
"$",
"this",
"->",
"key",
"=",
"null",
";",
... | Unpack a serialized Address into this object.
@param string $serialized | [
"Unpack",
"a",
"serialized",
"Address",
"into",
"this",
"object",
"."
] | 275282b60811d58d9aaa3c2c752ff01e48d02f6d | https://github.com/lcache/lcache/blob/275282b60811d58d9aaa3c2c752ff01e48d02f6d/src/Address.php#L111-L127 |
222,994 | lcache/lcache | src/StateL1APCu.php | StateL1APCu.recordEvent | private function recordEvent($key)
{
$success = null;
apcu_inc($key, 1, $success);
if ($success !== null && !$success) {
// @TODO: Remove this fallback when we drop APCu 4.x support.
// @codeCoverageIgnoreStart
// Ignore coverage because (1) it's tested wi... | php | private function recordEvent($key)
{
$success = null;
apcu_inc($key, 1, $success);
if ($success !== null && !$success) {
// @TODO: Remove this fallback when we drop APCu 4.x support.
// @codeCoverageIgnoreStart
// Ignore coverage because (1) it's tested wi... | [
"private",
"function",
"recordEvent",
"(",
"$",
"key",
")",
"{",
"$",
"success",
"=",
"null",
";",
"apcu_inc",
"(",
"$",
"key",
",",
"1",
",",
"$",
"success",
")",
";",
"if",
"(",
"$",
"success",
"!==",
"null",
"&&",
"!",
"$",
"success",
")",
"{"... | Utility method to reduce code duplication.
@param string $key
Key to store the evet counters in.
@return bool
True on success, false otherwise. | [
"Utility",
"method",
"to",
"reduce",
"code",
"duplication",
"."
] | 275282b60811d58d9aaa3c2c752ff01e48d02f6d | https://github.com/lcache/lcache/blob/275282b60811d58d9aaa3c2c752ff01e48d02f6d/src/StateL1APCu.php#L70-L83 |
222,995 | mongator/mongator | src/Mongator/IndexManager.php | IndexManager.getDiff | public function getDiff()
{
$set = $this->getIndexInfo();
unset($set['_id_1']);
$present = array();
$missing = array();
foreach ($this->config as $index) {
if ( !isset($index['options']) ) $index['options'] = array();
$name = $this->generateIndexKey... | php | public function getDiff()
{
$set = $this->getIndexInfo();
unset($set['_id_1']);
$present = array();
$missing = array();
foreach ($this->config as $index) {
if ( !isset($index['options']) ) $index['options'] = array();
$name = $this->generateIndexKey... | [
"public",
"function",
"getDiff",
"(",
")",
"{",
"$",
"set",
"=",
"$",
"this",
"->",
"getIndexInfo",
"(",
")",
";",
"unset",
"(",
"$",
"set",
"[",
"'_id_1'",
"]",
")",
";",
"$",
"present",
"=",
"array",
"(",
")",
";",
"$",
"missing",
"=",
"array",... | Returns the diferences between server indexes and class config, when a indexes change
will be marked in db as unknown and missing the new version.
@return array Associative array with keys: missing, present and unknown
@api | [
"Returns",
"the",
"diferences",
"between",
"server",
"indexes",
"and",
"class",
"config",
"when",
"a",
"indexes",
"change",
"will",
"be",
"marked",
"in",
"db",
"as",
"unknown",
"and",
"missing",
"the",
"new",
"version",
"."
] | c29b94989677597a84dc5d3907224bf608967c26 | https://github.com/mongator/mongator/blob/c29b94989677597a84dc5d3907224bf608967c26/src/Mongator/IndexManager.php#L80-L105 |
222,996 | mongator/mongator | src/Mongator/IndexManager.php | IndexManager.commit | public function commit($delete = true)
{
$diff = $this->getDiff();
if ($delete) {
foreach ($diff['unknown'] as $index) {
$this->deleteIndex($index['name']);
}
}
foreach ($diff['missing'] as $name => $index) {
$this->ensureIndex($i... | php | public function commit($delete = true)
{
$diff = $this->getDiff();
if ($delete) {
foreach ($diff['unknown'] as $index) {
$this->deleteIndex($index['name']);
}
}
foreach ($diff['missing'] as $name => $index) {
$this->ensureIndex($i... | [
"public",
"function",
"commit",
"(",
"$",
"delete",
"=",
"true",
")",
"{",
"$",
"diff",
"=",
"$",
"this",
"->",
"getDiff",
"(",
")",
";",
"if",
"(",
"$",
"delete",
")",
"{",
"foreach",
"(",
"$",
"diff",
"[",
"'unknown'",
"]",
"as",
"$",
"index",
... | Commit the indexes to the database
@param boolean $delete (optional) true by default or the unknown indexes will be dropeed from collection
@return boolean
@api | [
"Commit",
"the",
"indexes",
"to",
"the",
"database"
] | c29b94989677597a84dc5d3907224bf608967c26 | https://github.com/mongator/mongator/blob/c29b94989677597a84dc5d3907224bf608967c26/src/Mongator/IndexManager.php#L116-L131 |
222,997 | mongator/mongator | src/Mongator/Query/Query.php | Query.text | public function text($search, $requiredScore = null, $language = null)
{
if ($search === null) {
$this->text = null;
} else {
$this->text = array(
'search' => $search,
'requiredScore' => $requiredScore,
'language' => $language
... | php | public function text($search, $requiredScore = null, $language = null)
{
if ($search === null) {
$this->text = null;
} else {
$this->text = array(
'search' => $search,
'requiredScore' => $requiredScore,
'language' => $language
... | [
"public",
"function",
"text",
"(",
"$",
"search",
",",
"$",
"requiredScore",
"=",
"null",
",",
"$",
"language",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"search",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"text",
"=",
"null",
";",
"}",
"else",
"{... | Set the text search criterias. The text methods requires a text index.
@param string $search A string of terms
@param int $requiredScore (optional) All the documents with less score will be omitted
@param int $language (optional) Specify the language that determines for the search the list of stop wo... | [
"Set",
"the",
"text",
"search",
"criterias",
".",
"The",
"text",
"methods",
"requires",
"a",
"text",
"index",
"."
] | c29b94989677597a84dc5d3907224bf608967c26 | https://github.com/mongator/mongator/blob/c29b94989677597a84dc5d3907224bf608967c26/src/Mongator/Query/Query.php#L537-L550 |
222,998 | mongator/mongator | src/Mongator/Query/Query.php | Query.createResult | public function createResult()
{
if (!$this->text) {
return false;
}
list($search, $requiredScore, $language) = array_values($this->text);
$limit = $this->limit;
if ($this->skip && $this->limit) {
$limit += $this->skip;
}
$options = ... | php | public function createResult()
{
if (!$this->text) {
return false;
}
list($search, $requiredScore, $language) = array_values($this->text);
$limit = $this->limit;
if ($this->skip && $this->limit) {
$limit += $this->skip;
}
$options = ... | [
"public",
"function",
"createResult",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"text",
")",
"{",
"return",
"false",
";",
"}",
"list",
"(",
"$",
"search",
",",
"$",
"requiredScore",
",",
"$",
"language",
")",
"=",
"array_values",
"(",
"$",
... | Create an ArrayObject with a result's text command of the query.
@return Result A iterable object with the data of the query. | [
"Create",
"an",
"ArrayObject",
"with",
"a",
"result",
"s",
"text",
"command",
"of",
"the",
"query",
"."
] | c29b94989677597a84dc5d3907224bf608967c26 | https://github.com/mongator/mongator/blob/c29b94989677597a84dc5d3907224bf608967c26/src/Mongator/Query/Query.php#L667-L707 |
222,999 | mongator/mongator | src/Mongator/Query/Query.php | Query.generateKey | public function generateKey($includeHash = true)
{
$keys = array();
$keys['vars'] = get_object_vars($this);
$keys['class'] = get_class($this);
$keys['metadata'] = $this->repository->getMetadata();
$keys['dbname'] = $this->repository->getConnection()->getDbName();
un... | php | public function generateKey($includeHash = true)
{
$keys = array();
$keys['vars'] = get_object_vars($this);
$keys['class'] = get_class($this);
$keys['metadata'] = $this->repository->getMetadata();
$keys['dbname'] = $this->repository->getConnection()->getDbName();
un... | [
"public",
"function",
"generateKey",
"(",
"$",
"includeHash",
"=",
"true",
")",
"{",
"$",
"keys",
"=",
"array",
"(",
")",
";",
"$",
"keys",
"[",
"'vars'",
"]",
"=",
"get_object_vars",
"(",
"$",
"this",
")",
";",
"$",
"keys",
"[",
"'class'",
"]",
"=... | Generate a unique key for this query
@return string md5 | [
"Generate",
"a",
"unique",
"key",
"for",
"this",
"query"
] | c29b94989677597a84dc5d3907224bf608967c26 | https://github.com/mongator/mongator/blob/c29b94989677597a84dc5d3907224bf608967c26/src/Mongator/Query/Query.php#L729-L741 |
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.