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 | partition stringclasses 1 value |
|---|---|---|---|---|---|---|---|---|---|---|---|
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByDisplaycost | public function filterByDisplaycost($displaycost = null, $comparison = null)
{
if (is_array($displaycost)) {
$useMinMax = false;
if (isset($displaycost['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_DISPLAYCOST, $displaycost['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($displaycost['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_DISPLAYCOST, $displaycost['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_DISPLAYCOST, $displaycost, $comparison);
} | php | public function filterByDisplaycost($displaycost = null, $comparison = null)
{
if (is_array($displaycost)) {
$useMinMax = false;
if (isset($displaycost['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_DISPLAYCOST, $displaycost['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($displaycost['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_DISPLAYCOST, $displaycost['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_DISPLAYCOST, $displaycost, $comparison);
} | [
"public",
"function",
"filterByDisplaycost",
"(",
"$",
"displaycost",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"displaycost",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(... | Filter the query on the displayCost column
Example usage:
<code>
$query->filterByDisplaycost(1234); // WHERE displayCost = 1234
$query->filterByDisplaycost(array(12, 34)); // WHERE displayCost IN (12, 34)
$query->filterByDisplaycost(array('min' => 12)); // WHERE displayCost > 12
</code>
@param mixed $displaycost The value to use as filter.
Use scalar values for equality.
Use array values for in_array() equivalent.
Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"displayCost",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L814-L835 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByModname | public function filterByModname($modname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($modname)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_MODNAME, $modname, $comparison);
} | php | public function filterByModname($modname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($modname)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_MODNAME, $modname, $comparison);
} | [
"public",
"function",
"filterByModname",
"(",
"$",
"modname",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"modname",
")",
")",
"{",
"$",
"comparis... | Filter the query on the modName column
Example usage:
<code>
$query->filterByModname('fooValue'); // WHERE modName = 'fooValue'
$query->filterByModname('%fooValue%', Criteria::LIKE); // WHERE modName LIKE '%fooValue%'
</code>
@param string $modname The value to use as filter.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"modName",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L851-L860 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByLightmap | public function filterByLightmap($lightmap = null, $comparison = null)
{
if (is_array($lightmap)) {
$useMinMax = false;
if (isset($lightmap['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_LIGHTMAP, $lightmap['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($lightmap['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_LIGHTMAP, $lightmap['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_LIGHTMAP, $lightmap, $comparison);
} | php | public function filterByLightmap($lightmap = null, $comparison = null)
{
if (is_array($lightmap)) {
$useMinMax = false;
if (isset($lightmap['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_LIGHTMAP, $lightmap['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($lightmap['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_LIGHTMAP, $lightmap['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_LIGHTMAP, $lightmap, $comparison);
} | [
"public",
"function",
"filterByLightmap",
"(",
"$",
"lightmap",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"lightmap",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",... | Filter the query on the lightMap column
Example usage:
<code>
$query->filterByLightmap(1234); // WHERE lightMap = 1234
$query->filterByLightmap(array(12, 34)); // WHERE lightMap IN (12, 34)
$query->filterByLightmap(array('min' => 12)); // WHERE lightMap > 12
</code>
@param mixed $lightmap The value to use as filter.
Use scalar values for equality.
Use array values for in_array() equivalent.
Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"lightMap",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L880-L901 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByExeversion | public function filterByExeversion($exeversion = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($exeversion)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_EXEVERSION, $exeversion, $comparison);
} | php | public function filterByExeversion($exeversion = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($exeversion)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_EXEVERSION, $exeversion, $comparison);
} | [
"public",
"function",
"filterByExeversion",
"(",
"$",
"exeversion",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"exeversion",
")",
")",
"{",
"$",
... | Filter the query on the exeVersion column
Example usage:
<code>
$query->filterByExeversion('fooValue'); // WHERE exeVersion = 'fooValue'
$query->filterByExeversion('%fooValue%', Criteria::LIKE); // WHERE exeVersion LIKE '%fooValue%'
</code>
@param string $exeversion The value to use as filter.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"exeVersion",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L917-L926 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByExebuild | public function filterByExebuild($exebuild = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($exebuild)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_EXEBUILD, $exebuild, $comparison);
} | php | public function filterByExebuild($exebuild = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($exebuild)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_EXEBUILD, $exebuild, $comparison);
} | [
"public",
"function",
"filterByExebuild",
"(",
"$",
"exebuild",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"exebuild",
")",
")",
"{",
"$",
"compa... | Filter the query on the exeBuild column
Example usage:
<code>
$query->filterByExebuild('fooValue'); // WHERE exeBuild = 'fooValue'
$query->filterByExebuild('%fooValue%', Criteria::LIKE); // WHERE exeBuild LIKE '%fooValue%'
</code>
@param string $exebuild The value to use as filter.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"exeBuild",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L942-L951 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByEnvironmentname | public function filterByEnvironmentname($environmentname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($environmentname)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_ENVIRONMENTNAME, $environmentname, $comparison);
} | php | public function filterByEnvironmentname($environmentname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($environmentname)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_ENVIRONMENTNAME, $environmentname, $comparison);
} | [
"public",
"function",
"filterByEnvironmentname",
"(",
"$",
"environmentname",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"environmentname",
")",
")",
... | Filter the query on the environmentName column
Example usage:
<code>
$query->filterByEnvironmentname('fooValue'); // WHERE environmentName = 'fooValue'
$query->filterByEnvironmentname('%fooValue%', Criteria::LIKE); // WHERE environmentName LIKE '%fooValue%'
</code>
@param string $environmentname The value to use as filter.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"environmentName",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L967-L976 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByVehiclename | public function filterByVehiclename($vehiclename = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($vehiclename)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_VEHICLENAME, $vehiclename, $comparison);
} | php | public function filterByVehiclename($vehiclename = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($vehiclename)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_VEHICLENAME, $vehiclename, $comparison);
} | [
"public",
"function",
"filterByVehiclename",
"(",
"$",
"vehiclename",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"vehiclename",
")",
")",
"{",
"$",... | Filter the query on the vehicleName column
Example usage:
<code>
$query->filterByVehiclename('fooValue'); // WHERE vehicleName = 'fooValue'
$query->filterByVehiclename('%fooValue%', Criteria::LIKE); // WHERE vehicleName LIKE '%fooValue%'
</code>
@param string $vehiclename The value to use as filter.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"vehicleName",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L992-L1001 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByUnlimiterrequired | public function filterByUnlimiterrequired($unlimiterrequired = null, $comparison = null)
{
if (is_string($unlimiterrequired)) {
$unlimiterrequired = in_array(strtolower($unlimiterrequired), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(MxmapTableMap::COL_UNLIMITERREQUIRED, $unlimiterrequired, $comparison);
} | php | public function filterByUnlimiterrequired($unlimiterrequired = null, $comparison = null)
{
if (is_string($unlimiterrequired)) {
$unlimiterrequired = in_array(strtolower($unlimiterrequired), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(MxmapTableMap::COL_UNLIMITERREQUIRED, $unlimiterrequired, $comparison);
} | [
"public",
"function",
"filterByUnlimiterrequired",
"(",
"$",
"unlimiterrequired",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"unlimiterrequired",
")",
")",
"{",
"$",
"unlimiterrequired",
"=",
"in_array",
"(",
... | Filter the query on the unlimiterRequired column
Example usage:
<code>
$query->filterByUnlimiterrequired(true); // WHERE unlimiterRequired = true
$query->filterByUnlimiterrequired('yes'); // WHERE unlimiterRequired = true
</code>
@param boolean|string $unlimiterrequired The value to use as filter.
Non-boolean arguments are converted using the following rules:
* 1, '1', 'true', 'on', and 'yes' are converted to boolean true
* 0, '0', 'false', 'off', and 'no' are converted to boolean false
Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"unlimiterRequired",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1021-L1028 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByRoutename | public function filterByRoutename($routename = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($routename)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_ROUTENAME, $routename, $comparison);
} | php | public function filterByRoutename($routename = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($routename)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_ROUTENAME, $routename, $comparison);
} | [
"public",
"function",
"filterByRoutename",
"(",
"$",
"routename",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"routename",
")",
")",
"{",
"$",
"co... | Filter the query on the routeName column
Example usage:
<code>
$query->filterByRoutename('fooValue'); // WHERE routeName = 'fooValue'
$query->filterByRoutename('%fooValue%', Criteria::LIKE); // WHERE routeName LIKE '%fooValue%'
</code>
@param string $routename The value to use as filter.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"routeName",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1044-L1053 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByLengthname | public function filterByLengthname($lengthname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($lengthname)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_LENGTHNAME, $lengthname, $comparison);
} | php | public function filterByLengthname($lengthname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($lengthname)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_LENGTHNAME, $lengthname, $comparison);
} | [
"public",
"function",
"filterByLengthname",
"(",
"$",
"lengthname",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"lengthname",
")",
")",
"{",
"$",
... | Filter the query on the lengthName column
Example usage:
<code>
$query->filterByLengthname('fooValue'); // WHERE lengthName = 'fooValue'
$query->filterByLengthname('%fooValue%', Criteria::LIKE); // WHERE lengthName LIKE '%fooValue%'
</code>
@param string $lengthname The value to use as filter.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"lengthName",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1069-L1078 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByLaps | public function filterByLaps($laps = null, $comparison = null)
{
if (is_array($laps)) {
$useMinMax = false;
if (isset($laps['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_LAPS, $laps['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($laps['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_LAPS, $laps['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_LAPS, $laps, $comparison);
} | php | public function filterByLaps($laps = null, $comparison = null)
{
if (is_array($laps)) {
$useMinMax = false;
if (isset($laps['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_LAPS, $laps['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($laps['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_LAPS, $laps['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_LAPS, $laps, $comparison);
} | [
"public",
"function",
"filterByLaps",
"(",
"$",
"laps",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"laps",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",
"laps",
... | Filter the query on the laps column
Example usage:
<code>
$query->filterByLaps(1234); // WHERE laps = 1234
$query->filterByLaps(array(12, 34)); // WHERE laps IN (12, 34)
$query->filterByLaps(array('min' => 12)); // WHERE laps > 12
</code>
@param mixed $laps The value to use as filter.
Use scalar values for equality.
Use array values for in_array() equivalent.
Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"laps",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1098-L1119 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByDifficultyname | public function filterByDifficultyname($difficultyname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($difficultyname)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_DIFFICULTYNAME, $difficultyname, $comparison);
} | php | public function filterByDifficultyname($difficultyname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($difficultyname)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_DIFFICULTYNAME, $difficultyname, $comparison);
} | [
"public",
"function",
"filterByDifficultyname",
"(",
"$",
"difficultyname",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"difficultyname",
")",
")",
"{... | Filter the query on the difficultyName column
Example usage:
<code>
$query->filterByDifficultyname('fooValue'); // WHERE difficultyName = 'fooValue'
$query->filterByDifficultyname('%fooValue%', Criteria::LIKE); // WHERE difficultyName LIKE '%fooValue%'
</code>
@param string $difficultyname The value to use as filter.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"difficultyName",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1135-L1144 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByReplaytypename | public function filterByReplaytypename($replaytypename = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($replaytypename)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_REPLAYTYPENAME, $replaytypename, $comparison);
} | php | public function filterByReplaytypename($replaytypename = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($replaytypename)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_REPLAYTYPENAME, $replaytypename, $comparison);
} | [
"public",
"function",
"filterByReplaytypename",
"(",
"$",
"replaytypename",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"replaytypename",
")",
")",
"{... | Filter the query on the replayTypeName column
Example usage:
<code>
$query->filterByReplaytypename('fooValue'); // WHERE replayTypeName = 'fooValue'
$query->filterByReplaytypename('%fooValue%', Criteria::LIKE); // WHERE replayTypeName LIKE '%fooValue%'
</code>
@param string $replaytypename The value to use as filter.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"replayTypeName",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1160-L1169 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByReplaywrid | public function filterByReplaywrid($replaywrid = null, $comparison = null)
{
if (is_array($replaywrid)) {
$useMinMax = false;
if (isset($replaywrid['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_REPLAYWRID, $replaywrid['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($replaywrid['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_REPLAYWRID, $replaywrid['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_REPLAYWRID, $replaywrid, $comparison);
} | php | public function filterByReplaywrid($replaywrid = null, $comparison = null)
{
if (is_array($replaywrid)) {
$useMinMax = false;
if (isset($replaywrid['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_REPLAYWRID, $replaywrid['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($replaywrid['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_REPLAYWRID, $replaywrid['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_REPLAYWRID, $replaywrid, $comparison);
} | [
"public",
"function",
"filterByReplaywrid",
"(",
"$",
"replaywrid",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"replaywrid",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
... | Filter the query on the replayWRID column
Example usage:
<code>
$query->filterByReplaywrid(1234); // WHERE replayWRID = 1234
$query->filterByReplaywrid(array(12, 34)); // WHERE replayWRID IN (12, 34)
$query->filterByReplaywrid(array('min' => 12)); // WHERE replayWRID > 12
</code>
@param mixed $replaywrid The value to use as filter.
Use scalar values for equality.
Use array values for in_array() equivalent.
Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"replayWRID",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1189-L1210 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByReplaywrtime | public function filterByReplaywrtime($replaywrtime = null, $comparison = null)
{
if (is_array($replaywrtime)) {
$useMinMax = false;
if (isset($replaywrtime['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_REPLAYWRTIME, $replaywrtime['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($replaywrtime['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_REPLAYWRTIME, $replaywrtime['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_REPLAYWRTIME, $replaywrtime, $comparison);
} | php | public function filterByReplaywrtime($replaywrtime = null, $comparison = null)
{
if (is_array($replaywrtime)) {
$useMinMax = false;
if (isset($replaywrtime['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_REPLAYWRTIME, $replaywrtime['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($replaywrtime['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_REPLAYWRTIME, $replaywrtime['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_REPLAYWRTIME, $replaywrtime, $comparison);
} | [
"public",
"function",
"filterByReplaywrtime",
"(",
"$",
"replaywrtime",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"replaywrtime",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
... | Filter the query on the replayWRTime column
Example usage:
<code>
$query->filterByReplaywrtime(1234); // WHERE replayWRTime = 1234
$query->filterByReplaywrtime(array(12, 34)); // WHERE replayWRTime IN (12, 34)
$query->filterByReplaywrtime(array('min' => 12)); // WHERE replayWRTime > 12
</code>
@param mixed $replaywrtime The value to use as filter.
Use scalar values for equality.
Use array values for in_array() equivalent.
Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"replayWRTime",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1230-L1251 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByReplaywruserid | public function filterByReplaywruserid($replaywruserid = null, $comparison = null)
{
if (is_array($replaywruserid)) {
$useMinMax = false;
if (isset($replaywruserid['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_REPLAYWRUSERID, $replaywruserid['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($replaywruserid['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_REPLAYWRUSERID, $replaywruserid['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_REPLAYWRUSERID, $replaywruserid, $comparison);
} | php | public function filterByReplaywruserid($replaywruserid = null, $comparison = null)
{
if (is_array($replaywruserid)) {
$useMinMax = false;
if (isset($replaywruserid['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_REPLAYWRUSERID, $replaywruserid['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($replaywruserid['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_REPLAYWRUSERID, $replaywruserid['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_REPLAYWRUSERID, $replaywruserid, $comparison);
} | [
"public",
"function",
"filterByReplaywruserid",
"(",
"$",
"replaywruserid",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"replaywruserid",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"iss... | Filter the query on the replayWRUserID column
Example usage:
<code>
$query->filterByReplaywruserid(1234); // WHERE replayWRUserID = 1234
$query->filterByReplaywruserid(array(12, 34)); // WHERE replayWRUserID IN (12, 34)
$query->filterByReplaywruserid(array('min' => 12)); // WHERE replayWRUserID > 12
</code>
@param mixed $replaywruserid The value to use as filter.
Use scalar values for equality.
Use array values for in_array() equivalent.
Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"replayWRUserID",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1271-L1292 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByReplaywrusername | public function filterByReplaywrusername($replaywrusername = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($replaywrusername)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_REPLAYWRUSERNAME, $replaywrusername, $comparison);
} | php | public function filterByReplaywrusername($replaywrusername = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($replaywrusername)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_REPLAYWRUSERNAME, $replaywrusername, $comparison);
} | [
"public",
"function",
"filterByReplaywrusername",
"(",
"$",
"replaywrusername",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"replaywrusername",
")",
")"... | Filter the query on the replayWRUsername column
Example usage:
<code>
$query->filterByReplaywrusername('fooValue'); // WHERE replayWRUsername = 'fooValue'
$query->filterByReplaywrusername('%fooValue%', Criteria::LIKE); // WHERE replayWRUsername LIKE '%fooValue%'
</code>
@param string $replaywrusername The value to use as filter.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"replayWRUsername",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1308-L1317 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByRatingvotecount | public function filterByRatingvotecount($ratingvotecount = null, $comparison = null)
{
if (is_array($ratingvotecount)) {
$useMinMax = false;
if (isset($ratingvotecount['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_RATINGVOTECOUNT, $ratingvotecount['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($ratingvotecount['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_RATINGVOTECOUNT, $ratingvotecount['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_RATINGVOTECOUNT, $ratingvotecount, $comparison);
} | php | public function filterByRatingvotecount($ratingvotecount = null, $comparison = null)
{
if (is_array($ratingvotecount)) {
$useMinMax = false;
if (isset($ratingvotecount['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_RATINGVOTECOUNT, $ratingvotecount['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($ratingvotecount['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_RATINGVOTECOUNT, $ratingvotecount['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_RATINGVOTECOUNT, $ratingvotecount, $comparison);
} | [
"public",
"function",
"filterByRatingvotecount",
"(",
"$",
"ratingvotecount",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"ratingvotecount",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"... | Filter the query on the ratingVoteCount column
Example usage:
<code>
$query->filterByRatingvotecount(1234); // WHERE ratingVoteCount = 1234
$query->filterByRatingvotecount(array(12, 34)); // WHERE ratingVoteCount IN (12, 34)
$query->filterByRatingvotecount(array('min' => 12)); // WHERE ratingVoteCount > 12
</code>
@param mixed $ratingvotecount The value to use as filter.
Use scalar values for equality.
Use array values for in_array() equivalent.
Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"ratingVoteCount",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1337-L1358 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByRatingvoteaverage | public function filterByRatingvoteaverage($ratingvoteaverage = null, $comparison = null)
{
if (is_array($ratingvoteaverage)) {
$useMinMax = false;
if (isset($ratingvoteaverage['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_RATINGVOTEAVERAGE, $ratingvoteaverage['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($ratingvoteaverage['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_RATINGVOTEAVERAGE, $ratingvoteaverage['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_RATINGVOTEAVERAGE, $ratingvoteaverage, $comparison);
} | php | public function filterByRatingvoteaverage($ratingvoteaverage = null, $comparison = null)
{
if (is_array($ratingvoteaverage)) {
$useMinMax = false;
if (isset($ratingvoteaverage['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_RATINGVOTEAVERAGE, $ratingvoteaverage['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($ratingvoteaverage['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_RATINGVOTEAVERAGE, $ratingvoteaverage['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_RATINGVOTEAVERAGE, $ratingvoteaverage, $comparison);
} | [
"public",
"function",
"filterByRatingvoteaverage",
"(",
"$",
"ratingvoteaverage",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"ratingvoteaverage",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(... | Filter the query on the ratingVoteAverage column
Example usage:
<code>
$query->filterByRatingvoteaverage(1234); // WHERE ratingVoteAverage = 1234
$query->filterByRatingvoteaverage(array(12, 34)); // WHERE ratingVoteAverage IN (12, 34)
$query->filterByRatingvoteaverage(array('min' => 12)); // WHERE ratingVoteAverage > 12
</code>
@param mixed $ratingvoteaverage The value to use as filter.
Use scalar values for equality.
Use array values for in_array() equivalent.
Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"ratingVoteAverage",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1378-L1399 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByReplaycount | public function filterByReplaycount($replaycount = null, $comparison = null)
{
if (is_array($replaycount)) {
$useMinMax = false;
if (isset($replaycount['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_REPLAYCOUNT, $replaycount['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($replaycount['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_REPLAYCOUNT, $replaycount['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_REPLAYCOUNT, $replaycount, $comparison);
} | php | public function filterByReplaycount($replaycount = null, $comparison = null)
{
if (is_array($replaycount)) {
$useMinMax = false;
if (isset($replaycount['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_REPLAYCOUNT, $replaycount['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($replaycount['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_REPLAYCOUNT, $replaycount['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_REPLAYCOUNT, $replaycount, $comparison);
} | [
"public",
"function",
"filterByReplaycount",
"(",
"$",
"replaycount",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"replaycount",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(... | Filter the query on the replayCount column
Example usage:
<code>
$query->filterByReplaycount(1234); // WHERE replayCount = 1234
$query->filterByReplaycount(array(12, 34)); // WHERE replayCount IN (12, 34)
$query->filterByReplaycount(array('min' => 12)); // WHERE replayCount > 12
</code>
@param mixed $replaycount The value to use as filter.
Use scalar values for equality.
Use array values for in_array() equivalent.
Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"replayCount",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1419-L1440 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByTrackvalue | public function filterByTrackvalue($trackvalue = null, $comparison = null)
{
if (is_array($trackvalue)) {
$useMinMax = false;
if (isset($trackvalue['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_TRACKVALUE, $trackvalue['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($trackvalue['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_TRACKVALUE, $trackvalue['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_TRACKVALUE, $trackvalue, $comparison);
} | php | public function filterByTrackvalue($trackvalue = null, $comparison = null)
{
if (is_array($trackvalue)) {
$useMinMax = false;
if (isset($trackvalue['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_TRACKVALUE, $trackvalue['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($trackvalue['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_TRACKVALUE, $trackvalue['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_TRACKVALUE, $trackvalue, $comparison);
} | [
"public",
"function",
"filterByTrackvalue",
"(",
"$",
"trackvalue",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"trackvalue",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
... | Filter the query on the trackValue column
Example usage:
<code>
$query->filterByTrackvalue(1234); // WHERE trackValue = 1234
$query->filterByTrackvalue(array(12, 34)); // WHERE trackValue IN (12, 34)
$query->filterByTrackvalue(array('min' => 12)); // WHERE trackValue > 12
</code>
@param mixed $trackvalue The value to use as filter.
Use scalar values for equality.
Use array values for in_array() equivalent.
Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"trackValue",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1460-L1481 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByComments | public function filterByComments($comments = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($comments)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_COMMENTS, $comments, $comparison);
} | php | public function filterByComments($comments = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($comments)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_COMMENTS, $comments, $comparison);
} | [
"public",
"function",
"filterByComments",
"(",
"$",
"comments",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"comments",
")",
")",
"{",
"$",
"compa... | Filter the query on the comments column
Example usage:
<code>
$query->filterByComments('fooValue'); // WHERE comments = 'fooValue'
$query->filterByComments('%fooValue%', Criteria::LIKE); // WHERE comments LIKE '%fooValue%'
</code>
@param string $comments The value to use as filter.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"comments",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1497-L1506 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByCommentscount | public function filterByCommentscount($commentscount = null, $comparison = null)
{
if (is_array($commentscount)) {
$useMinMax = false;
if (isset($commentscount['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_COMMENTSCOUNT, $commentscount['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($commentscount['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_COMMENTSCOUNT, $commentscount['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_COMMENTSCOUNT, $commentscount, $comparison);
} | php | public function filterByCommentscount($commentscount = null, $comparison = null)
{
if (is_array($commentscount)) {
$useMinMax = false;
if (isset($commentscount['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_COMMENTSCOUNT, $commentscount['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($commentscount['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_COMMENTSCOUNT, $commentscount['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_COMMENTSCOUNT, $commentscount, $comparison);
} | [
"public",
"function",
"filterByCommentscount",
"(",
"$",
"commentscount",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"commentscount",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset"... | Filter the query on the commentsCount column
Example usage:
<code>
$query->filterByCommentscount(1234); // WHERE commentsCount = 1234
$query->filterByCommentscount(array(12, 34)); // WHERE commentsCount IN (12, 34)
$query->filterByCommentscount(array('min' => 12)); // WHERE commentsCount > 12
</code>
@param mixed $commentscount The value to use as filter.
Use scalar values for equality.
Use array values for in_array() equivalent.
Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"commentsCount",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1526-L1547 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByAwardcount | public function filterByAwardcount($awardcount = null, $comparison = null)
{
if (is_array($awardcount)) {
$useMinMax = false;
if (isset($awardcount['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_AWARDCOUNT, $awardcount['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($awardcount['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_AWARDCOUNT, $awardcount['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_AWARDCOUNT, $awardcount, $comparison);
} | php | public function filterByAwardcount($awardcount = null, $comparison = null)
{
if (is_array($awardcount)) {
$useMinMax = false;
if (isset($awardcount['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_AWARDCOUNT, $awardcount['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($awardcount['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_AWARDCOUNT, $awardcount['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_AWARDCOUNT, $awardcount, $comparison);
} | [
"public",
"function",
"filterByAwardcount",
"(",
"$",
"awardcount",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"awardcount",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
... | Filter the query on the awardCount column
Example usage:
<code>
$query->filterByAwardcount(1234); // WHERE awardCount = 1234
$query->filterByAwardcount(array(12, 34)); // WHERE awardCount IN (12, 34)
$query->filterByAwardcount(array('min' => 12)); // WHERE awardCount > 12
</code>
@param mixed $awardcount The value to use as filter.
Use scalar values for equality.
Use array values for in_array() equivalent.
Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"awardCount",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1567-L1588 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByHasscreenshot | public function filterByHasscreenshot($hasscreenshot = null, $comparison = null)
{
if (is_string($hasscreenshot)) {
$hasscreenshot = in_array(strtolower($hasscreenshot), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(MxmapTableMap::COL_HASSCREENSHOT, $hasscreenshot, $comparison);
} | php | public function filterByHasscreenshot($hasscreenshot = null, $comparison = null)
{
if (is_string($hasscreenshot)) {
$hasscreenshot = in_array(strtolower($hasscreenshot), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(MxmapTableMap::COL_HASSCREENSHOT, $hasscreenshot, $comparison);
} | [
"public",
"function",
"filterByHasscreenshot",
"(",
"$",
"hasscreenshot",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"hasscreenshot",
")",
")",
"{",
"$",
"hasscreenshot",
"=",
"in_array",
"(",
"strtolower",
... | Filter the query on the hasScreenshot column
Example usage:
<code>
$query->filterByHasscreenshot(true); // WHERE hasScreenshot = true
$query->filterByHasscreenshot('yes'); // WHERE hasScreenshot = true
</code>
@param boolean|string $hasscreenshot The value to use as filter.
Non-boolean arguments are converted using the following rules:
* 1, '1', 'true', 'on', and 'yes' are converted to boolean true
* 0, '0', 'false', 'off', and 'no' are converted to boolean false
Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"hasScreenshot",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1608-L1615 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByHasthumbnail | public function filterByHasthumbnail($hasthumbnail = null, $comparison = null)
{
if (is_string($hasthumbnail)) {
$hasthumbnail = in_array(strtolower($hasthumbnail), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(MxmapTableMap::COL_HASTHUMBNAIL, $hasthumbnail, $comparison);
} | php | public function filterByHasthumbnail($hasthumbnail = null, $comparison = null)
{
if (is_string($hasthumbnail)) {
$hasthumbnail = in_array(strtolower($hasthumbnail), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(MxmapTableMap::COL_HASTHUMBNAIL, $hasthumbnail, $comparison);
} | [
"public",
"function",
"filterByHasthumbnail",
"(",
"$",
"hasthumbnail",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"hasthumbnail",
")",
")",
"{",
"$",
"hasthumbnail",
"=",
"in_array",
"(",
"strtolower",
"(... | Filter the query on the hasThumbnail column
Example usage:
<code>
$query->filterByHasthumbnail(true); // WHERE hasThumbnail = true
$query->filterByHasthumbnail('yes'); // WHERE hasThumbnail = true
</code>
@param boolean|string $hasthumbnail The value to use as filter.
Non-boolean arguments are converted using the following rules:
* 1, '1', 'true', 'on', and 'yes' are converted to boolean true
* 0, '0', 'false', 'off', and 'no' are converted to boolean false
Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"hasThumbnail",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1635-L1642 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByHasghostblocks | public function filterByHasghostblocks($hasghostblocks = null, $comparison = null)
{
if (is_string($hasghostblocks)) {
$hasghostblocks = in_array(strtolower($hasghostblocks), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(MxmapTableMap::COL_HASGHOSTBLOCKS, $hasghostblocks, $comparison);
} | php | public function filterByHasghostblocks($hasghostblocks = null, $comparison = null)
{
if (is_string($hasghostblocks)) {
$hasghostblocks = in_array(strtolower($hasghostblocks), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(MxmapTableMap::COL_HASGHOSTBLOCKS, $hasghostblocks, $comparison);
} | [
"public",
"function",
"filterByHasghostblocks",
"(",
"$",
"hasghostblocks",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"hasghostblocks",
")",
")",
"{",
"$",
"hasghostblocks",
"=",
"in_array",
"(",
"strtolowe... | Filter the query on the hasGhostblocks column
Example usage:
<code>
$query->filterByHasghostblocks(true); // WHERE hasGhostblocks = true
$query->filterByHasghostblocks('yes'); // WHERE hasGhostblocks = true
</code>
@param boolean|string $hasghostblocks The value to use as filter.
Non-boolean arguments are converted using the following rules:
* 1, '1', 'true', 'on', and 'yes' are converted to boolean true
* 0, '0', 'false', 'off', and 'no' are converted to boolean false
Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"hasGhostblocks",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1662-L1669 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByEmbeddedobjectscount | public function filterByEmbeddedobjectscount($embeddedobjectscount = null, $comparison = null)
{
if (is_array($embeddedobjectscount)) {
$useMinMax = false;
if (isset($embeddedobjectscount['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_EMBEDDEDOBJECTSCOUNT, $embeddedobjectscount['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($embeddedobjectscount['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_EMBEDDEDOBJECTSCOUNT, $embeddedobjectscount['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_EMBEDDEDOBJECTSCOUNT, $embeddedobjectscount, $comparison);
} | php | public function filterByEmbeddedobjectscount($embeddedobjectscount = null, $comparison = null)
{
if (is_array($embeddedobjectscount)) {
$useMinMax = false;
if (isset($embeddedobjectscount['min'])) {
$this->addUsingAlias(MxmapTableMap::COL_EMBEDDEDOBJECTSCOUNT, $embeddedobjectscount['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($embeddedobjectscount['max'])) {
$this->addUsingAlias(MxmapTableMap::COL_EMBEDDEDOBJECTSCOUNT, $embeddedobjectscount['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MxmapTableMap::COL_EMBEDDEDOBJECTSCOUNT, $embeddedobjectscount, $comparison);
} | [
"public",
"function",
"filterByEmbeddedobjectscount",
"(",
"$",
"embeddedobjectscount",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"embeddedobjectscount",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"... | Filter the query on the embeddedObjectsCount column
Example usage:
<code>
$query->filterByEmbeddedobjectscount(1234); // WHERE embeddedObjectsCount = 1234
$query->filterByEmbeddedobjectscount(array(12, 34)); // WHERE embeddedObjectsCount IN (12, 34)
$query->filterByEmbeddedobjectscount(array('min' => 12)); // WHERE embeddedObjectsCount > 12
</code>
@param mixed $embeddedobjectscount The value to use as filter.
Use scalar values for equality.
Use array values for in_array() equivalent.
Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"embeddedObjectsCount",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1689-L1710 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.filterByMap | public function filterByMap($map, $comparison = null)
{
if ($map instanceof \eXpansion\Bundle\Maps\Model\Map) {
return $this
->addUsingAlias(MxmapTableMap::COL_TRACKUID, $map->getMapuid(), $comparison);
} elseif ($map instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(MxmapTableMap::COL_TRACKUID, $map->toKeyValue('PrimaryKey', 'Mapuid'), $comparison);
} else {
throw new PropelException('filterByMap() only accepts arguments of type \eXpansion\Bundle\Maps\Model\Map or Collection');
}
} | php | public function filterByMap($map, $comparison = null)
{
if ($map instanceof \eXpansion\Bundle\Maps\Model\Map) {
return $this
->addUsingAlias(MxmapTableMap::COL_TRACKUID, $map->getMapuid(), $comparison);
} elseif ($map instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(MxmapTableMap::COL_TRACKUID, $map->toKeyValue('PrimaryKey', 'Mapuid'), $comparison);
} else {
throw new PropelException('filterByMap() only accepts arguments of type \eXpansion\Bundle\Maps\Model\Map or Collection');
}
} | [
"public",
"function",
"filterByMap",
"(",
"$",
"map",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"map",
"instanceof",
"\\",
"eXpansion",
"\\",
"Bundle",
"\\",
"Maps",
"\\",
"Model",
"\\",
"Map",
")",
"{",
"return",
"$",
"this",
"-... | Filter the query by a related \eXpansion\Bundle\Maps\Model\Map object
@param \eXpansion\Bundle\Maps\Model\Map|ObjectCollection $map The related object(s) to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@throws \Propel\Runtime\Exception\PropelException
@return ChildMxmapQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"by",
"a",
"related",
"\\",
"eXpansion",
"\\",
"Bundle",
"\\",
"Maps",
"\\",
"Model",
"\\",
"Map",
"object"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1722-L1737 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php | MxmapQuery.useMapQuery | public function useMapQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinMap($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Map', '\eXpansion\Bundle\Maps\Model\MapQuery');
} | php | public function useMapQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinMap($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Map', '\eXpansion\Bundle\Maps\Model\MapQuery');
} | [
"public",
"function",
"useMapQuery",
"(",
"$",
"relationAlias",
"=",
"null",
",",
"$",
"joinType",
"=",
"Criteria",
"::",
"INNER_JOIN",
")",
"{",
"return",
"$",
"this",
"->",
"joinMap",
"(",
"$",
"relationAlias",
",",
"$",
"joinType",
")",
"->",
"useQuery"... | Use the Map relation Map object
@see useQuery()
@param string $relationAlias optional alias for the relation,
to be used as main alias in the secondary query
@param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
@return \eXpansion\Bundle\Maps\Model\MapQuery A secondary query class using the current class as primary query | [
"Use",
"the",
"Map",
"relation",
"Map",
"object"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/Maps/Model/Base/MxmapQuery.php#L1782-L1787 | train |
anklimsk/cakephp-theme | Vendor/PhpUnoconv/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php | LogglyFormatter.format | public function format(array $record)
{
if (isset($record["datetime"]) && ($record["datetime"] instanceof \DateTime)) {
$record["timestamp"] = $record["datetime"]->format("Y-m-d\TH:i:s.uO");
// TODO 2.0 unset the 'datetime' parameter, retained for BC
}
return parent::format($record);
} | php | public function format(array $record)
{
if (isset($record["datetime"]) && ($record["datetime"] instanceof \DateTime)) {
$record["timestamp"] = $record["datetime"]->format("Y-m-d\TH:i:s.uO");
// TODO 2.0 unset the 'datetime' parameter, retained for BC
}
return parent::format($record);
} | [
"public",
"function",
"format",
"(",
"array",
"$",
"record",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"record",
"[",
"\"datetime\"",
"]",
")",
"&&",
"(",
"$",
"record",
"[",
"\"datetime\"",
"]",
"instanceof",
"\\",
"DateTime",
")",
")",
"{",
"$",
"rec... | Appends the 'timestamp' parameter for indexing by Loggly.
@see https://www.loggly.com/docs/automated-parsing/#json
@see \Monolog\Formatter\JsonFormatter::format() | [
"Appends",
"the",
"timestamp",
"parameter",
"for",
"indexing",
"by",
"Loggly",
"."
] | b815a4aaabaaf03ef1df3d547200f73f332f38a7 | https://github.com/anklimsk/cakephp-theme/blob/b815a4aaabaaf03ef1df3d547200f73f332f38a7/Vendor/PhpUnoconv/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php#L38-L46 | train |
TheBnl/event-tickets | code/controllers/SuccessController.php | SuccessController.init | public function init()
{
parent::init();
$reservation = $this->getReservation();
// If we get to the success controller form any state except PENDING or PAID
// This would mean someone would be clever and change the url from summary to success bypassing the payment
// End the session, thus removing the reservation, and redirect back
if (!in_array($reservation->Status, array('PENDING', 'PAID'))) {
ReservationSession::end();
$this->redirect($this->Link('/'));
} elseif ($reservation->Status !== 'PAID') {
// todo move to TicketPayment::onCaptured()
$this->extend('afterPaymentComplete', $reservation);
}
} | php | public function init()
{
parent::init();
$reservation = $this->getReservation();
// If we get to the success controller form any state except PENDING or PAID
// This would mean someone would be clever and change the url from summary to success bypassing the payment
// End the session, thus removing the reservation, and redirect back
if (!in_array($reservation->Status, array('PENDING', 'PAID'))) {
ReservationSession::end();
$this->redirect($this->Link('/'));
} elseif ($reservation->Status !== 'PAID') {
// todo move to TicketPayment::onCaptured()
$this->extend('afterPaymentComplete', $reservation);
}
} | [
"public",
"function",
"init",
"(",
")",
"{",
"parent",
"::",
"init",
"(",
")",
";",
"$",
"reservation",
"=",
"$",
"this",
"->",
"getReservation",
"(",
")",
";",
"// If we get to the success controller form any state except PENDING or PAID",
"// This would mean someone w... | Init the success controller, check if files should be created and send | [
"Init",
"the",
"success",
"controller",
"check",
"if",
"files",
"should",
"be",
"created",
"and",
"send"
] | d18db4146a141795fd50689057130a6fd41ac397 | https://github.com/TheBnl/event-tickets/blob/d18db4146a141795fd50689057130a6fd41ac397/code/controllers/SuccessController.php#L27-L42 | train |
Celarius/spin-framework | src/Core/Config.php | Config.loadAndMerge | public function loadAndMerge(string $filename)
{
# Attempt to load config file
if ( \file_exists($filename) ) {
# Set filename
$this->filename = $filename;
# Load the config
$configArray = \json_decode( \file_get_contents($filename), true);
if ($configArray) {
// $configArray = $this->array_change_key_case_recursive($configArray); // Lowercase the keys
# Merge the Config with existing config
$this->confValues = \array_replace_recursive($this->confValues, $configArray);
} else {
throw new SpinException('Invalid JSON file "'.$filename.'"');
}
}
return $this;
} | php | public function loadAndMerge(string $filename)
{
# Attempt to load config file
if ( \file_exists($filename) ) {
# Set filename
$this->filename = $filename;
# Load the config
$configArray = \json_decode( \file_get_contents($filename), true);
if ($configArray) {
// $configArray = $this->array_change_key_case_recursive($configArray); // Lowercase the keys
# Merge the Config with existing config
$this->confValues = \array_replace_recursive($this->confValues, $configArray);
} else {
throw new SpinException('Invalid JSON file "'.$filename.'"');
}
}
return $this;
} | [
"public",
"function",
"loadAndMerge",
"(",
"string",
"$",
"filename",
")",
"{",
"# Attempt to load config file",
"if",
"(",
"\\",
"file_exists",
"(",
"$",
"filename",
")",
")",
"{",
"# Set filename",
"$",
"this",
"->",
"filename",
"=",
"$",
"filename",
";",
... | Load & Merge Configuration file to existing config
@param string $filename
@throws Exception On invalid JSON file
@return self | [
"Load",
"&",
"Merge",
"Configuration",
"file",
"to",
"existing",
"config"
] | 2c0d1dfc3c2ed556632dfe5ff9113600a72a93d0 | https://github.com/Celarius/spin-framework/blob/2c0d1dfc3c2ed556632dfe5ff9113600a72a93d0/src/Core/Config.php#L98-L119 | train |
anklimsk/cakephp-theme | Vendor/PhpUnoconv/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php | NativeMailerHandler.addHeader | public function addHeader($headers)
{
foreach ((array) $headers as $header) {
if (strpos($header, "\n") !== false || strpos($header, "\r") !== false) {
throw new \InvalidArgumentException('Headers can not contain newline characters for security reasons');
}
$this->headers[] = $header;
}
return $this;
} | php | public function addHeader($headers)
{
foreach ((array) $headers as $header) {
if (strpos($header, "\n") !== false || strpos($header, "\r") !== false) {
throw new \InvalidArgumentException('Headers can not contain newline characters for security reasons');
}
$this->headers[] = $header;
}
return $this;
} | [
"public",
"function",
"addHeader",
"(",
"$",
"headers",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"headers",
"as",
"$",
"header",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"header",
",",
"\"\\n\"",
")",
"!==",
"false",
"||",
"strpos",
"(",
"... | Add headers to the message
@param string|array $headers Custom added headers
@return self | [
"Add",
"headers",
"to",
"the",
"message"
] | b815a4aaabaaf03ef1df3d547200f73f332f38a7 | https://github.com/anklimsk/cakephp-theme/blob/b815a4aaabaaf03ef1df3d547200f73f332f38a7/Vendor/PhpUnoconv/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php#L90-L100 | train |
BugBuster1701/contao-dlstats-bundle | src/Resources/contao/modules/Dlstats.php | Dlstats.logDLStats | protected function logDLStats()
{
$q = \Database::getInstance()->prepare("SELECT id FROM `tl_dlstats` WHERE `filename`=?")
->execute($this->_filename);
if ($q->next())
{
$this->_statId = $q->id;
\Database::getInstance()->prepare("UPDATE `tl_dlstats` SET `tstamp`=?, `downloads`=`downloads`+1 WHERE `id`=?")
->execute(time(), $this->_statId);
}
else
{
$q = \Database::getInstance()->prepare("INSERT IGNORE INTO `tl_dlstats` %s")
->set(array('tstamp' => time(),
'filename' => $this->_filename,
'downloads' => 1)
)
->execute();
$this->_statId = $q->insertId;
} // if
$this->setBlockingIP($this->IP, $this->_filename);
} | php | protected function logDLStats()
{
$q = \Database::getInstance()->prepare("SELECT id FROM `tl_dlstats` WHERE `filename`=?")
->execute($this->_filename);
if ($q->next())
{
$this->_statId = $q->id;
\Database::getInstance()->prepare("UPDATE `tl_dlstats` SET `tstamp`=?, `downloads`=`downloads`+1 WHERE `id`=?")
->execute(time(), $this->_statId);
}
else
{
$q = \Database::getInstance()->prepare("INSERT IGNORE INTO `tl_dlstats` %s")
->set(array('tstamp' => time(),
'filename' => $this->_filename,
'downloads' => 1)
)
->execute();
$this->_statId = $q->insertId;
} // if
$this->setBlockingIP($this->IP, $this->_filename);
} | [
"protected",
"function",
"logDLStats",
"(",
")",
"{",
"$",
"q",
"=",
"\\",
"Database",
"::",
"getInstance",
"(",
")",
"->",
"prepare",
"(",
"\"SELECT id FROM `tl_dlstats` WHERE `filename`=?\"",
")",
"->",
"execute",
"(",
"$",
"this",
"->",
"_filename",
")",
";... | Helper function log file name
@return void | [
"Helper",
"function",
"log",
"file",
"name"
] | d0d6f8cbbd6a6694bb0564d9865e24bd95e1f6e3 | https://github.com/BugBuster1701/contao-dlstats-bundle/blob/d0d6f8cbbd6a6694bb0564d9865e24bd95e1f6e3/src/Resources/contao/modules/Dlstats.php#L85-L106 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/VoteManager/Structures/Vote.php | Vote.countVote | protected function countVote($toCount)
{
$value = 0;
foreach ($this->votes as $login => $vote) {
if ($vote === $toCount) {
$value++;
}
}
return $value;
} | php | protected function countVote($toCount)
{
$value = 0;
foreach ($this->votes as $login => $vote) {
if ($vote === $toCount) {
$value++;
}
}
return $value;
} | [
"protected",
"function",
"countVote",
"(",
"$",
"toCount",
")",
"{",
"$",
"value",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"votes",
"as",
"$",
"login",
"=>",
"$",
"vote",
")",
"{",
"if",
"(",
"$",
"vote",
"===",
"$",
"toCount",
")",
"{"... | Count votes of a certain type.
@param string $toCount
@return int | [
"Count",
"votes",
"of",
"a",
"certain",
"type",
"."
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/VoteManager/Structures/Vote.php#L98-L108 | train |
dontdrinkandroot/gitki-bundle.php | Controller/BaseController.php | BaseController.generateEtag | protected function generateEtag(\DateTime $timeStamp)
{
$user = $this->securityService->findGitUser();
$userString = '';
if (null !== $user) {
$userString = $user->getGitUserName();
}
return md5($timeStamp->getTimestamp() . $userString);
} | php | protected function generateEtag(\DateTime $timeStamp)
{
$user = $this->securityService->findGitUser();
$userString = '';
if (null !== $user) {
$userString = $user->getGitUserName();
}
return md5($timeStamp->getTimestamp() . $userString);
} | [
"protected",
"function",
"generateEtag",
"(",
"\\",
"DateTime",
"$",
"timeStamp",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"securityService",
"->",
"findGitUser",
"(",
")",
";",
"$",
"userString",
"=",
"''",
";",
"if",
"(",
"null",
"!==",
"$",
"u... | Generate an etag based on the timestamp and the current user.
@param \DateTime $timeStamp
@return string The generated etag. | [
"Generate",
"an",
"etag",
"based",
"on",
"the",
"timestamp",
"and",
"the",
"current",
"user",
"."
] | ab4399419be89b75f3d76180636c5ad020eb8b34 | https://github.com/dontdrinkandroot/gitki-bundle.php/blob/ab4399419be89b75f3d76180636c5ad020eb8b34/Controller/BaseController.php#L32-L41 | train |
phug-php/renderer | src/Phug/Renderer/Partial/FileSystemTrait.php | FileSystemTrait.scanDirectory | public function scanDirectory($directory)
{
$extensions = $this->getOption('extensions');
foreach (scandir($directory) as $object) {
if ($object === '.' || $object === '..') {
continue;
}
$inputFile = $directory.DIRECTORY_SEPARATOR.$object;
if (is_dir($inputFile)) {
foreach ($this->scanDirectory($inputFile) as $file) {
yield $file;
}
continue;
}
if ($this->fileMatchExtensions($object, $extensions)) {
yield $inputFile;
}
}
} | php | public function scanDirectory($directory)
{
$extensions = $this->getOption('extensions');
foreach (scandir($directory) as $object) {
if ($object === '.' || $object === '..') {
continue;
}
$inputFile = $directory.DIRECTORY_SEPARATOR.$object;
if (is_dir($inputFile)) {
foreach ($this->scanDirectory($inputFile) as $file) {
yield $file;
}
continue;
}
if ($this->fileMatchExtensions($object, $extensions)) {
yield $inputFile;
}
}
} | [
"public",
"function",
"scanDirectory",
"(",
"$",
"directory",
")",
"{",
"$",
"extensions",
"=",
"$",
"this",
"->",
"getOption",
"(",
"'extensions'",
")",
";",
"foreach",
"(",
"scandir",
"(",
"$",
"directory",
")",
"as",
"$",
"object",
")",
"{",
"if",
"... | Get all file matching extensions list recursively in a directory.
@param $directory
@return \Generator | [
"Get",
"all",
"file",
"matching",
"extensions",
"list",
"recursively",
"in",
"a",
"directory",
"."
] | ada6f713b6d614d215d62b36e64d2162e7f2569c | https://github.com/phug-php/renderer/blob/ada6f713b6d614d215d62b36e64d2162e7f2569c/src/Phug/Renderer/Partial/FileSystemTrait.php#L28-L48 | train |
GlobalTradingTechnologies/ad-poller | src/Command/PollCommand.php | PollCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$pollerNames = $input->getOption('poller');
$forceFullSync = $input->getOption('force-full-sync');
if ($pollerNames) {
$pollersToRun = [];
foreach ($pollerNames as $name) {
$pollersToRun[] = $this->pollerCollection->getPoller($name);
}
} else {
$pollersToRun = $this->pollerCollection;
}
$exitCode = 0;
foreach ($pollersToRun as $poller) {
$isSuccessfulRun = $this->runPoller($poller, $forceFullSync, $output);
if (!$isSuccessfulRun) {
$exitCode = 1;
}
}
return $exitCode;
} | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$pollerNames = $input->getOption('poller');
$forceFullSync = $input->getOption('force-full-sync');
if ($pollerNames) {
$pollersToRun = [];
foreach ($pollerNames as $name) {
$pollersToRun[] = $this->pollerCollection->getPoller($name);
}
} else {
$pollersToRun = $this->pollerCollection;
}
$exitCode = 0;
foreach ($pollersToRun as $poller) {
$isSuccessfulRun = $this->runPoller($poller, $forceFullSync, $output);
if (!$isSuccessfulRun) {
$exitCode = 1;
}
}
return $exitCode;
} | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"pollerNames",
"=",
"$",
"input",
"->",
"getOption",
"(",
"'poller'",
")",
";",
"$",
"forceFullSync",
"=",
"$",
"input",
"->",
"g... | Tries to execute action specified
{@inheritdoc} | [
"Tries",
"to",
"execute",
"action",
"specified"
] | c90073b13a6963970e70af67c6439dfe8c48739e | https://github.com/GlobalTradingTechnologies/ad-poller/blob/c90073b13a6963970e70af67c6439dfe8c48739e/src/Command/PollCommand.php#L81-L104 | train |
GlobalTradingTechnologies/ad-poller | src/Command/PollCommand.php | PollCommand.runPoller | private function runPoller(Poller $poller, $forceFullSync, OutputInterface $output)
{
$output->write(
sprintf("Run poller <info>%s</info>, force mode is <comment>%s</comment>: ", $poller->getName(), $forceFullSync ? 'on' : 'off')
);
try {
$processed = $poller->poll($forceFullSync);
$output->writeln("<info>OK</info> (Processed: <comment>$processed</comment>)");
return true;
} catch (Exception $e) {
$output->writeln("<error>FAIL</error> (Details: <error>{$e->getMessage()}</error>)");
return false;
}
} | php | private function runPoller(Poller $poller, $forceFullSync, OutputInterface $output)
{
$output->write(
sprintf("Run poller <info>%s</info>, force mode is <comment>%s</comment>: ", $poller->getName(), $forceFullSync ? 'on' : 'off')
);
try {
$processed = $poller->poll($forceFullSync);
$output->writeln("<info>OK</info> (Processed: <comment>$processed</comment>)");
return true;
} catch (Exception $e) {
$output->writeln("<error>FAIL</error> (Details: <error>{$e->getMessage()}</error>)");
return false;
}
} | [
"private",
"function",
"runPoller",
"(",
"Poller",
"$",
"poller",
",",
"$",
"forceFullSync",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"output",
"->",
"write",
"(",
"sprintf",
"(",
"\"Run poller <info>%s</info>, force mode is <comment>%s</comment>: \"",
",... | Runs poller specified
@param Poller $poller poller
@param bool $forceFullSync force full sync mode flag
@param OutputInterface $output output
@return bool | [
"Runs",
"poller",
"specified"
] | c90073b13a6963970e70af67c6439dfe8c48739e | https://github.com/GlobalTradingTechnologies/ad-poller/blob/c90073b13a6963970e70af67c6439dfe8c48739e/src/Command/PollCommand.php#L115-L130 | train |
ansas/php-component | src/Slim/Handler/ConfigHandler.php | ConfigHandler.getAvailableOverrides | public function getAvailableOverrides()
{
$path = $this->getPath();
$suffix = $this->getSuffix();
$glob = "{$path}/*{$suffix}";
$result = [];
foreach (glob($glob) as $file) {
$identifier = basename($file, $suffix);
$result[$identifier] = $file;
}
return $result;
} | php | public function getAvailableOverrides()
{
$path = $this->getPath();
$suffix = $this->getSuffix();
$glob = "{$path}/*{$suffix}";
$result = [];
foreach (glob($glob) as $file) {
$identifier = basename($file, $suffix);
$result[$identifier] = $file;
}
return $result;
} | [
"public",
"function",
"getAvailableOverrides",
"(",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getPath",
"(",
")",
";",
"$",
"suffix",
"=",
"$",
"this",
"->",
"getSuffix",
"(",
")",
";",
"$",
"glob",
"=",
"\"{$path}/*{$suffix}\"",
";",
"$",
"resul... | Returns a list of all available overrides.
Format: [$identifier => $file].
@return array | [
"Returns",
"a",
"list",
"of",
"all",
"available",
"overrides",
"."
] | 24574a1e32d5f1355a6e2b6f20f49b1eda7250ba | https://github.com/ansas/php-component/blob/24574a1e32d5f1355a6e2b6f20f49b1eda7250ba/src/Slim/Handler/ConfigHandler.php#L89-L102 | train |
ansas/php-component | src/Slim/Handler/ConfigHandler.php | ConfigHandler.setFormat | public function setFormat($format)
{
if ($format) {
$format = strtolower($format);
if (!in_array($format, static::$validFormats)) {
throw new Exception("Format {$format} is not supported");
}
$this->format = $format;
if (!$this->suffix) {
$this->setSuffix(".{$format}");
}
}
return $this;
} | php | public function setFormat($format)
{
if ($format) {
$format = strtolower($format);
if (!in_array($format, static::$validFormats)) {
throw new Exception("Format {$format} is not supported");
}
$this->format = $format;
if (!$this->suffix) {
$this->setSuffix(".{$format}");
}
}
return $this;
} | [
"public",
"function",
"setFormat",
"(",
"$",
"format",
")",
"{",
"if",
"(",
"$",
"format",
")",
"{",
"$",
"format",
"=",
"strtolower",
"(",
"$",
"format",
")",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"format",
",",
"static",
"::",
"$",
"validFor... | Set format of the override files.
@param string $format
@return $this
@throws Exception | [
"Set",
"format",
"of",
"the",
"override",
"files",
"."
] | 24574a1e32d5f1355a6e2b6f20f49b1eda7250ba | https://github.com/ansas/php-component/blob/24574a1e32d5f1355a6e2b6f20f49b1eda7250ba/src/Slim/Handler/ConfigHandler.php#L254-L271 | train |
eXpansionPluginPack/eXpansion2 | src_experimantal/eXpansionExperimantal/Bundle/Dedimania/Plugins/Dedimania.php | Dedimania.sendRequest | final public function sendRequest(Request $request, $callback)
{
if ($this->enabled->get() == false) {
return;
}
$this->webaccess->request(
self::dedimaniaUrl,
[[$this, "process"], $callback],
$request->getXml(),
true,
600,
3,
5,
'eXpansion server controller',
'application/x-www-form-urlencoded; charset=UTF-8'
);
} | php | final public function sendRequest(Request $request, $callback)
{
if ($this->enabled->get() == false) {
return;
}
$this->webaccess->request(
self::dedimaniaUrl,
[[$this, "process"], $callback],
$request->getXml(),
true,
600,
3,
5,
'eXpansion server controller',
'application/x-www-form-urlencoded; charset=UTF-8'
);
} | [
"final",
"public",
"function",
"sendRequest",
"(",
"Request",
"$",
"request",
",",
"$",
"callback",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"enabled",
"->",
"get",
"(",
")",
"==",
"false",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"webaccess",... | Send a request to Dedimania
@param Request $request
@param callable $callback | [
"Send",
"a",
"request",
"to",
"Dedimania"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src_experimantal/eXpansionExperimantal/Bundle/Dedimania/Plugins/Dedimania.php#L246-L263 | train |
eXpansionPluginPack/eXpansion2 | src_experimantal/eXpansionExperimantal/Bundle/Dedimania/Plugins/Dedimania.php | Dedimania.setGReplay | protected function setGReplay($login)
{
if ($this->enabled->get() == false) {
return;
}
$tempReplay = new IXR_Base64("");
$this->dedimaniaService->setGReplay("", $tempReplay);
$player = new Player();
$player->login = $login;
try {
$this->factory->getConnection()->saveBestGhostsReplay($player, "exp2_temp_replay");
$replay = new IXR_Base64(
$this->fileSystem->getUserData()->readAndDelete(
"Replays".DIRECTORY_SEPARATOR."exp2_temp_replay.Replay.Gbx")
);
$this->dedimaniaService->setGReplay($login, $replay);
} catch (\Exception $e) {
$this->console->writeln('Dedimania: $f00Error while fetching GhostsReplay');
}
} | php | protected function setGReplay($login)
{
if ($this->enabled->get() == false) {
return;
}
$tempReplay = new IXR_Base64("");
$this->dedimaniaService->setGReplay("", $tempReplay);
$player = new Player();
$player->login = $login;
try {
$this->factory->getConnection()->saveBestGhostsReplay($player, "exp2_temp_replay");
$replay = new IXR_Base64(
$this->fileSystem->getUserData()->readAndDelete(
"Replays".DIRECTORY_SEPARATOR."exp2_temp_replay.Replay.Gbx")
);
$this->dedimaniaService->setGReplay($login, $replay);
} catch (\Exception $e) {
$this->console->writeln('Dedimania: $f00Error while fetching GhostsReplay');
}
} | [
"protected",
"function",
"setGReplay",
"(",
"$",
"login",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"enabled",
"->",
"get",
"(",
")",
"==",
"false",
")",
"{",
"return",
";",
"}",
"$",
"tempReplay",
"=",
"new",
"IXR_Base64",
"(",
"\"\"",
")",
";",
"$"... | Sets new Ghost replay for the map
@param $login | [
"Sets",
"new",
"Ghost",
"replay",
"for",
"the",
"map"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src_experimantal/eXpansionExperimantal/Bundle/Dedimania/Plugins/Dedimania.php#L667-L689 | train |
eXpansionPluginPack/eXpansion2 | src_experimantal/eXpansionExperimantal/Bundle/Dedimania/Plugins/Dedimania.php | Dedimania.onEndMapStart | public function onEndMapStart($count, $time, $restarted, Map $map)
{
if ($this->enabled->get() == false) {
return;
}
if (!$restarted) {
$this->setRecords();
}
} | php | public function onEndMapStart($count, $time, $restarted, Map $map)
{
if ($this->enabled->get() == false) {
return;
}
if (!$restarted) {
$this->setRecords();
}
} | [
"public",
"function",
"onEndMapStart",
"(",
"$",
"count",
",",
"$",
"time",
",",
"$",
"restarted",
",",
"Map",
"$",
"map",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"enabled",
"->",
"get",
"(",
")",
"==",
"false",
")",
"{",
"return",
";",
"}",
"if"... | Callback sent when the "EndMap" section start.
@param int $count Each time this section is played, this number is incremented by one
@param int $time Server time when the callback was sent
@param boolean $restarted true if the map was restarted, false otherwise
@param Map $map Map started with.
@return void | [
"Callback",
"sent",
"when",
"the",
"EndMap",
"section",
"start",
"."
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src_experimantal/eXpansionExperimantal/Bundle/Dedimania/Plugins/Dedimania.php#L804-L813 | train |
zbateson/mb-wrapper | src/MbWrapper.php | MbWrapper.getNormalizedCharset | private function getNormalizedCharset($charset)
{
$upper = null;
if (is_array($charset)) {
$upper = array_map('strtoupper', $charset);
} else {
$upper = strtoupper($charset);
}
return preg_replace('/[^A-Z0-9]+/', '', $upper);
} | php | private function getNormalizedCharset($charset)
{
$upper = null;
if (is_array($charset)) {
$upper = array_map('strtoupper', $charset);
} else {
$upper = strtoupper($charset);
}
return preg_replace('/[^A-Z0-9]+/', '', $upper);
} | [
"private",
"function",
"getNormalizedCharset",
"(",
"$",
"charset",
")",
"{",
"$",
"upper",
"=",
"null",
";",
"if",
"(",
"is_array",
"(",
"$",
"charset",
")",
")",
"{",
"$",
"upper",
"=",
"array_map",
"(",
"'strtoupper'",
",",
"$",
"charset",
")",
";",... | The passed charset is uppercased, and stripped of non-alphanumeric
characters before being returned.
@param string|string[] $charset
@return string|string[] | [
"The",
"passed",
"charset",
"is",
"uppercased",
"and",
"stripped",
"of",
"non",
"-",
"alphanumeric",
"characters",
"before",
"being",
"returned",
"."
] | f5f007e4218a8b82ea1d8395c4897f76737a9124 | https://github.com/zbateson/mb-wrapper/blob/f5f007e4218a8b82ea1d8395c4897f76737a9124/src/MbWrapper.php#L313-L322 | train |
zbateson/mb-wrapper | src/MbWrapper.php | MbWrapper.getMbCharset | private function getMbCharset($cs)
{
$normalized = $this->getNormalizedCharset($cs);
if (array_key_exists($normalized, self::$mbListedEncodings)) {
return self::$mbListedEncodings[$normalized];
} elseif (array_key_exists($normalized, self::$mbAliases)) {
return self::$mbAliases[$normalized];
}
return false;
} | php | private function getMbCharset($cs)
{
$normalized = $this->getNormalizedCharset($cs);
if (array_key_exists($normalized, self::$mbListedEncodings)) {
return self::$mbListedEncodings[$normalized];
} elseif (array_key_exists($normalized, self::$mbAliases)) {
return self::$mbAliases[$normalized];
}
return false;
} | [
"private",
"function",
"getMbCharset",
"(",
"$",
"cs",
")",
"{",
"$",
"normalized",
"=",
"$",
"this",
"->",
"getNormalizedCharset",
"(",
"$",
"cs",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"normalized",
",",
"self",
"::",
"$",
"mbListedEncodings"... | Looks up a charset from mb_list_encodings and identified aliases,
checking if the lookup has been cached already first.
If the encoding is not listed, the method will return false.
On success, the method will return the charset name as accepted by mb_*.
@param string $cs
@param bool $mbSupported
@return string|bool | [
"Looks",
"up",
"a",
"charset",
"from",
"mb_list_encodings",
"and",
"identified",
"aliases",
"checking",
"if",
"the",
"lookup",
"has",
"been",
"cached",
"already",
"first",
"."
] | f5f007e4218a8b82ea1d8395c4897f76737a9124 | https://github.com/zbateson/mb-wrapper/blob/f5f007e4218a8b82ea1d8395c4897f76737a9124/src/MbWrapper.php#L437-L446 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/MxKarma/Plugins/MxKarma.php | MxKarma.setVote | public function setVote($login, $vote)
{
$player = $this->playerStorage->getPlayerInfo($login);
$obj = [
"login" => $login,
"nickname" => $player->getNickName(),
"vote" => $vote,
];
$this->changedVotes[$player->getLogin()] = new MxVote((object)$obj);
$this->chatNotification->sendMessage('expansion_mxkarma.chat.votechanged', $login);
} | php | public function setVote($login, $vote)
{
$player = $this->playerStorage->getPlayerInfo($login);
$obj = [
"login" => $login,
"nickname" => $player->getNickName(),
"vote" => $vote,
];
$this->changedVotes[$player->getLogin()] = new MxVote((object)$obj);
$this->chatNotification->sendMessage('expansion_mxkarma.chat.votechanged', $login);
} | [
"public",
"function",
"setVote",
"(",
"$",
"login",
",",
"$",
"vote",
")",
"{",
"$",
"player",
"=",
"$",
"this",
"->",
"playerStorage",
"->",
"getPlayerInfo",
"(",
"$",
"login",
")",
";",
"$",
"obj",
"=",
"[",
"\"login\"",
"=>",
"$",
"login",
",",
... | sets vote value
@param $login
@param $vote | [
"sets",
"vote",
"value"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/MxKarma/Plugins/MxKarma.php#L126-L138 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/MxKarma/Plugins/MxKarma.php | MxKarma.onStartMapEnd | public function onStartMapEnd($count, $time, $restarted, Map $map)
{
$this->startTime = time();
$this->mxKarma->loadVotes(array_keys($this->playerStorage->getOnline()), false);
} | php | public function onStartMapEnd($count, $time, $restarted, Map $map)
{
$this->startTime = time();
$this->mxKarma->loadVotes(array_keys($this->playerStorage->getOnline()), false);
} | [
"public",
"function",
"onStartMapEnd",
"(",
"$",
"count",
",",
"$",
"time",
",",
"$",
"restarted",
",",
"Map",
"$",
"map",
")",
"{",
"$",
"this",
"->",
"startTime",
"=",
"time",
"(",
")",
";",
"$",
"this",
"->",
"mxKarma",
"->",
"loadVotes",
"(",
"... | Callback sent when the "StartMap" section end.
@param int $count Each time this section is played, this number is incremented by one
@param int $time Server time when the callback was sent
@param boolean $restarted true if the map was restarted, false otherwise
@param Map $map Map started with.
@return void | [
"Callback",
"sent",
"when",
"the",
"StartMap",
"section",
"end",
"."
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/MxKarma/Plugins/MxKarma.php#L291-L295 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/MxKarma/Plugins/MxKarma.php | MxKarma.onEndMapEnd | public function onEndMapEnd($count, $time, $restarted, Map $map)
{
if (!empty($this->changedVotes)) {
$votes = [];
foreach ($this->changedVotes as $vote) {
$votes[] = $vote;
}
$this->mxKarma->saveVotes($map, (time() - $this->startTime), $votes);
}
} | php | public function onEndMapEnd($count, $time, $restarted, Map $map)
{
if (!empty($this->changedVotes)) {
$votes = [];
foreach ($this->changedVotes as $vote) {
$votes[] = $vote;
}
$this->mxKarma->saveVotes($map, (time() - $this->startTime), $votes);
}
} | [
"public",
"function",
"onEndMapEnd",
"(",
"$",
"count",
",",
"$",
"time",
",",
"$",
"restarted",
",",
"Map",
"$",
"map",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"changedVotes",
")",
")",
"{",
"$",
"votes",
"=",
"[",
"]",
";",
... | Callback sent when the "EndMap" section end.
@param int $count Each time this section is played, this number is incremented by one
@param int $time Server time when the callback was sent
@param boolean $restarted true if the map was restarted, false otherwise
@param Map $map Map started with.
@return void | [
"Callback",
"sent",
"when",
"the",
"EndMap",
"section",
"end",
"."
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/MxKarma/Plugins/MxKarma.php#L322-L333 | train |
davidecesarano/Embryo-Middleware | Embryo/Http/Server/RequestHandler.php | RequestHandler.add | public function add($middleware)
{
if (!is_string($middleware) && !$middleware instanceof MiddlewareInterface) {
throw new \InvalidArgumentException('Middleware must be a string or an instance of MiddlewareInterface');
}
$class = is_string($middleware) ? new $middleware : $middleware;
array_push($this->middleware, $class);
} | php | public function add($middleware)
{
if (!is_string($middleware) && !$middleware instanceof MiddlewareInterface) {
throw new \InvalidArgumentException('Middleware must be a string or an instance of MiddlewareInterface');
}
$class = is_string($middleware) ? new $middleware : $middleware;
array_push($this->middleware, $class);
} | [
"public",
"function",
"add",
"(",
"$",
"middleware",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"middleware",
")",
"&&",
"!",
"$",
"middleware",
"instanceof",
"MiddlewareInterface",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Mid... | Add a middleware to the end of the queue.
@param string|MiddlewareInterface $middleware | [
"Add",
"a",
"middleware",
"to",
"the",
"end",
"of",
"the",
"queue",
"."
] | aa2c4fe06f6dbf91dae4881f9e3b5564761c5eb6 | https://github.com/davidecesarano/Embryo-Middleware/blob/aa2c4fe06f6dbf91dae4881f9e3b5564761c5eb6/Embryo/Http/Server/RequestHandler.php#L51-L59 | train |
davidecesarano/Embryo-Middleware | Embryo/Http/Server/RequestHandler.php | RequestHandler.prepend | public function prepend($middleware)
{
if (!is_string($middleware) && !$middleware instanceof MiddlewareInterface) {
throw new \InvalidArgumentException('Middleware must be a string or an instance of MiddlewareInterface');
}
$class = is_string($middleware) ? new $middleware : $middleware;
array_unshift($this->middleware, $class);
} | php | public function prepend($middleware)
{
if (!is_string($middleware) && !$middleware instanceof MiddlewareInterface) {
throw new \InvalidArgumentException('Middleware must be a string or an instance of MiddlewareInterface');
}
$class = is_string($middleware) ? new $middleware : $middleware;
array_unshift($this->middleware, $class);
} | [
"public",
"function",
"prepend",
"(",
"$",
"middleware",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"middleware",
")",
"&&",
"!",
"$",
"middleware",
"instanceof",
"MiddlewareInterface",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"... | Add a middleware to the beginning of the queue.
@param string|MiddlewareInterface $middleware | [
"Add",
"a",
"middleware",
"to",
"the",
"beginning",
"of",
"the",
"queue",
"."
] | aa2c4fe06f6dbf91dae4881f9e3b5564761c5eb6 | https://github.com/davidecesarano/Embryo-Middleware/blob/aa2c4fe06f6dbf91dae4881f9e3b5564761c5eb6/Embryo/Http/Server/RequestHandler.php#L66-L74 | train |
davidecesarano/Embryo-Middleware | Embryo/Http/Server/RequestHandler.php | RequestHandler.dispatch | public function dispatch(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface
{
reset($this->middleware);
$this->response = $response;
return $this->handle($request);
} | php | public function dispatch(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface
{
reset($this->middleware);
$this->response = $response;
return $this->handle($request);
} | [
"public",
"function",
"dispatch",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
")",
":",
"ResponseInterface",
"{",
"reset",
"(",
"$",
"this",
"->",
"middleware",
")",
";",
"$",
"this",
"->",
"response",
"=",
"$",
... | Dispatch the middleware queue.
@param ServerRequestInterface $request
@param ResponseInterface $response | [
"Dispatch",
"the",
"middleware",
"queue",
"."
] | aa2c4fe06f6dbf91dae4881f9e3b5564761c5eb6 | https://github.com/davidecesarano/Embryo-Middleware/blob/aa2c4fe06f6dbf91dae4881f9e3b5564761c5eb6/Embryo/Http/Server/RequestHandler.php#L82-L87 | train |
davidecesarano/Embryo-Middleware | Embryo/Http/Server/RequestHandler.php | RequestHandler.handle | public function handle(ServerRequestInterface $request): ResponseInterface
{
if (!isset($this->middleware[$this->index])) {
return $this->response;
}
$middleware = $this->middleware[$this->index];
return $middleware->process($request, $this->next());
} | php | public function handle(ServerRequestInterface $request): ResponseInterface
{
if (!isset($this->middleware[$this->index])) {
return $this->response;
}
$middleware = $this->middleware[$this->index];
return $middleware->process($request, $this->next());
} | [
"public",
"function",
"handle",
"(",
"ServerRequestInterface",
"$",
"request",
")",
":",
"ResponseInterface",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"middleware",
"[",
"$",
"this",
"->",
"index",
"]",
")",
")",
"{",
"return",
"$",
"this",
... | Handle the request, return a response and calls
next middleware.
@param ServerRequestInterface $request
@return ResponseInterface | [
"Handle",
"the",
"request",
"return",
"a",
"response",
"and",
"calls",
"next",
"middleware",
"."
] | aa2c4fe06f6dbf91dae4881f9e3b5564761c5eb6 | https://github.com/davidecesarano/Embryo-Middleware/blob/aa2c4fe06f6dbf91dae4881f9e3b5564761c5eb6/Embryo/Http/Server/RequestHandler.php#L96-L104 | train |
stanislav-web/PhalconSonar | src/Sonar/Services/QueueService.php | QueueService.push | public function push(array $message, callable $messageHandler) {
$this->beanstalkMapper->put(serialize(
array_merge(
$messageHandler(), $message
)
));
return null;
} | php | public function push(array $message, callable $messageHandler) {
$this->beanstalkMapper->put(serialize(
array_merge(
$messageHandler(), $message
)
));
return null;
} | [
"public",
"function",
"push",
"(",
"array",
"$",
"message",
",",
"callable",
"$",
"messageHandler",
")",
"{",
"$",
"this",
"->",
"beanstalkMapper",
"->",
"put",
"(",
"serialize",
"(",
"array_merge",
"(",
"$",
"messageHandler",
"(",
")",
",",
"$",
"message"... | Push data to task
@param array $message
@param callable $messageHandler
@return null | [
"Push",
"data",
"to",
"task"
] | 4ebf59428fccfd7c7dfb100e0de00e5dd0efe1fa | https://github.com/stanislav-web/PhalconSonar/blob/4ebf59428fccfd7c7dfb100e0de00e5dd0efe1fa/src/Sonar/Services/QueueService.php#L53-L62 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Framework/GameTrackmania/DataProviders/ScriptBaseRounds/MethodGetNumberLapsDataProvider.php | MethodGetNumberLapsDataProvider.request | public function request()
{
$scriptSettings = $this->gameDataStorage->getScriptOptions();
$currentMap = $this->mapStorage->getCurrentMap();
$nbLaps = 1;
if ($currentMap->lapRace) {
$nbLaps = $currentMap->nbLaps;
}
if ($scriptSettings['S_ForceLapsNb'] != -1) {
$nbLaps = $scriptSettings['S_ForceLapsNb'];
}
$this->dispatch('set', [$nbLaps]);
} | php | public function request()
{
$scriptSettings = $this->gameDataStorage->getScriptOptions();
$currentMap = $this->mapStorage->getCurrentMap();
$nbLaps = 1;
if ($currentMap->lapRace) {
$nbLaps = $currentMap->nbLaps;
}
if ($scriptSettings['S_ForceLapsNb'] != -1) {
$nbLaps = $scriptSettings['S_ForceLapsNb'];
}
$this->dispatch('set', [$nbLaps]);
} | [
"public",
"function",
"request",
"(",
")",
"{",
"$",
"scriptSettings",
"=",
"$",
"this",
"->",
"gameDataStorage",
"->",
"getScriptOptions",
"(",
")",
";",
"$",
"currentMap",
"=",
"$",
"this",
"->",
"mapStorage",
"->",
"getCurrentMap",
"(",
")",
";",
"$",
... | Request call to fetch something..
@return void | [
"Request",
"call",
"to",
"fetch",
"something",
".."
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Framework/GameTrackmania/DataProviders/ScriptBaseRounds/MethodGetNumberLapsDataProvider.php#L56-L71 | train |
mgallegos/decima-accounting | src/Mgallegos/DecimaAccounting/Accounting/Repositories/JournalVoucher/EloquentJournalVoucher.php | EloquentJournalVoucher.getMaxJournalVoucherNumber | public function getMaxJournalVoucherNumber($id, $databaseConnectionName = null)
{
if(empty($databaseConnectionName))
{
$databaseConnectionName = $this->databaseConnectionName;
}
return $this->JournalVoucher->setConnection($databaseConnectionName)->where('organization_id', '=', $id)->max('number');
} | php | public function getMaxJournalVoucherNumber($id, $databaseConnectionName = null)
{
if(empty($databaseConnectionName))
{
$databaseConnectionName = $this->databaseConnectionName;
}
return $this->JournalVoucher->setConnection($databaseConnectionName)->where('organization_id', '=', $id)->max('number');
} | [
"public",
"function",
"getMaxJournalVoucherNumber",
"(",
"$",
"id",
",",
"$",
"databaseConnectionName",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"databaseConnectionName",
")",
")",
"{",
"$",
"databaseConnectionName",
"=",
"$",
"this",
"->",
"databa... | Get the max journal voucher number
@param int $id Organization id
@return integer | [
"Get",
"the",
"max",
"journal",
"voucher",
"number"
] | 6410585303a13892e64e9dfeacbae0ca212b458b | https://github.com/mgallegos/decima-accounting/blob/6410585303a13892e64e9dfeacbae0ca212b458b/src/Mgallegos/DecimaAccounting/Accounting/Repositories/JournalVoucher/EloquentJournalVoucher.php#L132-L140 | train |
mgallegos/decima-accounting | src/Mgallegos/DecimaAccounting/Accounting/Repositories/JournalVoucher/EloquentJournalVoucher.php | EloquentJournalVoucher.getByOrganizationByPeriodAndByStatus | public function getByOrganizationByPeriodAndByStatus($organizationId, $periodIds, $status, $databaseConnectionName = null)
{
if(empty($databaseConnectionName))
{
$databaseConnectionName = $this->databaseConnectionName;
}
return $this->JournalVoucher->setConnection($databaseConnectionName)
->where('organization_id', '=', $organizationId)
->whereIn('period_id', $periodIds)
->where('status', '=', $status)
->get();
} | php | public function getByOrganizationByPeriodAndByStatus($organizationId, $periodIds, $status, $databaseConnectionName = null)
{
if(empty($databaseConnectionName))
{
$databaseConnectionName = $this->databaseConnectionName;
}
return $this->JournalVoucher->setConnection($databaseConnectionName)
->where('organization_id', '=', $organizationId)
->whereIn('period_id', $periodIds)
->where('status', '=', $status)
->get();
} | [
"public",
"function",
"getByOrganizationByPeriodAndByStatus",
"(",
"$",
"organizationId",
",",
"$",
"periodIds",
",",
"$",
"status",
",",
"$",
"databaseConnectionName",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"databaseConnectionName",
")",
")",
"{",... | Get journal voucher by organization, by period and by status
@param int $organizationId
@param array $periodIds
@param string $status
@return integer | [
"Get",
"journal",
"voucher",
"by",
"organization",
"by",
"period",
"and",
"by",
"status"
] | 6410585303a13892e64e9dfeacbae0ca212b458b | https://github.com/mgallegos/decima-accounting/blob/6410585303a13892e64e9dfeacbae0ca212b458b/src/Mgallegos/DecimaAccounting/Accounting/Repositories/JournalVoucher/EloquentJournalVoucher.php#L212-L224 | train |
mgallegos/decima-accounting | src/Mgallegos/DecimaAccounting/Accounting/Repositories/JournalVoucher/EloquentJournalVoucher.php | EloquentJournalVoucher.subsequentByPeriodByNumberAndByOrganization | public function subsequentByPeriodByNumberAndByOrganization($periodId, $number, $organizationId, $databaseConnectionName = null)
{
if(empty($databaseConnectionName))
{
$databaseConnectionName = $this->databaseConnectionName;
}
return $this->JournalVoucher->setConnection($databaseConnectionName)
->where('period_id', '=', $periodId)
->where('number', '>', $number)
->where('organization_id', '=', $organizationId)
->get();
} | php | public function subsequentByPeriodByNumberAndByOrganization($periodId, $number, $organizationId, $databaseConnectionName = null)
{
if(empty($databaseConnectionName))
{
$databaseConnectionName = $this->databaseConnectionName;
}
return $this->JournalVoucher->setConnection($databaseConnectionName)
->where('period_id', '=', $periodId)
->where('number', '>', $number)
->where('organization_id', '=', $organizationId)
->get();
} | [
"public",
"function",
"subsequentByPeriodByNumberAndByOrganization",
"(",
"$",
"periodId",
",",
"$",
"number",
",",
"$",
"organizationId",
",",
"$",
"databaseConnectionName",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"databaseConnectionName",
")",
")",
... | Get subsequent journal vouchers by period by number and by organization id
@param int $periodId
@param int $number
@param int $organizationId
@return integer | [
"Get",
"subsequent",
"journal",
"vouchers",
"by",
"period",
"by",
"number",
"and",
"by",
"organization",
"id"
] | 6410585303a13892e64e9dfeacbae0ca212b458b | https://github.com/mgallegos/decima-accounting/blob/6410585303a13892e64e9dfeacbae0ca212b458b/src/Mgallegos/DecimaAccounting/Accounting/Repositories/JournalVoucher/EloquentJournalVoucher.php#L235-L247 | train |
mgallegos/decima-accounting | src/Mgallegos/DecimaAccounting/Accounting/Repositories/JournalVoucher/EloquentJournalVoucher.php | EloquentJournalVoucher.subsequentByPeriodByVoucherTypeByNumberAndByOrganization | public function subsequentByPeriodByVoucherTypeByNumberAndByOrganization($periodId, $voucherTypeId, $number, $organizationId, $databaseConnectionName = null)
{
if(empty($databaseConnectionName))
{
$databaseConnectionName = $this->databaseConnectionName;
}
return $this->JournalVoucher->setConnection($databaseConnectionName)
->where('period_id', '=', $periodId)
->where('voucher_type_id', '=', $voucherTypeId)
->where('number', '>', $number)
->where('organization_id', '=', $organizationId)
->get();
} | php | public function subsequentByPeriodByVoucherTypeByNumberAndByOrganization($periodId, $voucherTypeId, $number, $organizationId, $databaseConnectionName = null)
{
if(empty($databaseConnectionName))
{
$databaseConnectionName = $this->databaseConnectionName;
}
return $this->JournalVoucher->setConnection($databaseConnectionName)
->where('period_id', '=', $periodId)
->where('voucher_type_id', '=', $voucherTypeId)
->where('number', '>', $number)
->where('organization_id', '=', $organizationId)
->get();
} | [
"public",
"function",
"subsequentByPeriodByVoucherTypeByNumberAndByOrganization",
"(",
"$",
"periodId",
",",
"$",
"voucherTypeId",
",",
"$",
"number",
",",
"$",
"organizationId",
",",
"$",
"databaseConnectionName",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"... | Get subsequent journal vouchers by period, by voucher type id, by number and by organization id
@param int $periodId
@param int $voucherTypeId
@param int $number
@param int $organizationId
@return integer | [
"Get",
"subsequent",
"journal",
"vouchers",
"by",
"period",
"by",
"voucher",
"type",
"id",
"by",
"number",
"and",
"by",
"organization",
"id"
] | 6410585303a13892e64e9dfeacbae0ca212b458b | https://github.com/mgallegos/decima-accounting/blob/6410585303a13892e64e9dfeacbae0ca212b458b/src/Mgallegos/DecimaAccounting/Accounting/Repositories/JournalVoucher/EloquentJournalVoucher.php#L259-L272 | train |
mgallegos/decima-accounting | src/Mgallegos/DecimaAccounting/Accounting/Repositories/JournalVoucher/EloquentJournalVoucher.php | EloquentJournalVoucher.subtractOneNumber | public function subtractOneNumber($journalVoucherIds, $databaseConnectionName = null)
{
if(empty($databaseConnectionName))
{
$databaseConnectionName = $this->databaseConnectionName;
}
$this->JournalVoucher->setConnection($databaseConnectionName)
->whereIn('id', $journalVoucherIds)
->update(array('number' => $this->DB->raw('number - 1')));
return true;
} | php | public function subtractOneNumber($journalVoucherIds, $databaseConnectionName = null)
{
if(empty($databaseConnectionName))
{
$databaseConnectionName = $this->databaseConnectionName;
}
$this->JournalVoucher->setConnection($databaseConnectionName)
->whereIn('id', $journalVoucherIds)
->update(array('number' => $this->DB->raw('number - 1')));
return true;
} | [
"public",
"function",
"subtractOneNumber",
"(",
"$",
"journalVoucherIds",
",",
"$",
"databaseConnectionName",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"databaseConnectionName",
")",
")",
"{",
"$",
"databaseConnectionName",
"=",
"$",
"this",
"->",
"... | Flag sales with accounting journals generated
@param array $orderIds
@param integer $organizationId
@param string $databaseConnectionName
@param Mgallegos\DecimaSale\Sale\Client $Client
@return boolean | [
"Flag",
"sales",
"with",
"accounting",
"journals",
"generated"
] | 6410585303a13892e64e9dfeacbae0ca212b458b | https://github.com/mgallegos/decima-accounting/blob/6410585303a13892e64e9dfeacbae0ca212b458b/src/Mgallegos/DecimaAccounting/Accounting/Repositories/JournalVoucher/EloquentJournalVoucher.php#L346-L358 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/LocalMapRatings/Model/Base/MapratingQuery.php | MapratingQuery.filterByMapuid | public function filterByMapuid($mapuid = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($mapuid)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MapratingTableMap::COL_MAPUID, $mapuid, $comparison);
} | php | public function filterByMapuid($mapuid = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($mapuid)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MapratingTableMap::COL_MAPUID, $mapuid, $comparison);
} | [
"public",
"function",
"filterByMapuid",
"(",
"$",
"mapuid",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"mapuid",
")",
")",
"{",
"$",
"comparison"... | Filter the query on the mapUid column
Example usage:
<code>
$query->filterByMapuid('fooValue'); // WHERE mapUid = 'fooValue'
$query->filterByMapuid('%fooValue%', Criteria::LIKE); // WHERE mapUid LIKE '%fooValue%'
</code>
@param string $mapuid The value to use as filter.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMapratingQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"mapUid",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/LocalMapRatings/Model/Base/MapratingQuery.php#L339-L348 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Bundle/LocalMapRatings/Model/Base/MapratingQuery.php | MapratingQuery.filterByScore | public function filterByScore($score = null, $comparison = null)
{
if (is_array($score)) {
$useMinMax = false;
if (isset($score['min'])) {
$this->addUsingAlias(MapratingTableMap::COL_SCORE, $score['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($score['max'])) {
$this->addUsingAlias(MapratingTableMap::COL_SCORE, $score['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MapratingTableMap::COL_SCORE, $score, $comparison);
} | php | public function filterByScore($score = null, $comparison = null)
{
if (is_array($score)) {
$useMinMax = false;
if (isset($score['min'])) {
$this->addUsingAlias(MapratingTableMap::COL_SCORE, $score['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($score['max'])) {
$this->addUsingAlias(MapratingTableMap::COL_SCORE, $score['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(MapratingTableMap::COL_SCORE, $score, $comparison);
} | [
"public",
"function",
"filterByScore",
"(",
"$",
"score",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"score",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",
"score... | Filter the query on the score column
Example usage:
<code>
$query->filterByScore(1234); // WHERE score = 1234
$query->filterByScore(array(12, 34)); // WHERE score IN (12, 34)
$query->filterByScore(array('min' => 12)); // WHERE score > 12
</code>
@param mixed $score The value to use as filter.
Use scalar values for equality.
Use array values for in_array() equivalent.
Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return $this|ChildMapratingQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"score",
"column"
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Bundle/LocalMapRatings/Model/Base/MapratingQuery.php#L368-L389 | train |
eXpansionPluginPack/eXpansion2 | src/eXpansion/Framework/AdminGroups/DependencyInjection/Compiler/ConfigPass.php | ConfigPass.createConfigs | protected function createConfigs($groups, $permissions, ContainerBuilder $container)
{
$configManager = $container->findDefinition(ConfigManagerInterface::class);
foreach ($groups as $groupCode => $group)
{
$pathPrefix = $container->getParameter('expansion.admin_groups.config.path') . "/$groupCode";
$id = 'expansion.admin_groups.config.label.' . $groupCode;
$container->setDefinition($id, new ChildDefinition('expansion.admin_groups.config.label.abstract'))
->replaceArgument('$path', "$pathPrefix/label")
->replaceArgument('$defaultValue', $group['label']);
$configManager->addMethodCall('registerConfig', [new Reference($id), $id]);
$id = 'expansion.admin_groups.config.logins.' . $groupCode;
$container->setDefinition($id, new ChildDefinition('expansion.admin_groups.config.logins.abstract'))
->setArgument('$path', "$pathPrefix/logins")
->setArgument('$defaultValue', $group['logins']);
$configManager->addMethodCall('registerConfig', [new Reference($id), $id]);
if ($groupCode != "master_admin") {
foreach ($permissions as $permission) {
$id = 'expansion.admin_groups.config.permissions.' . $groupCode . ".$permission";
$container->setDefinition($id, new ChildDefinition('expansion.admin_groups.config.permissions.abstract'))
->setArgument('$path', "$pathPrefix/perm_$permission")
->setArgument('$defaultValue', $group['logins'])
->setArgument('$name', "expansion_admingroups.permission.$permission.label")
->setArgument('$description', "expansion_admingroups.permission.$permission.description");
$configManager->addMethodCall('registerConfig', [new Reference($id), $id]);
}
}
}
} | php | protected function createConfigs($groups, $permissions, ContainerBuilder $container)
{
$configManager = $container->findDefinition(ConfigManagerInterface::class);
foreach ($groups as $groupCode => $group)
{
$pathPrefix = $container->getParameter('expansion.admin_groups.config.path') . "/$groupCode";
$id = 'expansion.admin_groups.config.label.' . $groupCode;
$container->setDefinition($id, new ChildDefinition('expansion.admin_groups.config.label.abstract'))
->replaceArgument('$path', "$pathPrefix/label")
->replaceArgument('$defaultValue', $group['label']);
$configManager->addMethodCall('registerConfig', [new Reference($id), $id]);
$id = 'expansion.admin_groups.config.logins.' . $groupCode;
$container->setDefinition($id, new ChildDefinition('expansion.admin_groups.config.logins.abstract'))
->setArgument('$path', "$pathPrefix/logins")
->setArgument('$defaultValue', $group['logins']);
$configManager->addMethodCall('registerConfig', [new Reference($id), $id]);
if ($groupCode != "master_admin") {
foreach ($permissions as $permission) {
$id = 'expansion.admin_groups.config.permissions.' . $groupCode . ".$permission";
$container->setDefinition($id, new ChildDefinition('expansion.admin_groups.config.permissions.abstract'))
->setArgument('$path', "$pathPrefix/perm_$permission")
->setArgument('$defaultValue', $group['logins'])
->setArgument('$name', "expansion_admingroups.permission.$permission.label")
->setArgument('$description', "expansion_admingroups.permission.$permission.description");
$configManager->addMethodCall('registerConfig', [new Reference($id), $id]);
}
}
}
} | [
"protected",
"function",
"createConfigs",
"(",
"$",
"groups",
",",
"$",
"permissions",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"configManager",
"=",
"$",
"container",
"->",
"findDefinition",
"(",
"ConfigManagerInterface",
"::",
"class",
")",
";... | Create the config services.
@param $groups
@param ContainerBuilder $container | [
"Create",
"the",
"config",
"services",
"."
] | e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31 | https://github.com/eXpansionPluginPack/eXpansion2/blob/e82ffcfa7bcbcb8e354d2fde0eb64bb5695b4a31/src/eXpansion/Framework/AdminGroups/DependencyInjection/Compiler/ConfigPass.php#L32-L64 | train |
k-gun/oppa | src/Profiler.php | Profiler.getLastQuery | public function getLastQuery(string $key = null)
{
return $key ? $this->profiles['query'][$this->queryCount][$key] ?? null
: $this->profiles['query'][$this->queryCount] ?? null;
} | php | public function getLastQuery(string $key = null)
{
return $key ? $this->profiles['query'][$this->queryCount][$key] ?? null
: $this->profiles['query'][$this->queryCount] ?? null;
} | [
"public",
"function",
"getLastQuery",
"(",
"string",
"$",
"key",
"=",
"null",
")",
"{",
"return",
"$",
"key",
"?",
"$",
"this",
"->",
"profiles",
"[",
"'query'",
"]",
"[",
"$",
"this",
"->",
"queryCount",
"]",
"[",
"$",
"key",
"]",
"??",
"null",
":... | Get last query.
@param string|null $key
@return array|string|float|null | [
"Get",
"last",
"query",
"."
] | 3a20b5cc85cb3899c41737678798ec3de73a3836 | https://github.com/k-gun/oppa/blob/3a20b5cc85cb3899c41737678798ec3de73a3836/src/Profiler.php#L133-L137 | train |
k-gun/oppa | src/Profiler.php | Profiler.getTotalTime | public function getTotalTime(bool $indexed = false)
{
if ($this->profiles == null) {
return null;
}
$totalTime = 0.00;
$totalTimeIndexed = '';
if (isset($this->profiles['connection'])) {
$totalTime += $this->profiles['connection']['time'];
if ($indexed) {
$totalTimeIndexed .= "connection({$totalTime})";
}
}
if (isset($this->profiles['query'])) {
foreach ($this->profiles['query'] as $i => $profile) {
$totalTime += $profile['time'];
if ($indexed) {
$totalTimeIndexed .= " query{$i}({$profile['time']})";
}
}
}
return !$indexed ? $totalTime : $totalTimeIndexed;
} | php | public function getTotalTime(bool $indexed = false)
{
if ($this->profiles == null) {
return null;
}
$totalTime = 0.00;
$totalTimeIndexed = '';
if (isset($this->profiles['connection'])) {
$totalTime += $this->profiles['connection']['time'];
if ($indexed) {
$totalTimeIndexed .= "connection({$totalTime})";
}
}
if (isset($this->profiles['query'])) {
foreach ($this->profiles['query'] as $i => $profile) {
$totalTime += $profile['time'];
if ($indexed) {
$totalTimeIndexed .= " query{$i}({$profile['time']})";
}
}
}
return !$indexed ? $totalTime : $totalTimeIndexed;
} | [
"public",
"function",
"getTotalTime",
"(",
"bool",
"$",
"indexed",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"profiles",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"$",
"totalTime",
"=",
"0.00",
";",
"$",
"totalTimeIndexed",
"=",
... | Get total time.
@param bool $indexed
@return float|string|null | [
"Get",
"total",
"time",
"."
] | 3a20b5cc85cb3899c41737678798ec3de73a3836 | https://github.com/k-gun/oppa/blob/3a20b5cc85cb3899c41737678798ec3de73a3836/src/Profiler.php#L162-L187 | train |
BenGorUser/UserBundle | src/BenGorUser/UserBundle/DependencyInjection/Compiler/Routing/RoutesLoaderBuilder.php | RoutesLoaderBuilder.build | public function build()
{
if ($this->container->hasDefinition($this->definitionName())) {
$this->container->getDefinition(
$this->definitionName()
)->replaceArgument(0, array_unique($this->configuration, SORT_REGULAR));
}
if ($this->container->hasDefinition($this->definitionApiName())) {
foreach ($this->configuration as $key => $config) {
$this->configuration[$key]['enabled'] = $config['api_enabled'];
if (array_key_exists('type', $config)) {
$this->configuration[$key]['type'] = $config['api_type'];
}
}
$this->container->getDefinition(
$this->definitionApiName()
)->replaceArgument(0, array_unique($this->configuration, SORT_REGULAR));
}
return $this->container;
} | php | public function build()
{
if ($this->container->hasDefinition($this->definitionName())) {
$this->container->getDefinition(
$this->definitionName()
)->replaceArgument(0, array_unique($this->configuration, SORT_REGULAR));
}
if ($this->container->hasDefinition($this->definitionApiName())) {
foreach ($this->configuration as $key => $config) {
$this->configuration[$key]['enabled'] = $config['api_enabled'];
if (array_key_exists('type', $config)) {
$this->configuration[$key]['type'] = $config['api_type'];
}
}
$this->container->getDefinition(
$this->definitionApiName()
)->replaceArgument(0, array_unique($this->configuration, SORT_REGULAR));
}
return $this->container;
} | [
"public",
"function",
"build",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"container",
"->",
"hasDefinition",
"(",
"$",
"this",
"->",
"definitionName",
"(",
")",
")",
")",
"{",
"$",
"this",
"->",
"container",
"->",
"getDefinition",
"(",
"$",
"this",
... | Entry point of routes loader builder to
inject routes inside route loader.
@return ContainerBuilder | [
"Entry",
"point",
"of",
"routes",
"loader",
"builder",
"to",
"inject",
"routes",
"inside",
"route",
"loader",
"."
] | a6d0173496c269a6c80e1319d42eaed4b3bbbd4a | https://github.com/BenGorUser/UserBundle/blob/a6d0173496c269a6c80e1319d42eaed4b3bbbd4a/src/BenGorUser/UserBundle/DependencyInjection/Compiler/Routing/RoutesLoaderBuilder.php#L56-L78 | train |
BenGorUser/UserBundle | src/BenGorUser/UserBundle/DependencyInjection/Compiler/Routing/RoutesLoaderBuilder.php | RoutesLoaderBuilder.sanitize | protected function sanitize(array $configuration)
{
foreach ($configuration as $key => $config) {
if (null === $config['name']) {
$configuration[$key]['name'] = $this->defaultRouteName($key);
}
if (null === $config['path']) {
$configuration[$key]['path'] = $this->defaultRoutePath($key);
}
if (null === $config['api_name']) {
$configuration[$key]['api_name'] = $this->defaultApiRouteName($key);
}
if (null === $config['api_path']) {
$configuration[$key]['api_path'] = $this->defaultApiRoutePath($key);
}
}
return $configuration;
} | php | protected function sanitize(array $configuration)
{
foreach ($configuration as $key => $config) {
if (null === $config['name']) {
$configuration[$key]['name'] = $this->defaultRouteName($key);
}
if (null === $config['path']) {
$configuration[$key]['path'] = $this->defaultRoutePath($key);
}
if (null === $config['api_name']) {
$configuration[$key]['api_name'] = $this->defaultApiRouteName($key);
}
if (null === $config['api_path']) {
$configuration[$key]['api_path'] = $this->defaultApiRoutePath($key);
}
}
return $configuration;
} | [
"protected",
"function",
"sanitize",
"(",
"array",
"$",
"configuration",
")",
"{",
"foreach",
"(",
"$",
"configuration",
"as",
"$",
"key",
"=>",
"$",
"config",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"config",
"[",
"'name'",
"]",
")",
"{",
"$",
"con... | Sanitizes and validates the given configuration tree.
@param array $configuration The configuration tree
@return array | [
"Sanitizes",
"and",
"validates",
"the",
"given",
"configuration",
"tree",
"."
] | a6d0173496c269a6c80e1319d42eaed4b3bbbd4a | https://github.com/BenGorUser/UserBundle/blob/a6d0173496c269a6c80e1319d42eaed4b3bbbd4a/src/BenGorUser/UserBundle/DependencyInjection/Compiler/Routing/RoutesLoaderBuilder.php#L97-L115 | train |
Corviz/framework | src/String/ParametrizedString.php | ParametrizedString.getParameters | public function getParameters() : array
{
if (is_null($this->parameters)) {
$matches = [];
$regExp = self::PARAMS_SEARCH_REGEXP;
preg_match_all($regExp, $this->str, $matches);
$this->parameters = $matches[2];
}
return $this->parameters;
} | php | public function getParameters() : array
{
if (is_null($this->parameters)) {
$matches = [];
$regExp = self::PARAMS_SEARCH_REGEXP;
preg_match_all($regExp, $this->str, $matches);
$this->parameters = $matches[2];
}
return $this->parameters;
} | [
"public",
"function",
"getParameters",
"(",
")",
":",
"array",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"parameters",
")",
")",
"{",
"$",
"matches",
"=",
"[",
"]",
";",
"$",
"regExp",
"=",
"self",
"::",
"PARAMS_SEARCH_REGEXP",
";",
"preg_matc... | Get a list containing all parameters identified.
@return array | [
"Get",
"a",
"list",
"containing",
"all",
"parameters",
"identified",
"."
] | e297f890aa1c5aad28aae383b2df5c913bf6c780 | https://github.com/Corviz/framework/blob/e297f890aa1c5aad28aae383b2df5c913bf6c780/src/String/ParametrizedString.php#L44-L54 | train |
inc2734/wp-view-controller | src/App/View.php | View.render | public function render( $view, $view_suffix = '' ) {
$this->view = $view;
$this->view_suffix = $view_suffix;
if ( is_singular() ) {
$this->_render_loop();
} else {
$this->_render_direct();
}
} | php | public function render( $view, $view_suffix = '' ) {
$this->view = $view;
$this->view_suffix = $view_suffix;
if ( is_singular() ) {
$this->_render_loop();
} else {
$this->_render_direct();
}
} | [
"public",
"function",
"render",
"(",
"$",
"view",
",",
"$",
"view_suffix",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"view",
"=",
"$",
"view",
";",
"$",
"this",
"->",
"view_suffix",
"=",
"$",
"view_suffix",
";",
"if",
"(",
"is_singular",
"(",
")",
")... | Rendering the page
@param string $view view template path
@param string $view_suffix view template suffix
@return void | [
"Rendering",
"the",
"page"
] | d146b7dce51fead749f83b48fc49d1386e676bae | https://github.com/inc2734/wp-view-controller/blob/d146b7dce51fead749f83b48fc49d1386e676bae/src/App/View.php#L52-L61 | train |
inc2734/wp-view-controller | src/App/View.php | View.view | public function view() {
$view = $this->_get_args_for_template_part();
$view = apply_filters( 'inc2734_wp_view_controller_view', $view );
Helper\get_template_part( $view['slug'], $view['name'] );
} | php | public function view() {
$view = $this->_get_args_for_template_part();
$view = apply_filters( 'inc2734_wp_view_controller_view', $view );
Helper\get_template_part( $view['slug'], $view['name'] );
} | [
"public",
"function",
"view",
"(",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"_get_args_for_template_part",
"(",
")",
";",
"$",
"view",
"=",
"apply_filters",
"(",
"'inc2734_wp_view_controller_view'",
",",
"$",
"view",
")",
";",
"Helper",
"\\",
"get_temp... | Loading the view template in layout template
@return void | [
"Loading",
"the",
"view",
"template",
"in",
"layout",
"template"
] | d146b7dce51fead749f83b48fc49d1386e676bae | https://github.com/inc2734/wp-view-controller/blob/d146b7dce51fead749f83b48fc49d1386e676bae/src/App/View.php#L134-L138 | train |
inc2734/wp-view-controller | src/App/View.php | View._get_args_for_template_part | protected function _get_args_for_template_part() {
$view = [
'slug' => '',
'name' => '',
];
$template_name = Helper\locate_template( (array) Helper\config( 'view' ), $this->view, $this->view_suffix );
if ( empty( $template_name ) ) {
return $view;
}
if ( ! $this->view_suffix ) {
$view = [
'slug' => $template_name,
'name' => '',
];
} else {
$view = [
'slug' => preg_replace( '|\-' . preg_quote( $this->view_suffix ) . '$|', '', $template_name ),
'name' => $this->view_suffix,
];
}
if ( is_404() || is_search() ) {
return $view;
}
$static_template_name = $this->get_static_view_template_name();
if ( locate_template( $static_template_name . '.php', false ) ) {
return [
'slug' => $static_template_name,
'name' => '',
];
}
return $view;
} | php | protected function _get_args_for_template_part() {
$view = [
'slug' => '',
'name' => '',
];
$template_name = Helper\locate_template( (array) Helper\config( 'view' ), $this->view, $this->view_suffix );
if ( empty( $template_name ) ) {
return $view;
}
if ( ! $this->view_suffix ) {
$view = [
'slug' => $template_name,
'name' => '',
];
} else {
$view = [
'slug' => preg_replace( '|\-' . preg_quote( $this->view_suffix ) . '$|', '', $template_name ),
'name' => $this->view_suffix,
];
}
if ( is_404() || is_search() ) {
return $view;
}
$static_template_name = $this->get_static_view_template_name();
if ( locate_template( $static_template_name . '.php', false ) ) {
return [
'slug' => $static_template_name,
'name' => '',
];
}
return $view;
} | [
"protected",
"function",
"_get_args_for_template_part",
"(",
")",
"{",
"$",
"view",
"=",
"[",
"'slug'",
"=>",
"''",
",",
"'name'",
"=>",
"''",
",",
"]",
";",
"$",
"template_name",
"=",
"Helper",
"\\",
"locate_template",
"(",
"(",
"array",
")",
"Helper",
... | Gets the view args
@return array | [
"Gets",
"the",
"view",
"args"
] | d146b7dce51fead749f83b48fc49d1386e676bae | https://github.com/inc2734/wp-view-controller/blob/d146b7dce51fead749f83b48fc49d1386e676bae/src/App/View.php#L145-L181 | train |
inc2734/wp-view-controller | src/App/View.php | View.get_static_view_template_name | public function get_static_view_template_name() {
// @codingStandardsIgnoreStart
// @todo サニタイズしているのに Detected usage of a non-validated input variable: $_SERVER がでる。バグ?
$request_uri = sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) );
// @codingStandardsIgnoreEnd
$request_uri = $this->_get_relative_path( $request_uri );
$path = $this->_remove_http_query( $request_uri );
$path = $this->_remove_paged_slug( $path );
$path = trim( $path, '/' );
if ( ! $path ) {
return Helper\locate_template( (array) Helper\config( 'static' ), 'index' );
}
$template_name = Helper\locate_template( (array) Helper\config( 'static' ), $path );
if ( empty( $template_name ) ) {
$template_name = Helper\locate_template( (array) Helper\config( 'static' ), $path . '/index' );
}
return $template_name;
} | php | public function get_static_view_template_name() {
// @codingStandardsIgnoreStart
// @todo サニタイズしているのに Detected usage of a non-validated input variable: $_SERVER がでる。バグ?
$request_uri = sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) );
// @codingStandardsIgnoreEnd
$request_uri = $this->_get_relative_path( $request_uri );
$path = $this->_remove_http_query( $request_uri );
$path = $this->_remove_paged_slug( $path );
$path = trim( $path, '/' );
if ( ! $path ) {
return Helper\locate_template( (array) Helper\config( 'static' ), 'index' );
}
$template_name = Helper\locate_template( (array) Helper\config( 'static' ), $path );
if ( empty( $template_name ) ) {
$template_name = Helper\locate_template( (array) Helper\config( 'static' ), $path . '/index' );
}
return $template_name;
} | [
"public",
"function",
"get_static_view_template_name",
"(",
")",
"{",
"// @codingStandardsIgnoreStart",
"// @todo サニタイズしているのに Detected usage of a non-validated input variable: $_SERVER がでる。バグ?",
"$",
"request_uri",
"=",
"sanitize_text_field",
"(",
"wp_unslash",
"(",
"$",
"_SERVER",
... | Returns static view template name
@return string|null | [
"Returns",
"static",
"view",
"template",
"name"
] | d146b7dce51fead749f83b48fc49d1386e676bae | https://github.com/inc2734/wp-view-controller/blob/d146b7dce51fead749f83b48fc49d1386e676bae/src/App/View.php#L188-L208 | train |
inc2734/wp-view-controller | src/App/View.php | View._remove_http_query | protected function _remove_http_query( $uri ) {
$uri = str_replace( http_build_query( $_GET, null, '&' ), '', $uri );
$uri = rtrim( $uri, '?' );
return $uri;
} | php | protected function _remove_http_query( $uri ) {
$uri = str_replace( http_build_query( $_GET, null, '&' ), '', $uri );
$uri = rtrim( $uri, '?' );
return $uri;
} | [
"protected",
"function",
"_remove_http_query",
"(",
"$",
"uri",
")",
"{",
"$",
"uri",
"=",
"str_replace",
"(",
"http_build_query",
"(",
"$",
"_GET",
",",
"null",
",",
"'&'",
")",
",",
"''",
",",
"$",
"uri",
")",
";",
"$",
"uri",
"=",
"rtrim",
"(",
... | Return uri that removed http queries
@param string $uri
@return string | [
"Return",
"uri",
"that",
"removed",
"http",
"queries"
] | d146b7dce51fead749f83b48fc49d1386e676bae | https://github.com/inc2734/wp-view-controller/blob/d146b7dce51fead749f83b48fc49d1386e676bae/src/App/View.php#L226-L230 | train |
orchestral/avatar | src/Handlers/Gravatar.php | Gravatar.getGravatarSize | protected function getGravatarSize()
{
$size = $this->getSize();
return $this->config['sizes'][$size] ?? (\is_int($size) ? $size : 'small');
} | php | protected function getGravatarSize()
{
$size = $this->getSize();
return $this->config['sizes'][$size] ?? (\is_int($size) ? $size : 'small');
} | [
"protected",
"function",
"getGravatarSize",
"(",
")",
"{",
"$",
"size",
"=",
"$",
"this",
"->",
"getSize",
"(",
")",
";",
"return",
"$",
"this",
"->",
"config",
"[",
"'sizes'",
"]",
"[",
"$",
"size",
"]",
"??",
"(",
"\\",
"is_int",
"(",
"$",
"size"... | Get Gravatar size.
@return mixed | [
"Get",
"Gravatar",
"size",
"."
] | 2498b87366e42f2c661118aff589207014607e80 | https://github.com/orchestral/avatar/blob/2498b87366e42f2c661118aff589207014607e80/src/Handlers/Gravatar.php#L54-L59 | train |
ansas/php-component | src/Component/File/CsvBuilderBase.php | CsvBuilderBase.setCallback | public function setCallback($callback = null)
{
if (!is_null($callback) && !is_callable($callback)) {
throw new Exception("callback must be of type callable or null");
}
$this->callback = $callback;
return $this;
} | php | public function setCallback($callback = null)
{
if (!is_null($callback) && !is_callable($callback)) {
throw new Exception("callback must be of type callable or null");
}
$this->callback = $callback;
return $this;
} | [
"public",
"function",
"setCallback",
"(",
"$",
"callback",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"callback",
")",
"&&",
"!",
"is_callable",
"(",
"$",
"callback",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"callback must be o... | Set callback function run for every entry before added to CSV.
Callable must take old column value as first parameter and return new (sanitized / filtered) column parameter.
@param callable $callback [optional]
@return $this
@throws Exception | [
"Set",
"callback",
"function",
"run",
"for",
"every",
"entry",
"before",
"added",
"to",
"CSV",
"."
] | 24574a1e32d5f1355a6e2b6f20f49b1eda7250ba | https://github.com/ansas/php-component/blob/24574a1e32d5f1355a6e2b6f20f49b1eda7250ba/src/Component/File/CsvBuilderBase.php#L121-L130 | train |
ansas/php-component | src/Component/File/CsvBuilderBase.php | CsvBuilderBase.setHeader | public function setHeader(array $header)
{
if (is_numeric(key($header))) {
$header = array_fill_keys($header, '');
}
$this->header = $header;
return $this;
} | php | public function setHeader(array $header)
{
if (is_numeric(key($header))) {
$header = array_fill_keys($header, '');
}
$this->header = $header;
return $this;
} | [
"public",
"function",
"setHeader",
"(",
"array",
"$",
"header",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"key",
"(",
"$",
"header",
")",
")",
")",
"{",
"$",
"header",
"=",
"array_fill_keys",
"(",
"$",
"header",
",",
"''",
")",
";",
"}",
"$",
"this",... | Set CSV headers.
@param array $header
@return $this | [
"Set",
"CSV",
"headers",
"."
] | 24574a1e32d5f1355a6e2b6f20f49b1eda7250ba | https://github.com/ansas/php-component/blob/24574a1e32d5f1355a6e2b6f20f49b1eda7250ba/src/Component/File/CsvBuilderBase.php#L155-L163 | train |
byjg/xmlnuke | xmlnuke-php5/src/Xmlnuke/Core/Module/BaseService.php | BaseService.CreatePage | public final function CreatePage()
{
$method = strtoupper($this->_context->get("REQUEST_METHOD"));
$customAction = strtolower($method) . ucfirst($this->_action);
if (method_exists($this, $customAction))
$this->$customAction($this->getRawRequest(), $this->_context->get("id"));
else
throw new BadMethodCallException("The method '$customAction' does not exists.");
return $this->defaultXmlnukeDocument;
} | php | public final function CreatePage()
{
$method = strtoupper($this->_context->get("REQUEST_METHOD"));
$customAction = strtolower($method) . ucfirst($this->_action);
if (method_exists($this, $customAction))
$this->$customAction($this->getRawRequest(), $this->_context->get("id"));
else
throw new BadMethodCallException("The method '$customAction' does not exists.");
return $this->defaultXmlnukeDocument;
} | [
"public",
"final",
"function",
"CreatePage",
"(",
")",
"{",
"$",
"method",
"=",
"strtoupper",
"(",
"$",
"this",
"->",
"_context",
"->",
"get",
"(",
"\"REQUEST_METHOD\"",
")",
")",
";",
"$",
"customAction",
"=",
"strtolower",
"(",
"$",
"method",
")",
".",... | Expected TWO pa
@return type
@throws BadMethodCallException | [
"Expected",
"TWO",
"pa"
] | aeb458e4b7e0f6df1d900202f3c1c2a7ad7384f7 | https://github.com/byjg/xmlnuke/blob/aeb458e4b7e0f6df1d900202f3c1c2a7ad7384f7/xmlnuke-php5/src/Xmlnuke/Core/Module/BaseService.php#L60-L72 | train |
byjg/xmlnuke | xmlnuke-php5/src/Xmlnuke/Util/FileUtil.php | FileUtil.DeleteFilesFromPath | public static function DeleteFilesFromPath($file)
{
$files = self::RetrieveFilesFromFolder($file->PathSuggested(),null);
foreach ($files as $f)
{
if (strpos($f,$file->Extension())!== false)
{
self::DeleteFileString($f);
}
}
} | php | public static function DeleteFilesFromPath($file)
{
$files = self::RetrieveFilesFromFolder($file->PathSuggested(),null);
foreach ($files as $f)
{
if (strpos($f,$file->Extension())!== false)
{
self::DeleteFileString($f);
}
}
} | [
"public",
"static",
"function",
"DeleteFilesFromPath",
"(",
"$",
"file",
")",
"{",
"$",
"files",
"=",
"self",
"::",
"RetrieveFilesFromFolder",
"(",
"$",
"file",
"->",
"PathSuggested",
"(",
")",
",",
"null",
")",
";",
"foreach",
"(",
"$",
"files",
"as",
"... | Delete File from path
@param FileNameProcessor $file | [
"Delete",
"File",
"from",
"path"
] | aeb458e4b7e0f6df1d900202f3c1c2a7ad7384f7 | https://github.com/byjg/xmlnuke/blob/aeb458e4b7e0f6df1d900202f3c1c2a7ad7384f7/xmlnuke-php5/src/Xmlnuke/Util/FileUtil.php#L251-L261 | train |
byjg/xmlnuke | xmlnuke-php5/src/Xmlnuke/Util/FileUtil.php | FileUtil.AdjustSlashes | public static function AdjustSlashes($path)
{
if (self::isWindowsOS())
{
$search = "/";
$replace = "\\";
}
else
{
$search = "\\";
$replace = "/";
}
return str_replace($search, $replace, $path);
} | php | public static function AdjustSlashes($path)
{
if (self::isWindowsOS())
{
$search = "/";
$replace = "\\";
}
else
{
$search = "\\";
$replace = "/";
}
return str_replace($search, $replace, $path);
} | [
"public",
"static",
"function",
"AdjustSlashes",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"self",
"::",
"isWindowsOS",
"(",
")",
")",
"{",
"$",
"search",
"=",
"\"/\"",
";",
"$",
"replace",
"=",
"\"\\\\\"",
";",
"}",
"else",
"{",
"$",
"search",
"=",
"... | Return slash to a operational system
@param string $path
@return string | [
"Return",
"slash",
"to",
"a",
"operational",
"system"
] | aeb458e4b7e0f6df1d900202f3c1c2a7ad7384f7 | https://github.com/byjg/xmlnuke/blob/aeb458e4b7e0f6df1d900202f3c1c2a7ad7384f7/xmlnuke-php5/src/Xmlnuke/Util/FileUtil.php#L296-L310 | train |
byjg/xmlnuke | xmlnuke-php5/src/Xmlnuke/Util/FileUtil.php | FileUtil.getUriFromFile | public static function getUriFromFile($absolutepath)
{
if (self::isWindowsOS())
{
$result = "file:///".$absolutepath;
$search = "\\";
$replace = "/";
$result =str_replace($search, $replace, $result);
}
else
{
$result = "file://".$absolutepath;
}
return $result;
} | php | public static function getUriFromFile($absolutepath)
{
if (self::isWindowsOS())
{
$result = "file:///".$absolutepath;
$search = "\\";
$replace = "/";
$result =str_replace($search, $replace, $result);
}
else
{
$result = "file://".$absolutepath;
}
return $result;
} | [
"public",
"static",
"function",
"getUriFromFile",
"(",
"$",
"absolutepath",
")",
"{",
"if",
"(",
"self",
"::",
"isWindowsOS",
"(",
")",
")",
"{",
"$",
"result",
"=",
"\"file:///\"",
".",
"$",
"absolutepath",
";",
"$",
"search",
"=",
"\"\\\\\"",
";",
"$",... | Get filr from absolute path
@param string $absolutepath Absolute path from file
@return string | [
"Get",
"filr",
"from",
"absolute",
"path"
] | aeb458e4b7e0f6df1d900202f3c1c2a7ad7384f7 | https://github.com/byjg/xmlnuke/blob/aeb458e4b7e0f6df1d900202f3c1c2a7ad7384f7/xmlnuke-php5/src/Xmlnuke/Util/FileUtil.php#L318-L335 | train |
byjg/xmlnuke | xmlnuke-php5/src/Xmlnuke/Util/FileUtil.php | FileUtil.isReadable | public static function isReadable($filename)
{
if (!is_readable($filename))
return false;
if ((self::isWindowsOS() || self::isMacOS()) && (count(glob($filename . '*')) == 0))
throw new \Xmlnuke\Core\Exception\CaseMismatchException(
'Your operating system is not case sensitive and it can find the file "' . $filename . '" ' .
'with different uppercase and lowercase combination in your name. ' .
'However Xmlnuke will not accept it for ensure your code will run on any platform.'
);
else
return true;
} | php | public static function isReadable($filename)
{
if (!is_readable($filename))
return false;
if ((self::isWindowsOS() || self::isMacOS()) && (count(glob($filename . '*')) == 0))
throw new \Xmlnuke\Core\Exception\CaseMismatchException(
'Your operating system is not case sensitive and it can find the file "' . $filename . '" ' .
'with different uppercase and lowercase combination in your name. ' .
'However Xmlnuke will not accept it for ensure your code will run on any platform.'
);
else
return true;
} | [
"public",
"static",
"function",
"isReadable",
"(",
"$",
"filename",
")",
"{",
"if",
"(",
"!",
"is_readable",
"(",
"$",
"filename",
")",
")",
"return",
"false",
";",
"if",
"(",
"(",
"self",
"::",
"isWindowsOS",
"(",
")",
"||",
"self",
"::",
"isMacOS",
... | Check if the file is readable across all platforms
@param string $filename
@return bool The filename matches with your spelling name. | [
"Check",
"if",
"the",
"file",
"is",
"readable",
"across",
"all",
"platforms"
] | aeb458e4b7e0f6df1d900202f3c1c2a7ad7384f7 | https://github.com/byjg/xmlnuke/blob/aeb458e4b7e0f6df1d900202f3c1c2a7ad7384f7/xmlnuke-php5/src/Xmlnuke/Util/FileUtil.php#L372-L385 | train |
byjg/xmlnuke | xmlnuke-php5/src/Xmlnuke/Util/FileUtil.php | FileUtil.ForceDirectories | public static function ForceDirectories($pathname, $mode = 0777)
{
// Crawl up the directory tree
$next_pathname = substr($pathname,0, strrpos($pathname, self::Slash()));
if ($next_pathname != "")
{
self::ForceDirectories($next_pathname, $mode);
}
if (!file_exists($pathname))
{
FileUtil::CreateDirectory($pathname, $mode);
}
} | php | public static function ForceDirectories($pathname, $mode = 0777)
{
// Crawl up the directory tree
$next_pathname = substr($pathname,0, strrpos($pathname, self::Slash()));
if ($next_pathname != "")
{
self::ForceDirectories($next_pathname, $mode);
}
if (!file_exists($pathname))
{
FileUtil::CreateDirectory($pathname, $mode);
}
} | [
"public",
"static",
"function",
"ForceDirectories",
"(",
"$",
"pathname",
",",
"$",
"mode",
"=",
"0777",
")",
"{",
"// Crawl up the directory tree",
"$",
"next_pathname",
"=",
"substr",
"(",
"$",
"pathname",
",",
"0",
",",
"strrpos",
"(",
"$",
"pathname",
",... | Create a directory structure recursively
@author Aidan Lister <aidan@php.net> (original name mkdirr)
@version 1.0.0
@param string $pathname - The directory structure to create
@param int $mode - Security mode apply in directorys
@return bool - Returns TRUE on success, FALSE on failure | [
"Create",
"a",
"directory",
"structure",
"recursively"
] | aeb458e4b7e0f6df1d900202f3c1c2a7ad7384f7 | https://github.com/byjg/xmlnuke/blob/aeb458e4b7e0f6df1d900202f3c1c2a7ad7384f7/xmlnuke-php5/src/Xmlnuke/Util/FileUtil.php#L406-L418 | train |
byjg/xmlnuke | xmlnuke-php5/src/Xmlnuke/Util/FileUtil.php | FileUtil.ForceRemoveDirectories | public static function ForceRemoveDirectories($dir)
{
if($objs = glob($dir."/*")){
foreach($objs as $obj) {
is_dir($obj)? self::ForceRemoveDirectories($obj) : self::DeleteFileString($obj);
}
}
self::DeleteDirectory($dir);
} | php | public static function ForceRemoveDirectories($dir)
{
if($objs = glob($dir."/*")){
foreach($objs as $obj) {
is_dir($obj)? self::ForceRemoveDirectories($obj) : self::DeleteFileString($obj);
}
}
self::DeleteDirectory($dir);
} | [
"public",
"static",
"function",
"ForceRemoveDirectories",
"(",
"$",
"dir",
")",
"{",
"if",
"(",
"$",
"objs",
"=",
"glob",
"(",
"$",
"dir",
".",
"\"/*\"",
")",
")",
"{",
"foreach",
"(",
"$",
"objs",
"as",
"$",
"obj",
")",
"{",
"is_dir",
"(",
"$",
... | Remove directorys structure recursively
@author dexn (at) metazure.com (original name rmdirr)
@version 1.0.0
@param string $dir - The directory structure to delete
@return void | [
"Remove",
"directorys",
"structure",
"recursively"
] | aeb458e4b7e0f6df1d900202f3c1c2a7ad7384f7 | https://github.com/byjg/xmlnuke/blob/aeb458e4b7e0f6df1d900202f3c1c2a7ad7384f7/xmlnuke-php5/src/Xmlnuke/Util/FileUtil.php#L443-L451 | train |
byjg/xmlnuke | xmlnuke-php5/src/Xmlnuke/Util/FileUtil.php | FileUtil.OpenRemoteDocument | public static function OpenRemoteDocument($url)
{
// Expression Regular:
// [1]: http or ftp
// [2]: Server name
// [4]: Full Path
$pat = '/(http|ftp|https):\\/\\/((\\w|\\.)+)/i';
$urlParts = preg_split($pat, $url, -1,PREG_SPLIT_DELIM_CAPTURE);
$handle = fsockopen($urlParts[2], 80, $errno, $errstr, 30);
if (!$handle)
{
throw new FileUtilException("Socket error: $errstr ($errno)");
}
else
{
$out = "GET " . $urlParts[4] . " HTTP/1.1\r\n";
$out .= "Host: " . $urlParts[2] . "\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($handle, $out);
return $handle;
}
} | php | public static function OpenRemoteDocument($url)
{
// Expression Regular:
// [1]: http or ftp
// [2]: Server name
// [4]: Full Path
$pat = '/(http|ftp|https):\\/\\/((\\w|\\.)+)/i';
$urlParts = preg_split($pat, $url, -1,PREG_SPLIT_DELIM_CAPTURE);
$handle = fsockopen($urlParts[2], 80, $errno, $errstr, 30);
if (!$handle)
{
throw new FileUtilException("Socket error: $errstr ($errno)");
}
else
{
$out = "GET " . $urlParts[4] . " HTTP/1.1\r\n";
$out .= "Host: " . $urlParts[2] . "\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($handle, $out);
return $handle;
}
} | [
"public",
"static",
"function",
"OpenRemoteDocument",
"(",
"$",
"url",
")",
"{",
"// Expression Regular:",
"// [1]: http or ftp",
"// [2]: Server name",
"// [4]: Full Path",
"$",
"pat",
"=",
"'/(http|ftp|https):\\\\/\\\\/((\\\\w|\\\\.)+)/i'",
";",
"$",
"urlParts",
"=",
"pre... | Open a remote document from a specific URL
@param string $url
@return handle Handle of the document opened | [
"Open",
"a",
"remote",
"document",
"from",
"a",
"specific",
"URL"
] | aeb458e4b7e0f6df1d900202f3c1c2a7ad7384f7 | https://github.com/byjg/xmlnuke/blob/aeb458e4b7e0f6df1d900202f3c1c2a7ad7384f7/xmlnuke-php5/src/Xmlnuke/Util/FileUtil.php#L458-L482 | train |
byjg/xmlnuke | xmlnuke-php5/src/Xmlnuke/Util/FileUtil.php | FileUtil.ReadRemoteDocument | public static function ReadRemoteDocument($handle)
{
// THIS FUNCTION IS A CRAP!!!!
// I NEED REFACTORY THIS!
$retdocument = "";
$xml = true;
$canread = true;
// READ HEADER
while (!feof($handle))
{
$buffer = fgets($handle, 4096);
if (strpos(strtolower($buffer), "content-type:")!==false)
{
$xml = (strpos(strtolower($buffer), "xml")!==false);
$canread = !$xml;
}
if (trim($buffer) == "")
{
break;
}
}
// READ CONTENT
while (!feof($handle))
{
$buffer = fgets($handle, 4096);
if (!$canread && ($buffer[0] != "<"))
{
$buffer = "";
}
else
{
$canread = true;
}
$retdocument = $retdocument . $buffer;
}
fclose($handle);
if ($xml)
{
$lastvalid = strrpos($retdocument, ">");
$retdocument = substr($retdocument, 0, $lastvalid+1);
}
return $retdocument;
} | php | public static function ReadRemoteDocument($handle)
{
// THIS FUNCTION IS A CRAP!!!!
// I NEED REFACTORY THIS!
$retdocument = "";
$xml = true;
$canread = true;
// READ HEADER
while (!feof($handle))
{
$buffer = fgets($handle, 4096);
if (strpos(strtolower($buffer), "content-type:")!==false)
{
$xml = (strpos(strtolower($buffer), "xml")!==false);
$canread = !$xml;
}
if (trim($buffer) == "")
{
break;
}
}
// READ CONTENT
while (!feof($handle))
{
$buffer = fgets($handle, 4096);
if (!$canread && ($buffer[0] != "<"))
{
$buffer = "";
}
else
{
$canread = true;
}
$retdocument = $retdocument . $buffer;
}
fclose($handle);
if ($xml)
{
$lastvalid = strrpos($retdocument, ">");
$retdocument = substr($retdocument, 0, $lastvalid+1);
}
return $retdocument;
} | [
"public",
"static",
"function",
"ReadRemoteDocument",
"(",
"$",
"handle",
")",
"{",
"// THIS FUNCTION IS A CRAP!!!!",
"// I NEED REFACTORY THIS!",
"$",
"retdocument",
"=",
"\"\"",
";",
"$",
"xml",
"=",
"true",
";",
"$",
"canread",
"=",
"true",
";",
"// READ HEADER... | Get the full document opened from OpenRemoteDocument
@param handle $handle
@return string Remote document | [
"Get",
"the",
"full",
"document",
"opened",
"from",
"OpenRemoteDocument"
] | aeb458e4b7e0f6df1d900202f3c1c2a7ad7384f7 | https://github.com/byjg/xmlnuke/blob/aeb458e4b7e0f6df1d900202f3c1c2a7ad7384f7/xmlnuke-php5/src/Xmlnuke/Util/FileUtil.php#L489-L535 | train |
byrokrat/autogiro | src/Xml/Stringifier.php | Stringifier.stringify | public function stringify($value): string
{
if ($value instanceof \DateTimeInterface) {
return $value->format('Y-m-d');
}
if (is_array($value)) {
return self::ARRAY_VALUE;
}
if (is_object($value) && !method_exists($value, '__tostring')) {
return self::OBJECT_VALUE;
}
return (string)$value;
} | php | public function stringify($value): string
{
if ($value instanceof \DateTimeInterface) {
return $value->format('Y-m-d');
}
if (is_array($value)) {
return self::ARRAY_VALUE;
}
if (is_object($value) && !method_exists($value, '__tostring')) {
return self::OBJECT_VALUE;
}
return (string)$value;
} | [
"public",
"function",
"stringify",
"(",
"$",
"value",
")",
":",
"string",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"\\",
"DateTimeInterface",
")",
"{",
"return",
"$",
"value",
"->",
"format",
"(",
"'Y-m-d'",
")",
";",
"}",
"if",
"(",
"is_array",
"("... | Cast value to string | [
"Cast",
"value",
"to",
"string"
] | 7035467af18e991c0c130d83294b0779aa3e1583 | https://github.com/byrokrat/autogiro/blob/7035467af18e991c0c130d83294b0779aa3e1583/src/Xml/Stringifier.php#L43-L58 | train |
ansas/php-component | src/Monolog/Profiler.php | Profiler.add | public function add(string $profile, $inheritContext = false)
{
if ($this->has($profile)) {
throw new Exception("Profile {$profile} already exist.");
}
if (!strlen($profile)) {
throw new Exception("Profile must be set.");
}
$child = clone $this;
$child->clear(!$inheritContext);
$child->name = ($this->name ? $this->name . ' > ' : '') . $profile;
$child->children = [];
$this->children[$profile] = $child;
return $child;
} | php | public function add(string $profile, $inheritContext = false)
{
if ($this->has($profile)) {
throw new Exception("Profile {$profile} already exist.");
}
if (!strlen($profile)) {
throw new Exception("Profile must be set.");
}
$child = clone $this;
$child->clear(!$inheritContext);
$child->name = ($this->name ? $this->name . ' > ' : '') . $profile;
$child->children = [];
$this->children[$profile] = $child;
return $child;
} | [
"public",
"function",
"add",
"(",
"string",
"$",
"profile",
",",
"$",
"inheritContext",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"profile",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"Profile {$profile} already exist.\... | Add child profile.
@param string $profile
@param bool $inheritContext [optional] Also set context for child profile?
@return Profiler
@throws Exception | [
"Add",
"child",
"profile",
"."
] | 24574a1e32d5f1355a6e2b6f20f49b1eda7250ba | https://github.com/ansas/php-component/blob/24574a1e32d5f1355a6e2b6f20f49b1eda7250ba/src/Monolog/Profiler.php#L147-L165 | train |
ansas/php-component | src/Monolog/Profiler.php | Profiler.clear | public function clear($clearContext = false)
{
// Clear all stopwatch related values
$this->start = null;
$this->stop = null;
$this->laps = [];
if ($clearContext) {
$this->context = null;
}
return $this;
} | php | public function clear($clearContext = false)
{
// Clear all stopwatch related values
$this->start = null;
$this->stop = null;
$this->laps = [];
if ($clearContext) {
$this->context = null;
}
return $this;
} | [
"public",
"function",
"clear",
"(",
"$",
"clearContext",
"=",
"false",
")",
"{",
"// Clear all stopwatch related values",
"$",
"this",
"->",
"start",
"=",
"null",
";",
"$",
"this",
"->",
"stop",
"=",
"null",
";",
"$",
"this",
"->",
"laps",
"=",
"[",
"]",... | Clear profile.
Resets profile and removes all collected data so it can:
- be started again
- will not be logged at profiler destruction
@param bool $clearContext [optional] Clear context as well?
@return $this | [
"Clear",
"profile",
"."
] | 24574a1e32d5f1355a6e2b6f20f49b1eda7250ba | https://github.com/ansas/php-component/blob/24574a1e32d5f1355a6e2b6f20f49b1eda7250ba/src/Monolog/Profiler.php#L178-L190 | train |
ansas/php-component | src/Monolog/Profiler.php | Profiler.clearAll | public function clearAll($clearContext = false)
{
foreach ($this->getProfiles() as $child) {
$child->clearAll($clearContext);
}
$this->clear($clearContext);
return $this;
} | php | public function clearAll($clearContext = false)
{
foreach ($this->getProfiles() as $child) {
$child->clearAll($clearContext);
}
$this->clear($clearContext);
return $this;
} | [
"public",
"function",
"clearAll",
"(",
"$",
"clearContext",
"=",
"false",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getProfiles",
"(",
")",
"as",
"$",
"child",
")",
"{",
"$",
"child",
"->",
"clearAll",
"(",
"$",
"clearContext",
")",
";",
"}",
"$"... | Clear this and all child profiles.
@param bool $clearContext [optional] Clear context as well?
@return $this | [
"Clear",
"this",
"and",
"all",
"child",
"profiles",
"."
] | 24574a1e32d5f1355a6e2b6f20f49b1eda7250ba | https://github.com/ansas/php-component/blob/24574a1e32d5f1355a6e2b6f20f49b1eda7250ba/src/Monolog/Profiler.php#L199-L208 | train |
ansas/php-component | src/Monolog/Profiler.php | Profiler.get | public function get(string $profile)
{
if (!$this->has($profile)) {
throw new Exception("Profile {$profile} does not exist.");
}
return $this->children[$profile];
} | php | public function get(string $profile)
{
if (!$this->has($profile)) {
throw new Exception("Profile {$profile} does not exist.");
}
return $this->children[$profile];
} | [
"public",
"function",
"get",
"(",
"string",
"$",
"profile",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"profile",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"Profile {$profile} does not exist.\"",
")",
";",
"}",
"return",
"$",
... | Get child profile.
@param string $profile
@return mixed
@throws Exception | [
"Get",
"child",
"profile",
"."
] | 24574a1e32d5f1355a6e2b6f20f49b1eda7250ba | https://github.com/ansas/php-component/blob/24574a1e32d5f1355a6e2b6f20f49b1eda7250ba/src/Monolog/Profiler.php#L260-L267 | train |
ansas/php-component | src/Monolog/Profiler.php | Profiler.note | public function note($message = 'Note', $context = [], $level = null)
{
// Check if method was called only with $context
if (is_array($message)) {
$level = $context ?: null;
$context = $message;
$message = 'Note';
}
// Skip log entry if message is null
if (is_null($message)) {
return $this;
}
// Add and format context
if ($this->context) {
$context = array_merge($this->context->all(), $context);
}
$context['profile'] = $this->name;
if (isset($context['runtime'])) {
$formatter = $this->getFormatter();
$context['runtime'] = $formatter($context['runtime']);
}
// Log
$this->logger->log($level ?: $this->level, $message, $context);
return $this;
} | php | public function note($message = 'Note', $context = [], $level = null)
{
// Check if method was called only with $context
if (is_array($message)) {
$level = $context ?: null;
$context = $message;
$message = 'Note';
}
// Skip log entry if message is null
if (is_null($message)) {
return $this;
}
// Add and format context
if ($this->context) {
$context = array_merge($this->context->all(), $context);
}
$context['profile'] = $this->name;
if (isset($context['runtime'])) {
$formatter = $this->getFormatter();
$context['runtime'] = $formatter($context['runtime']);
}
// Log
$this->logger->log($level ?: $this->level, $message, $context);
return $this;
} | [
"public",
"function",
"note",
"(",
"$",
"message",
"=",
"'Note'",
",",
"$",
"context",
"=",
"[",
"]",
",",
"$",
"level",
"=",
"null",
")",
"{",
"// Check if method was called only with $context",
"if",
"(",
"is_array",
"(",
"$",
"message",
")",
")",
"{",
... | Log note for this profile.
This is the main method for actually logging everything. start()|stop()|lap() use this method for logging. This
method can be used to note information without using a time feature.
@param string $message [optional]
@param array $context [optional]
@param mixed $level [optional]
@return $this | [
"Log",
"note",
"for",
"this",
"profile",
"."
] | 24574a1e32d5f1355a6e2b6f20f49b1eda7250ba | https://github.com/ansas/php-component/blob/24574a1e32d5f1355a6e2b6f20f49b1eda7250ba/src/Monolog/Profiler.php#L404-L432 | train |
ansas/php-component | src/Monolog/Profiler.php | Profiler.remove | public function remove(string $profile)
{
$child = $this->get($profile);
$child->clearAll();
$child->removeAll();
unset($this->children[$profile]);
return $this;
} | php | public function remove(string $profile)
{
$child = $this->get($profile);
$child->clearAll();
$child->removeAll();
unset($this->children[$profile]);
return $this;
} | [
"public",
"function",
"remove",
"(",
"string",
"$",
"profile",
")",
"{",
"$",
"child",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"profile",
")",
";",
"$",
"child",
"->",
"clearAll",
"(",
")",
";",
"$",
"child",
"->",
"removeAll",
"(",
")",
";",
"u... | Removes specified child profile from this profile.
@param string $profile
@return $this | [
"Removes",
"specified",
"child",
"profile",
"from",
"this",
"profile",
"."
] | 24574a1e32d5f1355a6e2b6f20f49b1eda7250ba | https://github.com/ansas/php-component/blob/24574a1e32d5f1355a6e2b6f20f49b1eda7250ba/src/Monolog/Profiler.php#L441-L450 | train |
ansas/php-component | src/Monolog/Profiler.php | Profiler.removeAll | public function removeAll()
{
foreach ($this->getProfiles() as $profile => $child) {
$this->remove($profile);
}
return $this;
} | php | public function removeAll()
{
foreach ($this->getProfiles() as $profile => $child) {
$this->remove($profile);
}
return $this;
} | [
"public",
"function",
"removeAll",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getProfiles",
"(",
")",
"as",
"$",
"profile",
"=>",
"$",
"child",
")",
"{",
"$",
"this",
"->",
"remove",
"(",
"$",
"profile",
")",
";",
"}",
"return",
"$",
"this"... | Removes all child profiles from this profile.
@return $this | [
"Removes",
"all",
"child",
"profiles",
"from",
"this",
"profile",
"."
] | 24574a1e32d5f1355a6e2b6f20f49b1eda7250ba | https://github.com/ansas/php-component/blob/24574a1e32d5f1355a6e2b6f20f49b1eda7250ba/src/Monolog/Profiler.php#L457-L464 | train |
ansas/php-component | src/Monolog/Profiler.php | Profiler.restart | public function restart($message = 'Restart', $context = [])
{
// Check if method was called only with $context
if (is_array($message)) {
$context = $message;
$message = 'Restart';
}
// Clear data and start (again)
$this->clear();
$this->start($message, $context);
} | php | public function restart($message = 'Restart', $context = [])
{
// Check if method was called only with $context
if (is_array($message)) {
$context = $message;
$message = 'Restart';
}
// Clear data and start (again)
$this->clear();
$this->start($message, $context);
} | [
"public",
"function",
"restart",
"(",
"$",
"message",
"=",
"'Restart'",
",",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"// Check if method was called only with $context",
"if",
"(",
"is_array",
"(",
"$",
"message",
")",
")",
"{",
"$",
"context",
"=",
"$",
"... | Clear and start profile again.
@param string $message [optional]
@param array $context [optional] | [
"Clear",
"and",
"start",
"profile",
"again",
"."
] | 24574a1e32d5f1355a6e2b6f20f49b1eda7250ba | https://github.com/ansas/php-component/blob/24574a1e32d5f1355a6e2b6f20f49b1eda7250ba/src/Monolog/Profiler.php#L472-L483 | train |
ansas/php-component | src/Monolog/Profiler.php | Profiler.set | public function set(string $profile, $inheritContext = false)
{
return $this->has($profile) ? $this->get($profile) : $this->add($profile, $inheritContext);
} | php | public function set(string $profile, $inheritContext = false)
{
return $this->has($profile) ? $this->get($profile) : $this->add($profile, $inheritContext);
} | [
"public",
"function",
"set",
"(",
"string",
"$",
"profile",
",",
"$",
"inheritContext",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"has",
"(",
"$",
"profile",
")",
"?",
"$",
"this",
"->",
"get",
"(",
"$",
"profile",
")",
":",
"$",
"this",... | Set and use profile.
Quick form for add() and get(): Adds child profile if needed and returns the child profile.
@param string $profile
@param bool $inheritContext [optional] Also set context for child profile?
@return Profiler | [
"Set",
"and",
"use",
"profile",
"."
] | 24574a1e32d5f1355a6e2b6f20f49b1eda7250ba | https://github.com/ansas/php-component/blob/24574a1e32d5f1355a6e2b6f20f49b1eda7250ba/src/Monolog/Profiler.php#L495-L498 | train |
ansas/php-component | src/Monolog/Profiler.php | Profiler.start | public function start($message = 'Start', $context = [])
{
// Check if method was called only with $context
if (is_array($message)) {
$context = $message;
$message = 'Start';
}
// A profile can only be started if never started or cleared before
if ($this->isStarted()) {
throw new Exception("Profile {$this->getName()} already started.");
}
// The main profile
if (null === $this->name) {
if ($this->children) {
throw new Exception("Profile {$this->getName()} must be started before all other profiles.");
}
$timeStart = $_SERVER['REQUEST_TIME_FLOAT'] ?? $this->timeCurrent();
} else {
$timeStart = $this->timeCurrent();
}
// Start counter and first lap
$this->start = $timeStart;
$this->laps[] = $timeStart;
// Log
$this->note($message, $context);
return $this;
} | php | public function start($message = 'Start', $context = [])
{
// Check if method was called only with $context
if (is_array($message)) {
$context = $message;
$message = 'Start';
}
// A profile can only be started if never started or cleared before
if ($this->isStarted()) {
throw new Exception("Profile {$this->getName()} already started.");
}
// The main profile
if (null === $this->name) {
if ($this->children) {
throw new Exception("Profile {$this->getName()} must be started before all other profiles.");
}
$timeStart = $_SERVER['REQUEST_TIME_FLOAT'] ?? $this->timeCurrent();
} else {
$timeStart = $this->timeCurrent();
}
// Start counter and first lap
$this->start = $timeStart;
$this->laps[] = $timeStart;
// Log
$this->note($message, $context);
return $this;
} | [
"public",
"function",
"start",
"(",
"$",
"message",
"=",
"'Start'",
",",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"// Check if method was called only with $context",
"if",
"(",
"is_array",
"(",
"$",
"message",
")",
")",
"{",
"$",
"context",
"=",
"$",
"mess... | Start this profile.
@param string $message [optional]
@param array $context [optional]
@return $this
@throws Exception | [
"Start",
"this",
"profile",
"."
] | 24574a1e32d5f1355a6e2b6f20f49b1eda7250ba | https://github.com/ansas/php-component/blob/24574a1e32d5f1355a6e2b6f20f49b1eda7250ba/src/Monolog/Profiler.php#L554-L585 | train |
ansas/php-component | src/Monolog/Profiler.php | Profiler.startAll | public function startAll($message = 'Start', $context = [])
{
// Start this profile if not started
if (!$this->isStarted()) {
$this->start($message, $context);
}
// Start all child profiles afterwards
foreach ($this->getProfiles() as $child) {
$child->startAll($message, $context);
}
return $this;
} | php | public function startAll($message = 'Start', $context = [])
{
// Start this profile if not started
if (!$this->isStarted()) {
$this->start($message, $context);
}
// Start all child profiles afterwards
foreach ($this->getProfiles() as $child) {
$child->startAll($message, $context);
}
return $this;
} | [
"public",
"function",
"startAll",
"(",
"$",
"message",
"=",
"'Start'",
",",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"// Start this profile if not started",
"if",
"(",
"!",
"$",
"this",
"->",
"isStarted",
"(",
")",
")",
"{",
"$",
"this",
"->",
"start",
... | Start this and all child profiles.
@param string $message [optional]
@param array $context [optional]
@return $this | [
"Start",
"this",
"and",
"all",
"child",
"profiles",
"."
] | 24574a1e32d5f1355a6e2b6f20f49b1eda7250ba | https://github.com/ansas/php-component/blob/24574a1e32d5f1355a6e2b6f20f49b1eda7250ba/src/Monolog/Profiler.php#L595-L608 | train |
ansas/php-component | src/Monolog/Profiler.php | Profiler.stop | public function stop($message = 'Stop', $context = [], $lap = true)
{
// Check if method was called only with $context
if (is_array($message)) {
$lap = $context;
$context = $message;
$message = 'Stop';
} elseif (is_bool($message)) {
$lap = $message;
$context = [];
$message = 'Stop';
} elseif (is_bool($context)) {
$lap = $context;
$context = [];
}
if (!$this->isRunning()) {
throw new Exception("Profile {$this->getName()} not running.");
}
// Skip saving and logging lap for single lap profiles
if ($lap && count($this->laps) > 1) {
$this->lap();
}
// Stop counter
$this->stop = $this->timeCurrent();
// Add total runtime to context
$context['runtime'] = $this->timeTotal();
// Log
$this->note($message, $context);
return $this;
} | php | public function stop($message = 'Stop', $context = [], $lap = true)
{
// Check if method was called only with $context
if (is_array($message)) {
$lap = $context;
$context = $message;
$message = 'Stop';
} elseif (is_bool($message)) {
$lap = $message;
$context = [];
$message = 'Stop';
} elseif (is_bool($context)) {
$lap = $context;
$context = [];
}
if (!$this->isRunning()) {
throw new Exception("Profile {$this->getName()} not running.");
}
// Skip saving and logging lap for single lap profiles
if ($lap && count($this->laps) > 1) {
$this->lap();
}
// Stop counter
$this->stop = $this->timeCurrent();
// Add total runtime to context
$context['runtime'] = $this->timeTotal();
// Log
$this->note($message, $context);
return $this;
} | [
"public",
"function",
"stop",
"(",
"$",
"message",
"=",
"'Stop'",
",",
"$",
"context",
"=",
"[",
"]",
",",
"$",
"lap",
"=",
"true",
")",
"{",
"// Check if method was called only with $context",
"if",
"(",
"is_array",
"(",
"$",
"message",
")",
")",
"{",
"... | Stop this profile.
Usage:
- <code>$profiler->stop("Msg")</code><br>
Simple message with only default context => if set via <code>context()</code>
- <code>$profiler->stop("Msg", ['key' => 'value'])</code><br>
Message and (additional) context
- <code>$profiler->stop("Msg", ['key' => 'value'], false)</code><br>
For "no lap" before stop
- <code>$profiler->stop(['key' => 'value'])</code><br>
Default message and (additional) context
- <code>$profiler->stop(['key' => 'value'], false)</code><br>
Context, but "no lap" before stop
- <code>$profiler->stop("Msg", false)</code><br>
No (additional) context and "no lap" before stop
- <code>$profiler->stop(false)</code><br>
Default message, no (additional) context and "no lap" before stop
- <code>$profiler->stop(null)</code><br>
Stop without logging
- <code>$profiler->stop(null, false)</code><br>
Stop without logging and "no lap" before stop
@param string $message [optional]
@param array $context [optional]
@param bool $lap [optional]
@return $this
@throws Exception | [
"Stop",
"this",
"profile",
"."
] | 24574a1e32d5f1355a6e2b6f20f49b1eda7250ba | https://github.com/ansas/php-component/blob/24574a1e32d5f1355a6e2b6f20f49b1eda7250ba/src/Monolog/Profiler.php#L640-L675 | train |
ansas/php-component | src/Monolog/Profiler.php | Profiler.stopAll | public function stopAll($message = 'Stop', $context = [], $lap = true)
{
// Stop all running child profiles first
foreach ($this->getProfiles(true) as $child) {
$child->stopAll($message, $context, $lap);
}
// Stop this profile if still running
if ($this->isRunning()) {
$this->stop($message, $context, $lap);
}
return $this;
} | php | public function stopAll($message = 'Stop', $context = [], $lap = true)
{
// Stop all running child profiles first
foreach ($this->getProfiles(true) as $child) {
$child->stopAll($message, $context, $lap);
}
// Stop this profile if still running
if ($this->isRunning()) {
$this->stop($message, $context, $lap);
}
return $this;
} | [
"public",
"function",
"stopAll",
"(",
"$",
"message",
"=",
"'Stop'",
",",
"$",
"context",
"=",
"[",
"]",
",",
"$",
"lap",
"=",
"true",
")",
"{",
"// Stop all running child profiles first",
"foreach",
"(",
"$",
"this",
"->",
"getProfiles",
"(",
"true",
")",... | Stop this profile and all children of this profile.
@param string $message [optional]
@param array $context [optional]
@param bool $lap [optional]
@return $this | [
"Stop",
"this",
"profile",
"and",
"all",
"children",
"of",
"this",
"profile",
"."
] | 24574a1e32d5f1355a6e2b6f20f49b1eda7250ba | https://github.com/ansas/php-component/blob/24574a1e32d5f1355a6e2b6f20f49b1eda7250ba/src/Monolog/Profiler.php#L686-L699 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.