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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
223,300 | Torann/laravel-asana | src/Asana.php | Asana.getWorkspaceTags | public function getWorkspaceTags($workspaceId = null)
{
$workspaceId = $workspaceId ?: $this->defaultWorkspaceId;
return $this->curl->get("workspaces/{$workspaceId}/tags");
} | php | public function getWorkspaceTags($workspaceId = null)
{
$workspaceId = $workspaceId ?: $this->defaultWorkspaceId;
return $this->curl->get("workspaces/{$workspaceId}/tags");
} | [
"public",
"function",
"getWorkspaceTags",
"(",
"$",
"workspaceId",
"=",
"null",
")",
"{",
"$",
"workspaceId",
"=",
"$",
"workspaceId",
"?",
":",
"$",
"this",
"->",
"defaultWorkspaceId",
";",
"return",
"$",
"this",
"->",
"curl",
"->",
"get",
"(",
"\"workspa... | Returns tags of all workspace.
@param string $workspaceId The id of the workspace
@return string|null | [
"Returns",
"tags",
"of",
"all",
"workspace",
"."
] | 6e669720dbc3e66f19ffb637865eab9d5ae9d299 | https://github.com/Torann/laravel-asana/blob/6e669720dbc3e66f19ffb637865eab9d5ae9d299/src/Asana.php#L604-L609 |
223,301 | Torann/laravel-asana | src/Asana.php | Asana.getWorkspaceUsers | public function getWorkspaceUsers($workspaceId = null)
{
$workspaceId = $workspaceId ?: $this->defaultWorkspaceId;
return $this->curl->get("workspaces/{$workspaceId}/users");
} | php | public function getWorkspaceUsers($workspaceId = null)
{
$workspaceId = $workspaceId ?: $this->defaultWorkspaceId;
return $this->curl->get("workspaces/{$workspaceId}/users");
} | [
"public",
"function",
"getWorkspaceUsers",
"(",
"$",
"workspaceId",
"=",
"null",
")",
"{",
"$",
"workspaceId",
"=",
"$",
"workspaceId",
"?",
":",
"$",
"this",
"->",
"defaultWorkspaceId",
";",
"return",
"$",
"this",
"->",
"curl",
"->",
"get",
"(",
"\"worksp... | Returns users of all workspace.
@param string $workspaceId The id of the workspace
@return string|null | [
"Returns",
"users",
"of",
"all",
"workspace",
"."
] | 6e669720dbc3e66f19ffb637865eab9d5ae9d299 | https://github.com/Torann/laravel-asana/blob/6e669720dbc3e66f19ffb637865eab9d5ae9d299/src/Asana.php#L618-L623 |
223,302 | Torann/laravel-asana | src/Asana.php | Asana.getProjectEvents | public function getProjectEvents($projectId = null)
{
$projectId = $projectId ?: $this->defaultProjectId;
return $this->curl->get("projects/{$projectId}/events");
} | php | public function getProjectEvents($projectId = null)
{
$projectId = $projectId ?: $this->defaultProjectId;
return $this->curl->get("projects/{$projectId}/events");
} | [
"public",
"function",
"getProjectEvents",
"(",
"$",
"projectId",
"=",
"null",
")",
"{",
"$",
"projectId",
"=",
"$",
"projectId",
"?",
":",
"$",
"this",
"->",
"defaultProjectId",
";",
"return",
"$",
"this",
"->",
"curl",
"->",
"get",
"(",
"\"projects/{$proj... | Returns events of a given project
@param string $projectId The id of the project
@return string|null | [
"Returns",
"events",
"of",
"a",
"given",
"project"
] | 6e669720dbc3e66f19ffb637865eab9d5ae9d299 | https://github.com/Torann/laravel-asana/blob/6e669720dbc3e66f19ffb637865eab9d5ae9d299/src/Asana.php#L632-L637 |
223,303 | stuttter/wp-event-calendar | wp-event-calendar/includes/common/list-table-day.php | WP_Event_Calendar_Day_Table.setup_item | protected function setup_item( $post = false, $max = 10 ) {
// Calculate start day
if ( ! empty( $this->item_start ) ) {
$start_day = date_i18n( 'j', $this->item_start );
$start_hour = date_i18n( 'G', $this->item_start );
} else {
$start_day = 0;
$start_hour = 0;
}
// Calculate end day
if ( ... | php | protected function setup_item( $post = false, $max = 10 ) {
// Calculate start day
if ( ! empty( $this->item_start ) ) {
$start_day = date_i18n( 'j', $this->item_start );
$start_hour = date_i18n( 'G', $this->item_start );
} else {
$start_day = 0;
$start_hour = 0;
}
// Calculate end day
if ( ... | [
"protected",
"function",
"setup_item",
"(",
"$",
"post",
"=",
"false",
",",
"$",
"max",
"=",
"10",
")",
"{",
"// Calculate start day",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"item_start",
")",
")",
"{",
"$",
"start_day",
"=",
"date_i18n",
"("... | Add a post to the items array, keyed by day
@todo Repeat & expire
@since 0.1.8
@param object $post
@param int $max | [
"Add",
"a",
"post",
"to",
"the",
"items",
"array",
"keyed",
"by",
"day"
] | e2221b52f0683c105c64fca056daa63763ea8665 | https://github.com/stuttter/wp-event-calendar/blob/e2221b52f0683c105c64fca056daa63763ea8665/wp-event-calendar/includes/common/list-table-day.php#L109-L168 |
223,304 | stuttter/wp-event-calendar | wp-event-calendar/includes/common/list-table-day.php | WP_Event_Calendar_Day_Table.pagination | protected function pagination( $args = array() ) {
// Parse args
$r = wp_parse_args( $args, array(
'small' => '1 day',
'large' => '1 week',
'labels' => array(
'next_small' => esc_html__( 'Tomorrow', 'wp-event-calendar' ),
'next_large' => esc_html__( 'Next Week', 'wp-event-calendar' ),
... | php | protected function pagination( $args = array() ) {
// Parse args
$r = wp_parse_args( $args, array(
'small' => '1 day',
'large' => '1 week',
'labels' => array(
'next_small' => esc_html__( 'Tomorrow', 'wp-event-calendar' ),
'next_large' => esc_html__( 'Next Week', 'wp-event-calendar' ),
... | [
"protected",
"function",
"pagination",
"(",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"// Parse args",
"$",
"r",
"=",
"wp_parse_args",
"(",
"$",
"args",
",",
"array",
"(",
"'small'",
"=>",
"'1 day'",
",",
"'large'",
"=>",
"'1 week'",
",",
"'labels'"... | Paginate through days & weeks
@since 0.1.8
@param array $args | [
"Paginate",
"through",
"days",
"&",
"weeks"
] | e2221b52f0683c105c64fca056daa63763ea8665 | https://github.com/stuttter/wp-event-calendar/blob/e2221b52f0683c105c64fca056daa63763ea8665/wp-event-calendar/includes/common/list-table-day.php#L177-L193 |
223,305 | stuttter/wp-event-calendar | wp-event-calendar/includes/common/list-table-day.php | WP_Event_Calendar_Day_Table.display_mode | protected function display_mode() {
// Get timestamp
$timestamp = mktime( 0, 0, 0, $this->month, $this->day, $this->year );
$this_month = getdate( $timestamp );
$start_day = $this_month['wday'];
// All day events
echo $this->get_all_day_row();
// Multi day events
echo $this->get_multi_day_row();
... | php | protected function display_mode() {
// Get timestamp
$timestamp = mktime( 0, 0, 0, $this->month, $this->day, $this->year );
$this_month = getdate( $timestamp );
$start_day = $this_month['wday'];
// All day events
echo $this->get_all_day_row();
// Multi day events
echo $this->get_multi_day_row();
... | [
"protected",
"function",
"display_mode",
"(",
")",
"{",
"// Get timestamp",
"$",
"timestamp",
"=",
"mktime",
"(",
"0",
",",
"0",
",",
"0",
",",
"$",
"this",
"->",
"month",
",",
"$",
"this",
"->",
"day",
",",
"$",
"this",
"->",
"year",
")",
";",
"$"... | Display a calendar by mode & range
@since 0.1.8 | [
"Display",
"a",
"calendar",
"by",
"mode",
"&",
"range"
] | e2221b52f0683c105c64fca056daa63763ea8665 | https://github.com/stuttter/wp-event-calendar/blob/e2221b52f0683c105c64fca056daa63763ea8665/wp-event-calendar/includes/common/list-table-day.php#L333-L361 |
223,306 | mjanser/php-systemctl | Service.php | Service.isRunning | public function isRunning()
{
$process = $this->getProcess([
'--lines=0',
'status',
$this->name,
]);
$process->run();
if ($process->isSuccessful()) {
return true;
}
if (self::STATUS_STOPPED === $process->getExitCode())... | php | public function isRunning()
{
$process = $this->getProcess([
'--lines=0',
'status',
$this->name,
]);
$process->run();
if ($process->isSuccessful()) {
return true;
}
if (self::STATUS_STOPPED === $process->getExitCode())... | [
"public",
"function",
"isRunning",
"(",
")",
"{",
"$",
"process",
"=",
"$",
"this",
"->",
"getProcess",
"(",
"[",
"'--lines=0'",
",",
"'status'",
",",
"$",
"this",
"->",
"name",
",",
"]",
")",
";",
"$",
"process",
"->",
"run",
"(",
")",
";",
"if",
... | Checks whether or not the service is running.
@throws CommandFailedException If the command failed
@return bool | [
"Checks",
"whether",
"or",
"not",
"the",
"service",
"is",
"running",
"."
] | d3e11f6451260bfbb935830d444e16b0dfc7de31 | https://github.com/mjanser/php-systemctl/blob/d3e11f6451260bfbb935830d444e16b0dfc7de31/Service.php#L87-L105 |
223,307 | mjanser/php-systemctl | Service.php | Service.stop | public function stop()
{
if (!$this->isRunning()) {
return;
}
$process = $this->getProcess([
'stop',
$this->name,
]);
$process->run();
if (!$process->isSuccessful()) {
throw new CommandFailedException($process);
... | php | public function stop()
{
if (!$this->isRunning()) {
return;
}
$process = $this->getProcess([
'stop',
$this->name,
]);
$process->run();
if (!$process->isSuccessful()) {
throw new CommandFailedException($process);
... | [
"public",
"function",
"stop",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isRunning",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"process",
"=",
"$",
"this",
"->",
"getProcess",
"(",
"[",
"'stop'",
",",
"$",
"this",
"->",
"name",
",",
... | Stops the service.
@throws CommandFailedException If the command failed | [
"Stops",
"the",
"service",
"."
] | d3e11f6451260bfbb935830d444e16b0dfc7de31 | https://github.com/mjanser/php-systemctl/blob/d3e11f6451260bfbb935830d444e16b0dfc7de31/Service.php#L135-L151 |
223,308 | mjanser/php-systemctl | Service.php | Service.restart | public function restart()
{
$process = $this->getProcess([
'restart',
$this->name,
]);
$process->run();
if (!$process->isSuccessful()) {
throw new CommandFailedException($process);
}
} | php | public function restart()
{
$process = $this->getProcess([
'restart',
$this->name,
]);
$process->run();
if (!$process->isSuccessful()) {
throw new CommandFailedException($process);
}
} | [
"public",
"function",
"restart",
"(",
")",
"{",
"$",
"process",
"=",
"$",
"this",
"->",
"getProcess",
"(",
"[",
"'restart'",
",",
"$",
"this",
"->",
"name",
",",
"]",
")",
";",
"$",
"process",
"->",
"run",
"(",
")",
";",
"if",
"(",
"!",
"$",
"p... | Restarts the service.
@throws CommandFailedException If the command failed | [
"Restarts",
"the",
"service",
"."
] | d3e11f6451260bfbb935830d444e16b0dfc7de31 | https://github.com/mjanser/php-systemctl/blob/d3e11f6451260bfbb935830d444e16b0dfc7de31/Service.php#L158-L170 |
223,309 | mjanser/php-systemctl | Service.php | Service.getProcess | private function getProcess(array $arguments)
{
$command = explode(' ', self::$command);
if (self::$sudo) {
array_unshift($command, 'sudo');
}
$command = array_merge($command, $arguments);
$process = new Process($command);
$process->setTimeout(self::$time... | php | private function getProcess(array $arguments)
{
$command = explode(' ', self::$command);
if (self::$sudo) {
array_unshift($command, 'sudo');
}
$command = array_merge($command, $arguments);
$process = new Process($command);
$process->setTimeout(self::$time... | [
"private",
"function",
"getProcess",
"(",
"array",
"$",
"arguments",
")",
"{",
"$",
"command",
"=",
"explode",
"(",
"' '",
",",
"self",
"::",
"$",
"command",
")",
";",
"if",
"(",
"self",
"::",
"$",
"sudo",
")",
"{",
"array_unshift",
"(",
"$",
"comman... | Creates and prepares a process.
@param string[] $arguments
@return Process | [
"Creates",
"and",
"prepares",
"a",
"process",
"."
] | d3e11f6451260bfbb935830d444e16b0dfc7de31 | https://github.com/mjanser/php-systemctl/blob/d3e11f6451260bfbb935830d444e16b0dfc7de31/Service.php#L187-L199 |
223,310 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.getSingleIdReflectionProperty | public function getSingleIdReflectionProperty()
{
if ($this->isIdentifierComposite) {
throw new BadMethodCallException("Class " . $this->name . " has a composite identifier.");
}
return $this->reflFields[$this->identifier[0]];
} | php | public function getSingleIdReflectionProperty()
{
if ($this->isIdentifierComposite) {
throw new BadMethodCallException("Class " . $this->name . " has a composite identifier.");
}
return $this->reflFields[$this->identifier[0]];
} | [
"public",
"function",
"getSingleIdReflectionProperty",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isIdentifierComposite",
")",
"{",
"throw",
"new",
"BadMethodCallException",
"(",
"\"Class \"",
".",
"$",
"this",
"->",
"name",
".",
"\" has a composite identifier.\"... | Gets the ReflectionProperty for the single identifier field.
@return \ReflectionProperty
@throws BadMethodCallException If the class has a composite identifier. | [
"Gets",
"the",
"ReflectionProperty",
"for",
"the",
"single",
"identifier",
"field",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L697-L703 |
223,311 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.getIdentifierValues | public function getIdentifierValues($entity)
{
if ($this->isIdentifierComposite) {
$id = array();
foreach ($this->identifier as $idField) {
$value = $this->reflFields[$idField]->getValue($entity);
if ($value !== null) {
$id[$idFie... | php | public function getIdentifierValues($entity)
{
if ($this->isIdentifierComposite) {
$id = array();
foreach ($this->identifier as $idField) {
$value = $this->reflFields[$idField]->getValue($entity);
if ($value !== null) {
$id[$idFie... | [
"public",
"function",
"getIdentifierValues",
"(",
"$",
"entity",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isIdentifierComposite",
")",
"{",
"$",
"id",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"identifier",
"as",
"$",
"idField",
"... | Extracts the identifier values of an entity of this class.
For composite identifiers, the identifier values are returned as an array
with the same order as the field order in {@link identifier}.
@param object $entity
@return array | [
"Extracts",
"the",
"identifier",
"values",
"of",
"an",
"entity",
"of",
"this",
"class",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L715-L739 |
223,312 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.isNullable | public function isNullable($fieldName)
{
$mapping = $this->getFieldMapping($fieldName);
if ($mapping !== false) {
return isset($mapping['nullable']) && $mapping['nullable'] == true;
}
return false;
} | php | public function isNullable($fieldName)
{
$mapping = $this->getFieldMapping($fieldName);
if ($mapping !== false) {
return isset($mapping['nullable']) && $mapping['nullable'] == true;
}
return false;
} | [
"public",
"function",
"isNullable",
"(",
"$",
"fieldName",
")",
"{",
"$",
"mapping",
"=",
"$",
"this",
"->",
"getFieldMapping",
"(",
"$",
"fieldName",
")",
";",
"if",
"(",
"$",
"mapping",
"!==",
"false",
")",
"{",
"return",
"isset",
"(",
"$",
"mapping"... | Checks if the field is not null.
@param string $fieldName The field name.
@return boolean TRUE if the field is not null, FALSE otherwise. | [
"Checks",
"if",
"the",
"field",
"is",
"not",
"null",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L1193-L1200 |
223,313 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.getColumnName | public function getColumnName($fieldName)
{
return isset($this->columnNames[$fieldName]) ?
$this->columnNames[$fieldName] : $fieldName;
} | php | public function getColumnName($fieldName)
{
return isset($this->columnNames[$fieldName]) ?
$this->columnNames[$fieldName] : $fieldName;
} | [
"public",
"function",
"getColumnName",
"(",
"$",
"fieldName",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"columnNames",
"[",
"$",
"fieldName",
"]",
")",
"?",
"$",
"this",
"->",
"columnNames",
"[",
"$",
"fieldName",
"]",
":",
"$",
"fieldName",
... | Gets a column name for a field name.
If the column name for the field cannot be found, the given field name
is returned.
@param string $fieldName The field name.
@return string The column name. | [
"Gets",
"a",
"column",
"name",
"for",
"a",
"field",
"name",
".",
"If",
"the",
"column",
"name",
"for",
"the",
"field",
"cannot",
"be",
"found",
"the",
"given",
"field",
"name",
"is",
"returned",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L1211-L1215 |
223,314 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.getAssociationMapping | public function getAssociationMapping($fieldName)
{
if ( ! isset($this->associationMappings[$fieldName])) {
throw MappingException::mappingNotFound($this->name, $fieldName);
}
return $this->associationMappings[$fieldName];
} | php | public function getAssociationMapping($fieldName)
{
if ( ! isset($this->associationMappings[$fieldName])) {
throw MappingException::mappingNotFound($this->name, $fieldName);
}
return $this->associationMappings[$fieldName];
} | [
"public",
"function",
"getAssociationMapping",
"(",
"$",
"fieldName",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"associationMappings",
"[",
"$",
"fieldName",
"]",
")",
")",
"{",
"throw",
"MappingException",
"::",
"mappingNotFound",
"(",
"$",... | Gets the mapping of an association.
@see ClassMetadataInfo::$associationMappings
@param string $fieldName The field name that represents the association in
the object model.
@return array The mapping.
@throws MappingException | [
"Gets",
"the",
"mapping",
"of",
"an",
"association",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L1247-L1253 |
223,315 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.getFieldName | public function getFieldName($columnName)
{
return isset($this->fieldNames[$columnName]) ?
$this->fieldNames[$columnName] : $columnName;
} | php | public function getFieldName($columnName)
{
return isset($this->fieldNames[$columnName]) ?
$this->fieldNames[$columnName] : $columnName;
} | [
"public",
"function",
"getFieldName",
"(",
"$",
"columnName",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"fieldNames",
"[",
"$",
"columnName",
"]",
")",
"?",
"$",
"this",
"->",
"fieldNames",
"[",
"$",
"columnName",
"]",
":",
"$",
"columnName",
... | Gets the field name for a column name.
If no field name can be found the column name is returned.
@param string $columnName The column name.
@return string The column alias. | [
"Gets",
"the",
"field",
"name",
"for",
"a",
"column",
"name",
".",
"If",
"no",
"field",
"name",
"can",
"be",
"found",
"the",
"column",
"name",
"is",
"returned",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L1273-L1277 |
223,316 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.getNamedQuery | public function getNamedQuery($queryName)
{
if ( ! isset($this->namedQueries[$queryName])) {
throw MappingException::queryNotFound($this->name, $queryName);
}
return $this->namedQueries[$queryName]['dql'];
} | php | public function getNamedQuery($queryName)
{
if ( ! isset($this->namedQueries[$queryName])) {
throw MappingException::queryNotFound($this->name, $queryName);
}
return $this->namedQueries[$queryName]['dql'];
} | [
"public",
"function",
"getNamedQuery",
"(",
"$",
"queryName",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"namedQueries",
"[",
"$",
"queryName",
"]",
")",
")",
"{",
"throw",
"MappingException",
"::",
"queryNotFound",
"(",
"$",
"this",
"->"... | Gets the named query.
@see ClassMetadataInfo::$namedQueries
@param string $queryName The query name.
@return string
@throws MappingException | [
"Gets",
"the",
"named",
"query",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L1290-L1296 |
223,317 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.getNamedNativeQuery | public function getNamedNativeQuery($queryName)
{
if ( ! isset($this->namedNativeQueries[$queryName])) {
throw MappingException::queryNotFound($this->name, $queryName);
}
return $this->namedNativeQueries[$queryName];
} | php | public function getNamedNativeQuery($queryName)
{
if ( ! isset($this->namedNativeQueries[$queryName])) {
throw MappingException::queryNotFound($this->name, $queryName);
}
return $this->namedNativeQueries[$queryName];
} | [
"public",
"function",
"getNamedNativeQuery",
"(",
"$",
"queryName",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"namedNativeQueries",
"[",
"$",
"queryName",
"]",
")",
")",
"{",
"throw",
"MappingException",
"::",
"queryNotFound",
"(",
"$",
"t... | Gets the named native query.
@see ClassMetadataInfo::$namedNativeQueries
@param string $queryName The query name.
@return array
@throws MappingException | [
"Gets",
"the",
"named",
"native",
"query",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L1319-L1326 |
223,318 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.getSqlResultSetMapping | public function getSqlResultSetMapping($name)
{
if ( ! isset($this->sqlResultSetMappings[$name])) {
throw MappingException::resultMappingNotFound($this->name, $name);
}
return $this->sqlResultSetMappings[$name];
} | php | public function getSqlResultSetMapping($name)
{
if ( ! isset($this->sqlResultSetMappings[$name])) {
throw MappingException::resultMappingNotFound($this->name, $name);
}
return $this->sqlResultSetMappings[$name];
} | [
"public",
"function",
"getSqlResultSetMapping",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"sqlResultSetMappings",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"MappingException",
"::",
"resultMappingNotFound",
"(",
"$",
... | Gets the result set mapping.
@see ClassMetadataInfo::$sqlResultSetMappings
@param string $name The result set mapping name.
@return array
@throws MappingException | [
"Gets",
"the",
"result",
"set",
"mapping",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L1349-L1356 |
223,319 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo._validateAndCompleteFieldMapping | protected function _validateAndCompleteFieldMapping(array &$mapping)
{
// Check mandatory fields
if ( ! isset($mapping['fieldName']) || strlen($mapping['fieldName']) == 0) {
throw MappingException::missingFieldName($this->name);
}
if ( ! isset($mapping['type'])) {
... | php | protected function _validateAndCompleteFieldMapping(array &$mapping)
{
// Check mandatory fields
if ( ! isset($mapping['fieldName']) || strlen($mapping['fieldName']) == 0) {
throw MappingException::missingFieldName($this->name);
}
if ( ! isset($mapping['type'])) {
... | [
"protected",
"function",
"_validateAndCompleteFieldMapping",
"(",
"array",
"&",
"$",
"mapping",
")",
"{",
"// Check mandatory fields",
"if",
"(",
"!",
"isset",
"(",
"$",
"mapping",
"[",
"'fieldName'",
"]",
")",
"||",
"strlen",
"(",
"$",
"mapping",
"[",
"'field... | Validates & completes the given field mapping.
@param array $mapping The field mapping to validate & complete.
@return array The validated and completed field mapping.
@throws MappingException | [
"Validates",
"&",
"completes",
"the",
"given",
"field",
"mapping",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L1377-L1427 |
223,320 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.getColumnNames | public function getColumnNames(array $fieldNames = null)
{
if ($fieldNames === null) {
return array_keys($this->fieldNames);
} else {
$columnNames = array();
foreach ($fieldNames as $fieldName) {
$columnNames[] = $this->getColumnName($fieldName);
... | php | public function getColumnNames(array $fieldNames = null)
{
if ($fieldNames === null) {
return array_keys($this->fieldNames);
} else {
$columnNames = array();
foreach ($fieldNames as $fieldName) {
$columnNames[] = $this->getColumnName($fieldName);
... | [
"public",
"function",
"getColumnNames",
"(",
"array",
"$",
"fieldNames",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"fieldNames",
"===",
"null",
")",
"{",
"return",
"array_keys",
"(",
"$",
"this",
"->",
"fieldNames",
")",
";",
"}",
"else",
"{",
"$",
"colum... | Gets an array containing all the column names.
@param array|null $fieldNames
@return array | [
"Gets",
"an",
"array",
"containing",
"all",
"the",
"column",
"names",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L1847-L1858 |
223,321 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.getIdentifierColumnNames | public function getIdentifierColumnNames()
{
$columnNames = array();
foreach ($this->identifier as $idProperty) {
if (isset($this->fieldMappings[$idProperty])) {
$columnNames[] = $this->fieldMappings[$idProperty]['columnName'];
continue;
}
... | php | public function getIdentifierColumnNames()
{
$columnNames = array();
foreach ($this->identifier as $idProperty) {
if (isset($this->fieldMappings[$idProperty])) {
$columnNames[] = $this->fieldMappings[$idProperty]['columnName'];
continue;
}
... | [
"public",
"function",
"getIdentifierColumnNames",
"(",
")",
"{",
"$",
"columnNames",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"identifier",
"as",
"$",
"idProperty",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"fieldMappin... | Returns an array with all the identifier column names.
@return array | [
"Returns",
"an",
"array",
"with",
"all",
"the",
"identifier",
"column",
"names",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L1865-L1884 |
223,322 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.setAssociationOverride | public function setAssociationOverride($fieldName, array $overrideMapping)
{
if ( ! isset($this->associationMappings[$fieldName])) {
throw MappingException::invalidOverrideFieldName($this->name, $fieldName);
}
$mapping = $this->associationMappings[$fieldName];
if (isset... | php | public function setAssociationOverride($fieldName, array $overrideMapping)
{
if ( ! isset($this->associationMappings[$fieldName])) {
throw MappingException::invalidOverrideFieldName($this->name, $fieldName);
}
$mapping = $this->associationMappings[$fieldName];
if (isset... | [
"public",
"function",
"setAssociationOverride",
"(",
"$",
"fieldName",
",",
"array",
"$",
"overrideMapping",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"associationMappings",
"[",
"$",
"fieldName",
"]",
")",
")",
"{",
"throw",
"MappingExcepti... | Sets the association to override association mapping of property for an entity relationship.
@param string $fieldName
@param array $overrideMapping
@return void
@throws MappingException | [
"Sets",
"the",
"association",
"to",
"override",
"association",
"mapping",
"of",
"property",
"for",
"an",
"entity",
"relationship",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L2117-L2155 |
223,323 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.setAttributeOverride | public function setAttributeOverride($fieldName, array $overrideMapping)
{
if ( ! isset($this->fieldMappings[$fieldName])) {
throw MappingException::invalidOverrideFieldName($this->name, $fieldName);
}
$mapping = $this->fieldMappings[$fieldName];
if (isset($mapping['id'... | php | public function setAttributeOverride($fieldName, array $overrideMapping)
{
if ( ! isset($this->fieldMappings[$fieldName])) {
throw MappingException::invalidOverrideFieldName($this->name, $fieldName);
}
$mapping = $this->fieldMappings[$fieldName];
if (isset($mapping['id'... | [
"public",
"function",
"setAttributeOverride",
"(",
"$",
"fieldName",
",",
"array",
"$",
"overrideMapping",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"fieldMappings",
"[",
"$",
"fieldName",
"]",
")",
")",
"{",
"throw",
"MappingException",
"... | Sets the override for a mapped field.
@param string $fieldName
@param array $overrideMapping
@return void
@throws MappingException | [
"Sets",
"the",
"override",
"for",
"a",
"mapped",
"field",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L2167-L2197 |
223,324 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.mapOneToOne | public function mapOneToOne(array $mapping)
{
$mapping['type'] = self::ONE_TO_ONE;
$mapping = $this->_validateAndCompleteOneToOneMapping($mapping);
$this->_storeAssociationMapping($mapping);
} | php | public function mapOneToOne(array $mapping)
{
$mapping['type'] = self::ONE_TO_ONE;
$mapping = $this->_validateAndCompleteOneToOneMapping($mapping);
$this->_storeAssociationMapping($mapping);
} | [
"public",
"function",
"mapOneToOne",
"(",
"array",
"$",
"mapping",
")",
"{",
"$",
"mapping",
"[",
"'type'",
"]",
"=",
"self",
"::",
"ONE_TO_ONE",
";",
"$",
"mapping",
"=",
"$",
"this",
"->",
"_validateAndCompleteOneToOneMapping",
"(",
"$",
"mapping",
")",
... | Adds a one-to-one mapping.
@param array $mapping The mapping.
@return void | [
"Adds",
"a",
"one",
"-",
"to",
"-",
"one",
"mapping",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L2512-L2517 |
223,325 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.mapOneToMany | public function mapOneToMany(array $mapping)
{
$mapping['type'] = self::ONE_TO_MANY;
$mapping = $this->_validateAndCompleteOneToManyMapping($mapping);
$this->_storeAssociationMapping($mapping);
} | php | public function mapOneToMany(array $mapping)
{
$mapping['type'] = self::ONE_TO_MANY;
$mapping = $this->_validateAndCompleteOneToManyMapping($mapping);
$this->_storeAssociationMapping($mapping);
} | [
"public",
"function",
"mapOneToMany",
"(",
"array",
"$",
"mapping",
")",
"{",
"$",
"mapping",
"[",
"'type'",
"]",
"=",
"self",
"::",
"ONE_TO_MANY",
";",
"$",
"mapping",
"=",
"$",
"this",
"->",
"_validateAndCompleteOneToManyMapping",
"(",
"$",
"mapping",
")",... | Adds a one-to-many mapping.
@param array $mapping The mapping.
@return void | [
"Adds",
"a",
"one",
"-",
"to",
"-",
"many",
"mapping",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L2526-L2531 |
223,326 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.mapManyToOne | public function mapManyToOne(array $mapping)
{
$mapping['type'] = self::MANY_TO_ONE;
// A many-to-one mapping is essentially a one-one backreference
$mapping = $this->_validateAndCompleteOneToOneMapping($mapping);
$this->_storeAssociationMapping($mapping);
} | php | public function mapManyToOne(array $mapping)
{
$mapping['type'] = self::MANY_TO_ONE;
// A many-to-one mapping is essentially a one-one backreference
$mapping = $this->_validateAndCompleteOneToOneMapping($mapping);
$this->_storeAssociationMapping($mapping);
} | [
"public",
"function",
"mapManyToOne",
"(",
"array",
"$",
"mapping",
")",
"{",
"$",
"mapping",
"[",
"'type'",
"]",
"=",
"self",
"::",
"MANY_TO_ONE",
";",
"// A many-to-one mapping is essentially a one-one backreference",
"$",
"mapping",
"=",
"$",
"this",
"->",
"_va... | Adds a many-to-one mapping.
@param array $mapping The mapping.
@return void | [
"Adds",
"a",
"many",
"-",
"to",
"-",
"one",
"mapping",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L2540-L2546 |
223,327 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.mapManyToMany | public function mapManyToMany(array $mapping)
{
$mapping['type'] = self::MANY_TO_MANY;
$mapping = $this->_validateAndCompleteManyToManyMapping($mapping);
$this->_storeAssociationMapping($mapping);
} | php | public function mapManyToMany(array $mapping)
{
$mapping['type'] = self::MANY_TO_MANY;
$mapping = $this->_validateAndCompleteManyToManyMapping($mapping);
$this->_storeAssociationMapping($mapping);
} | [
"public",
"function",
"mapManyToMany",
"(",
"array",
"$",
"mapping",
")",
"{",
"$",
"mapping",
"[",
"'type'",
"]",
"=",
"self",
"::",
"MANY_TO_MANY",
";",
"$",
"mapping",
"=",
"$",
"this",
"->",
"_validateAndCompleteManyToManyMapping",
"(",
"$",
"mapping",
"... | Adds a many-to-many mapping.
@param array $mapping The mapping.
@return void | [
"Adds",
"a",
"many",
"-",
"to",
"-",
"many",
"mapping",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L2555-L2560 |
223,328 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo._storeAssociationMapping | protected function _storeAssociationMapping(array $assocMapping)
{
$sourceFieldName = $assocMapping['fieldName'];
$this->assertFieldNotMapped($sourceFieldName);
$this->associationMappings[$sourceFieldName] = $assocMapping;
} | php | protected function _storeAssociationMapping(array $assocMapping)
{
$sourceFieldName = $assocMapping['fieldName'];
$this->assertFieldNotMapped($sourceFieldName);
$this->associationMappings[$sourceFieldName] = $assocMapping;
} | [
"protected",
"function",
"_storeAssociationMapping",
"(",
"array",
"$",
"assocMapping",
")",
"{",
"$",
"sourceFieldName",
"=",
"$",
"assocMapping",
"[",
"'fieldName'",
"]",
";",
"$",
"this",
"->",
"assertFieldNotMapped",
"(",
"$",
"sourceFieldName",
")",
";",
"$... | Stores the association mapping.
@param array $assocMapping
@return void
@throws MappingException | [
"Stores",
"the",
"association",
"mapping",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L2571-L2578 |
223,329 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.invokeLifecycleCallbacks | public function invokeLifecycleCallbacks($lifecycleEvent, $entity)
{
foreach ($this->lifecycleCallbacks[$lifecycleEvent] as $callback) {
$entity->$callback();
}
} | php | public function invokeLifecycleCallbacks($lifecycleEvent, $entity)
{
foreach ($this->lifecycleCallbacks[$lifecycleEvent] as $callback) {
$entity->$callback();
}
} | [
"public",
"function",
"invokeLifecycleCallbacks",
"(",
"$",
"lifecycleEvent",
",",
"$",
"entity",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"lifecycleCallbacks",
"[",
"$",
"lifecycleEvent",
"]",
"as",
"$",
"callback",
")",
"{",
"$",
"entity",
"->",
"$",
... | Dispatches the lifecycle event of the given entity to the registered
lifecycle callbacks and lifecycle listeners.
@deprecated Deprecated since version 2.4 in favor of \Doctrine\ORM\Event\ListenersInvoker
@param string $lifecycleEvent The lifecycle event.
@param object $entity The Entity on which the event occ... | [
"Dispatches",
"the",
"lifecycle",
"event",
"of",
"the",
"given",
"entity",
"to",
"the",
"registered",
"lifecycle",
"callbacks",
"and",
"lifecycle",
"listeners",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L2603-L2608 |
223,330 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.isAssociationWithSingleJoinColumn | public function isAssociationWithSingleJoinColumn($fieldName)
{
return (
isset($this->associationMappings[$fieldName]) &&
isset($this->associationMappings[$fieldName]['joinColumns'][0]) &&
!isset($this->associationMappings[$fieldName]['joinColumns'][1])
);
} | php | public function isAssociationWithSingleJoinColumn($fieldName)
{
return (
isset($this->associationMappings[$fieldName]) &&
isset($this->associationMappings[$fieldName]['joinColumns'][0]) &&
!isset($this->associationMappings[$fieldName]['joinColumns'][1])
);
} | [
"public",
"function",
"isAssociationWithSingleJoinColumn",
"(",
"$",
"fieldName",
")",
"{",
"return",
"(",
"isset",
"(",
"$",
"this",
"->",
"associationMappings",
"[",
"$",
"fieldName",
"]",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"associationMappings",
"[... | Is this an association that only has a single join column?
@param string $fieldName
@return bool | [
"Is",
"this",
"an",
"association",
"that",
"only",
"has",
"a",
"single",
"join",
"column?"
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L2849-L2856 |
223,331 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.getFieldForColumn | public function getFieldForColumn($columnName)
{
if (isset($this->fieldNames[$columnName])) {
return $this->fieldNames[$columnName];
} else {
foreach ($this->associationMappings as $assocName => $mapping) {
if ($this->isAssociationWithSingleJoinColumn($assocNa... | php | public function getFieldForColumn($columnName)
{
if (isset($this->fieldNames[$columnName])) {
return $this->fieldNames[$columnName];
} else {
foreach ($this->associationMappings as $assocName => $mapping) {
if ($this->isAssociationWithSingleJoinColumn($assocNa... | [
"public",
"function",
"getFieldForColumn",
"(",
"$",
"columnName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"fieldNames",
"[",
"$",
"columnName",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"fieldNames",
"[",
"$",
"columnName",
"]",
"... | Used to retrieve a fieldname for either field or association from a given column.
This method is used in foreign-key as primary-key contexts.
@param string $columnName
@return string
@throws MappingException | [
"Used",
"to",
"retrieve",
"a",
"fieldname",
"for",
"either",
"field",
"or",
"association",
"from",
"a",
"given",
"column",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L2903-L2918 |
223,332 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.setSequenceGeneratorDefinition | public function setSequenceGeneratorDefinition(array $definition)
{
if ( ! isset($definition['sequenceName'])) {
throw MappingException::missingSequenceName($this->name);
}
if ($definition['sequenceName'][0] == '`') {
$definition['sequenceName'] = trim($definition[... | php | public function setSequenceGeneratorDefinition(array $definition)
{
if ( ! isset($definition['sequenceName'])) {
throw MappingException::missingSequenceName($this->name);
}
if ($definition['sequenceName'][0] == '`') {
$definition['sequenceName'] = trim($definition[... | [
"public",
"function",
"setSequenceGeneratorDefinition",
"(",
"array",
"$",
"definition",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"definition",
"[",
"'sequenceName'",
"]",
")",
")",
"{",
"throw",
"MappingException",
"::",
"missingSequenceName",
"(",
"$",
"... | Sets the definition of the sequence ID generator for this class.
The definition must have the following structure:
<code>
array(
'sequenceName' => 'name',
'allocationSize' => 20,
'initialValue' => 1
'quoted' => 1
)
</code>
@param array $definition
@return void | [
"Sets",
"the",
"definition",
"of",
"the",
"sequence",
"ID",
"generator",
"for",
"this",
"class",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L2961-L2973 |
223,333 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.mapEmbedded | public function mapEmbedded(array $mapping)
{
$this->assertFieldNotMapped($mapping['fieldName']);
$this->embeddedClasses[$mapping['fieldName']] = array(
'class' => $this->fullyQualifiedClassName($mapping['class']),
'columnPrefix' => $mapping['columnPrefix'],
'dec... | php | public function mapEmbedded(array $mapping)
{
$this->assertFieldNotMapped($mapping['fieldName']);
$this->embeddedClasses[$mapping['fieldName']] = array(
'class' => $this->fullyQualifiedClassName($mapping['class']),
'columnPrefix' => $mapping['columnPrefix'],
'dec... | [
"public",
"function",
"mapEmbedded",
"(",
"array",
"$",
"mapping",
")",
"{",
"$",
"this",
"->",
"assertFieldNotMapped",
"(",
"$",
"mapping",
"[",
"'fieldName'",
"]",
")",
";",
"$",
"this",
"->",
"embeddedClasses",
"[",
"$",
"mapping",
"[",
"'fieldName'",
"... | Map Embedded Class
@param array $mapping
@throws MappingException
@return void | [
"Map",
"Embedded",
"Class"
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L3229-L3239 |
223,334 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.inlineEmbeddable | public function inlineEmbeddable($property, ClassMetadataInfo $embeddable)
{
foreach ($embeddable->fieldMappings as $fieldMapping) {
$fieldMapping['originalClass'] = isset($fieldMapping['originalClass'])
? $fieldMapping['originalClass']
: $embeddable->name;
... | php | public function inlineEmbeddable($property, ClassMetadataInfo $embeddable)
{
foreach ($embeddable->fieldMappings as $fieldMapping) {
$fieldMapping['originalClass'] = isset($fieldMapping['originalClass'])
? $fieldMapping['originalClass']
: $embeddable->name;
... | [
"public",
"function",
"inlineEmbeddable",
"(",
"$",
"property",
",",
"ClassMetadataInfo",
"$",
"embeddable",
")",
"{",
"foreach",
"(",
"$",
"embeddable",
"->",
"fieldMappings",
"as",
"$",
"fieldMapping",
")",
"{",
"$",
"fieldMapping",
"[",
"'originalClass'",
"]"... | Inline the embeddable class
@param string $property
@param ClassMetadataInfo $embeddable | [
"Inline",
"the",
"embeddable",
"class"
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L3247-L3275 |
223,335 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.getSequenceName | public function getSequenceName(AbstractPlatform $platform)
{
$sequencePrefix = $this->getSequencePrefix($platform);
$columnName = $this->getSingleIdentifierColumnName();
$sequenceName = $sequencePrefix . '_' . $columnName . '_seq';
return $sequenceName;
} | php | public function getSequenceName(AbstractPlatform $platform)
{
$sequencePrefix = $this->getSequencePrefix($platform);
$columnName = $this->getSingleIdentifierColumnName();
$sequenceName = $sequencePrefix . '_' . $columnName . '_seq';
return $sequenceName;
} | [
"public",
"function",
"getSequenceName",
"(",
"AbstractPlatform",
"$",
"platform",
")",
"{",
"$",
"sequencePrefix",
"=",
"$",
"this",
"->",
"getSequencePrefix",
"(",
"$",
"platform",
")",
";",
"$",
"columnName",
"=",
"$",
"this",
"->",
"getSingleIdentifierColumn... | Gets the sequence name based on class metadata.
@param AbstractPlatform $platform
@return string
@todo Sequence names should be computed in DBAL depending on the platform | [
"Gets",
"the",
"sequence",
"name",
"based",
"on",
"class",
"metadata",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L3299-L3307 |
223,336 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.getSequencePrefix | public function getSequencePrefix(AbstractPlatform $platform)
{
$tableName = $this->getTableName();
$sequencePrefix = $tableName;
// Prepend the schema name to the table name if there is one
if ($schemaName = $this->getSchemaName()) {
$sequencePrefix = $schemaName .... | php | public function getSequencePrefix(AbstractPlatform $platform)
{
$tableName = $this->getTableName();
$sequencePrefix = $tableName;
// Prepend the schema name to the table name if there is one
if ($schemaName = $this->getSchemaName()) {
$sequencePrefix = $schemaName .... | [
"public",
"function",
"getSequencePrefix",
"(",
"AbstractPlatform",
"$",
"platform",
")",
"{",
"$",
"tableName",
"=",
"$",
"this",
"->",
"getTableName",
"(",
")",
";",
"$",
"sequencePrefix",
"=",
"$",
"tableName",
";",
"// Prepend the schema name to the table name i... | Gets the sequence name prefix based on class metadata.
@param AbstractPlatform $platform
@return string
@todo Sequence names should be computed in DBAL depending on the platform | [
"Gets",
"the",
"sequence",
"name",
"prefix",
"based",
"on",
"class",
"metadata",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L3317-L3332 |
223,337 | mespronos/mespronos | src/Entity/Getters/GameGettersTrait.php | GameGettersTrait.getBets | public function getBets() {
$query = \Drupal::entityQuery('bet');
$query->condition('game', $this->id());
$games_ids = $query->execute();
return Bet::loadMultiple($games_ids);
} | php | public function getBets() {
$query = \Drupal::entityQuery('bet');
$query->condition('game', $this->id());
$games_ids = $query->execute();
return Bet::loadMultiple($games_ids);
} | [
"public",
"function",
"getBets",
"(",
")",
"{",
"$",
"query",
"=",
"\\",
"Drupal",
"::",
"entityQuery",
"(",
"'bet'",
")",
";",
"$",
"query",
"->",
"condition",
"(",
"'game'",
",",
"$",
"this",
"->",
"id",
"(",
")",
")",
";",
"$",
"games_ids",
"=",... | Return all bets for the current game
@return \Drupal\mespronos\Entity\Bet[] | [
"Return",
"all",
"bets",
"for",
"the",
"current",
"game"
] | 73757663581ed9040944768073d1d9abc761196b | https://github.com/mespronos/mespronos/blob/73757663581ed9040944768073d1d9abc761196b/src/Entity/Getters/GameGettersTrait.php#L210-L215 |
223,338 | mespronos/mespronos | src/Controller/GameController.php | GameController.getGameWithoutMarks | public static function getGameWithoutMarks($only_past = true) {
$game_storage = \Drupal::entityTypeManager()->getStorage('game');
$query = \Drupal::entityQuery('game');
if ($only_past) {
$now = new \DateTime(null, new \DateTimeZone("UTC"));
$query->condition('game_date', $now->format('Y-m-d\TH:... | php | public static function getGameWithoutMarks($only_past = true) {
$game_storage = \Drupal::entityTypeManager()->getStorage('game');
$query = \Drupal::entityQuery('game');
if ($only_past) {
$now = new \DateTime(null, new \DateTimeZone("UTC"));
$query->condition('game_date', $now->format('Y-m-d\TH:... | [
"public",
"static",
"function",
"getGameWithoutMarks",
"(",
"$",
"only_past",
"=",
"true",
")",
"{",
"$",
"game_storage",
"=",
"\\",
"Drupal",
"::",
"entityTypeManager",
"(",
")",
"->",
"getStorage",
"(",
"'game'",
")",
";",
"$",
"query",
"=",
"\\",
"Drupa... | Return array of games that has no marks setted
@param bool $only_past
@return \Drupal\mespronos\Entity\Game[] | [
"Return",
"array",
"of",
"games",
"that",
"has",
"no",
"marks",
"setted"
] | 73757663581ed9040944768073d1d9abc761196b | https://github.com/mespronos/mespronos/blob/73757663581ed9040944768073d1d9abc761196b/src/Controller/GameController.php#L26-L44 |
223,339 | mespronos/mespronos | src/Controller/GameController.php | GameController.getGamesToBet | public static function getGamesToBet(Day $day) {
$game_storage = \Drupal::entityTypeManager()->getStorage('game');
$query = \Drupal::entityQuery('game');
$now = new \DateTime(null, new \DateTimeZone("UTC"));
$query->condition('day', $day->id());
$query->condition('game_date', $now->format('Y-m-d\T... | php | public static function getGamesToBet(Day $day) {
$game_storage = \Drupal::entityTypeManager()->getStorage('game');
$query = \Drupal::entityQuery('game');
$now = new \DateTime(null, new \DateTimeZone("UTC"));
$query->condition('day', $day->id());
$query->condition('game_date', $now->format('Y-m-d\T... | [
"public",
"static",
"function",
"getGamesToBet",
"(",
"Day",
"$",
"day",
")",
"{",
"$",
"game_storage",
"=",
"\\",
"Drupal",
"::",
"entityTypeManager",
"(",
")",
"->",
"getStorage",
"(",
"'game'",
")",
";",
"$",
"query",
"=",
"\\",
"Drupal",
"::",
"entit... | Return all games available to bet on a given day
@param \Drupal\mespronos\Entity\Day $day
@return \Drupal\mespronos\Entity\Game[] | [
"Return",
"all",
"games",
"available",
"to",
"bet",
"on",
"a",
"given",
"day"
] | 73757663581ed9040944768073d1d9abc761196b | https://github.com/mespronos/mespronos/blob/73757663581ed9040944768073d1d9abc761196b/src/Controller/GameController.php#L51-L72 |
223,340 | fourlabsldn/GmailBundle | Swift/GmailApiTransport.php | GmailApiTransport.fromArrayToString | private function fromArrayToString(array $fromArray): string
{
// $fromArray = [ 'john.doe@example.com' => 'John Doe', 'jane.doe@example.com' => 'Jane Doe' ]; // sample
if (count($fromArray) > 0) {
reset($fromArray);
$fromString = key($fromArray);
return $fromStr... | php | private function fromArrayToString(array $fromArray): string
{
// $fromArray = [ 'john.doe@example.com' => 'John Doe', 'jane.doe@example.com' => 'Jane Doe' ]; // sample
if (count($fromArray) > 0) {
reset($fromArray);
$fromString = key($fromArray);
return $fromStr... | [
"private",
"function",
"fromArrayToString",
"(",
"array",
"$",
"fromArray",
")",
":",
"string",
"{",
"// $fromArray = [ 'john.doe@example.com' => 'John Doe', 'jane.doe@example.com' => 'Jane Doe' ]; // sample",
"if",
"(",
"count",
"(",
"$",
"fromArray",
")",
">",
"0",
")",
... | The Gmail API can only take one address at a time, let's get the very first one.
@param array $fromArray
@return string | [
"The",
"Gmail",
"API",
"can",
"only",
"take",
"one",
"address",
"at",
"a",
"time",
"let",
"s",
"get",
"the",
"very",
"first",
"one",
"."
] | 3a7bf480db67502ee16968699c7a28cbf3add178 | https://github.com/fourlabsldn/GmailBundle/blob/3a7bf480db67502ee16968699c7a28cbf3add178/Swift/GmailApiTransport.php#L146-L157 |
223,341 | fourlabsldn/GmailBundle | Swift/GmailApiTransport.php | GmailApiTransport.fromArrayToFailedRecipients | private function fromArrayToFailedRecipients(array $fromArray): array
{
if (count($fromArray) > 0) {
reset($fromArray);
$keyOfFirstElement = key($fromArray); // john_doe@example.com
unset($fromArray[$keyOfFirstElement]);
return $fromArray;
}
... | php | private function fromArrayToFailedRecipients(array $fromArray): array
{
if (count($fromArray) > 0) {
reset($fromArray);
$keyOfFirstElement = key($fromArray); // john_doe@example.com
unset($fromArray[$keyOfFirstElement]);
return $fromArray;
}
... | [
"private",
"function",
"fromArrayToFailedRecipients",
"(",
"array",
"$",
"fromArray",
")",
":",
"array",
"{",
"if",
"(",
"count",
"(",
"$",
"fromArray",
")",
">",
"0",
")",
"{",
"reset",
"(",
"$",
"fromArray",
")",
";",
"$",
"keyOfFirstElement",
"=",
"ke... | The Gmail API can only take one address at a time, the others are failed recipients.
@param array $fromArray
@return array | [
"The",
"Gmail",
"API",
"can",
"only",
"take",
"one",
"address",
"at",
"a",
"time",
"the",
"others",
"are",
"failed",
"recipients",
"."
] | 3a7bf480db67502ee16968699c7a28cbf3add178 | https://github.com/fourlabsldn/GmailBundle/blob/3a7bf480db67502ee16968699c7a28cbf3add178/Swift/GmailApiTransport.php#L166-L177 |
223,342 | shopsys/doctrine-orm | lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php | MappingDescribeCommand.getMappedEntities | private function getMappedEntities(EntityManagerInterface $entityManager)
{
$entityClassNames = $entityManager
->getConfiguration()
->getMetadataDriverImpl()
->getAllClassNames();
if ( ! $entityClassNames) {
throw new \InvalidArgumentException(
... | php | private function getMappedEntities(EntityManagerInterface $entityManager)
{
$entityClassNames = $entityManager
->getConfiguration()
->getMetadataDriverImpl()
->getAllClassNames();
if ( ! $entityClassNames) {
throw new \InvalidArgumentException(
... | [
"private",
"function",
"getMappedEntities",
"(",
"EntityManagerInterface",
"$",
"entityManager",
")",
"{",
"$",
"entityClassNames",
"=",
"$",
"entityManager",
"->",
"getConfiguration",
"(",
")",
"->",
"getMetadataDriverImpl",
"(",
")",
"->",
"getAllClassNames",
"(",
... | Return all mapped entity class names
@param EntityManagerInterface $entityManager
@return string[] | [
"Return",
"all",
"mapped",
"entity",
"class",
"names"
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php#L139-L154 |
223,343 | shopsys/doctrine-orm | lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php | MappingDescribeCommand.formatMappings | private function formatMappings(array $propertyMappings)
{
$output = array();
foreach ($propertyMappings as $propertyName => $mapping) {
$output[] = $this->formatField(sprintf(' %s', $propertyName), '');
foreach ($mapping as $field => $value) {
$output[] = ... | php | private function formatMappings(array $propertyMappings)
{
$output = array();
foreach ($propertyMappings as $propertyName => $mapping) {
$output[] = $this->formatField(sprintf(' %s', $propertyName), '');
foreach ($mapping as $field => $value) {
$output[] = ... | [
"private",
"function",
"formatMappings",
"(",
"array",
"$",
"propertyMappings",
")",
"{",
"$",
"output",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"propertyMappings",
"as",
"$",
"propertyName",
"=>",
"$",
"mapping",
")",
"{",
"$",
"output",
"[",
... | Format the association mappings
@param array
@return array | [
"Format",
"the",
"association",
"mappings"
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php#L264-L277 |
223,344 | shopsys/doctrine-orm | lib/Doctrine/ORM/Mapping/Builder/ManyToManyAssociationBuilder.php | ManyToManyAssociationBuilder.addInverseJoinColumn | public function addInverseJoinColumn($columnName, $referencedColumnName, $nullable = true, $unique = false, $onDelete = null, $columnDef = null)
{
$this->inverseJoinColumns[] = array(
'name' => $columnName,
'referencedColumnName' => $referencedColumnName,
'nullable' => $n... | php | public function addInverseJoinColumn($columnName, $referencedColumnName, $nullable = true, $unique = false, $onDelete = null, $columnDef = null)
{
$this->inverseJoinColumns[] = array(
'name' => $columnName,
'referencedColumnName' => $referencedColumnName,
'nullable' => $n... | [
"public",
"function",
"addInverseJoinColumn",
"(",
"$",
"columnName",
",",
"$",
"referencedColumnName",
",",
"$",
"nullable",
"=",
"true",
",",
"$",
"unique",
"=",
"false",
",",
"$",
"onDelete",
"=",
"null",
",",
"$",
"columnDef",
"=",
"null",
")",
"{",
... | Adds Inverse Join Columns.
@param string $columnName
@param string $referencedColumnName
@param bool $nullable
@param bool $unique
@param string|null $onDelete
@param string|null $columnDef
@return ManyToManyAssociationBuilder | [
"Adds",
"Inverse",
"Join",
"Columns",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Mapping/Builder/ManyToManyAssociationBuilder.php#L65-L76 |
223,345 | shopsys/doctrine-orm | lib/Doctrine/ORM/Proxy/ProxyFactory.php | ProxyFactory.createInitializer | private function createInitializer(ClassMetadata $classMetadata, EntityPersister $entityPersister)
{
if ($classMetadata->getReflectionClass()->hasMethod('__wakeup')) {
return function (BaseProxy $proxy) use ($entityPersister, $classMetadata) {
$initializer = $proxy->__getInitiali... | php | private function createInitializer(ClassMetadata $classMetadata, EntityPersister $entityPersister)
{
if ($classMetadata->getReflectionClass()->hasMethod('__wakeup')) {
return function (BaseProxy $proxy) use ($entityPersister, $classMetadata) {
$initializer = $proxy->__getInitiali... | [
"private",
"function",
"createInitializer",
"(",
"ClassMetadata",
"$",
"classMetadata",
",",
"EntityPersister",
"$",
"entityPersister",
")",
"{",
"if",
"(",
"$",
"classMetadata",
"->",
"getReflectionClass",
"(",
")",
"->",
"hasMethod",
"(",
"'__wakeup'",
")",
")",... | Creates a closure capable of initializing a proxy
@param \Doctrine\Common\Persistence\Mapping\ClassMetadata $classMetadata
@param \Doctrine\ORM\Persisters\Entity\EntityPersister $entityPersister
@return \Closure
@throws \Doctrine\ORM\EntityNotFoundException | [
"Creates",
"a",
"closure",
"capable",
"of",
"initializing",
"a",
"proxy"
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L124-L198 |
223,346 | shopsys/doctrine-orm | lib/Doctrine/ORM/Proxy/ProxyFactory.php | ProxyFactory.createCloner | private function createCloner(ClassMetadata $classMetadata, EntityPersister $entityPersister)
{
return function (BaseProxy $proxy) use ($entityPersister, $classMetadata) {
if ($proxy->__isInitialized()) {
return;
}
$proxy->__setInitialized(true);
... | php | private function createCloner(ClassMetadata $classMetadata, EntityPersister $entityPersister)
{
return function (BaseProxy $proxy) use ($entityPersister, $classMetadata) {
if ($proxy->__isInitialized()) {
return;
}
$proxy->__setInitialized(true);
... | [
"private",
"function",
"createCloner",
"(",
"ClassMetadata",
"$",
"classMetadata",
",",
"EntityPersister",
"$",
"entityPersister",
")",
"{",
"return",
"function",
"(",
"BaseProxy",
"$",
"proxy",
")",
"use",
"(",
"$",
"entityPersister",
",",
"$",
"classMetadata",
... | Creates a closure capable of finalizing state a cloned proxy
@param \Doctrine\Common\Persistence\Mapping\ClassMetadata $classMetadata
@param \Doctrine\ORM\Persisters\Entity\EntityPersister $entityPersister
@return \Closure
@throws \Doctrine\ORM\EntityNotFoundException | [
"Creates",
"a",
"closure",
"capable",
"of",
"finalizing",
"state",
"a",
"cloned",
"proxy"
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L210-L240 |
223,347 | shopsys/doctrine-orm | lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php | ClassMetadataExporter.getExporter | public function getExporter($type, $dest = null)
{
if ( ! isset(self::$_exporterDrivers[$type])) {
throw ExportException::invalidExporterDriverType($type);
}
$class = self::$_exporterDrivers[$type];
return new $class($dest);
} | php | public function getExporter($type, $dest = null)
{
if ( ! isset(self::$_exporterDrivers[$type])) {
throw ExportException::invalidExporterDriverType($type);
}
$class = self::$_exporterDrivers[$type];
return new $class($dest);
} | [
"public",
"function",
"getExporter",
"(",
"$",
"type",
",",
"$",
"dest",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"_exporterDrivers",
"[",
"$",
"type",
"]",
")",
")",
"{",
"throw",
"ExportException",
"::",
"invalidExporte... | Gets an exporter driver instance.
@param string $type The type to get (yml, xml, etc.).
@param string|null $dest The directory where the exporter will export to.
@return Driver\AbstractExporter
@throws ExportException | [
"Gets",
"an",
"exporter",
"driver",
"instance",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php#L66-L75 |
223,348 | shopsys/doctrine-orm | lib/Doctrine/ORM/Persisters/Collection/AbstractCollectionPersister.php | AbstractCollectionPersister.isValidEntityState | protected function isValidEntityState($entity)
{
$entityState = $this->uow->getEntityState($entity, UnitOfWork::STATE_NEW);
if ($entityState === UnitOfWork::STATE_NEW) {
return false;
}
// If Entity is scheduled for inclusion, it is not in this collection.
// We... | php | protected function isValidEntityState($entity)
{
$entityState = $this->uow->getEntityState($entity, UnitOfWork::STATE_NEW);
if ($entityState === UnitOfWork::STATE_NEW) {
return false;
}
// If Entity is scheduled for inclusion, it is not in this collection.
// We... | [
"protected",
"function",
"isValidEntityState",
"(",
"$",
"entity",
")",
"{",
"$",
"entityState",
"=",
"$",
"this",
"->",
"uow",
"->",
"getEntityState",
"(",
"$",
"entity",
",",
"UnitOfWork",
"::",
"STATE_NEW",
")",
";",
"if",
"(",
"$",
"entityState",
"==="... | Check if entity is in a valid state for operations.
@param object $entity
@return bool | [
"Check",
"if",
"entity",
"is",
"in",
"a",
"valid",
"state",
"for",
"operations",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Persisters/Collection/AbstractCollectionPersister.php#L83-L98 |
223,349 | mmerian/phpcrawl | libs/PHPCrawlerLinkFinder.class.php | PHPCrawlerLinkFinder.findRedirectLinkInHeader | protected function findRedirectLinkInHeader(&$http_header)
{
PHPCrawlerBenchmark::start("checking_for_redirect_link");
// Get redirect-URL or link from header
$redirect_link = PHPCrawlerUtils::getRedirectURLFromHeader($http_header);
// Add redirect-URL to linkcache
if ($redirect_... | php | protected function findRedirectLinkInHeader(&$http_header)
{
PHPCrawlerBenchmark::start("checking_for_redirect_link");
// Get redirect-URL or link from header
$redirect_link = PHPCrawlerUtils::getRedirectURLFromHeader($http_header);
// Add redirect-URL to linkcache
if ($redirect_... | [
"protected",
"function",
"findRedirectLinkInHeader",
"(",
"&",
"$",
"http_header",
")",
"{",
"PHPCrawlerBenchmark",
"::",
"start",
"(",
"\"checking_for_redirect_link\"",
")",
";",
"// Get redirect-URL or link from header\r",
"$",
"redirect_link",
"=",
"PHPCrawlerUtils",
"::... | Checks for a redirect-URL in the given http-header and adds it to the internal link-cache. | [
"Checks",
"for",
"a",
"redirect",
"-",
"URL",
"in",
"the",
"given",
"http",
"-",
"header",
"and",
"adds",
"it",
"to",
"the",
"internal",
"link",
"-",
"cache",
"."
] | 1c5e07ff33cf079c69191eb9540a3ced64d392dc | https://github.com/mmerian/phpcrawl/blob/1c5e07ff33cf079c69191eb9540a3ced64d392dc/libs/PHPCrawlerLinkFinder.class.php#L121-L135 |
223,350 | mmerian/phpcrawl | libs/PHPCrawlerLinkFinder.class.php | PHPCrawlerLinkFinder.prepareHTMLChunk | protected function prepareHTMLChunk(&$html_source)
{
// WARNING:
// When modifying, test thhe following regexes on a huge page for preg_replace segfaults.
// Be sure to set the preg-groups to "non-capture" (?:...)!
// Replace <script>-sections from source, but only those without src in it.... | php | protected function prepareHTMLChunk(&$html_source)
{
// WARNING:
// When modifying, test thhe following regexes on a huge page for preg_replace segfaults.
// Be sure to set the preg-groups to "non-capture" (?:...)!
// Replace <script>-sections from source, but only those without src in it.... | [
"protected",
"function",
"prepareHTMLChunk",
"(",
"&",
"$",
"html_source",
")",
"{",
"// WARNING:\r",
"// When modifying, test thhe following regexes on a huge page for preg_replace segfaults.\r",
"// Be sure to set the preg-groups to \"non-capture\" (?:...)!\r",
"// Replace <script>-section... | Prepares a chunk of HTML before links get searched in it | [
"Prepares",
"a",
"chunk",
"of",
"HTML",
"before",
"links",
"get",
"searched",
"in",
"it"
] | 1c5e07ff33cf079c69191eb9540a3ced64d392dc | https://github.com/mmerian/phpcrawl/blob/1c5e07ff33cf079c69191eb9540a3ced64d392dc/libs/PHPCrawlerLinkFinder.class.php#L244-L269 |
223,351 | efficiently/jquery-laravel | src/Efficiently/JqueryLaravel/EloquentHtmlHelper.php | EloquentHtmlHelper.domId | public function domId($record, $prefix = null, $fallbackPrefix = 'create')
{
if ($recordId = $this->recordKeyForDomId($record)) {
return $this->domClass($record, $prefix).'_'.$recordId;
} else {
$prefix = $prefix ?: $fallbackPrefix;
return $this->domClass($record,... | php | public function domId($record, $prefix = null, $fallbackPrefix = 'create')
{
if ($recordId = $this->recordKeyForDomId($record)) {
return $this->domClass($record, $prefix).'_'.$recordId;
} else {
$prefix = $prefix ?: $fallbackPrefix;
return $this->domClass($record,... | [
"public",
"function",
"domId",
"(",
"$",
"record",
",",
"$",
"prefix",
"=",
"null",
",",
"$",
"fallbackPrefix",
"=",
"'create'",
")",
"{",
"if",
"(",
"$",
"recordId",
"=",
"$",
"this",
"->",
"recordKeyForDomId",
"(",
"$",
"record",
")",
")",
"{",
"re... | The DOM id convention is to use the singular form of an object or class with the id following an underscore.
If no id is found, prefix with "create_" instead.
@param object|\Illuminate\Database\Eloquent\Model $record
@param string $prefix
@param string $fallbackPrefix By default it's 'create'
@return string | [
"The",
"DOM",
"id",
"convention",
"is",
"to",
"use",
"the",
"singular",
"form",
"of",
"an",
"object",
"or",
"class",
"with",
"the",
"id",
"following",
"an",
"underscore",
".",
"If",
"no",
"id",
"is",
"found",
"prefix",
"with",
"create_",
"instead",
"."
] | 30e3953e51ac8644e13d90150e2cf56012ce8f6b | https://github.com/efficiently/jquery-laravel/blob/30e3953e51ac8644e13d90150e2cf56012ce8f6b/src/Efficiently/JqueryLaravel/EloquentHtmlHelper.php#L16-L24 |
223,352 | efficiently/jquery-laravel | src/Efficiently/JqueryLaravel/EloquentHtmlHelper.php | EloquentHtmlHelper.formId | public function formId($record, $fallbackPrefix = 'create')
{
if ($recordId = $this->recordKeyForDomId($record)) {
return $this->domClass($record, 'edit').'_'.$recordId;
}
return $this->domClass($record, $fallbackPrefix);
} | php | public function formId($record, $fallbackPrefix = 'create')
{
if ($recordId = $this->recordKeyForDomId($record)) {
return $this->domClass($record, 'edit').'_'.$recordId;
}
return $this->domClass($record, $fallbackPrefix);
} | [
"public",
"function",
"formId",
"(",
"$",
"record",
",",
"$",
"fallbackPrefix",
"=",
"'create'",
")",
"{",
"if",
"(",
"$",
"recordId",
"=",
"$",
"this",
"->",
"recordKeyForDomId",
"(",
"$",
"record",
")",
")",
"{",
"return",
"$",
"this",
"->",
"domClas... | The Form id convention is to use the singular form of an object or class with the id following an underscore.
If id is found, prefix with "edit_".
If no id is found, prefix with "create_" instead.
@param object|\Illuminate\Database\Eloquent\Model $record
@param string $fallbackPrefix By default it's 'create'
@retur... | [
"The",
"Form",
"id",
"convention",
"is",
"to",
"use",
"the",
"singular",
"form",
"of",
"an",
"object",
"or",
"class",
"with",
"the",
"id",
"following",
"an",
"underscore",
".",
"If",
"id",
"is",
"found",
"prefix",
"with",
"edit_",
".",
"If",
"no",
"id"... | 30e3953e51ac8644e13d90150e2cf56012ce8f6b | https://github.com/efficiently/jquery-laravel/blob/30e3953e51ac8644e13d90150e2cf56012ce8f6b/src/Efficiently/JqueryLaravel/EloquentHtmlHelper.php#L35-L42 |
223,353 | efficiently/jquery-laravel | src/Efficiently/JqueryLaravel/EloquentHtmlHelper.php | EloquentHtmlHelper.domClass | public function domClass($recordOrClass, $prefix = null)
{
$singular = snake_case(camel_case(preg_replace('/\\\\/', ' ', $this->modelNameFromRecordOrClassname($recordOrClass))));
return $prefix ? $prefix.'_'.$singular : $singular;
} | php | public function domClass($recordOrClass, $prefix = null)
{
$singular = snake_case(camel_case(preg_replace('/\\\\/', ' ', $this->modelNameFromRecordOrClassname($recordOrClass))));
return $prefix ? $prefix.'_'.$singular : $singular;
} | [
"public",
"function",
"domClass",
"(",
"$",
"recordOrClass",
",",
"$",
"prefix",
"=",
"null",
")",
"{",
"$",
"singular",
"=",
"snake_case",
"(",
"camel_case",
"(",
"preg_replace",
"(",
"'/\\\\\\\\/'",
",",
"' '",
",",
"$",
"this",
"->",
"modelNameFromRecordO... | The DOM class convention is to use the singular form of an object or class.
@param string|object|\Illuminate\Database\Eloquent\Model $recordOrClass
@param string $prefix
@return string | [
"The",
"DOM",
"class",
"convention",
"is",
"to",
"use",
"the",
"singular",
"form",
"of",
"an",
"object",
"or",
"class",
"."
] | 30e3953e51ac8644e13d90150e2cf56012ce8f6b | https://github.com/efficiently/jquery-laravel/blob/30e3953e51ac8644e13d90150e2cf56012ce8f6b/src/Efficiently/JqueryLaravel/EloquentHtmlHelper.php#L62-L66 |
223,354 | efficiently/jquery-laravel | src/Efficiently/JqueryLaravel/EloquentHtmlHelper.php | EloquentHtmlHelper.removeRootNamespace | protected function removeRootNamespace($classname)
{
$namespaces = $this->splitNamespaces($classname);
if (count($namespaces) > 1) {
$classname = implode('\\', array_slice($namespaces, 1));
}
return $classname;
} | php | protected function removeRootNamespace($classname)
{
$namespaces = $this->splitNamespaces($classname);
if (count($namespaces) > 1) {
$classname = implode('\\', array_slice($namespaces, 1));
}
return $classname;
} | [
"protected",
"function",
"removeRootNamespace",
"(",
"$",
"classname",
")",
"{",
"$",
"namespaces",
"=",
"$",
"this",
"->",
"splitNamespaces",
"(",
"$",
"classname",
")",
";",
"if",
"(",
"count",
"(",
"$",
"namespaces",
")",
">",
"1",
")",
"{",
"$",
"c... | Remove Root namespace. E.G 'App\Message' -> 'Message'
@param string $classname | [
"Remove",
"Root",
"namespace",
".",
"E",
".",
"G",
"App",
"\\",
"Message",
"-",
">",
"Message"
] | 30e3953e51ac8644e13d90150e2cf56012ce8f6b | https://github.com/efficiently/jquery-laravel/blob/30e3953e51ac8644e13d90150e2cf56012ce8f6b/src/Efficiently/JqueryLaravel/EloquentHtmlHelper.php#L84-L92 |
223,355 | mmerian/phpcrawl | libs/Utils/PHPCrawlerEncodingUtils.class.php | PHPCrawlerEncodingUtils.isUTF8String | public static function isUTF8String($string)
{
$sample = @iconv('utf-8', 'utf-8', $string);
if (md5($sample) == md5($string))
return true;
else
return false;
} | php | public static function isUTF8String($string)
{
$sample = @iconv('utf-8', 'utf-8', $string);
if (md5($sample) == md5($string))
return true;
else
return false;
} | [
"public",
"static",
"function",
"isUTF8String",
"(",
"$",
"string",
")",
"{",
"$",
"sample",
"=",
"@",
"iconv",
"(",
"'utf-8'",
",",
"'utf-8'",
",",
"$",
"string",
")",
";",
"if",
"(",
"md5",
"(",
"$",
"sample",
")",
"==",
"md5",
"(",
"$",
"string"... | Checks wether the given string is an UTF8-encoded string.
Taken from http://www.php.net/manual/de/function.mb-detect-encoding.php
(comment from "prgss at bk dot ru")
@param string $string The string
@return bool TRUE if the string is UTF-8 encoded. | [
"Checks",
"wether",
"the",
"given",
"string",
"is",
"an",
"UTF8",
"-",
"encoded",
"string",
"."
] | 1c5e07ff33cf079c69191eb9540a3ced64d392dc | https://github.com/mmerian/phpcrawl/blob/1c5e07ff33cf079c69191eb9540a3ced64d392dc/libs/Utils/PHPCrawlerEncodingUtils.class.php#L44-L52 |
223,356 | mmerian/phpcrawl | libs/Utils/PHPCrawlerEncodingUtils.class.php | PHPCrawlerEncodingUtils.decodeHtmlEntities | public static function decodeHtmlEntities($string)
{
// Entities-replacements
$entities = array ("'&(quot|#34);'i",
"'&(amp|#38);'i",
"'&(lt|#60);'i",
"'&(gt|#62);'i",
"'&(nbsp|#160);'i",
... | php | public static function decodeHtmlEntities($string)
{
// Entities-replacements
$entities = array ("'&(quot|#34);'i",
"'&(amp|#38);'i",
"'&(lt|#60);'i",
"'&(gt|#62);'i",
"'&(nbsp|#160);'i",
... | [
"public",
"static",
"function",
"decodeHtmlEntities",
"(",
"$",
"string",
")",
"{",
"// Entities-replacements\r",
"$",
"entities",
"=",
"array",
"(",
"\"'&(quot|#34);'i\"",
",",
"\"'&(amp|#38);'i\"",
",",
"\"'&(lt|#60);'i\"",
",",
"\"'&(gt|#62);'i\"",
",",
"\"'&(nbsp|#1... | Decodes all HTML-entities in the given string including numeric and hexadecimal character references
@param string $string
@return string | [
"Decodes",
"all",
"HTML",
"-",
"entities",
"in",
"the",
"given",
"string",
"including",
"numeric",
"and",
"hexadecimal",
"character",
"references"
] | 1c5e07ff33cf079c69191eb9540a3ced64d392dc | https://github.com/mmerian/phpcrawl/blob/1c5e07ff33cf079c69191eb9540a3ced64d392dc/libs/Utils/PHPCrawlerEncodingUtils.class.php#L60-L93 |
223,357 | shopsys/doctrine-orm | lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php | ConvertDoctrine1Schema.getMetadata | public function getMetadata()
{
$schema = array();
foreach ($this->from as $path) {
if (is_dir($path)) {
$files = glob($path . '/*.yml');
foreach ($files as $file) {
$schema = array_merge($schema, (array) Yaml::parse(file_get_contents($... | php | public function getMetadata()
{
$schema = array();
foreach ($this->from as $path) {
if (is_dir($path)) {
$files = glob($path . '/*.yml');
foreach ($files as $file) {
$schema = array_merge($schema, (array) Yaml::parse(file_get_contents($... | [
"public",
"function",
"getMetadata",
"(",
")",
"{",
"$",
"schema",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"from",
"as",
"$",
"path",
")",
"{",
"if",
"(",
"is_dir",
"(",
"$",
"path",
")",
")",
"{",
"$",
"files",
"=",
"gl... | Gets an array of ClassMetadataInfo instances from the passed
Doctrine 1 schema.
@return array An array of ClassMetadataInfo instances | [
"Gets",
"an",
"array",
"of",
"ClassMetadataInfo",
"instances",
"from",
"the",
"passed",
"Doctrine",
"1",
"schema",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php#L73-L93 |
223,358 | stuttter/wp-event-calendar | wp-event-calendar/includes/common/list-table-month.php | WP_Event_Calendar_Month_Table.setup_item | protected function setup_item( $post = false, $max = 10 ) {
// Bail if there is no post
if ( empty( $post ) ) {
return;
}
// Start day
$time = $this->item_start;
$type = 'items';
$max_int = absint( $max );
// Loop through days and setup the item
for ( $i = 0, $j = $this->item_days; $i < $j... | php | protected function setup_item( $post = false, $max = 10 ) {
// Bail if there is no post
if ( empty( $post ) ) {
return;
}
// Start day
$time = $this->item_start;
$type = 'items';
$max_int = absint( $max );
// Loop through days and setup the item
for ( $i = 0, $j = $this->item_days; $i < $j... | [
"protected",
"function",
"setup_item",
"(",
"$",
"post",
"=",
"false",
",",
"$",
"max",
"=",
"10",
")",
"{",
"// Bail if there is no post",
"if",
"(",
"empty",
"(",
"$",
"post",
")",
")",
"{",
"return",
";",
"}",
"// Start day",
"$",
"time",
"=",
"$",
... | Add a post to the item array, keyed by day
@todo Repeat & expire
@since 0.1.1
@param object $post
@param int $max | [
"Add",
"a",
"post",
"to",
"the",
"item",
"array",
"keyed",
"by",
"day"
] | e2221b52f0683c105c64fca056daa63763ea8665 | https://github.com/stuttter/wp-event-calendar/blob/e2221b52f0683c105c64fca056daa63763ea8665/wp-event-calendar/includes/common/list-table-month.php#L89-L127 |
223,359 | stuttter/wp-event-calendar | wp-event-calendar/includes/common/list-table-month.php | WP_Event_Calendar_Month_Table.display_mode | protected function display_mode() {
// Get timestamp
$timestamp = mktime( 0, 0, 0, $this->month, 1, $this->year );
$max_day = date_i18n( 't', $timestamp );
$this_month = getdate( $timestamp );
$start_day = $this_month['wday'];
// Loop through days of the month
for ( $i = 0; $i < ( $max_day + $start... | php | protected function display_mode() {
// Get timestamp
$timestamp = mktime( 0, 0, 0, $this->month, 1, $this->year );
$max_day = date_i18n( 't', $timestamp );
$this_month = getdate( $timestamp );
$start_day = $this_month['wday'];
// Loop through days of the month
for ( $i = 0; $i < ( $max_day + $start... | [
"protected",
"function",
"display_mode",
"(",
")",
"{",
"// Get timestamp",
"$",
"timestamp",
"=",
"mktime",
"(",
"0",
",",
"0",
",",
"0",
",",
"$",
"this",
"->",
"month",
",",
"1",
",",
"$",
"this",
"->",
"year",
")",
";",
"$",
"max_day",
"=",
"da... | Display a calendar by month and year
@since 0.1.0 | [
"Display",
"a",
"calendar",
"by",
"month",
"and",
"year"
] | e2221b52f0683c105c64fca056daa63763ea8665 | https://github.com/stuttter/wp-event-calendar/blob/e2221b52f0683c105c64fca056daa63763ea8665/wp-event-calendar/includes/common/list-table-month.php#L214-L243 |
223,360 | shopsys/doctrine-orm | lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php | LimitSubqueryOutputWalker.rebuildOrderByClauseForOuterScope | private function rebuildOrderByClauseForOuterScope(OrderByClause $orderByClause)
{
$dqlAliasToSqlTableAliasMap
= $searchPatterns
= $replacements
= $dqlAliasToClassMap
= $selectListAdditions
= $orderByItems
= [];
// Generate DQL... | php | private function rebuildOrderByClauseForOuterScope(OrderByClause $orderByClause)
{
$dqlAliasToSqlTableAliasMap
= $searchPatterns
= $replacements
= $dqlAliasToClassMap
= $selectListAdditions
= $orderByItems
= [];
// Generate DQL... | [
"private",
"function",
"rebuildOrderByClauseForOuterScope",
"(",
"OrderByClause",
"$",
"orderByClause",
")",
"{",
"$",
"dqlAliasToSqlTableAliasMap",
"=",
"$",
"searchPatterns",
"=",
"$",
"replacements",
"=",
"$",
"dqlAliasToClassMap",
"=",
"$",
"selectListAdditions",
"=... | Generates a new order by clause that works in the scope of a select query wrapping the original
@param OrderByClause $orderByClause
@return array | [
"Generates",
"a",
"new",
"order",
"by",
"clause",
"that",
"works",
"in",
"the",
"scope",
"of",
"a",
"select",
"query",
"wrapping",
"the",
"original"
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php#L396-L462 |
223,361 | mmerian/phpcrawl | libs/PHPCrawlerRobotsTxtParser.class.php | PHPCrawlerRobotsTxtParser.parseRobotsTxt | public function parseRobotsTxt(PHPCrawlerURLDescriptor $BaseUrl, $user_agent_string, $robots_txt_uri = null)
{
PHPCrawlerBenchmark::start("processing_robotstxt");
// If robots_txt_uri not given, use the default one for the given BaseUrl
if ($robots_txt_uri === null)
$robots_txt_uri = self... | php | public function parseRobotsTxt(PHPCrawlerURLDescriptor $BaseUrl, $user_agent_string, $robots_txt_uri = null)
{
PHPCrawlerBenchmark::start("processing_robotstxt");
// If robots_txt_uri not given, use the default one for the given BaseUrl
if ($robots_txt_uri === null)
$robots_txt_uri = self... | [
"public",
"function",
"parseRobotsTxt",
"(",
"PHPCrawlerURLDescriptor",
"$",
"BaseUrl",
",",
"$",
"user_agent_string",
",",
"$",
"robots_txt_uri",
"=",
"null",
")",
"{",
"PHPCrawlerBenchmark",
"::",
"start",
"(",
"\"processing_robotstxt\"",
")",
";",
"// If robots_txt... | Parses a robots.txt-file and returns regular-expression-rules corresponding to the containing "disallow"-rules
that are adressed to the given user-agent.
@param PHPCrawlerURLDescriptor $BaseUrl The root-URL all rules from the robots-txt-file should relate to
@param string $user_agent_string ... | [
"Parses",
"a",
"robots",
".",
"txt",
"-",
"file",
"and",
"returns",
"regular",
"-",
"expression",
"-",
"rules",
"corresponding",
"to",
"the",
"containing",
"disallow",
"-",
"rules",
"that",
"are",
"adressed",
"to",
"the",
"given",
"user",
"-",
"agent",
"."... | 1c5e07ff33cf079c69191eb9540a3ced64d392dc | https://github.com/mmerian/phpcrawl/blob/1c5e07ff33cf079c69191eb9540a3ced64d392dc/libs/PHPCrawlerRobotsTxtParser.class.php#L29-L55 |
223,362 | mmerian/phpcrawl | libs/PHPCrawlerRobotsTxtParser.class.php | PHPCrawlerRobotsTxtParser.getUserAgentLines | protected function getUserAgentLines(&$robots_txt_content, $user_agent_string)
{
// Split the content into its lines
$robotstxt_lines = explode("\n", $robots_txt_content);
$user_agent_lines = array();
$current_user_agent = null;
// Loop over the lines and check if any user-agent-... | php | protected function getUserAgentLines(&$robots_txt_content, $user_agent_string)
{
// Split the content into its lines
$robotstxt_lines = explode("\n", $robots_txt_content);
$user_agent_lines = array();
$current_user_agent = null;
// Loop over the lines and check if any user-agent-... | [
"protected",
"function",
"getUserAgentLines",
"(",
"&",
"$",
"robots_txt_content",
",",
"$",
"user_agent_string",
")",
"{",
"// Split the content into its lines\r",
"$",
"robotstxt_lines",
"=",
"explode",
"(",
"\"\\n\"",
",",
"$",
"robots_txt_content",
")",
";",
"$",
... | Gets all raw lines from the given robots.txt-content that apply to
the given useragent-string.
@return array Numeric array containing the lines | [
"Gets",
"all",
"raw",
"lines",
"from",
"the",
"given",
"robots",
".",
"txt",
"-",
"content",
"that",
"apply",
"to",
"the",
"given",
"useragent",
"-",
"string",
"."
] | 1c5e07ff33cf079c69191eb9540a3ced64d392dc | https://github.com/mmerian/phpcrawl/blob/1c5e07ff33cf079c69191eb9540a3ced64d392dc/libs/PHPCrawlerRobotsTxtParser.class.php#L63-L98 |
223,363 | mmerian/phpcrawl | libs/PHPCrawlerRobotsTxtParser.class.php | PHPCrawlerRobotsTxtParser.getRobotsTxtURL | public static function getRobotsTxtURL($url)
{
$url_parts = PHPCrawlerUtils::splitURL($url);
$robots_txt_url = $url_parts["protocol"].$url_parts["host"].":".$url_parts["port"] . "/robots.txt";
return $robots_txt_url;
} | php | public static function getRobotsTxtURL($url)
{
$url_parts = PHPCrawlerUtils::splitURL($url);
$robots_txt_url = $url_parts["protocol"].$url_parts["host"].":".$url_parts["port"] . "/robots.txt";
return $robots_txt_url;
} | [
"public",
"static",
"function",
"getRobotsTxtURL",
"(",
"$",
"url",
")",
"{",
"$",
"url_parts",
"=",
"PHPCrawlerUtils",
"::",
"splitURL",
"(",
"$",
"url",
")",
";",
"$",
"robots_txt_url",
"=",
"$",
"url_parts",
"[",
"\"protocol\"",
"]",
".",
"$",
"url_part... | Returns the default Robots.txt-URL related to the given URL
@param string $url The URL
@return string Url of the related robots.txt file | [
"Returns",
"the",
"default",
"Robots",
".",
"txt",
"-",
"URL",
"related",
"to",
"the",
"given",
"URL"
] | 1c5e07ff33cf079c69191eb9540a3ced64d392dc | https://github.com/mmerian/phpcrawl/blob/1c5e07ff33cf079c69191eb9540a3ced64d392dc/libs/PHPCrawlerRobotsTxtParser.class.php#L159-L165 |
223,364 | shopsys/doctrine-orm | lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php | ResultSetMappingBuilder.getColumnAlias | private function getColumnAlias($columnName, $mode, array $customRenameColumns)
{
switch ($mode) {
case self::COLUMN_RENAMING_INCREMENT:
return $columnName . $this->sqlCounter++;
case self::COLUMN_RENAMING_CUSTOM:
return isset($customRenameColumns[$co... | php | private function getColumnAlias($columnName, $mode, array $customRenameColumns)
{
switch ($mode) {
case self::COLUMN_RENAMING_INCREMENT:
return $columnName . $this->sqlCounter++;
case self::COLUMN_RENAMING_CUSTOM:
return isset($customRenameColumns[$co... | [
"private",
"function",
"getColumnAlias",
"(",
"$",
"columnName",
",",
"$",
"mode",
",",
"array",
"$",
"customRenameColumns",
")",
"{",
"switch",
"(",
"$",
"mode",
")",
"{",
"case",
"self",
"::",
"COLUMN_RENAMING_INCREMENT",
":",
"return",
"$",
"columnName",
... | Gets column alias for a given column.
@param string $columnName
@param int $mode
@param array $customRenameColumns
@return string | [
"Gets",
"column",
"alias",
"for",
"a",
"given",
"column",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php#L201-L215 |
223,365 | shopsys/doctrine-orm | lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php | ResultSetMappingBuilder.getColumnAliasMap | private function getColumnAliasMap($className, $mode, array $customRenameColumns)
{
if ($customRenameColumns) { // for BC with 2.2-2.3 API
$mode = self::COLUMN_RENAMING_CUSTOM;
}
$columnAlias = array();
$class = $this->em->getClassMetadata($className);
for... | php | private function getColumnAliasMap($className, $mode, array $customRenameColumns)
{
if ($customRenameColumns) { // for BC with 2.2-2.3 API
$mode = self::COLUMN_RENAMING_CUSTOM;
}
$columnAlias = array();
$class = $this->em->getClassMetadata($className);
for... | [
"private",
"function",
"getColumnAliasMap",
"(",
"$",
"className",
",",
"$",
"mode",
",",
"array",
"$",
"customRenameColumns",
")",
"{",
"if",
"(",
"$",
"customRenameColumns",
")",
"{",
"// for BC with 2.2-2.3 API",
"$",
"mode",
"=",
"self",
"::",
"COLUMN_RENAMI... | Retrieves a class columns and join columns aliases that are used in the SELECT clause.
This depends on the renaming mode selected by the user.
@param string $className
@param int $mode
@param array $customRenameColumns
@return array | [
"Retrieves",
"a",
"class",
"columns",
"and",
"join",
"columns",
"aliases",
"that",
"are",
"used",
"in",
"the",
"SELECT",
"clause",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php#L228-L251 |
223,366 | shopsys/doctrine-orm | lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php | ResultSetMappingBuilder.addNamedNativeQueryMapping | public function addNamedNativeQueryMapping(ClassMetadataInfo $class, array $queryMapping)
{
if (isset($queryMapping['resultClass'])) {
return $this->addNamedNativeQueryResultClassMapping($class, $queryMapping['resultClass']);
}
return $this->addNamedNativeQueryResultSetMapping($... | php | public function addNamedNativeQueryMapping(ClassMetadataInfo $class, array $queryMapping)
{
if (isset($queryMapping['resultClass'])) {
return $this->addNamedNativeQueryResultClassMapping($class, $queryMapping['resultClass']);
}
return $this->addNamedNativeQueryResultSetMapping($... | [
"public",
"function",
"addNamedNativeQueryMapping",
"(",
"ClassMetadataInfo",
"$",
"class",
",",
"array",
"$",
"queryMapping",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"queryMapping",
"[",
"'resultClass'",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"add... | Adds the mappings of the results of native SQL queries to the result set.
@param ClassMetadataInfo $class
@param array $queryMapping
@return ResultSetMappingBuilder | [
"Adds",
"the",
"mappings",
"of",
"the",
"results",
"of",
"native",
"SQL",
"queries",
"to",
"the",
"result",
"set",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php#L261-L268 |
223,367 | shopsys/doctrine-orm | lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php | ResultSetMappingBuilder.addNamedNativeQueryResultClassMapping | public function addNamedNativeQueryResultClassMapping(ClassMetadataInfo $class, $resultClassName)
{
$classMetadata = $this->em->getClassMetadata($resultClassName);
$shortName = $classMetadata->reflClass->getShortName();
$alias = strtolower($shortName[0]).'0';
$this->a... | php | public function addNamedNativeQueryResultClassMapping(ClassMetadataInfo $class, $resultClassName)
{
$classMetadata = $this->em->getClassMetadata($resultClassName);
$shortName = $classMetadata->reflClass->getShortName();
$alias = strtolower($shortName[0]).'0';
$this->a... | [
"public",
"function",
"addNamedNativeQueryResultClassMapping",
"(",
"ClassMetadataInfo",
"$",
"class",
",",
"$",
"resultClassName",
")",
"{",
"$",
"classMetadata",
"=",
"$",
"this",
"->",
"em",
"->",
"getClassMetadata",
"(",
"$",
"resultClassName",
")",
";",
"$",
... | Adds the class mapping of the results of native SQL queries to the result set.
@param ClassMetadataInfo $class
@param string $resultClassName
@return ResultSetMappingBuilder | [
"Adds",
"the",
"class",
"mapping",
"of",
"the",
"results",
"of",
"native",
"SQL",
"queries",
"to",
"the",
"result",
"set",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php#L278-L307 |
223,368 | shopsys/doctrine-orm | lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php | ResultSetMappingBuilder.addNamedNativeQueryResultSetMapping | public function addNamedNativeQueryResultSetMapping(ClassMetadataInfo $class, $resultSetMappingName)
{
$counter = 0;
$resultMapping = $class->getSqlResultSetMapping($resultSetMappingName);
$rooShortName = $class->reflClass->getShortName();
$rootAlias = strtolower($rooS... | php | public function addNamedNativeQueryResultSetMapping(ClassMetadataInfo $class, $resultSetMappingName)
{
$counter = 0;
$resultMapping = $class->getSqlResultSetMapping($resultSetMappingName);
$rooShortName = $class->reflClass->getShortName();
$rootAlias = strtolower($rooS... | [
"public",
"function",
"addNamedNativeQueryResultSetMapping",
"(",
"ClassMetadataInfo",
"$",
"class",
",",
"$",
"resultSetMappingName",
")",
"{",
"$",
"counter",
"=",
"0",
";",
"$",
"resultMapping",
"=",
"$",
"class",
"->",
"getSqlResultSetMapping",
"(",
"$",
"resu... | Adds the result set mapping of the results of native SQL queries to the result set.
@param ClassMetadataInfo $class
@param string $resultSetMappingName
@return ResultSetMappingBuilder | [
"Adds",
"the",
"result",
"set",
"mapping",
"of",
"the",
"results",
"of",
"native",
"SQL",
"queries",
"to",
"the",
"result",
"set",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php#L317-L353 |
223,369 | shopsys/doctrine-orm | lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php | ResultSetMappingBuilder.addNamedNativeQueryEntityResultMapping | public function addNamedNativeQueryEntityResultMapping(ClassMetadataInfo $classMetadata, array $entityMapping, $alias)
{
if (isset($entityMapping['discriminatorColumn']) && $entityMapping['discriminatorColumn']) {
$discriminatorColumn = $entityMapping['discriminatorColumn'];
$this->s... | php | public function addNamedNativeQueryEntityResultMapping(ClassMetadataInfo $classMetadata, array $entityMapping, $alias)
{
if (isset($entityMapping['discriminatorColumn']) && $entityMapping['discriminatorColumn']) {
$discriminatorColumn = $entityMapping['discriminatorColumn'];
$this->s... | [
"public",
"function",
"addNamedNativeQueryEntityResultMapping",
"(",
"ClassMetadataInfo",
"$",
"classMetadata",
",",
"array",
"$",
"entityMapping",
",",
"$",
"alias",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"entityMapping",
"[",
"'discriminatorColumn'",
"]",
")",
... | Adds the entity result mapping of the results of native SQL queries to the result set.
@param ClassMetadataInfo $classMetadata
@param array $entityMapping
@param string $alias
@return ResultSetMappingBuilder
@throws \InvalidArgumentException | [
"Adds",
"the",
"entity",
"result",
"mapping",
"of",
"the",
"results",
"of",
"native",
"SQL",
"queries",
"to",
"the",
"result",
"set",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php#L366-L410 |
223,370 | mespronos/mespronos | src/Entity/RankingGeneral.php | RankingGeneral.getRankingForBetter | public static function getRankingForBetter(\Drupal\user\Entity\User $better, $entity = null, $entity_name = null, $storage_name = null) {
return parent::getRankingForBetter($better, null, null, 'ranking_general');
} | php | public static function getRankingForBetter(\Drupal\user\Entity\User $better, $entity = null, $entity_name = null, $storage_name = null) {
return parent::getRankingForBetter($better, null, null, 'ranking_general');
} | [
"public",
"static",
"function",
"getRankingForBetter",
"(",
"\\",
"Drupal",
"\\",
"user",
"\\",
"Entity",
"\\",
"User",
"$",
"better",
",",
"$",
"entity",
"=",
"null",
",",
"$",
"entity_name",
"=",
"null",
",",
"$",
"storage_name",
"=",
"null",
")",
"{",... | Get General ranking for user
@param \Drupal\user\Entity\User $better
@param \Drupal\mespronos\Entity\Base\RankingBase $entity
@param string $entity_name
@param string $storage_name
@return \Drupal\mespronos\Entity\RankingGeneral | [
"Get",
"General",
"ranking",
"for",
"user"
] | 73757663581ed9040944768073d1d9abc761196b | https://github.com/mespronos/mespronos/blob/73757663581ed9040944768073d1d9abc761196b/src/Entity/RankingGeneral.php#L139-L141 |
223,371 | middlewares/debugbar | src/Debugbar.php | Debugbar.handleRedirect | private function handleRedirect(ResponseInterface $response): ResponseInterface
{
if ($this->debugbar->isDataPersisted() || session_status() === PHP_SESSION_ACTIVE) {
$this->debugbar->stackData();
}
return $response;
} | php | private function handleRedirect(ResponseInterface $response): ResponseInterface
{
if ($this->debugbar->isDataPersisted() || session_status() === PHP_SESSION_ACTIVE) {
$this->debugbar->stackData();
}
return $response;
} | [
"private",
"function",
"handleRedirect",
"(",
"ResponseInterface",
"$",
"response",
")",
":",
"ResponseInterface",
"{",
"if",
"(",
"$",
"this",
"->",
"debugbar",
"->",
"isDataPersisted",
"(",
")",
"||",
"session_status",
"(",
")",
"===",
"PHP_SESSION_ACTIVE",
")... | Handle redirection responses | [
"Handle",
"redirection",
"responses"
] | 8e0de02958cb138fc9e29a59e362128eaeb1127c | https://github.com/middlewares/debugbar/blob/8e0de02958cb138fc9e29a59e362128eaeb1127c/src/Debugbar.php#L132-L139 |
223,372 | middlewares/debugbar | src/Debugbar.php | Debugbar.handleHtml | private function handleHtml(ResponseInterface $response, bool $isAjax): ResponseInterface
{
$html = (string) $response->getBody();
$renderer = $this->debugbar->getJavascriptRenderer();
if (!$isAjax) {
if ($this->inline) {
ob_start();
echo "<style>... | php | private function handleHtml(ResponseInterface $response, bool $isAjax): ResponseInterface
{
$html = (string) $response->getBody();
$renderer = $this->debugbar->getJavascriptRenderer();
if (!$isAjax) {
if ($this->inline) {
ob_start();
echo "<style>... | [
"private",
"function",
"handleHtml",
"(",
"ResponseInterface",
"$",
"response",
",",
"bool",
"$",
"isAjax",
")",
":",
"ResponseInterface",
"{",
"$",
"html",
"=",
"(",
"string",
")",
"$",
"response",
"->",
"getBody",
"(",
")",
";",
"$",
"renderer",
"=",
"... | Handle html responses | [
"Handle",
"html",
"responses"
] | 8e0de02958cb138fc9e29a59e362128eaeb1127c | https://github.com/middlewares/debugbar/blob/8e0de02958cb138fc9e29a59e362128eaeb1127c/src/Debugbar.php#L144-L174 |
223,373 | shopsys/doctrine-orm | lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php | AbstractHydrator.registerManaged | protected function registerManaged(ClassMetadata $class, $entity, array $data)
{
if ($class->isIdentifierComposite) {
$id = array();
foreach ($class->identifier as $fieldName) {
$id[$fieldName] = isset($class->associationMappings[$fieldName])
? $d... | php | protected function registerManaged(ClassMetadata $class, $entity, array $data)
{
if ($class->isIdentifierComposite) {
$id = array();
foreach ($class->identifier as $fieldName) {
$id[$fieldName] = isset($class->associationMappings[$fieldName])
? $d... | [
"protected",
"function",
"registerManaged",
"(",
"ClassMetadata",
"$",
"class",
",",
"$",
"entity",
",",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"class",
"->",
"isIdentifierComposite",
")",
"{",
"$",
"id",
"=",
"array",
"(",
")",
";",
"foreach",
... | Register entity as managed in UnitOfWork.
@param ClassMetadata $class
@param object $entity
@param array $data
@return void
@todo The "$id" generation is the same of UnitOfWork#createEntity. Remove this duplication somehow | [
"Register",
"entity",
"as",
"managed",
"in",
"UnitOfWork",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php#L449-L469 |
223,374 | mespronos/mespronos | src/Entity/Getters/DayGettersTrait.php | DayGettersTrait.getNbGame | public function getNbGame() : int {
$query = \Drupal::entityQuery('game')->condition('day', $this->id());
$ids = $query->execute();
return count($ids);
} | php | public function getNbGame() : int {
$query = \Drupal::entityQuery('game')->condition('day', $this->id());
$ids = $query->execute();
return count($ids);
} | [
"public",
"function",
"getNbGame",
"(",
")",
":",
"int",
"{",
"$",
"query",
"=",
"\\",
"Drupal",
"::",
"entityQuery",
"(",
"'game'",
")",
"->",
"condition",
"(",
"'day'",
",",
"$",
"this",
"->",
"id",
"(",
")",
")",
";",
"$",
"ids",
"=",
"$",
"qu... | Return the number of games of the day
@return int
Number of games for the day | [
"Return",
"the",
"number",
"of",
"games",
"of",
"the",
"day"
] | 73757663581ed9040944768073d1d9abc761196b | https://github.com/mespronos/mespronos/blob/73757663581ed9040944768073d1d9abc761196b/src/Entity/Getters/DayGettersTrait.php#L51-L55 |
223,375 | mespronos/mespronos | src/Entity/Getters/DayGettersTrait.php | DayGettersTrait.getGamesId | public function getGamesId($onlyFuture = FALSE) {
$query = \Drupal::entityQuery('game');
$query->condition('day', $this->id());
if($onlyFuture) {
$now = new \DateTime(NULL, new \DateTimeZone('UTC'));
$query->condition('game_date', $now->format('Y-m-d\TH:i:s'), '>');
}
$query->sort('game_... | php | public function getGamesId($onlyFuture = FALSE) {
$query = \Drupal::entityQuery('game');
$query->condition('day', $this->id());
if($onlyFuture) {
$now = new \DateTime(NULL, new \DateTimeZone('UTC'));
$query->condition('game_date', $now->format('Y-m-d\TH:i:s'), '>');
}
$query->sort('game_... | [
"public",
"function",
"getGamesId",
"(",
"$",
"onlyFuture",
"=",
"FALSE",
")",
"{",
"$",
"query",
"=",
"\\",
"Drupal",
"::",
"entityQuery",
"(",
"'game'",
")",
";",
"$",
"query",
"->",
"condition",
"(",
"'day'",
",",
"$",
"this",
"->",
"id",
"(",
")"... | Return all games id for day
@return integer[] | [
"Return",
"all",
"games",
"id",
"for",
"day"
] | 73757663581ed9040944768073d1d9abc761196b | https://github.com/mespronos/mespronos/blob/73757663581ed9040944768073d1d9abc761196b/src/Entity/Getters/DayGettersTrait.php#L71-L82 |
223,376 | mespronos/mespronos | src/Entity/Getters/DayGettersTrait.php | DayGettersTrait.getNbGameWIthScore | public function getNbGameWIthScore() {
$query = \Drupal::entityQuery('game')
->condition('day', $this->id())
->condition('score_team_1', NULL, 'IS NOT')
->condition('score_team_2', NULL, 'IS NOT');
$ids = $query->execute();
return \count($ids);
} | php | public function getNbGameWIthScore() {
$query = \Drupal::entityQuery('game')
->condition('day', $this->id())
->condition('score_team_1', NULL, 'IS NOT')
->condition('score_team_2', NULL, 'IS NOT');
$ids = $query->execute();
return \count($ids);
} | [
"public",
"function",
"getNbGameWIthScore",
"(",
")",
"{",
"$",
"query",
"=",
"\\",
"Drupal",
"::",
"entityQuery",
"(",
"'game'",
")",
"->",
"condition",
"(",
"'day'",
",",
"$",
"this",
"->",
"id",
"(",
")",
")",
"->",
"condition",
"(",
"'score_team_1'",... | Return the number of games of the day with score setted
@return int
Number of games with score setted | [
"Return",
"the",
"number",
"of",
"games",
"of",
"the",
"day",
"with",
"score",
"setted"
] | 73757663581ed9040944768073d1d9abc761196b | https://github.com/mespronos/mespronos/blob/73757663581ed9040944768073d1d9abc761196b/src/Entity/Getters/DayGettersTrait.php#L90-L97 |
223,377 | Torann/laravel-asana | src/ServiceProvider.php | ServiceProvider.registerAsanaService | public function registerAsanaService()
{
$this->app->singleton('torann.asana', function ($app) {
$config = $app->config->get('asana', []);
return new Asana($config);
});
} | php | public function registerAsanaService()
{
$this->app->singleton('torann.asana', function ($app) {
$config = $app->config->get('asana', []);
return new Asana($config);
});
} | [
"public",
"function",
"registerAsanaService",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'torann.asana'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"$",
"config",
"=",
"$",
"app",
"->",
"config",
"->",
"get",
"(",
"'asana'",
",... | Register the Asana service.
@return void | [
"Register",
"the",
"Asana",
"service",
"."
] | 6e669720dbc3e66f19ffb637865eab9d5ae9d299 | https://github.com/Torann/laravel-asana/blob/6e669720dbc3e66f19ffb637865eab9d5ae9d299/src/ServiceProvider.php#L38-L45 |
223,378 | shopsys/doctrine-orm | lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php | BasicEntityPersister.expandToManyParameters | private function expandToManyParameters($criteria)
{
$params = array();
$types = array();
foreach ($criteria as $criterion) {
if ($criterion['value'] === null) {
continue; // skip null values.
}
$types = array_merge($types, $this->getTy... | php | private function expandToManyParameters($criteria)
{
$params = array();
$types = array();
foreach ($criteria as $criterion) {
if ($criterion['value'] === null) {
continue; // skip null values.
}
$types = array_merge($types, $this->getTy... | [
"private",
"function",
"expandToManyParameters",
"(",
"$",
"criteria",
")",
"{",
"$",
"params",
"=",
"array",
"(",
")",
";",
"$",
"types",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"criteria",
"as",
"$",
"criterion",
")",
"{",
"if",
"(",
"$",... | Expands the parameters from the given criteria and use the correct binding types if found,
specialized for OneToMany or ManyToMany associations.
@param mixed[][] $criteria an array of arrays containing following:
- field to which each criterion will be bound
- value to be bound
- class to which the field belongs to
... | [
"Expands",
"the",
"parameters",
"from",
"the",
"given",
"criteria",
"and",
"use",
"the",
"correct",
"binding",
"types",
"if",
"found",
"specialized",
"for",
"OneToMany",
"or",
"ManyToMany",
"associations",
"."
] | faf2288cd1c133c4b5340079a26aa4f14dd7beab | https://github.com/shopsys/doctrine-orm/blob/faf2288cd1c133c4b5340079a26aa4f14dd7beab/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php#L1843-L1858 |
223,379 | fourlabsldn/GmailBundle | Services/Email.php | Email.get | public function get(string $userId, string $emailId, array $options = []): ?\Google_Service_Gmail_Message
{
try {
return $this->googleServices->getGoogleServiceGmailForUserId($userId)->users_messages->get($userId, $emailId, $options);
} catch (\Google_Service_Exception $exception) {
... | php | public function get(string $userId, string $emailId, array $options = []): ?\Google_Service_Gmail_Message
{
try {
return $this->googleServices->getGoogleServiceGmailForUserId($userId)->users_messages->get($userId, $emailId, $options);
} catch (\Google_Service_Exception $exception) {
... | [
"public",
"function",
"get",
"(",
"string",
"$",
"userId",
",",
"string",
"$",
"emailId",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"?",
"\\",
"Google_Service_Gmail_Message",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"googleServices",
"-... | Get email information given its ID.
@param string $userId
@param string $emailId
@param array $options
@return \Google_Service_Gmail_Message|null
@throws \Google_Service_Exception | [
"Get",
"email",
"information",
"given",
"its",
"ID",
"."
] | 3a7bf480db67502ee16968699c7a28cbf3add178 | https://github.com/fourlabsldn/GmailBundle/blob/3a7bf480db67502ee16968699c7a28cbf3add178/Services/Email.php#L64-L76 |
223,380 | fourlabsldn/GmailBundle | Services/Email.php | Email.trash | public function trash(string $userId, string $emailId): ?\Google_Service_Gmail_Message
{
if ($this->get($userId, $emailId)) {
return null;
}
return $this->googleServices->getGoogleServiceGmailForUserId($userId)->users_messages->trash($userId, $emailId);
} | php | public function trash(string $userId, string $emailId): ?\Google_Service_Gmail_Message
{
if ($this->get($userId, $emailId)) {
return null;
}
return $this->googleServices->getGoogleServiceGmailForUserId($userId)->users_messages->trash($userId, $emailId);
} | [
"public",
"function",
"trash",
"(",
"string",
"$",
"userId",
",",
"string",
"$",
"emailId",
")",
":",
"?",
"\\",
"Google_Service_Gmail_Message",
"{",
"if",
"(",
"$",
"this",
"->",
"get",
"(",
"$",
"userId",
",",
"$",
"emailId",
")",
")",
"{",
"return",... | Delete an email given its ID.
@param string $userId
@param string $emailId
@return \Google_Service_Gmail_Message|null | [
"Delete",
"an",
"email",
"given",
"its",
"ID",
"."
] | 3a7bf480db67502ee16968699c7a28cbf3add178 | https://github.com/fourlabsldn/GmailBundle/blob/3a7bf480db67502ee16968699c7a28cbf3add178/Services/Email.php#L173-L180 |
223,381 | fourlabsldn/GmailBundle | Services/Email.php | Email.getLabels | public function getLabels(string $userId): \Google_Service_Gmail_ListLabelsResponse
{
return $this->googleServices->getGoogleServiceGmailForUserId($userId)->users_labels->listUsersLabels($userId);
} | php | public function getLabels(string $userId): \Google_Service_Gmail_ListLabelsResponse
{
return $this->googleServices->getGoogleServiceGmailForUserId($userId)->users_labels->listUsersLabels($userId);
} | [
"public",
"function",
"getLabels",
"(",
"string",
"$",
"userId",
")",
":",
"\\",
"Google_Service_Gmail_ListLabelsResponse",
"{",
"return",
"$",
"this",
"->",
"googleServices",
"->",
"getGoogleServiceGmailForUserId",
"(",
"$",
"userId",
")",
"->",
"users_labels",
"->... | Get user's labels.
@param string $userId
@return \Google_Service_Gmail_ListLabelsResponse | [
"Get",
"user",
"s",
"labels",
"."
] | 3a7bf480db67502ee16968699c7a28cbf3add178 | https://github.com/fourlabsldn/GmailBundle/blob/3a7bf480db67502ee16968699c7a28cbf3add178/Services/Email.php#L206-L209 |
223,382 | overint/php-paypal-ipn | src/PaypalIPN.php | PaypalIPN.verifyIPN | function verifyIPN()
{
if (!count($_POST)) {
throw new Exception("Missing POST Data");
}
$raw_post_data = file_get_contents('php://input');
$raw_post_array = explode('&', $raw_post_data);
$myPost = [];
foreach ($raw_post_array as $keyval) {
$k... | php | function verifyIPN()
{
if (!count($_POST)) {
throw new Exception("Missing POST Data");
}
$raw_post_data = file_get_contents('php://input');
$raw_post_array = explode('&', $raw_post_data);
$myPost = [];
foreach ($raw_post_array as $keyval) {
$k... | [
"function",
"verifyIPN",
"(",
")",
"{",
"if",
"(",
"!",
"count",
"(",
"$",
"_POST",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"Missing POST Data\"",
")",
";",
"}",
"$",
"raw_post_data",
"=",
"file_get_contents",
"(",
"'php://input'",
")",
";",
"... | Verification Function
Sends the incoming post data back to PayPal using the cURL library.
@return bool
@throws Exception | [
"Verification",
"Function",
"Sends",
"the",
"incoming",
"post",
"data",
"back",
"to",
"PayPal",
"using",
"the",
"cURL",
"library",
"."
] | 635af4cf75a1e77a0531f46eea867cfcf9d1193d | https://github.com/overint/php-paypal-ipn/blob/635af4cf75a1e77a0531f46eea867cfcf9d1193d/src/PaypalIPN.php#L68-L136 |
223,383 | Torann/laravel-asana | src/AsanaCurl.php | AsanaCurl.setHeaders | public function setHeaders(array $values)
{
foreach ($values as $key => $value) {
$this->setHeader($key, $value);
}
} | php | public function setHeaders(array $values)
{
foreach ($values as $key => $value) {
$this->setHeader($key, $value);
}
} | [
"public",
"function",
"setHeaders",
"(",
"array",
"$",
"values",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"setHeader",
"(",
"$",
"key",
",",
"$",
"value",
")",
";",
"}",
"}"
] | Add multiple headers to request.
@param array $values | [
"Add",
"multiple",
"headers",
"to",
"request",
"."
] | 6e669720dbc3e66f19ffb637865eab9d5ae9d299 | https://github.com/Torann/laravel-asana/blob/6e669720dbc3e66f19ffb637865eab9d5ae9d299/src/AsanaCurl.php#L68-L73 |
223,384 | Torann/laravel-asana | src/AsanaCurl.php | AsanaCurl.request | private function request($method, $url, array $parameters = [], array $headers = [])
{
$this->errors = null;
// Set default content type
$this->setHeader('Content-Type', 'application/json');
$curl = curl_init();
// Set options
curl_setopt_array($curl, [
... | php | private function request($method, $url, array $parameters = [], array $headers = [])
{
$this->errors = null;
// Set default content type
$this->setHeader('Content-Type', 'application/json');
$curl = curl_init();
// Set options
curl_setopt_array($curl, [
... | [
"private",
"function",
"request",
"(",
"$",
"method",
",",
"$",
"url",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"errors",
"=",
"null",
";",
"// Set default content type",
... | This function communicates with Asana REST API.
You don't need to call this function directly. It's only for inner class working.
@param int $method
@param string $url
@param array $parameters
@param array $headers
@return string|null
@throws Exception | [
"This",
"function",
"communicates",
"with",
"Asana",
"REST",
"API",
".",
"You",
"don",
"t",
"need",
"to",
"call",
"this",
"function",
"directly",
".",
"It",
"s",
"only",
"for",
"inner",
"class",
"working",
"."
] | 6e669720dbc3e66f19ffb637865eab9d5ae9d299 | https://github.com/Torann/laravel-asana/blob/6e669720dbc3e66f19ffb637865eab9d5ae9d299/src/AsanaCurl.php#L169-L237 |
223,385 | Torann/laravel-asana | src/AsanaCurl.php | AsanaCurl.buildArrayForCurl | protected function buildArrayForCurl($params)
{
if (isset($params['file'])) {
// Have cUrl set the correct content type for upload
$this->setHeader('Content-Type', null);
// Convert array to a simple cUrl usable array
return $this->http_build_query_for_curl(... | php | protected function buildArrayForCurl($params)
{
if (isset($params['file'])) {
// Have cUrl set the correct content type for upload
$this->setHeader('Content-Type', null);
// Convert array to a simple cUrl usable array
return $this->http_build_query_for_curl(... | [
"protected",
"function",
"buildArrayForCurl",
"(",
"$",
"params",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"params",
"[",
"'file'",
"]",
")",
")",
"{",
"// Have cUrl set the correct content type for upload",
"$",
"this",
"->",
"setHeader",
"(",
"'Content-Type'",
... | Build http query that will be cUrl compliant.
@param array $params
@return array | [
"Build",
"http",
"query",
"that",
"will",
"be",
"cUrl",
"compliant",
"."
] | 6e669720dbc3e66f19ffb637865eab9d5ae9d299 | https://github.com/Torann/laravel-asana/blob/6e669720dbc3e66f19ffb637865eab9d5ae9d299/src/AsanaCurl.php#L246-L258 |
223,386 | Torann/laravel-asana | src/AsanaCurl.php | AsanaCurl.http_build_query_for_curl | protected function http_build_query_for_curl($var, $prefix = null)
{
$return = [];
foreach ($var as $key => $value) {
$name = $prefix ? $prefix . '[' . $key . ']' : $key;
if (is_array($value)) {
$return = array_merge($return, $this->http_build_query_for_curl... | php | protected function http_build_query_for_curl($var, $prefix = null)
{
$return = [];
foreach ($var as $key => $value) {
$name = $prefix ? $prefix . '[' . $key . ']' : $key;
if (is_array($value)) {
$return = array_merge($return, $this->http_build_query_for_curl... | [
"protected",
"function",
"http_build_query_for_curl",
"(",
"$",
"var",
",",
"$",
"prefix",
"=",
"null",
")",
"{",
"$",
"return",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"var",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"name",
"=",
"$",
... | Handle nested arrays when posting
@param mixed $var
@param string $prefix
@return array | [
"Handle",
"nested",
"arrays",
"when",
"posting"
] | 6e669720dbc3e66f19ffb637865eab9d5ae9d299 | https://github.com/Torann/laravel-asana/blob/6e669720dbc3e66f19ffb637865eab9d5ae9d299/src/AsanaCurl.php#L268-L289 |
223,387 | Torann/laravel-asana | src/AsanaCurl.php | AsanaCurl.addPostFile | public function addPostFile($filename)
{
if ($filename instanceof UploadedFile) {
// Get original filename
$name = $filename->getClientOriginalName();
// Move the file
$file = $filename->move(sys_get_temp_dir() . '/' . uniqid(), $name);
// Get t... | php | public function addPostFile($filename)
{
if ($filename instanceof UploadedFile) {
// Get original filename
$name = $filename->getClientOriginalName();
// Move the file
$file = $filename->move(sys_get_temp_dir() . '/' . uniqid(), $name);
// Get t... | [
"public",
"function",
"addPostFile",
"(",
"$",
"filename",
")",
"{",
"if",
"(",
"$",
"filename",
"instanceof",
"UploadedFile",
")",
"{",
"// Get original filename",
"$",
"name",
"=",
"$",
"filename",
"->",
"getClientOriginalName",
"(",
")",
";",
"// Move the fil... | POST file upload
@param string $filename File to be uploaded
@return mixed
@throws InvalidArgumentException | [
"POST",
"file",
"upload"
] | 6e669720dbc3e66f19ffb637865eab9d5ae9d299 | https://github.com/Torann/laravel-asana/blob/6e669720dbc3e66f19ffb637865eab9d5ae9d299/src/AsanaCurl.php#L299-L325 |
223,388 | imanee/imanee | src/ImageResource/GDPixel.php | GDPixel.load | public static function load($color, $resource)
{
if ($color === 'transparent') {
return imagecolorallocatealpha($resource, 0, 0, 0, 127);
}
$gdpixel = new GDPixel($color);
return imagecolorallocate($resource, $gdpixel->channelR, $gdpixel->channelG, $gdpixel->channelB);... | php | public static function load($color, $resource)
{
if ($color === 'transparent') {
return imagecolorallocatealpha($resource, 0, 0, 0, 127);
}
$gdpixel = new GDPixel($color);
return imagecolorallocate($resource, $gdpixel->channelR, $gdpixel->channelG, $gdpixel->channelB);... | [
"public",
"static",
"function",
"load",
"(",
"$",
"color",
",",
"$",
"resource",
")",
"{",
"if",
"(",
"$",
"color",
"===",
"'transparent'",
")",
"{",
"return",
"imagecolorallocatealpha",
"(",
"$",
"resource",
",",
"0",
",",
"0",
",",
"0",
",",
"127",
... | Returns a color representation for GD based on a color string.
Examples of valid color strings:
- black
- white
- purple
- #00FFCC
- 00FFCC
@param string $color
@param resource $resource
@return int | [
"Returns",
"a",
"color",
"representation",
"for",
"GD",
"based",
"on",
"a",
"color",
"string",
"."
] | cf390b5e7f92ca21d6e388abe51433e9ed671b1b | https://github.com/imanee/imanee/blob/cf390b5e7f92ca21d6e388abe51433e9ed671b1b/src/ImageResource/GDPixel.php#L54-L64 |
223,389 | yii2mod/yii2-validators | ECCValidator.php | ECCValidator.validateNumber | public function validateNumber($creditCardNumber)
{
if (!$this->checkType()) {
throw new Exception(Yii::t('ECCValidator', 'The "format" property must be specified with a supported Credit Card format.'));
}
$creditCardNumber = preg_replace('/[ -]+/', '', $creditCardNumber);
... | php | public function validateNumber($creditCardNumber)
{
if (!$this->checkType()) {
throw new Exception(Yii::t('ECCValidator', 'The "format" property must be specified with a supported Credit Card format.'));
}
$creditCardNumber = preg_replace('/[ -]+/', '', $creditCardNumber);
... | [
"public",
"function",
"validateNumber",
"(",
"$",
"creditCardNumber",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"checkType",
"(",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"Yii",
"::",
"t",
"(",
"'ECCValidator'",
",",
"'The \"format\" property must... | Validates a Credit Card number
@param string $creditCardNumber
@throws \yii\base\Exception
@return bool
@return bool | [
"Validates",
"a",
"Credit",
"Card",
"number"
] | 6c60328757b78cd33883b26c66c3d663f8ded47e | https://github.com/yii2mod/yii2-validators/blob/6c60328757b78cd33883b26c66c3d663f8ded47e/ECCValidator.php#L103-L112 |
223,390 | yii2mod/yii2-validators | ECCValidator.php | ECCValidator.validateDate | public function validateDate($creditCardExpiredMonth, $creditCardExpiredYear)
{
$currentYear = intval(date('Y'));
$currentMonth = intval(date('m'));
if (is_scalar($creditCardExpiredMonth)) {
$creditCardExpiredMonth = intval($creditCardExpiredMonth);
}
if (is_scal... | php | public function validateDate($creditCardExpiredMonth, $creditCardExpiredYear)
{
$currentYear = intval(date('Y'));
$currentMonth = intval(date('m'));
if (is_scalar($creditCardExpiredMonth)) {
$creditCardExpiredMonth = intval($creditCardExpiredMonth);
}
if (is_scal... | [
"public",
"function",
"validateDate",
"(",
"$",
"creditCardExpiredMonth",
",",
"$",
"creditCardExpiredYear",
")",
"{",
"$",
"currentYear",
"=",
"intval",
"(",
"date",
"(",
"'Y'",
")",
")",
";",
"$",
"currentMonth",
"=",
"intval",
"(",
"date",
"(",
"'m'",
"... | Validates a Credit Card date
@param int $creditCardExpiredMonth
@param int $creditCardExpiredYear
@return bool | [
"Validates",
"a",
"Credit",
"Card",
"date"
] | 6c60328757b78cd33883b26c66c3d663f8ded47e | https://github.com/yii2mod/yii2-validators/blob/6c60328757b78cd33883b26c66c3d663f8ded47e/ECCValidator.php#L122-L137 |
223,391 | yii2mod/yii2-validators | ECCValidator.php | ECCValidator.validateAll | public function validateAll($creditCardHolder, $creditCardNumber, $creditCardExpiredMonth, $creditCardExpiredYear)
{
return $this->validateName($creditCardHolder) && $this->validateNumber($creditCardNumber) && $this->validateDate($creditCardExpiredMonth, $creditCardExpiredYear);
} | php | public function validateAll($creditCardHolder, $creditCardNumber, $creditCardExpiredMonth, $creditCardExpiredYear)
{
return $this->validateName($creditCardHolder) && $this->validateNumber($creditCardNumber) && $this->validateDate($creditCardExpiredMonth, $creditCardExpiredYear);
} | [
"public",
"function",
"validateAll",
"(",
"$",
"creditCardHolder",
",",
"$",
"creditCardNumber",
",",
"$",
"creditCardExpiredMonth",
",",
"$",
"creditCardExpiredYear",
")",
"{",
"return",
"$",
"this",
"->",
"validateName",
"(",
"$",
"creditCardHolder",
")",
"&&",
... | Validates holder, number, and dates of Credit Card numbers
@param string $creditCardHolder
@param string $creditCardNumber
@param int $creditCardExpiredMonth
@param int $creditCardExpiredYear
@return bool | [
"Validates",
"holder",
"number",
"and",
"dates",
"of",
"Credit",
"Card",
"numbers"
] | 6c60328757b78cd33883b26c66c3d663f8ded47e | https://github.com/yii2mod/yii2-validators/blob/6c60328757b78cd33883b26c66c3d663f8ded47e/ECCValidator.php#L161-L164 |
223,392 | yii2mod/yii2-validators | ECCValidator.php | ECCValidator.checkFormat | protected function checkFormat($cardNumber)
{
return preg_match('/^[0-9]+$/', $cardNumber) && preg_match($this->patterns[$this->format], $cardNumber);
} | php | protected function checkFormat($cardNumber)
{
return preg_match('/^[0-9]+$/', $cardNumber) && preg_match($this->patterns[$this->format], $cardNumber);
} | [
"protected",
"function",
"checkFormat",
"(",
"$",
"cardNumber",
")",
"{",
"return",
"preg_match",
"(",
"'/^[0-9]+$/'",
",",
"$",
"cardNumber",
")",
"&&",
"preg_match",
"(",
"$",
"this",
"->",
"patterns",
"[",
"$",
"this",
"->",
"format",
"]",
",",
"$",
"... | Checks Credit Card Prefixes
@param $cardNumber
@return bool | [
"Checks",
"Credit",
"Card",
"Prefixes"
] | 6c60328757b78cd33883b26c66c3d663f8ded47e | https://github.com/yii2mod/yii2-validators/blob/6c60328757b78cd33883b26c66c3d663f8ded47e/ECCValidator.php#L173-L176 |
223,393 | yii2mod/yii2-validators | ECCValidator.php | ECCValidator.mod10 | protected function mod10($cardNumber)
{
$cardNumber = strrev($cardNumber);
$numSum = 0;
for ($i = 0; $i < strlen($cardNumber); $i++) {
$currentNum = substr($cardNumber, $i, 1);
if ($i % 2 == 1) {
$currentNum *= 2;
}
if ($current... | php | protected function mod10($cardNumber)
{
$cardNumber = strrev($cardNumber);
$numSum = 0;
for ($i = 0; $i < strlen($cardNumber); $i++) {
$currentNum = substr($cardNumber, $i, 1);
if ($i % 2 == 1) {
$currentNum *= 2;
}
if ($current... | [
"protected",
"function",
"mod10",
"(",
"$",
"cardNumber",
")",
"{",
"$",
"cardNumber",
"=",
"strrev",
"(",
"$",
"cardNumber",
")",
";",
"$",
"numSum",
"=",
"0",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"strlen",
"(",
"$",
"cardNum... | Check credit card number by Mod 10 algorithm
@param $cardNumber
@return bool
@see http://en.wikipedia.org/wiki/Luhn_algorithm#Mod_10.2B5_Variant | [
"Check",
"credit",
"card",
"number",
"by",
"Mod",
"10",
"algorithm"
] | 6c60328757b78cd33883b26c66c3d663f8ded47e | https://github.com/yii2mod/yii2-validators/blob/6c60328757b78cd33883b26c66c3d663f8ded47e/ECCValidator.php#L187-L205 |
223,394 | ConsoleTVs/Links | src/Builder.php | Builder.track | public static function track($jquery = false)
{
$link = new Link(Request::url());
return $link->ajax($jquery);
} | php | public static function track($jquery = false)
{
$link = new Link(Request::url());
return $link->ajax($jquery);
} | [
"public",
"static",
"function",
"track",
"(",
"$",
"jquery",
"=",
"false",
")",
"{",
"$",
"link",
"=",
"new",
"Link",
"(",
"Request",
"::",
"url",
"(",
")",
")",
";",
"return",
"$",
"link",
"->",
"ajax",
"(",
"$",
"jquery",
")",
";",
"}"
] | Create a new link from the current page url.
@param string $url | [
"Create",
"a",
"new",
"link",
"from",
"the",
"current",
"page",
"url",
"."
] | f9afe304137f8d7682eac9c46f8aa4c82f5e625c | https://github.com/ConsoleTVs/Links/blob/f9afe304137f8d7682eac9c46f8aa4c82f5e625c/src/Builder.php#L51-L56 |
223,395 | personnummer/php | src/Personnummer.php | Personnummer.luhn | private static function luhn($str)
{
$v = 0;
$sum = 0;
for ($i = 0; $i < strlen($str); $i ++) {
$v = intval($str[$i]);
$v *= 2 - ($i % 2);
if ($v > 9) {
$v -= 9;
}
$sum += $v;
}
return intval(ce... | php | private static function luhn($str)
{
$v = 0;
$sum = 0;
for ($i = 0; $i < strlen($str); $i ++) {
$v = intval($str[$i]);
$v *= 2 - ($i % 2);
if ($v > 9) {
$v -= 9;
}
$sum += $v;
}
return intval(ce... | [
"private",
"static",
"function",
"luhn",
"(",
"$",
"str",
")",
"{",
"$",
"v",
"=",
"0",
";",
"$",
"sum",
"=",
"0",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"strlen",
"(",
"$",
"str",
")",
";",
"$",
"i",
"++",
")",
"{",
"... | The Luhn algorithm.
@param string str
@return int | [
"The",
"Luhn",
"algorithm",
"."
] | acb1376e96b48744d863b2c59c9cd438f39c0330 | https://github.com/personnummer/php/blob/acb1376e96b48744d863b2c59c9cd438f39c0330/src/Personnummer.php#L14-L31 |
223,396 | personnummer/php | src/Personnummer.php | Personnummer.getParts | protected static function getParts($str) {
$reg = '/^(\d{2}){0,1}(\d{2})(\d{2})(\d{2})([\+\-\s]?)(\d{3})(\d)$/';
preg_match($reg, $str, $match);
if (!isset($match) || count($match) !== 8) {
return array();
}
$century = $match[1];
$year = $match[2];
... | php | protected static function getParts($str) {
$reg = '/^(\d{2}){0,1}(\d{2})(\d{2})(\d{2})([\+\-\s]?)(\d{3})(\d)$/';
preg_match($reg, $str, $match);
if (!isset($match) || count($match) !== 8) {
return array();
}
$century = $match[1];
$year = $match[2];
... | [
"protected",
"static",
"function",
"getParts",
"(",
"$",
"str",
")",
"{",
"$",
"reg",
"=",
"'/^(\\d{2}){0,1}(\\d{2})(\\d{2})(\\d{2})([\\+\\-\\s]?)(\\d{3})(\\d)$/'",
";",
"preg_match",
"(",
"$",
"reg",
",",
"$",
"str",
",",
"$",
"match",
")",
";",
"if",
"(",
"!... | Parse Swedish social security numbers and get the parts
@param string $str
@return array | [
"Parse",
"Swedish",
"social",
"security",
"numbers",
"and",
"get",
"the",
"parts"
] | acb1376e96b48744d863b2c59c9cd438f39c0330 | https://github.com/personnummer/php/blob/acb1376e96b48744d863b2c59c9cd438f39c0330/src/Personnummer.php#L40-L82 |
223,397 | personnummer/php | src/Personnummer.php | Personnummer.valid | public static function valid($str)
{
if (!is_numeric($str) && !is_string($str)) {
return false;
}
$str = strval($str);
$parts = array_pad(self::getParts($str), 7, '');
if (in_array('', $parts, true)) {
return false;
}
list($century,... | php | public static function valid($str)
{
if (!is_numeric($str) && !is_string($str)) {
return false;
}
$str = strval($str);
$parts = array_pad(self::getParts($str), 7, '');
if (in_array('', $parts, true)) {
return false;
}
list($century,... | [
"public",
"static",
"function",
"valid",
"(",
"$",
"str",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"str",
")",
"&&",
"!",
"is_string",
"(",
"$",
"str",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"str",
"=",
"strval",
"(",
"$",
"s... | Validate Swedish social security numbers.
@param string|int $str
@return bool | [
"Validate",
"Swedish",
"social",
"security",
"numbers",
"."
] | acb1376e96b48744d863b2c59c9cd438f39c0330 | https://github.com/personnummer/php/blob/acb1376e96b48744d863b2c59c9cd438f39c0330/src/Personnummer.php#L91-L117 |
223,398 | personnummer/php | src/Personnummer.php | Personnummer.format | public static function format($str, $longFormat = false) {
if (!self::valid($str)) {
return '';
}
$parts = self::getParts($str);
if ($longFormat) {
$format = '%1$s%2$s%3$s%4$s%6$s%7$s';
} else {
$format = '%2$s%3$s%4$s%5$s%6$s%7$s';
}... | php | public static function format($str, $longFormat = false) {
if (!self::valid($str)) {
return '';
}
$parts = self::getParts($str);
if ($longFormat) {
$format = '%1$s%2$s%3$s%4$s%6$s%7$s';
} else {
$format = '%2$s%3$s%4$s%5$s%6$s%7$s';
}... | [
"public",
"static",
"function",
"format",
"(",
"$",
"str",
",",
"$",
"longFormat",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"valid",
"(",
"$",
"str",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"parts",
"=",
"self",
"::",
"getParts... | Format Swedish social security numbers to official format
@param string|int $str
@param bool $longFormat YYMMDD-XXXX or YYYYMMDDXXXX since the tax office says both are official
@return string | [
"Format",
"Swedish",
"social",
"security",
"numbers",
"to",
"official",
"format"
] | acb1376e96b48744d863b2c59c9cd438f39c0330 | https://github.com/personnummer/php/blob/acb1376e96b48744d863b2c59c9cd438f39c0330/src/Personnummer.php#L127-L152 |
223,399 | lexik/LexikWorkflowBundle | Flow/Node.php | Node.addNextState | public function addNextState($name, $type, Node $target)
{
$this->nextStates[$name] = new NextState($name, $type, $target);
} | php | public function addNextState($name, $type, Node $target)
{
$this->nextStates[$name] = new NextState($name, $type, $target);
} | [
"public",
"function",
"addNextState",
"(",
"$",
"name",
",",
"$",
"type",
",",
"Node",
"$",
"target",
")",
"{",
"$",
"this",
"->",
"nextStates",
"[",
"$",
"name",
"]",
"=",
"new",
"NextState",
"(",
"$",
"name",
",",
"$",
"type",
",",
"$",
"target",... | Add a next state.
@param string $name
@param string $type
@param Node $state | [
"Add",
"a",
"next",
"state",
"."
] | 0caf4609843c8b1929f14d7c717e37626c3f2f71 | https://github.com/lexik/LexikWorkflowBundle/blob/0caf4609843c8b1929f14d7c717e37626c3f2f71/Flow/Node.php#L87-L90 |
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.