id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
188,700 | purekid/mongodm | src/Model.php | Model.getId | public function getId()
{
$class = get_called_class();
if (isset($this->cleanData['_id'])) {
if($class::$customIdType === true) return $this->cleanData['_id'];
return new \MongoId($this->cleanData['_id']);
} elseif (isset($this->_tempId)) {
return $this-... | php | public function getId()
{
$class = get_called_class();
if (isset($this->cleanData['_id'])) {
if($class::$customIdType === true) return $this->cleanData['_id'];
return new \MongoId($this->cleanData['_id']);
} elseif (isset($this->_tempId)) {
return $this-... | [
"public",
"function",
"getId",
"(",
")",
"{",
"$",
"class",
"=",
"get_called_class",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"cleanData",
"[",
"'_id'",
"]",
")",
")",
"{",
"if",
"(",
"$",
"class",
"::",
"$",
"customIdType",
"==="... | get MongoId of this record
@return \MongoId Object | [
"get",
"MongoId",
"of",
"this",
"record"
] | 108f2e4de5e14eb07c1e2b097a2233b62b33f672 | https://github.com/purekid/mongodm/blob/108f2e4de5e14eb07c1e2b097a2233b62b33f672/src/Model.php#L219-L232 |
188,701 | purekid/mongodm | src/Model.php | Model.save | public function save($options = array())
{
if ($this->isEmbed()) {
return false;
}
$this->processReferencesChanged();
$this->processEmbedsChanged();
/* if no changes then do nothing */
if ($this->_exist && empty($this->dirtyData) && empty($this->unsetD... | php | public function save($options = array())
{
if ($this->isEmbed()) {
return false;
}
$this->processReferencesChanged();
$this->processEmbedsChanged();
/* if no changes then do nothing */
if ($this->_exist && empty($this->dirtyData) && empty($this->unsetD... | [
"public",
"function",
"save",
"(",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isEmbed",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"processReferencesChanged",
"(",
")",
";",
"$",
"this"... | Save to database
@param array $options options
@return array | [
"Save",
"to",
"database"
] | 108f2e4de5e14eb07c1e2b097a2233b62b33f672 | https://github.com/purekid/mongodm/blob/108f2e4de5e14eb07c1e2b097a2233b62b33f672/src/Model.php#L263-L312 |
188,702 | purekid/mongodm | src/Model.php | Model.toArray | public function toArray($ignore = array('_type'), $recursive = false, $deep = 3)
{
if (!empty($ignore)) {
$ignores = array();
foreach ($ignore as $val) {
$ignores[$val] = 1;
}
$ignore = $ignores;
}
if ($recursive === true && $de... | php | public function toArray($ignore = array('_type'), $recursive = false, $deep = 3)
{
if (!empty($ignore)) {
$ignores = array();
foreach ($ignore as $val) {
$ignores[$val] = 1;
}
$ignore = $ignores;
}
if ($recursive === true && $de... | [
"public",
"function",
"toArray",
"(",
"$",
"ignore",
"=",
"array",
"(",
"'_type'",
")",
",",
"$",
"recursive",
"=",
"false",
",",
"$",
"deep",
"=",
"3",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"ignore",
")",
")",
"{",
"$",
"ignores",
"=",
... | Export datas to array
@param array $ignore ignore
@param bool $recursive
@param int $deep
@return array | [
"Export",
"datas",
"to",
"array"
] | 108f2e4de5e14eb07c1e2b097a2233b62b33f672 | https://github.com/purekid/mongodm/blob/108f2e4de5e14eb07c1e2b097a2233b62b33f672/src/Model.php#L323-L369 |
188,703 | purekid/mongodm | src/Model.php | Model.id | public static function id($id)
{
$class = get_called_class();
if ($class::$customIdType !== true) {
if ($id && strlen($id) == 24 ) {
$id = new \MongoId($id);
}
}
return self::one(array("_id" => $id));
} | php | public static function id($id)
{
$class = get_called_class();
if ($class::$customIdType !== true) {
if ($id && strlen($id) == 24 ) {
$id = new \MongoId($id);
}
}
return self::one(array("_id" => $id));
} | [
"public",
"static",
"function",
"id",
"(",
"$",
"id",
")",
"{",
"$",
"class",
"=",
"get_called_class",
"(",
")",
";",
"if",
"(",
"$",
"class",
"::",
"$",
"customIdType",
"!==",
"true",
")",
"{",
"if",
"(",
"$",
"id",
"&&",
"strlen",
"(",
"$",
"id... | Retrieve a record by MongoId
@param mixed $id id
@return Model | [
"Retrieve",
"a",
"record",
"by",
"MongoId"
] | 108f2e4de5e14eb07c1e2b097a2233b62b33f672 | https://github.com/purekid/mongodm/blob/108f2e4de5e14eb07c1e2b097a2233b62b33f672/src/Model.php#L447-L459 |
188,704 | purekid/mongodm | src/Model.php | Model.one | public static function one($criteria = array(),$fields = array())
{
self::processCriteriaWithType($criteria);
$result = self::connection()->findOne(static::$collection, $criteria, self::mapFields($fields));
if ($result) {
return Hydrator::hydrate(get_called_class(), $result, H... | php | public static function one($criteria = array(),$fields = array())
{
self::processCriteriaWithType($criteria);
$result = self::connection()->findOne(static::$collection, $criteria, self::mapFields($fields));
if ($result) {
return Hydrator::hydrate(get_called_class(), $result, H... | [
"public",
"static",
"function",
"one",
"(",
"$",
"criteria",
"=",
"array",
"(",
")",
",",
"$",
"fields",
"=",
"array",
"(",
")",
")",
"{",
"self",
"::",
"processCriteriaWithType",
"(",
"$",
"criteria",
")",
";",
"$",
"result",
"=",
"self",
"::",
"con... | Retrieve a record
@param array $criteria criteria
@param array $fields fields
@return Model | [
"Retrieve",
"a",
"record"
] | 108f2e4de5e14eb07c1e2b097a2233b62b33f672 | https://github.com/purekid/mongodm/blob/108f2e4de5e14eb07c1e2b097a2233b62b33f672/src/Model.php#L469-L480 |
188,705 | purekid/mongodm | src/Model.php | Model.count | public static function count($criteria = array())
{
self::processCriteriaWithType($criteria);
$count = self::connection()->count(self::collectionName(), $criteria);
return $count;
} | php | public static function count($criteria = array())
{
self::processCriteriaWithType($criteria);
$count = self::connection()->count(self::collectionName(), $criteria);
return $count;
} | [
"public",
"static",
"function",
"count",
"(",
"$",
"criteria",
"=",
"array",
"(",
")",
")",
"{",
"self",
"::",
"processCriteriaWithType",
"(",
"$",
"criteria",
")",
";",
"$",
"count",
"=",
"self",
"::",
"connection",
"(",
")",
"->",
"count",
"(",
"self... | Count of records
@param array $criteria
@return integer | [
"Count",
"of",
"records"
] | 108f2e4de5e14eb07c1e2b097a2233b62b33f672 | https://github.com/purekid/mongodm/blob/108f2e4de5e14eb07c1e2b097a2233b62b33f672/src/Model.php#L613-L618 |
188,706 | purekid/mongodm | src/Model.php | Model.ref | public static function ref($ref)
{
if (isset($ref['$id'])) {
if ($ref['$ref'] == self::collectionName()) {
return self::id($ref['$id']);
}
}
return null;
} | php | public static function ref($ref)
{
if (isset($ref['$id'])) {
if ($ref['$ref'] == self::collectionName()) {
return self::id($ref['$id']);
}
}
return null;
} | [
"public",
"static",
"function",
"ref",
"(",
"$",
"ref",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"ref",
"[",
"'$id'",
"]",
")",
")",
"{",
"if",
"(",
"$",
"ref",
"[",
"'$ref'",
"]",
"==",
"self",
"::",
"collectionName",
"(",
")",
")",
"{",
"retur... | Retrieve a record by MongoRef
@param mixed $ref ref
@return Model | [
"Retrieve",
"a",
"record",
"by",
"MongoRef"
] | 108f2e4de5e14eb07c1e2b097a2233b62b33f672 | https://github.com/purekid/mongodm/blob/108f2e4de5e14eb07c1e2b097a2233b62b33f672/src/Model.php#L652-L661 |
188,707 | purekid/mongodm | src/Model.php | Model.setEmbed | public function setEmbed($is_embed)
{
$this->_isEmbed = $is_embed;
if ($is_embed) {
unset($this->_connection);
unset($this->_exist);
}
} | php | public function setEmbed($is_embed)
{
$this->_isEmbed = $is_embed;
if ($is_embed) {
unset($this->_connection);
unset($this->_exist);
}
} | [
"public",
"function",
"setEmbed",
"(",
"$",
"is_embed",
")",
"{",
"$",
"this",
"->",
"_isEmbed",
"=",
"$",
"is_embed",
";",
"if",
"(",
"$",
"is_embed",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"_connection",
")",
";",
"unset",
"(",
"$",
"this",
"... | Set the embed status of model.
@param bool $is_embed
@return null | [
"Set",
"the",
"embed",
"status",
"of",
"model",
"."
] | 108f2e4de5e14eb07c1e2b097a2233b62b33f672 | https://github.com/purekid/mongodm/blob/108f2e4de5e14eb07c1e2b097a2233b62b33f672/src/Model.php#L687-L694 |
188,708 | purekid/mongodm | src/Model.php | Model.initTypes | protected function initTypes()
{
$class = $this->getClassName(false);
$types = $this->getModelTypes();
$type = $this->_type;
if (!$type || !is_array($type)) {
if(!empty($types)){
$this->_type = $types;
}
} elseif (!in_array($class, $ty... | php | protected function initTypes()
{
$class = $this->getClassName(false);
$types = $this->getModelTypes();
$type = $this->_type;
if (!$type || !is_array($type)) {
if(!empty($types)){
$this->_type = $types;
}
} elseif (!in_array($class, $ty... | [
"protected",
"function",
"initTypes",
"(",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"getClassName",
"(",
"false",
")",
";",
"$",
"types",
"=",
"$",
"this",
"->",
"getModelTypes",
"(",
")",
";",
"$",
"type",
"=",
"$",
"this",
"->",
"_type",
"... | Initialize the "_type" attribute for the model
@return null | [
"Initialize",
"the",
"_type",
"attribute",
"for",
"the",
"model"
] | 108f2e4de5e14eb07c1e2b097a2233b62b33f672 | https://github.com/purekid/mongodm/blob/108f2e4de5e14eb07c1e2b097a2233b62b33f672/src/Model.php#L787-L802 |
188,709 | purekid/mongodm | src/Model.php | Model.cacheAttrsMap | protected static function cacheAttrsMap()
{
$class = get_called_class();
$attrs = $class::getAttrs();
$private = & $class::getPrivateData();
if (!isset($private['attrsMapCache'])) {
$private['attrsMapCache'] = array();
}
$cache = & $private['attrsMapCach... | php | protected static function cacheAttrsMap()
{
$class = get_called_class();
$attrs = $class::getAttrs();
$private = & $class::getPrivateData();
if (!isset($private['attrsMapCache'])) {
$private['attrsMapCache'] = array();
}
$cache = & $private['attrsMapCach... | [
"protected",
"static",
"function",
"cacheAttrsMap",
"(",
")",
"{",
"$",
"class",
"=",
"get_called_class",
"(",
")",
";",
"$",
"attrs",
"=",
"$",
"class",
"::",
"getAttrs",
"(",
")",
";",
"$",
"private",
"=",
"&",
"$",
"class",
"::",
"getPrivateData",
"... | Cache attrs map
@return null | [
"Cache",
"attrs",
"map"
] | 108f2e4de5e14eb07c1e2b097a2233b62b33f672 | https://github.com/purekid/mongodm/blob/108f2e4de5e14eb07c1e2b097a2233b62b33f672/src/Model.php#L822-L847 |
188,710 | purekid/mongodm | src/Model.php | Model.dbName | protected function dbName()
{
$dbName = "default";
$config = $this::$config;
$configs = ConnectionManager::config($config);
if ($configs) {
$dbName = $configs['connection']['database'];
}
return $dbName;
} | php | protected function dbName()
{
$dbName = "default";
$config = $this::$config;
$configs = ConnectionManager::config($config);
if ($configs) {
$dbName = $configs['connection']['database'];
}
return $dbName;
} | [
"protected",
"function",
"dbName",
"(",
")",
"{",
"$",
"dbName",
"=",
"\"default\"",
";",
"$",
"config",
"=",
"$",
"this",
"::",
"$",
"config",
";",
"$",
"configs",
"=",
"ConnectionManager",
"::",
"config",
"(",
"$",
"config",
")",
";",
"if",
"(",
"$... | Get current database name
@return string | [
"Get",
"current",
"database",
"name"
] | 108f2e4de5e14eb07c1e2b097a2233b62b33f672 | https://github.com/purekid/mongodm/blob/108f2e4de5e14eb07c1e2b097a2233b62b33f672/src/Model.php#L855-L866 |
188,711 | purekid/mongodm | src/Model.php | Model.processReferencesChanged | protected function processReferencesChanged()
{
$cache = $this->_cache;
$attrs = $this->getAttrs();
foreach ($cache as $key => $item) {
if(!isset($attrs[$key])) continue;
$attr = $attrs[$key];
if ($attr['type'] == self::DATA_TYPE_REFERENCES) {
... | php | protected function processReferencesChanged()
{
$cache = $this->_cache;
$attrs = $this->getAttrs();
foreach ($cache as $key => $item) {
if(!isset($attrs[$key])) continue;
$attr = $attrs[$key];
if ($attr['type'] == self::DATA_TYPE_REFERENCES) {
... | [
"protected",
"function",
"processReferencesChanged",
"(",
")",
"{",
"$",
"cache",
"=",
"$",
"this",
"->",
"_cache",
";",
"$",
"attrs",
"=",
"$",
"this",
"->",
"getAttrs",
"(",
")",
";",
"foreach",
"(",
"$",
"cache",
"as",
"$",
"key",
"=>",
"$",
"item... | Update the 'references' attribute for model's instance when that 'references' data has changed.
@return null | [
"Update",
"the",
"references",
"attribute",
"for",
"model",
"s",
"instance",
"when",
"that",
"references",
"data",
"has",
"changed",
"."
] | 108f2e4de5e14eb07c1e2b097a2233b62b33f672 | https://github.com/purekid/mongodm/blob/108f2e4de5e14eb07c1e2b097a2233b62b33f672/src/Model.php#L873-L886 |
188,712 | purekid/mongodm | src/Model.php | Model.processEmbedsChanged | protected function processEmbedsChanged()
{
$cache = $this->_cache;
$attrs = $this->getAttrs();
foreach ($cache as $key => $item) {
if(!isset($attrs[$key])) continue;
$attr = $attrs[$key];
if ($attr['type'] == self::DATA_TYPE_EMBED) {
$item... | php | protected function processEmbedsChanged()
{
$cache = $this->_cache;
$attrs = $this->getAttrs();
foreach ($cache as $key => $item) {
if(!isset($attrs[$key])) continue;
$attr = $attrs[$key];
if ($attr['type'] == self::DATA_TYPE_EMBED) {
$item... | [
"protected",
"function",
"processEmbedsChanged",
"(",
")",
"{",
"$",
"cache",
"=",
"$",
"this",
"->",
"_cache",
";",
"$",
"attrs",
"=",
"$",
"this",
"->",
"getAttrs",
"(",
")",
";",
"foreach",
"(",
"$",
"cache",
"as",
"$",
"key",
"=>",
"$",
"item",
... | Update the 'embeds' attribute for model's instance when that 'embeds' data has changed.
@return null | [
"Update",
"the",
"embeds",
"attribute",
"for",
"model",
"s",
"instance",
"when",
"that",
"embeds",
"data",
"has",
"changed",
"."
] | 108f2e4de5e14eb07c1e2b097a2233b62b33f672 | https://github.com/purekid/mongodm/blob/108f2e4de5e14eb07c1e2b097a2233b62b33f672/src/Model.php#L893-L911 |
188,713 | purekid/mongodm | src/Model.php | Model.fillEmbed | protected function fillEmbed($key, $value)
{
$attrs = $this->getAttrs();
$cache = &$this->_cache;
$embed = $attrs[$key];
$model = $embed['model'];
$type = $embed['type'];
if ($type == self::DATA_TYPE_EMBED) {
$model = $embed['model'];
if ($val... | php | protected function fillEmbed($key, $value)
{
$attrs = $this->getAttrs();
$cache = &$this->_cache;
$embed = $attrs[$key];
$model = $embed['model'];
$type = $embed['type'];
if ($type == self::DATA_TYPE_EMBED) {
$model = $embed['model'];
if ($val... | [
"protected",
"function",
"fillEmbed",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"attrs",
"=",
"$",
"this",
"->",
"getAttrs",
"(",
")",
";",
"$",
"cache",
"=",
"&",
"$",
"this",
"->",
"_cache",
";",
"$",
"embed",
"=",
"$",
"attrs",
"[",
... | Fill the Embed attribute.
@param string $key key
@param string $value value
@throws \Exception
@return array|null | [
"Fill",
"the",
"Embed",
"attribute",
"."
] | 108f2e4de5e14eb07c1e2b097a2233b62b33f672 | https://github.com/purekid/mongodm/blob/108f2e4de5e14eb07c1e2b097a2233b62b33f672/src/Model.php#L998-L1044 |
188,714 | purekid/mongodm | src/Model.php | Model.loadEmbed | protected function loadEmbed($key)
{
$attrs = $this->getAttrs();
$embed = $attrs[$key];
$cache = &$this->_cache;
if (isset($this->cleanData[$key])) {
$value = $this->cleanData[$key];
} else {
$value = null;
}
$model = $embed['model'];... | php | protected function loadEmbed($key)
{
$attrs = $this->getAttrs();
$embed = $attrs[$key];
$cache = &$this->_cache;
if (isset($this->cleanData[$key])) {
$value = $this->cleanData[$key];
} else {
$value = null;
}
$model = $embed['model'];... | [
"protected",
"function",
"loadEmbed",
"(",
"$",
"key",
")",
"{",
"$",
"attrs",
"=",
"$",
"this",
"->",
"getAttrs",
"(",
")",
";",
"$",
"embed",
"=",
"$",
"attrs",
"[",
"$",
"key",
"]",
";",
"$",
"cache",
"=",
"&",
"$",
"this",
"->",
"_cache",
"... | Load the embed attribute
@param string $key key
@return null | [
"Load",
"the",
"embed",
"attribute"
] | 108f2e4de5e14eb07c1e2b097a2233b62b33f672 | https://github.com/purekid/mongodm/blob/108f2e4de5e14eb07c1e2b097a2233b62b33f672/src/Model.php#L1053-L1104 |
188,715 | purekid/mongodm | src/Model.php | Model.initAttrs | protected function initAttrs()
{
$attrs = self::getAttrs();
foreach ($attrs as $key => $attr) {
if (! isset($attr['default'])) continue;
if (! isset($this->cleanData[$key])) {
$this->$key = $attr['default'];
}
}
} | php | protected function initAttrs()
{
$attrs = self::getAttrs();
foreach ($attrs as $key => $attr) {
if (! isset($attr['default'])) continue;
if (! isset($this->cleanData[$key])) {
$this->$key = $attr['default'];
}
}
} | [
"protected",
"function",
"initAttrs",
"(",
")",
"{",
"$",
"attrs",
"=",
"self",
"::",
"getAttrs",
"(",
")",
";",
"foreach",
"(",
"$",
"attrs",
"as",
"$",
"key",
"=>",
"$",
"attr",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"attr",
"[",
"'defaul... | Initialize attributes with default value
@return null | [
"Initialize",
"attributes",
"with",
"default",
"value"
] | 108f2e4de5e14eb07c1e2b097a2233b62b33f672 | https://github.com/purekid/mongodm/blob/108f2e4de5e14eb07c1e2b097a2233b62b33f672/src/Model.php#L1183-L1192 |
188,716 | purekid/mongodm | src/Model.php | Model.getModelTypes | protected static function getModelTypes()
{
$class = get_called_class();
if($class::$useType === false) {
return array();
}
$class_name = $class::getClassName(false);
$parent = get_parent_class($class);
if ($parent) {
$names_parent = $parent:... | php | protected static function getModelTypes()
{
$class = get_called_class();
if($class::$useType === false) {
return array();
}
$class_name = $class::getClassName(false);
$parent = get_parent_class($class);
if ($parent) {
$names_parent = $parent:... | [
"protected",
"static",
"function",
"getModelTypes",
"(",
")",
"{",
"$",
"class",
"=",
"get_called_class",
"(",
")",
";",
"if",
"(",
"$",
"class",
"::",
"$",
"useType",
"===",
"false",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"$",
"class_name",
... | Get types of model,type is the class_name without namespace of Model
@return array | [
"Get",
"types",
"of",
"model",
"type",
"is",
"the",
"class_name",
"without",
"namespace",
"of",
"Model"
] | 108f2e4de5e14eb07c1e2b097a2233b62b33f672 | https://github.com/purekid/mongodm/blob/108f2e4de5e14eb07c1e2b097a2233b62b33f672/src/Model.php#L1235-L1254 |
188,717 | redound/phalcon-rest | src/PhalconRest/Api/ApiResource.php | ApiResource.crud | public static function crud($prefix, $name = null)
{
return self::factory($prefix, $name)
->endpoint(ApiEndpoint::all())
->endpoint(ApiEndpoint::find())
->endpoint(ApiEndpoint::create())
->endpoint(ApiEndpoint::update())
->endpoint(ApiEndpoint::rem... | php | public static function crud($prefix, $name = null)
{
return self::factory($prefix, $name)
->endpoint(ApiEndpoint::all())
->endpoint(ApiEndpoint::find())
->endpoint(ApiEndpoint::create())
->endpoint(ApiEndpoint::update())
->endpoint(ApiEndpoint::rem... | [
"public",
"static",
"function",
"crud",
"(",
"$",
"prefix",
",",
"$",
"name",
"=",
"null",
")",
"{",
"return",
"self",
"::",
"factory",
"(",
"$",
"prefix",
",",
"$",
"name",
")",
"->",
"endpoint",
"(",
"ApiEndpoint",
"::",
"all",
"(",
")",
")",
"->... | Returns resource with default values & all, find, create, update and delete endpoints pre-configured
@param string $prefix Prefix for the resource (e.g. /user)
@param string $name Name for the resource (e.g. users) (optional)
@return static | [
"Returns",
"resource",
"with",
"default",
"values",
"&",
"all",
"find",
"create",
"update",
"and",
"delete",
"endpoints",
"pre",
"-",
"configured"
] | fe3c417d60f87190d1f51e3d3e749d86e280eb56 | https://github.com/redound/phalcon-rest/blob/fe3c417d60f87190d1f51e3d3e749d86e280eb56/src/PhalconRest/Api/ApiResource.php#L30-L38 |
188,718 | redound/phalcon-rest | src/PhalconRest/Api/ApiResource.php | ApiResource.factory | public static function factory($prefix, $name = null)
{
$calledClass = get_called_class();
/** @var \PhalconRest\Api\ApiResource $resource */
$resource = new $calledClass($prefix);
if (!$resource->getItemKey()) {
$resource->itemKey('items');
}
if (!$res... | php | public static function factory($prefix, $name = null)
{
$calledClass = get_called_class();
/** @var \PhalconRest\Api\ApiResource $resource */
$resource = new $calledClass($prefix);
if (!$resource->getItemKey()) {
$resource->itemKey('items');
}
if (!$res... | [
"public",
"static",
"function",
"factory",
"(",
"$",
"prefix",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"calledClass",
"=",
"get_called_class",
"(",
")",
";",
"/** @var \\PhalconRest\\Api\\ApiResource $resource */",
"$",
"resource",
"=",
"new",
"$",
"called... | Returns resource with default values
@param string $prefix Prefix for the resource (e.g. /user)
@param string $name Name for the resource (e.g. users) (optional)
@return static | [
"Returns",
"resource",
"with",
"default",
"values"
] | fe3c417d60f87190d1f51e3d3e749d86e280eb56 | https://github.com/redound/phalcon-rest/blob/fe3c417d60f87190d1f51e3d3e749d86e280eb56/src/PhalconRest/Api/ApiResource.php#L48-L80 |
188,719 | Okipa/laravel-toggle-switch-button | src/ToggleSwitchButton.php | ToggleSwitchButton.render | public function render()
{
return view('toggle-switch-button::components.toggle-switch-button', [
'name' => $this->name,
'checked' => $this->checked,
'icon' => $this->icon,
'label' => $this->label,
])->render();
} | php | public function render()
{
return view('toggle-switch-button::components.toggle-switch-button', [
'name' => $this->name,
'checked' => $this->checked,
'icon' => $this->icon,
'label' => $this->label,
])->render();
} | [
"public",
"function",
"render",
"(",
")",
"{",
"return",
"view",
"(",
"'toggle-switch-button::components.toggle-switch-button'",
",",
"[",
"'name'",
"=>",
"$",
"this",
"->",
"name",
",",
"'checked'",
"=>",
"$",
"this",
"->",
"checked",
",",
"'icon'",
"=>",
"$"... | Render the toggle switch button.
@return string
@throws \Throwable | [
"Render",
"the",
"toggle",
"switch",
"button",
"."
] | b7ac34ca22deabd392dfbc1615fa78b030fc6970 | https://github.com/Okipa/laravel-toggle-switch-button/blob/b7ac34ca22deabd392dfbc1615fa78b030fc6970/src/ToggleSwitchButton.php#L107-L115 |
188,720 | coolcsn/CsnUser | src/CsnUser/Entity/User.php | User.addMyFriends | public function addMyFriends(Collection $users)
{
foreach ($users as $user) {
$this->addMyFriend($user);
}
return $this;
} | php | public function addMyFriends(Collection $users)
{
foreach ($users as $user) {
$this->addMyFriend($user);
}
return $this;
} | [
"public",
"function",
"addMyFriends",
"(",
"Collection",
"$",
"users",
")",
"{",
"foreach",
"(",
"$",
"users",
"as",
"$",
"user",
")",
"{",
"$",
"this",
"->",
"addMyFriend",
"(",
"$",
"user",
")",
";",
"}",
"return",
"$",
"this",
";",
"}"
] | Add myFriends - mandatory with ManyToMany
@param Collection
@return User | [
"Add",
"myFriends",
"-",
"mandatory",
"with",
"ManyToMany"
] | c0128675cd767f599a2c193ba24220afcde04959 | https://github.com/coolcsn/CsnUser/blob/c0128675cd767f599a2c193ba24220afcde04959/src/CsnUser/Entity/User.php#L639-L646 |
188,721 | coolcsn/CsnUser | src/CsnUser/Service/Factory/ErrorViewFactory.php | ErrorViewFactory.createErrorView | public function createErrorView($errorMessage, $exception, $displayExceptions = false, $displayNavMenu = false )
{
$viewModel = new ViewModel(array(
'navMenu' => $displayNavMenu,
'display_exceptions' => $displayExceptions,
'errorMessage' => $errorMessage,
'exception' =>... | php | public function createErrorView($errorMessage, $exception, $displayExceptions = false, $displayNavMenu = false )
{
$viewModel = new ViewModel(array(
'navMenu' => $displayNavMenu,
'display_exceptions' => $displayExceptions,
'errorMessage' => $errorMessage,
'exception' =>... | [
"public",
"function",
"createErrorView",
"(",
"$",
"errorMessage",
",",
"$",
"exception",
",",
"$",
"displayExceptions",
"=",
"false",
",",
"$",
"displayNavMenu",
"=",
"false",
")",
"{",
"$",
"viewModel",
"=",
"new",
"ViewModel",
"(",
"array",
"(",
"'navMenu... | Create error view
Method to create error view to display possible exceptions
@return ViewModel | [
"Create",
"error",
"view"
] | c0128675cd767f599a2c193ba24220afcde04959 | https://github.com/coolcsn/CsnUser/blob/c0128675cd767f599a2c193ba24220afcde04959/src/CsnUser/Service/Factory/ErrorViewFactory.php#L38-L48 |
188,722 | coolcsn/CsnUser | src/CsnUser/Controller/IndexController.php | IndexController.logoutAction | public function logoutAction()
{
$auth = $this->getServiceLocator()->get('Zend\Authentication\AuthenticationService');
if ($auth->hasIdentity()) {
$auth->clearIdentity();
$sessionManager = new SessionManager();
$sessionManager->forgetMe();
}
retur... | php | public function logoutAction()
{
$auth = $this->getServiceLocator()->get('Zend\Authentication\AuthenticationService');
if ($auth->hasIdentity()) {
$auth->clearIdentity();
$sessionManager = new SessionManager();
$sessionManager->forgetMe();
}
retur... | [
"public",
"function",
"logoutAction",
"(",
")",
"{",
"$",
"auth",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'Zend\\Authentication\\AuthenticationService'",
")",
";",
"if",
"(",
"$",
"auth",
"->",
"hasIdentity",
"(",
")",
")",
... | Log out action
The method destroys session for a logged user
@return redirect to specific action | [
"Log",
"out",
"action"
] | c0128675cd767f599a2c193ba24220afcde04959 | https://github.com/coolcsn/CsnUser/blob/c0128675cd767f599a2c193ba24220afcde04959/src/CsnUser/Controller/IndexController.php#L157-L167 |
188,723 | coolcsn/CsnUser | src/CsnUser/Controller/RegistrationController.php | RegistrationController.editProfileAction | public function editProfileAction()
{
if(!$user = $this->identity()) {
return $this->redirect()->toRoute($this->getOptions()->getLoginRedirectRoute());
}
$form = $this->getUserFormHelper()->createUserForm($user, 'EditProfile');
$email = $user->getEmail();
... | php | public function editProfileAction()
{
if(!$user = $this->identity()) {
return $this->redirect()->toRoute($this->getOptions()->getLoginRedirectRoute());
}
$form = $this->getUserFormHelper()->createUserForm($user, 'EditProfile');
$email = $user->getEmail();
... | [
"public",
"function",
"editProfileAction",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"user",
"=",
"$",
"this",
"->",
"identity",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"redirect",
"(",
")",
"->",
"toRoute",
"(",
"$",
"this",
"->",
"getOptions",
... | Edit Profile Action
Displays user edit profile form
@return Zend\View\Model\ViewModel | [
"Edit",
"Profile",
"Action"
] | c0128675cd767f599a2c193ba24220afcde04959 | https://github.com/coolcsn/CsnUser/blob/c0128675cd767f599a2c193ba24220afcde04959/src/CsnUser/Controller/RegistrationController.php#L121-L156 |
188,724 | coolcsn/CsnUser | src/CsnUser/Controller/RegistrationController.php | RegistrationController.confirmEmailAction | public function confirmEmailAction()
{
$token = $this->params()->fromRoute('id');
try {
$entityManager = $this->getEntityManager();
if($token !== '' && $user = $entityManager->getRepository('CsnUser\Entity\User')->findOneBy(array('registrationToken' => $token))) {
... | php | public function confirmEmailAction()
{
$token = $this->params()->fromRoute('id');
try {
$entityManager = $this->getEntityManager();
if($token !== '' && $user = $entityManager->getRepository('CsnUser\Entity\User')->findOneBy(array('registrationToken' => $token))) {
... | [
"public",
"function",
"confirmEmailAction",
"(",
")",
"{",
"$",
"token",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'id'",
")",
";",
"try",
"{",
"$",
"entityManager",
"=",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
";",
... | Confirm Email Action
Checks for email validation through given token
@return Zend\View\Model\ViewModel | [
"Confirm",
"Email",
"Action"
] | c0128675cd767f599a2c193ba24220afcde04959 | https://github.com/coolcsn/CsnUser/blob/c0128675cd767f599a2c193ba24220afcde04959/src/CsnUser/Controller/RegistrationController.php#L351-L379 |
188,725 | coolcsn/CsnUser | src/CsnUser/Controller/RegistrationController.php | RegistrationController.confirmEmailChangePasswordAction | public function confirmEmailChangePasswordAction()
{
$token = $this->params()->fromRoute('id');
try {
$entityManager = $this->getEntityManager();
if($token !== '' && $user = $entityManager->getRepository('CsnUser\Entity\User')->findOneBy(array('registrationToken' => $token))) {
... | php | public function confirmEmailChangePasswordAction()
{
$token = $this->params()->fromRoute('id');
try {
$entityManager = $this->getEntityManager();
if($token !== '' && $user = $entityManager->getRepository('CsnUser\Entity\User')->findOneBy(array('registrationToken' => $token))) {
... | [
"public",
"function",
"confirmEmailChangePasswordAction",
"(",
")",
"{",
"$",
"token",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'id'",
")",
";",
"try",
"{",
"$",
"entityManager",
"=",
"$",
"this",
"->",
"getEntityManager",
"(",
... | Confirm Email Change Action
Confirms password change through given token
@return Zend\View\Model\ViewModel | [
"Confirm",
"Email",
"Change",
"Action"
] | c0128675cd767f599a2c193ba24220afcde04959 | https://github.com/coolcsn/CsnUser/blob/c0128675cd767f599a2c193ba24220afcde04959/src/CsnUser/Controller/RegistrationController.php#L388-L424 |
188,726 | coolcsn/CsnUser | src/CsnUser/Controller/RegistrationController.php | RegistrationController.getBaseUrl | private function getBaseUrl() {
$uri = $this->getRequest()->getUri();
return sprintf('%s://%s', $uri->getScheme(), $uri->getHost());
} | php | private function getBaseUrl() {
$uri = $this->getRequest()->getUri();
return sprintf('%s://%s', $uri->getScheme(), $uri->getHost());
} | [
"private",
"function",
"getBaseUrl",
"(",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getUri",
"(",
")",
";",
"return",
"sprintf",
"(",
"'%s://%s'",
",",
"$",
"uri",
"->",
"getScheme",
"(",
")",
",",
"$",
"uri",
"->... | Get Base Url
Get Base App Url | [
"Get",
"Base",
"Url"
] | c0128675cd767f599a2c193ba24220afcde04959 | https://github.com/coolcsn/CsnUser/blob/c0128675cd767f599a2c193ba24220afcde04959/src/CsnUser/Controller/RegistrationController.php#L516-L519 |
188,727 | cvuorinen/raspicam-php | src/Raspivid.php | Raspivid.recordVideo | public function recordVideo($filename, $length, $timeUnit = self::TIMEUNIT_SECOND)
{
if (empty($filename)) {
throw new \InvalidArgumentException('Filename required');
}
$this->valueArguments['output'] = $filename;
$this->timeout($length, $timeUnit);
$this->exec... | php | public function recordVideo($filename, $length, $timeUnit = self::TIMEUNIT_SECOND)
{
if (empty($filename)) {
throw new \InvalidArgumentException('Filename required');
}
$this->valueArguments['output'] = $filename;
$this->timeout($length, $timeUnit);
$this->exec... | [
"public",
"function",
"recordVideo",
"(",
"$",
"filename",
",",
"$",
"length",
",",
"$",
"timeUnit",
"=",
"self",
"::",
"TIMEUNIT_SECOND",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"filename",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
... | Record a video clip for the specified amount of time and save with the given filename
Time unit can be one of: `Raspicam::TIMEUNIT_MINUTE`, `Raspicam::TIMEUNIT_SECOND`,
`Raspicam::TIMEUNIT_MILLISECOND`, `Raspicam::TIMEUNIT_MICROSECOND`.
**Example:**
```php
// Record a 5s video clip with default settings (1080p30)
$ca... | [
"Record",
"a",
"video",
"clip",
"for",
"the",
"specified",
"amount",
"of",
"time",
"and",
"save",
"with",
"the",
"given",
"filename"
] | f2a43cd2b6ce8968033b86dc920c47b64da03dc6 | https://github.com/cvuorinen/raspicam-php/blob/f2a43cd2b6ce8968033b86dc920c47b64da03dc6/src/Raspivid.php#L92-L105 |
188,728 | cvuorinen/raspicam-php | src/Raspicam.php | Raspicam.flip | public function flip($value = true)
{
$this->booleanArguments['vflip'] = (bool) $value;
$this->booleanArguments['hflip'] = (bool) $value;
return $this;
} | php | public function flip($value = true)
{
$this->booleanArguments['vflip'] = (bool) $value;
$this->booleanArguments['hflip'] = (bool) $value;
return $this;
} | [
"public",
"function",
"flip",
"(",
"$",
"value",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"booleanArguments",
"[",
"'vflip'",
"]",
"=",
"(",
"bool",
")",
"$",
"value",
";",
"$",
"this",
"->",
"booleanArguments",
"[",
"'hflip'",
"]",
"=",
"(",
"bool"... | Flips the image both vertically and horizontally
@param bool $value Optional. TRUE enables flip, FALSE disables (default=TRUE)
@return $this | [
"Flips",
"the",
"image",
"both",
"vertically",
"and",
"horizontally"
] | f2a43cd2b6ce8968033b86dc920c47b64da03dc6 | https://github.com/cvuorinen/raspicam-php/blob/f2a43cd2b6ce8968033b86dc920c47b64da03dc6/src/Raspicam.php#L134-L140 |
188,729 | cvuorinen/raspicam-php | src/Raspicam.php | Raspicam.exposure | public function exposure($mode)
{
$exposureModes = [
self::EXPOSURE_AUTO,
self::EXPOSURE_NIGHT,
self::EXPOSURE_NIGHTPREVIEW,
self::EXPOSURE_BACKLIGHT,
self::EXPOSURE_SPOTLIGHT,
self::EXPOSURE_SPORTS,
self::EXPOSURE_SNOW,
... | php | public function exposure($mode)
{
$exposureModes = [
self::EXPOSURE_AUTO,
self::EXPOSURE_NIGHT,
self::EXPOSURE_NIGHTPREVIEW,
self::EXPOSURE_BACKLIGHT,
self::EXPOSURE_SPOTLIGHT,
self::EXPOSURE_SPORTS,
self::EXPOSURE_SNOW,
... | [
"public",
"function",
"exposure",
"(",
"$",
"mode",
")",
"{",
"$",
"exposureModes",
"=",
"[",
"self",
"::",
"EXPOSURE_AUTO",
",",
"self",
"::",
"EXPOSURE_NIGHT",
",",
"self",
"::",
"EXPOSURE_NIGHTPREVIEW",
",",
"self",
"::",
"EXPOSURE_BACKLIGHT",
",",
"self",
... | Set exposure mode
Possible options are:
- 'auto' `Raspicam::EXPOSURE_AUTO` Use automatic exposure mode
- 'night' `Raspicam::EXPOSURE_NIGHT` Select setting for night shooting
- 'nightpreview' `Raspicam::EXPOSURE_NIGHTPREVIEW`
- 'backlight' `Raspicam::EXPOSURE_BACKLIGHT` Select setting for back lit subject
- 'spotlight'... | [
"Set",
"exposure",
"mode"
] | f2a43cd2b6ce8968033b86dc920c47b64da03dc6 | https://github.com/cvuorinen/raspicam-php/blob/f2a43cd2b6ce8968033b86dc920c47b64da03dc6/src/Raspicam.php#L289-L311 |
188,730 | cvuorinen/raspicam-php | src/Raspicam.php | Raspicam.effect | public function effect($mode)
{
$effectModes = [
self::EFFECT_NONE,
self::EFFECT_NEGATIVE,
self::EFFECT_SOLARISE,
self::EFFECT_POSTERISE,
self::EFFECT_WHITEBOARD,
self::EFFECT_BLACKBOARD,
self::EFFECT_SKETCH,
sel... | php | public function effect($mode)
{
$effectModes = [
self::EFFECT_NONE,
self::EFFECT_NEGATIVE,
self::EFFECT_SOLARISE,
self::EFFECT_POSTERISE,
self::EFFECT_WHITEBOARD,
self::EFFECT_BLACKBOARD,
self::EFFECT_SKETCH,
sel... | [
"public",
"function",
"effect",
"(",
"$",
"mode",
")",
"{",
"$",
"effectModes",
"=",
"[",
"self",
"::",
"EFFECT_NONE",
",",
"self",
"::",
"EFFECT_NEGATIVE",
",",
"self",
"::",
"EFFECT_SOLARISE",
",",
"self",
"::",
"EFFECT_POSTERISE",
",",
"self",
"::",
"EF... | Set an effect to be applied to the image
Possible options are:
- 'none' `Raspicam::EFFECT_NONE` NO effect (default)
- 'negative' `Raspicam::EFFECT_NEGATIVE` Negate the image
- 'solarise' `Raspicam::EFFECT_SOLARISE` Solarise the image
- 'posterise' `Raspicam::EFFECT_POSTERISE` Posterise the image
- 'whiteboard' `Raspic... | [
"Set",
"an",
"effect",
"to",
"be",
"applied",
"to",
"the",
"image"
] | f2a43cd2b6ce8968033b86dc920c47b64da03dc6 | https://github.com/cvuorinen/raspicam-php/blob/f2a43cd2b6ce8968033b86dc920c47b64da03dc6/src/Raspicam.php#L389-L421 |
188,731 | cvuorinen/raspicam-php | src/Raspicam.php | Raspicam.metering | public function metering($mode)
{
$meteringModes = [
self::METERING_AVERAGE,
self::METERING_SPOT,
self::METERING_BACKLIT,
self::METERING_MATRIX,
];
$this->assertInArray($mode, $meteringModes);
$this->valueArguments['metering'] = $mode... | php | public function metering($mode)
{
$meteringModes = [
self::METERING_AVERAGE,
self::METERING_SPOT,
self::METERING_BACKLIT,
self::METERING_MATRIX,
];
$this->assertInArray($mode, $meteringModes);
$this->valueArguments['metering'] = $mode... | [
"public",
"function",
"metering",
"(",
"$",
"mode",
")",
"{",
"$",
"meteringModes",
"=",
"[",
"self",
"::",
"METERING_AVERAGE",
",",
"self",
"::",
"METERING_SPOT",
",",
"self",
"::",
"METERING_BACKLIT",
",",
"self",
"::",
"METERING_MATRIX",
",",
"]",
";",
... | Set metering mode
Possible options are:
- 'average' `Raspicam::METERING_AVERAGE` Average the whole frame for metering
- 'spot' `Raspicam::METERING_SPOT` Spot metering
- 'backlit' `Raspicam::METERING_BACKLIT` Assume a backlit image
- 'matrix' `Raspicam::METERING_MATRIX` Matrix metering
@param string $mode
@return $th... | [
"Set",
"metering",
"mode"
] | f2a43cd2b6ce8968033b86dc920c47b64da03dc6 | https://github.com/cvuorinen/raspicam-php/blob/f2a43cd2b6ce8968033b86dc920c47b64da03dc6/src/Raspicam.php#L436-L450 |
188,732 | cvuorinen/raspicam-php | src/Raspicam.php | Raspicam.rotate | public function rotate($degrees)
{
$supportedRotations = [
0,
90,
180,
270,
];
$this->assertInArray($degrees, $supportedRotations);
$this->valueArguments['rotation'] = $degrees;
return $this;
} | php | public function rotate($degrees)
{
$supportedRotations = [
0,
90,
180,
270,
];
$this->assertInArray($degrees, $supportedRotations);
$this->valueArguments['rotation'] = $degrees;
return $this;
} | [
"public",
"function",
"rotate",
"(",
"$",
"degrees",
")",
"{",
"$",
"supportedRotations",
"=",
"[",
"0",
",",
"90",
",",
"180",
",",
"270",
",",
"]",
";",
"$",
"this",
"->",
"assertInArray",
"(",
"$",
"degrees",
",",
"$",
"supportedRotations",
")",
"... | Set image rotation
Only 0, 90, 180 and 270 degree rotations are supported.
@param int $degrees Degrees
@return $this | [
"Set",
"image",
"rotation"
] | f2a43cd2b6ce8968033b86dc920c47b64da03dc6 | https://github.com/cvuorinen/raspicam-php/blob/f2a43cd2b6ce8968033b86dc920c47b64da03dc6/src/Raspicam.php#L493-L507 |
188,733 | cvuorinen/raspicam-php | src/Raspicam.php | Raspicam.shutterSpeed | public function shutterSpeed($value, $unit = self::TIMEUNIT_SECOND)
{
$this->assertPositiveNumber($value);
$this->valueArguments['shutter'] = $this->convertTimeUnit(
$value,
$unit,
self::TIMEUNIT_MICROSECOND
);
return $this;
} | php | public function shutterSpeed($value, $unit = self::TIMEUNIT_SECOND)
{
$this->assertPositiveNumber($value);
$this->valueArguments['shutter'] = $this->convertTimeUnit(
$value,
$unit,
self::TIMEUNIT_MICROSECOND
);
return $this;
} | [
"public",
"function",
"shutterSpeed",
"(",
"$",
"value",
",",
"$",
"unit",
"=",
"self",
"::",
"TIMEUNIT_SECOND",
")",
"{",
"$",
"this",
"->",
"assertPositiveNumber",
"(",
"$",
"value",
")",
";",
"$",
"this",
"->",
"valueArguments",
"[",
"'shutter'",
"]",
... | Set the shutter speed to the specified time.
There is currently an upper limit of approximately 6000000us (6000ms, 6s) past which operation is undefined.
Unit can be one of: `Raspicam::TIMEUNIT_MINUTE`, `Raspicam::TIMEUNIT_SECOND`,
`Raspicam::TIMEUNIT_MILLISECOND`, `Raspicam::TIMEUNIT_MICROSECOND`.
@param int|float $... | [
"Set",
"the",
"shutter",
"speed",
"to",
"the",
"specified",
"time",
"."
] | f2a43cd2b6ce8968033b86dc920c47b64da03dc6 | https://github.com/cvuorinen/raspicam-php/blob/f2a43cd2b6ce8968033b86dc920c47b64da03dc6/src/Raspicam.php#L521-L532 |
188,734 | cvuorinen/raspicam-php | src/Raspistill.php | Raspistill.timeout | public function timeout($value, $unit = self::TIMEUNIT_SECOND)
{
$this->assertPositiveNumber($value);
$this->valueArguments['timeout'] = $this->convertTimeUnit(
$value,
$unit,
self::TIMEUNIT_MILLISECOND
);
return $this;
} | php | public function timeout($value, $unit = self::TIMEUNIT_SECOND)
{
$this->assertPositiveNumber($value);
$this->valueArguments['timeout'] = $this->convertTimeUnit(
$value,
$unit,
self::TIMEUNIT_MILLISECOND
);
return $this;
} | [
"public",
"function",
"timeout",
"(",
"$",
"value",
",",
"$",
"unit",
"=",
"self",
"::",
"TIMEUNIT_SECOND",
")",
"{",
"$",
"this",
"->",
"assertPositiveNumber",
"(",
"$",
"value",
")",
";",
"$",
"this",
"->",
"valueArguments",
"[",
"'timeout'",
"]",
"=",... | Time before takes picture, default is 5 seconds
The camera will run for this length of time, then take the picture.
Unit can be one of: `Raspicam::TIMEUNIT_MINUTE`, `Raspicam::TIMEUNIT_SECOND`,
`Raspicam::TIMEUNIT_MILLISECOND`, `Raspicam::TIMEUNIT_MICROSECOND`.
@param int|float $value Timeout
@param string $unit ... | [
"Time",
"before",
"takes",
"picture",
"default",
"is",
"5",
"seconds"
] | f2a43cd2b6ce8968033b86dc920c47b64da03dc6 | https://github.com/cvuorinen/raspicam-php/blob/f2a43cd2b6ce8968033b86dc920c47b64da03dc6/src/Raspistill.php#L94-L105 |
188,735 | cvuorinen/raspicam-php | src/Raspistill.php | Raspistill.encoding | public function encoding($mode)
{
$encodings = [
self::ENCODING_JPG,
self::ENCODING_BMP,
self::ENCODING_GIF,
self::ENCODING_PNG,
];
$this->assertInArray($mode, $encodings);
$this->valueArguments['encoding'] = $mode;
return $t... | php | public function encoding($mode)
{
$encodings = [
self::ENCODING_JPG,
self::ENCODING_BMP,
self::ENCODING_GIF,
self::ENCODING_PNG,
];
$this->assertInArray($mode, $encodings);
$this->valueArguments['encoding'] = $mode;
return $t... | [
"public",
"function",
"encoding",
"(",
"$",
"mode",
")",
"{",
"$",
"encodings",
"=",
"[",
"self",
"::",
"ENCODING_JPG",
",",
"self",
"::",
"ENCODING_BMP",
",",
"self",
"::",
"ENCODING_GIF",
",",
"self",
"::",
"ENCODING_PNG",
",",
"]",
";",
"$",
"this",
... | Encoding to use for output file
Note that unaccelerated image types (gif, png, bmp) will take much longer to save than JPG which is hardware
accelerated. Also note that the filename suffix is completely ignored when deciding the encoding of a file.
Possible options are:
- 'jpg' `Raspicam::ENCODING_JPG` (default)
- 'b... | [
"Encoding",
"to",
"use",
"for",
"output",
"file"
] | f2a43cd2b6ce8968033b86dc920c47b64da03dc6 | https://github.com/cvuorinen/raspicam-php/blob/f2a43cd2b6ce8968033b86dc920c47b64da03dc6/src/Raspistill.php#L123-L137 |
188,736 | cvuorinen/raspicam-php | src/Raspistill.php | Raspistill.addExif | public function addExif($tagName, $value)
{
if (empty($tagName)) {
throw new \InvalidArgumentException('Tag name required');
}
if ('' === (string) $value) {
throw new \InvalidArgumentException('Non-empty value required');
}
if (!isset($this->valueArg... | php | public function addExif($tagName, $value)
{
if (empty($tagName)) {
throw new \InvalidArgumentException('Tag name required');
}
if ('' === (string) $value) {
throw new \InvalidArgumentException('Non-empty value required');
}
if (!isset($this->valueArg... | [
"public",
"function",
"addExif",
"(",
"$",
"tagName",
",",
"$",
"value",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"tagName",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Tag name required'",
")",
";",
"}",
"if",
"(",
"''",
"==... | Add EXIF tag to apply to pictures.
Allows the insertion of specific exif tags in to the JPEG image. You can have up to 32 exif tag entries.
This is useful for things like adding GPS metadata. See exif documentation for more details on the range of
tags available.
Note that a small subset of these tags will be set aut... | [
"Add",
"EXIF",
"tag",
"to",
"apply",
"to",
"pictures",
"."
] | f2a43cd2b6ce8968033b86dc920c47b64da03dc6 | https://github.com/cvuorinen/raspicam-php/blob/f2a43cd2b6ce8968033b86dc920c47b64da03dc6/src/Raspistill.php#L188-L209 |
188,737 | cvuorinen/raspicam-php | src/Raspistill.php | Raspistill.setExif | public function setExif(array $tags)
{
$this->valueArguments['exif'] = [];
foreach ($tags as $tagName => $value) {
$this->addExif($tagName, $value);
}
return $this;
} | php | public function setExif(array $tags)
{
$this->valueArguments['exif'] = [];
foreach ($tags as $tagName => $value) {
$this->addExif($tagName, $value);
}
return $this;
} | [
"public",
"function",
"setExif",
"(",
"array",
"$",
"tags",
")",
"{",
"$",
"this",
"->",
"valueArguments",
"[",
"'exif'",
"]",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"tags",
"as",
"$",
"tagName",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
... | Add multiple EXIF tags at once
**Example:**
```php
$camera->setExif([
'IFD0.Artist' => 'Boris',
'GPS.GPSAltitude' => '1235/10',
'EXIF.MakerNote' => 'Testing',
]);
```
@see Raspistill::addExif
@param array $tags Associative array where key=EXIF tag name & value=tag value
@return $this | [
"Add",
"multiple",
"EXIF",
"tags",
"at",
"once"
] | f2a43cd2b6ce8968033b86dc920c47b64da03dc6 | https://github.com/cvuorinen/raspicam-php/blob/f2a43cd2b6ce8968033b86dc920c47b64da03dc6/src/Raspistill.php#L229-L238 |
188,738 | cvuorinen/raspicam-php | src/Raspistill.php | Raspistill.takePicture | public function takePicture($filename)
{
if (empty($filename)) {
throw new \InvalidArgumentException('Filename required');
}
# TODO check filepath and create missing dirs?
$this->valueArguments['output'] = $filename;
$this->execute(
$this->buildComm... | php | public function takePicture($filename)
{
if (empty($filename)) {
throw new \InvalidArgumentException('Filename required');
}
# TODO check filepath and create missing dirs?
$this->valueArguments['output'] = $filename;
$this->execute(
$this->buildComm... | [
"public",
"function",
"takePicture",
"(",
"$",
"filename",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"filename",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Filename required'",
")",
";",
"}",
"# TODO check filepath and create missing dir... | Take a picture and save with the given filename
**Example:**
```php
// Take picture with default configurations
$camera->takePicture('pic1.jpg');
```
@param string $filename | [
"Take",
"a",
"picture",
"and",
"save",
"with",
"the",
"given",
"filename"
] | f2a43cd2b6ce8968033b86dc920c47b64da03dc6 | https://github.com/cvuorinen/raspicam-php/blob/f2a43cd2b6ce8968033b86dc920c47b64da03dc6/src/Raspistill.php#L285-L298 |
188,739 | cvuorinen/raspicam-php | src/Raspistill.php | Raspistill.startTimelapse | public function startTimelapse($filename, $interval, $length, $timeUnit = self::TIMEUNIT_SECOND)
{
if (empty($filename)) {
throw new \InvalidArgumentException('Filename required');
}
$this->valueArguments['output'] = $filename;
$this->timeout($length, $timeUnit);
... | php | public function startTimelapse($filename, $interval, $length, $timeUnit = self::TIMEUNIT_SECOND)
{
if (empty($filename)) {
throw new \InvalidArgumentException('Filename required');
}
$this->valueArguments['output'] = $filename;
$this->timeout($length, $timeUnit);
... | [
"public",
"function",
"startTimelapse",
"(",
"$",
"filename",
",",
"$",
"interval",
",",
"$",
"length",
",",
"$",
"timeUnit",
"=",
"self",
"::",
"TIMEUNIT_SECOND",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"filename",
")",
")",
"{",
"throw",
"new",
"\\",... | Take pictures with timelapse mode.
Note you should specify %04d at the point in the filename where you want a frame count number to appear.
e.g. 'image%04d.jpg'. Note that the %04d indicates a 4 digit number with leading zero's added to pad to the
required number of digits. So, for example, %08d would result in an 8 d... | [
"Take",
"pictures",
"with",
"timelapse",
"mode",
"."
] | f2a43cd2b6ce8968033b86dc920c47b64da03dc6 | https://github.com/cvuorinen/raspicam-php/blob/f2a43cd2b6ce8968033b86dc920c47b64da03dc6/src/Raspistill.php#L324-L338 |
188,740 | demisang/yii2-sitemap-generator | SitemapController.php | SitemapController.actionIndex | public function actionIndex()
{
$dataHandler = new SitemapDataHandler($this->savePathAlias, $this->sitemapFileName, [
'builderConfig' => $this->builderConfig,
]);
$models = $dataHandler->getModelsClasses($this->modelsPath, $this->modelsNamespace);
$dataHandler->handleMod... | php | public function actionIndex()
{
$dataHandler = new SitemapDataHandler($this->savePathAlias, $this->sitemapFileName, [
'builderConfig' => $this->builderConfig,
]);
$models = $dataHandler->getModelsClasses($this->modelsPath, $this->modelsNamespace);
$dataHandler->handleMod... | [
"public",
"function",
"actionIndex",
"(",
")",
"{",
"$",
"dataHandler",
"=",
"new",
"SitemapDataHandler",
"(",
"$",
"this",
"->",
"savePathAlias",
",",
"$",
"this",
"->",
"sitemapFileName",
",",
"[",
"'builderConfig'",
"=>",
"$",
"this",
"->",
"builderConfig",... | Index action for run sitemap creation | [
"Index",
"action",
"for",
"run",
"sitemap",
"creation"
] | 1cbb5d4a6d537b18d88d6b2d0e30b87c6553469b | https://github.com/demisang/yii2-sitemap-generator/blob/1cbb5d4a6d537b18d88d6b2d0e30b87c6553469b/SitemapController.php#L45-L53 |
188,741 | demisang/yii2-sitemap-generator | SitemapBuilder.php | SitemapBuilder.appendToFile | public function appendToFile($content)
{
$result = @fwrite($this->_file, $content);
if ($result === false) {
throw new Exception("I'm can not wrtite to file");
}
return $result;
} | php | public function appendToFile($content)
{
$result = @fwrite($this->_file, $content);
if ($result === false) {
throw new Exception("I'm can not wrtite to file");
}
return $result;
} | [
"public",
"function",
"appendToFile",
"(",
"$",
"content",
")",
"{",
"$",
"result",
"=",
"@",
"fwrite",
"(",
"$",
"this",
"->",
"_file",
",",
"$",
"content",
")",
";",
"if",
"(",
"$",
"result",
"===",
"false",
")",
"{",
"throw",
"new",
"Exception",
... | Append to opened file new content
@param string $content
@throws \yii\console\Exception
@return int | [
"Append",
"to",
"opened",
"file",
"new",
"content"
] | 1cbb5d4a6d537b18d88d6b2d0e30b87c6553469b | https://github.com/demisang/yii2-sitemap-generator/blob/1cbb5d4a6d537b18d88d6b2d0e30b87c6553469b/SitemapBuilder.php#L61-L70 |
188,742 | demisang/yii2-sitemap-generator | SitemapDataHandler.php | SitemapDataHandler.getModelsClasses | public function getModelsClasses($modelsPath, $modelsNamespace)
{
$path = Yii::getAlias($modelsPath);
$files = @scandir($path);
if ($files === false) {
throw new InvalidConfigException('Path to sitemap models "' . $modelsPath . '"(' .
$path . ') is incorrect');
... | php | public function getModelsClasses($modelsPath, $modelsNamespace)
{
$path = Yii::getAlias($modelsPath);
$files = @scandir($path);
if ($files === false) {
throw new InvalidConfigException('Path to sitemap models "' . $modelsPath . '"(' .
$path . ') is incorrect');
... | [
"public",
"function",
"getModelsClasses",
"(",
"$",
"modelsPath",
",",
"$",
"modelsNamespace",
")",
"{",
"$",
"path",
"=",
"Yii",
"::",
"getAlias",
"(",
"$",
"modelsPath",
")",
";",
"$",
"files",
"=",
"@",
"scandir",
"(",
"$",
"path",
")",
";",
"if",
... | Get list of sitemap model instancies
@param string $modelsPath Alias to sitemap-models dir
@param string $modelsNamespace
@throws \yii\base\InvalidConfigException
@return ActiveRecord[]|Basic[] | [
"Get",
"list",
"of",
"sitemap",
"model",
"instancies"
] | 1cbb5d4a6d537b18d88d6b2d0e30b87c6553469b | https://github.com/demisang/yii2-sitemap-generator/blob/1cbb5d4a6d537b18d88d6b2d0e30b87c6553469b/SitemapDataHandler.php#L62-L105 |
188,743 | demisang/yii2-sitemap-generator | SitemapDataHandler.php | SitemapDataHandler.handleModels | public function handleModels(array $models)
{
$builder = $this->builder;
$builder->start();
foreach ($models as $model) {
$languages = (array)(isset($model->sitemapLanguages) ? $model->sitemapLanguages : Yii::$app->language);
if (count($languages) > 1) {
... | php | public function handleModels(array $models)
{
$builder = $this->builder;
$builder->start();
foreach ($models as $model) {
$languages = (array)(isset($model->sitemapLanguages) ? $model->sitemapLanguages : Yii::$app->language);
if (count($languages) > 1) {
... | [
"public",
"function",
"handleModels",
"(",
"array",
"$",
"models",
")",
"{",
"$",
"builder",
"=",
"$",
"this",
"->",
"builder",
";",
"$",
"builder",
"->",
"start",
"(",
")",
";",
"foreach",
"(",
"$",
"models",
"as",
"$",
"model",
")",
"{",
"$",
"la... | Start sitemap generate
@param Basic[] $models | [
"Start",
"sitemap",
"generate"
] | 1cbb5d4a6d537b18d88d6b2d0e30b87c6553469b | https://github.com/demisang/yii2-sitemap-generator/blob/1cbb5d4a6d537b18d88d6b2d0e30b87c6553469b/SitemapDataHandler.php#L112-L141 |
188,744 | demisang/yii2-sitemap-generator | SitemapDataHandler.php | SitemapDataHandler.handleModel | public function handleModel(Basic $model, $lang = null)
{
// Handle links to static items
$items = $model->getSitemapItems($lang);
if (is_array($items)) {
// Foreach static model content
foreach ($items as $item) {
/* @var $item Basic|GoogleImage|Googl... | php | public function handleModel(Basic $model, $lang = null)
{
// Handle links to static items
$items = $model->getSitemapItems($lang);
if (is_array($items)) {
// Foreach static model content
foreach ($items as $item) {
/* @var $item Basic|GoogleImage|Googl... | [
"public",
"function",
"handleModel",
"(",
"Basic",
"$",
"model",
",",
"$",
"lang",
"=",
"null",
")",
"{",
"// Handle links to static items",
"$",
"items",
"=",
"$",
"model",
"->",
"getSitemapItems",
"(",
"$",
"lang",
")",
";",
"if",
"(",
"is_array",
"(",
... | Handle all model content rows
@param Basic|ActiveRecord $model
@param string|null $lang | [
"Handle",
"all",
"model",
"content",
"rows"
] | 1cbb5d4a6d537b18d88d6b2d0e30b87c6553469b | https://github.com/demisang/yii2-sitemap-generator/blob/1cbb5d4a6d537b18d88d6b2d0e30b87c6553469b/SitemapDataHandler.php#L149-L171 |
188,745 | demisang/yii2-sitemap-generator | SitemapDataHandler.php | SitemapDataHandler.handleItem | public function handleItem($item, $lang)
{
if (is_array($item)) {
$item = new SitemapArrayItem($item);
$loc = $item->getSitemapLoc();
if (empty($loc)) {
$this->printMessage('Warning: item "' . var_export($item->item, true) .
'" does not... | php | public function handleItem($item, $lang)
{
if (is_array($item)) {
$item = new SitemapArrayItem($item);
$loc = $item->getSitemapLoc();
if (empty($loc)) {
$this->printMessage('Warning: item "' . var_export($item->item, true) .
'" does not... | [
"public",
"function",
"handleItem",
"(",
"$",
"item",
",",
"$",
"lang",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"item",
")",
")",
"{",
"$",
"item",
"=",
"new",
"SitemapArrayItem",
"(",
"$",
"item",
")",
";",
"$",
"loc",
"=",
"$",
"item",
"->",... | Handle sitemap item
@param Basic|GoogleImage|GoogleAlternateLang|ActiveRecord $item
@param string $lang
@return bool | [
"Handle",
"sitemap",
"item"
] | 1cbb5d4a6d537b18d88d6b2d0e30b87c6553469b | https://github.com/demisang/yii2-sitemap-generator/blob/1cbb5d4a6d537b18d88d6b2d0e30b87c6553469b/SitemapDataHandler.php#L181-L233 |
188,746 | demisang/yii2-sitemap-generator | SitemapDataHandler.php | SitemapDataHandler.getModelBatchSize | public static function getModelBatchSize(Basic $model, $defaultValue = 10)
{
return isset($model->sitemapBatchSize) ? $model->sitemapBatchSize : $defaultValue;
} | php | public static function getModelBatchSize(Basic $model, $defaultValue = 10)
{
return isset($model->sitemapBatchSize) ? $model->sitemapBatchSize : $defaultValue;
} | [
"public",
"static",
"function",
"getModelBatchSize",
"(",
"Basic",
"$",
"model",
",",
"$",
"defaultValue",
"=",
"10",
")",
"{",
"return",
"isset",
"(",
"$",
"model",
"->",
"sitemapBatchSize",
")",
"?",
"$",
"model",
"->",
"sitemapBatchSize",
":",
"$",
"def... | Get model sitemapBatchSize attribute
@param Basic|ActiveRecord $model
@param int $defaultValue
@return int | [
"Get",
"model",
"sitemapBatchSize",
"attribute"
] | 1cbb5d4a6d537b18d88d6b2d0e30b87c6553469b | https://github.com/demisang/yii2-sitemap-generator/blob/1cbb5d4a6d537b18d88d6b2d0e30b87c6553469b/SitemapDataHandler.php#L243-L246 |
188,747 | demisang/yii2-sitemap-generator | SitemapDataHandler.php | SitemapDataHandler.printMessage | public function printMessage($text, $fg = Console::FG_YELLOW, $bg = Console::BG_BLACK)
{
if (Yii::$app instanceof \yii\console\Application && Yii::$app->controller->interactive) {
Yii::$app->controller->stdout($text . PHP_EOL, $fg, $bg);
}
} | php | public function printMessage($text, $fg = Console::FG_YELLOW, $bg = Console::BG_BLACK)
{
if (Yii::$app instanceof \yii\console\Application && Yii::$app->controller->interactive) {
Yii::$app->controller->stdout($text . PHP_EOL, $fg, $bg);
}
} | [
"public",
"function",
"printMessage",
"(",
"$",
"text",
",",
"$",
"fg",
"=",
"Console",
"::",
"FG_YELLOW",
",",
"$",
"bg",
"=",
"Console",
"::",
"BG_BLACK",
")",
"{",
"if",
"(",
"Yii",
"::",
"$",
"app",
"instanceof",
"\\",
"yii",
"\\",
"console",
"\\... | Show error in console mode
@param string $text
@param int $fg foreground
@param int $bg background | [
"Show",
"error",
"in",
"console",
"mode"
] | 1cbb5d4a6d537b18d88d6b2d0e30b87c6553469b | https://github.com/demisang/yii2-sitemap-generator/blob/1cbb5d4a6d537b18d88d6b2d0e30b87c6553469b/SitemapDataHandler.php#L292-L297 |
188,748 | demisang/yii2-sitemap-generator | SitemapDataHandler.php | SitemapDataHandler.setLanguage | public static function setLanguage($lang)
{
static::$_appLanguage = Yii::$app->language;
Yii::$app->language = $lang;
} | php | public static function setLanguage($lang)
{
static::$_appLanguage = Yii::$app->language;
Yii::$app->language = $lang;
} | [
"public",
"static",
"function",
"setLanguage",
"(",
"$",
"lang",
")",
"{",
"static",
"::",
"$",
"_appLanguage",
"=",
"Yii",
"::",
"$",
"app",
"->",
"language",
";",
"Yii",
"::",
"$",
"app",
"->",
"language",
"=",
"$",
"lang",
";",
"}"
] | Set new app language and save original language for future restore
@param string $lang | [
"Set",
"new",
"app",
"language",
"and",
"save",
"original",
"language",
"for",
"future",
"restore"
] | 1cbb5d4a6d537b18d88d6b2d0e30b87c6553469b | https://github.com/demisang/yii2-sitemap-generator/blob/1cbb5d4a6d537b18d88d6b2d0e30b87c6553469b/SitemapDataHandler.php#L304-L309 |
188,749 | collizo4sky/omnipay-2checkout | src/Message/TokenPurchaseRequest.php | TokenPurchaseRequest.getEndpoint | public function getEndpoint()
{
$endpoint = $this->getTestMode() ? $this->testEndpoint : $this->liveEndpoint;
return $endpoint . $this->getAccountNumber() . '/rs/authService';
} | php | public function getEndpoint()
{
$endpoint = $this->getTestMode() ? $this->testEndpoint : $this->liveEndpoint;
return $endpoint . $this->getAccountNumber() . '/rs/authService';
} | [
"public",
"function",
"getEndpoint",
"(",
")",
"{",
"$",
"endpoint",
"=",
"$",
"this",
"->",
"getTestMode",
"(",
")",
"?",
"$",
"this",
"->",
"testEndpoint",
":",
"$",
"this",
"->",
"liveEndpoint",
";",
"return",
"$",
"endpoint",
".",
"$",
"this",
"->"... | Build endpoint.
@return string | [
"Build",
"endpoint",
"."
] | c59b2ac8d9035019e7b23b7801badd1f6c2b044f | https://github.com/collizo4sky/omnipay-2checkout/blob/c59b2ac8d9035019e7b23b7801badd1f6c2b044f/src/Message/TokenPurchaseRequest.php#L22-L27 |
188,750 | collizo4sky/omnipay-2checkout | src/Message/NotificationResponse.php | NotificationResponse.isSuccessful | public function isSuccessful()
{
# Validate the Hash
$hashSecretWord = $this->data['secretWord']; # Input your secret word
$hashSid = $this->data['accountNumber']; #Input your seller ID (2Checkout account number)
$hashOrder = $this->data['sale_id'];
$hashInvoice = $this->data... | php | public function isSuccessful()
{
# Validate the Hash
$hashSecretWord = $this->data['secretWord']; # Input your secret word
$hashSid = $this->data['accountNumber']; #Input your seller ID (2Checkout account number)
$hashOrder = $this->data['sale_id'];
$hashInvoice = $this->data... | [
"public",
"function",
"isSuccessful",
"(",
")",
"{",
"# Validate the Hash",
"$",
"hashSecretWord",
"=",
"$",
"this",
"->",
"data",
"[",
"'secretWord'",
"]",
";",
"# Input your secret word",
"$",
"hashSid",
"=",
"$",
"this",
"->",
"data",
"[",
"'accountNumber'",
... | Is the notification harsh correct after validation? | [
"Is",
"the",
"notification",
"harsh",
"correct",
"after",
"validation?"
] | c59b2ac8d9035019e7b23b7801badd1f6c2b044f | https://github.com/collizo4sky/omnipay-2checkout/blob/c59b2ac8d9035019e7b23b7801badd1f6c2b044f/src/Message/NotificationResponse.php#L13-L23 |
188,751 | symfony-bundles/queue-bundle | DependencyInjection/Configuration.php | Configuration.addServiceSection | private function addServiceSection(ArrayNodeDefinition $node)
{
$node
->children()
->arrayNode('service')
->addDefaultsIfNotSet()
->children()
->scalarNode('class')
->defaultValue(Service\... | php | private function addServiceSection(ArrayNodeDefinition $node)
{
$node
->children()
->arrayNode('service')
->addDefaultsIfNotSet()
->children()
->scalarNode('class')
->defaultValue(Service\... | [
"private",
"function",
"addServiceSection",
"(",
"ArrayNodeDefinition",
"$",
"node",
")",
"{",
"$",
"node",
"->",
"children",
"(",
")",
"->",
"arrayNode",
"(",
"'service'",
")",
"->",
"addDefaultsIfNotSet",
"(",
")",
"->",
"children",
"(",
")",
"->",
"scalar... | Adds the sb_queue.service configuration.
@param ArrayNodeDefinition $node | [
"Adds",
"the",
"sb_queue",
".",
"service",
"configuration",
"."
] | 36aeea803359c0462237433e7f6c3187420b15ae | https://github.com/symfony-bundles/queue-bundle/blob/36aeea803359c0462237433e7f6c3187420b15ae/DependencyInjection/Configuration.php#L32-L51 |
188,752 | symfony-bundles/queue-bundle | DependencyInjection/Configuration.php | Configuration.addStoragesSection | private function addStoragesSection(ArrayNodeDefinition $node)
{
$node
->children()
->arrayNode('storages')
->addDefaultChildrenIfNoneSet('redis')
->requiresAtLeastOneElement()
->useAttributeAsKey('redis')
... | php | private function addStoragesSection(ArrayNodeDefinition $node)
{
$node
->children()
->arrayNode('storages')
->addDefaultChildrenIfNoneSet('redis')
->requiresAtLeastOneElement()
->useAttributeAsKey('redis')
... | [
"private",
"function",
"addStoragesSection",
"(",
"ArrayNodeDefinition",
"$",
"node",
")",
"{",
"$",
"node",
"->",
"children",
"(",
")",
"->",
"arrayNode",
"(",
"'storages'",
")",
"->",
"addDefaultChildrenIfNoneSet",
"(",
"'redis'",
")",
"->",
"requiresAtLeastOneE... | Adds the sb_queue.storages configuration.
@param ArrayNodeDefinition $node | [
"Adds",
"the",
"sb_queue",
".",
"storages",
"configuration",
"."
] | 36aeea803359c0462237433e7f6c3187420b15ae | https://github.com/symfony-bundles/queue-bundle/blob/36aeea803359c0462237433e7f6c3187420b15ae/DependencyInjection/Configuration.php#L78-L98 |
188,753 | JackieDo/Timezone-List | src/Jackiedo/Timezonelist/Timezonelist.php | Timezonelist.formatTimezone | protected function formatTimezone($timezone, $continent)
{
$time = new DateTime(null, new DateTimeZone($timezone));
$offset = $time->format('P');
$offset = str_replace('-', ' − ', $offset);
$offset = str_replace('+', ' + ', $offset);
$timezone = substr($timezone, ... | php | protected function formatTimezone($timezone, $continent)
{
$time = new DateTime(null, new DateTimeZone($timezone));
$offset = $time->format('P');
$offset = str_replace('-', ' − ', $offset);
$offset = str_replace('+', ' + ', $offset);
$timezone = substr($timezone, ... | [
"protected",
"function",
"formatTimezone",
"(",
"$",
"timezone",
",",
"$",
"continent",
")",
"{",
"$",
"time",
"=",
"new",
"DateTime",
"(",
"null",
",",
"new",
"DateTimeZone",
"(",
"$",
"timezone",
")",
")",
";",
"$",
"offset",
"=",
"$",
"time",
"->",
... | Format to display timezones
@param string $timezone
@param string $continent
@return string | [
"Format",
"to",
"display",
"timezones"
] | 2b787fd7975bacce52c102d8700a65526f2c807f | https://github.com/JackieDo/Timezone-List/blob/2b787fd7975bacce52c102d8700a65526f2c807f/src/Jackiedo/Timezonelist/Timezonelist.php#L55-L68 |
188,754 | JackieDo/Timezone-List | src/Jackiedo/Timezonelist/Timezonelist.php | Timezonelist.create | public function create($name, $selected='', $attr='')
{
// Attributes for select element
$attrSet = null;
if (!empty($attr)) {
if (is_array($attr)) {
foreach ($attr as $attr_name => $attr_value) {
$attrSet .= ' ' .$attr_name. '="' .$attr_value... | php | public function create($name, $selected='', $attr='')
{
// Attributes for select element
$attrSet = null;
if (!empty($attr)) {
if (is_array($attr)) {
foreach ($attr as $attr_name => $attr_value) {
$attrSet .= ' ' .$attr_name. '="' .$attr_value... | [
"public",
"function",
"create",
"(",
"$",
"name",
",",
"$",
"selected",
"=",
"''",
",",
"$",
"attr",
"=",
"''",
")",
"{",
"// Attributes for select element",
"$",
"attrSet",
"=",
"null",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"attr",
")",
")",
"{",
... | Create a GMT timezone select element for form
@param string $name
@param string $selected
@param mixed $attr
@return string | [
"Create",
"a",
"GMT",
"timezone",
"select",
"element",
"for",
"form"
] | 2b787fd7975bacce52c102d8700a65526f2c807f | https://github.com/JackieDo/Timezone-List/blob/2b787fd7975bacce52c102d8700a65526f2c807f/src/Jackiedo/Timezonelist/Timezonelist.php#L78-L128 |
188,755 | JackieDo/Timezone-List | src/Jackiedo/Timezonelist/Timezonelist.php | Timezonelist.toArray | public function toArray()
{
$list = [];
// Add popular timezones to list
foreach ($this->popularTimezones as $key => $value) {
$list['General'][$key] = $value;
}
// Add all timezone of continents to list
foreach ($this->continents as $continent => $mask)... | php | public function toArray()
{
$list = [];
// Add popular timezones to list
foreach ($this->popularTimezones as $key => $value) {
$list['General'][$key] = $value;
}
// Add all timezone of continents to list
foreach ($this->continents as $continent => $mask)... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"list",
"=",
"[",
"]",
";",
"// Add popular timezones to list",
"foreach",
"(",
"$",
"this",
"->",
"popularTimezones",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"list",
"[",
"'General'",
"]"... | Create a timezone array
@return mixed | [
"Create",
"a",
"timezone",
"array"
] | 2b787fd7975bacce52c102d8700a65526f2c807f | https://github.com/JackieDo/Timezone-List/blob/2b787fd7975bacce52c102d8700a65526f2c807f/src/Jackiedo/Timezonelist/Timezonelist.php#L135-L153 |
188,756 | pingpong-labs/menus | MenuBuilder.php | MenuBuilder.route | public function route($route, $title, $parameters = array(), $order = null, $attributes = array())
{
if (func_num_args() == 4) {
$arguments = func_get_args();
return $this->add([
'route' => [array_get($arguments, 0), array_get($arguments, 2)],
'title'... | php | public function route($route, $title, $parameters = array(), $order = null, $attributes = array())
{
if (func_num_args() == 4) {
$arguments = func_get_args();
return $this->add([
'route' => [array_get($arguments, 0), array_get($arguments, 2)],
'title'... | [
"public",
"function",
"route",
"(",
"$",
"route",
",",
"$",
"title",
",",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"$",
"order",
"=",
"null",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
"... | Register new menu item using registered route.
@param $route
@param $title
@param array $parameters
@param array $attributes
@return static | [
"Register",
"new",
"menu",
"item",
"using",
"registered",
"route",
"."
] | 2147626dcb2f6ee6707573b60ec4dfc6430d557f | https://github.com/pingpong-labs/menus/blob/2147626dcb2f6ee6707573b60ec4dfc6430d557f/MenuBuilder.php#L370-L391 |
188,757 | pingpong-labs/menus | MenuItem.php | MenuItem.route | public function route($route, $title, $parameters = array(), $order = 0, $attributes = array())
{
if (func_num_args() == 4) {
$arguments = func_get_args();
return $this->add([
'route' => [array_get($arguments, 0), array_get($arguments, 2)],
'title' =>... | php | public function route($route, $title, $parameters = array(), $order = 0, $attributes = array())
{
if (func_num_args() == 4) {
$arguments = func_get_args();
return $this->add([
'route' => [array_get($arguments, 0), array_get($arguments, 2)],
'title' =>... | [
"public",
"function",
"route",
"(",
"$",
"route",
",",
"$",
"title",
",",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"$",
"order",
"=",
"0",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
"=="... | Create new menu item and set the action to route.
@param $route
@param $title
@param array $parameters
@param array $attributes
@return array | [
"Create",
"new",
"menu",
"item",
"and",
"set",
"the",
"action",
"to",
"route",
"."
] | 2147626dcb2f6ee6707573b60ec4dfc6430d557f | https://github.com/pingpong-labs/menus/blob/2147626dcb2f6ee6707573b60ec4dfc6430d557f/MenuItem.php#L177-L192 |
188,758 | pingpong-labs/menus | MenuItem.php | MenuItem.url | public function url($url, $title, $order = 0, $attributes = array())
{
if (func_num_args() == 3) {
$arguments = func_get_args();
return $this->add([
'url' => array_get($arguments, 0),
'title' => array_get($arguments, 1),
'attributes' =... | php | public function url($url, $title, $order = 0, $attributes = array())
{
if (func_num_args() == 3) {
$arguments = func_get_args();
return $this->add([
'url' => array_get($arguments, 0),
'title' => array_get($arguments, 1),
'attributes' =... | [
"public",
"function",
"url",
"(",
"$",
"url",
",",
"$",
"title",
",",
"$",
"order",
"=",
"0",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
"==",
"3",
")",
"{",
"$",
"arguments",
"=",
"func_get_ar... | Create new menu item and set the action to url.
@param $url
@param $title
@param array $attributes
@return array | [
"Create",
"new",
"menu",
"item",
"and",
"set",
"the",
"action",
"to",
"url",
"."
] | 2147626dcb2f6ee6707573b60ec4dfc6430d557f | https://github.com/pingpong-labs/menus/blob/2147626dcb2f6ee6707573b60ec4dfc6430d557f/MenuItem.php#L203-L216 |
188,759 | pingpong-labs/menus | MenuItem.php | MenuItem.getChilds | public function getChilds()
{
if (config('menus.ordering')) {
return collect($this->childs)->sortBy(function ($child) {
return $child->order;
})->all();
}
return $this->childs;
} | php | public function getChilds()
{
if (config('menus.ordering')) {
return collect($this->childs)->sortBy(function ($child) {
return $child->order;
})->all();
}
return $this->childs;
} | [
"public",
"function",
"getChilds",
"(",
")",
"{",
"if",
"(",
"config",
"(",
"'menus.ordering'",
")",
")",
"{",
"return",
"collect",
"(",
"$",
"this",
"->",
"childs",
")",
"->",
"sortBy",
"(",
"function",
"(",
"$",
"child",
")",
"{",
"return",
"$",
"c... | Get childs.
@return array | [
"Get",
"childs",
"."
] | 2147626dcb2f6ee6707573b60ec4dfc6430d557f | https://github.com/pingpong-labs/menus/blob/2147626dcb2f6ee6707573b60ec4dfc6430d557f/MenuItem.php#L296-L305 |
188,760 | zoilomora/laravel-msaccess | src/Doctrine/DBAL/Driver/Access/AccessConnection.php | AccessConnection._pdoTransactionsSupported | private function _pdoTransactionsSupported()
{
if (!is_null($this->_pdoTransactionsSupport)) {
return $this->_pdoTransactionsSupport;
}
try {
$supported = true;
parent::beginTransaction();
} catch (\PDOException $e) {
$supported = fals... | php | private function _pdoTransactionsSupported()
{
if (!is_null($this->_pdoTransactionsSupport)) {
return $this->_pdoTransactionsSupport;
}
try {
$supported = true;
parent::beginTransaction();
} catch (\PDOException $e) {
$supported = fals... | [
"private",
"function",
"_pdoTransactionsSupported",
"(",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"_pdoTransactionsSupport",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_pdoTransactionsSupport",
";",
"}",
"try",
"{",
"$",
"supported",
"=... | Gets support for native transactions
@return bool | [
"Gets",
"support",
"for",
"native",
"transactions"
] | 7f4ca5d0377d0884f91813c8ef0c59fd817b19f8 | https://github.com/zoilomora/laravel-msaccess/blob/7f4ca5d0377d0884f91813c8ef0c59fd817b19f8/src/Doctrine/DBAL/Driver/Access/AccessConnection.php#L76-L94 |
188,761 | optimumweb/php-email-reader-parser | email_reader.php | Email_Reader.close | function close()
{
if ( $this->stream !== null && $this->stream !== false ) {
return imap_close($this->stream);
}
} | php | function close()
{
if ( $this->stream !== null && $this->stream !== false ) {
return imap_close($this->stream);
}
} | [
"function",
"close",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"stream",
"!==",
"null",
"&&",
"$",
"this",
"->",
"stream",
"!==",
"false",
")",
"{",
"return",
"imap_close",
"(",
"$",
"this",
"->",
"stream",
")",
";",
"}",
"}"
] | close the server stream | [
"close",
"the",
"server",
"stream"
] | f9ef2c52662da64a70f22eb44bbfc8ea3b1de8db | https://github.com/optimumweb/php-email-reader-parser/blob/f9ef2c52662da64a70f22eb44bbfc8ea3b1de8db/email_reader.php#L39-L44 |
188,762 | optimumweb/php-email-reader-parser | email_reader.php | Email_Reader.connect | function connect()
{
if ( $this->mailbox !== null && $this->username !== null && $this->password !== null ) {
if ( $this->stream = imap_open($this->mailbox, $this->username, $this->password) ) {
return true;
} else {
throw new Exception(sprintf("Invali... | php | function connect()
{
if ( $this->mailbox !== null && $this->username !== null && $this->password !== null ) {
if ( $this->stream = imap_open($this->mailbox, $this->username, $this->password) ) {
return true;
} else {
throw new Exception(sprintf("Invali... | [
"function",
"connect",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"mailbox",
"!==",
"null",
"&&",
"$",
"this",
"->",
"username",
"!==",
"null",
"&&",
"$",
"this",
"->",
"password",
"!==",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"stream",
... | open the server stream | [
"open",
"the",
"server",
"stream"
] | f9ef2c52662da64a70f22eb44bbfc8ea3b1de8db | https://github.com/optimumweb/php-email-reader-parser/blob/f9ef2c52662da64a70f22eb44bbfc8ea3b1de8db/email_reader.php#L47-L58 |
188,763 | optimumweb/php-email-reader-parser | email_reader.php | Email_Reader.move | function move($uid, $folder, $expunge = true)
{
if ( $this->stream !== null && $this->stream !== false ) {
$tries = 0;
while ( $tries++ < 3 ) {
if ( imap_mail_move($this->stream, $uid, $folder, CP_UID) ) {
if ( $expunge ) {
... | php | function move($uid, $folder, $expunge = true)
{
if ( $this->stream !== null && $this->stream !== false ) {
$tries = 0;
while ( $tries++ < 3 ) {
if ( imap_mail_move($this->stream, $uid, $folder, CP_UID) ) {
if ( $expunge ) {
... | [
"function",
"move",
"(",
"$",
"uid",
",",
"$",
"folder",
",",
"$",
"expunge",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"stream",
"!==",
"null",
"&&",
"$",
"this",
"->",
"stream",
"!==",
"false",
")",
"{",
"$",
"tries",
"=",
"0",
";"... | move the message to a folder | [
"move",
"the",
"message",
"to",
"a",
"folder"
] | f9ef2c52662da64a70f22eb44bbfc8ea3b1de8db | https://github.com/optimumweb/php-email-reader-parser/blob/f9ef2c52662da64a70f22eb44bbfc8ea3b1de8db/email_reader.php#L61-L81 |
188,764 | optimumweb/php-email-reader-parser | email_reader.php | Email_Reader.get_message | function get_message($uid, $raw = null)
{
if ( $this->stream !== null && $this->stream !== false ) {
if ( $raw === null ) {
$raw = $this->options['raw'];
}
$raw_header = imap_fetchheader($this->stream, $uid, FT_UID);
$raw_body = imap_body... | php | function get_message($uid, $raw = null)
{
if ( $this->stream !== null && $this->stream !== false ) {
if ( $raw === null ) {
$raw = $this->options['raw'];
}
$raw_header = imap_fetchheader($this->stream, $uid, FT_UID);
$raw_body = imap_body... | [
"function",
"get_message",
"(",
"$",
"uid",
",",
"$",
"raw",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"stream",
"!==",
"null",
"&&",
"$",
"this",
"->",
"stream",
"!==",
"false",
")",
"{",
"if",
"(",
"$",
"raw",
"===",
"null",
")",
"... | get a specific message | [
"get",
"a",
"specific",
"message"
] | f9ef2c52662da64a70f22eb44bbfc8ea3b1de8db | https://github.com/optimumweb/php-email-reader-parser/blob/f9ef2c52662da64a70f22eb44bbfc8ea3b1de8db/email_reader.php#L84-L105 |
188,765 | themsaid/laravel-routes-publisher | src/RoutesPublisherCommand.php | RoutesPublisherCommand.prepareFileContent | private function prepareFileContent($fileContent)
{
// Remove 1 line comments
$fileContent = preg_replace("#(.*)//(.*)#", " ", $fileContent);
// Remove multi-line comments
$fileContent = preg_replace("#/\*(.*)\*?/#", "", $fileContent);
// Remove all new line characters
... | php | private function prepareFileContent($fileContent)
{
// Remove 1 line comments
$fileContent = preg_replace("#(.*)//(.*)#", " ", $fileContent);
// Remove multi-line comments
$fileContent = preg_replace("#/\*(.*)\*?/#", "", $fileContent);
// Remove all new line characters
... | [
"private",
"function",
"prepareFileContent",
"(",
"$",
"fileContent",
")",
"{",
"// Remove 1 line comments",
"$",
"fileContent",
"=",
"preg_replace",
"(",
"\"#(.*)//(.*)#\"",
",",
"\" \"",
",",
"$",
"fileContent",
")",
";",
"// Remove multi-line comments",
"$",
"fileC... | Prepare file content for parsing.
@param string $fileContent
@return string | [
"Prepare",
"file",
"content",
"for",
"parsing",
"."
] | 5f7ba589c9d03a1fed02125bbe6842b40e801f7c | https://github.com/themsaid/laravel-routes-publisher/blob/5f7ba589c9d03a1fed02125bbe6842b40e801f7c/src/RoutesPublisherCommand.php#L103-L127 |
188,766 | themsaid/laravel-routes-publisher | src/RoutesPublisherCommand.php | RoutesPublisherCommand.extractController | private function extractController($path, $controller, $initialSpace = '')
{
$class = new ReflectionClass($this->controllersNamespace.'\\'.$controller);
$methods = $class->getMethods(ReflectionMethod::IS_PUBLIC);
$routables = array_filter($methods, function ($method) {
return
... | php | private function extractController($path, $controller, $initialSpace = '')
{
$class = new ReflectionClass($this->controllersNamespace.'\\'.$controller);
$methods = $class->getMethods(ReflectionMethod::IS_PUBLIC);
$routables = array_filter($methods, function ($method) {
return
... | [
"private",
"function",
"extractController",
"(",
"$",
"path",
",",
"$",
"controller",
",",
"$",
"initialSpace",
"=",
"''",
")",
"{",
"$",
"class",
"=",
"new",
"ReflectionClass",
"(",
"$",
"this",
"->",
"controllersNamespace",
".",
"'\\\\'",
".",
"$",
"cont... | Extract routes from a given controller
@param string $path
@param string $controller
@param string $initialSpace
@return string | [
"Extract",
"routes",
"from",
"a",
"given",
"controller"
] | 5f7ba589c9d03a1fed02125bbe6842b40e801f7c | https://github.com/themsaid/laravel-routes-publisher/blob/5f7ba589c9d03a1fed02125bbe6842b40e801f7c/src/RoutesPublisherCommand.php#L170-L189 |
188,767 | themsaid/laravel-routes-publisher | src/RoutesPublisherCommand.php | RoutesPublisherCommand.getWildcards | private function getWildcards(ReflectionMethod $routable)
{
$output = '';
foreach ($routable->getParameters() as $parameter) {
if ($parameter->hasType()) {
continue;
}
$wildCard = Str::snake($parameter->getName()).($parameter->isDefaultValueAvail... | php | private function getWildcards(ReflectionMethod $routable)
{
$output = '';
foreach ($routable->getParameters() as $parameter) {
if ($parameter->hasType()) {
continue;
}
$wildCard = Str::snake($parameter->getName()).($parameter->isDefaultValueAvail... | [
"private",
"function",
"getWildcards",
"(",
"ReflectionMethod",
"$",
"routable",
")",
"{",
"$",
"output",
"=",
"''",
";",
"foreach",
"(",
"$",
"routable",
"->",
"getParameters",
"(",
")",
"as",
"$",
"parameter",
")",
"{",
"if",
"(",
"$",
"parameter",
"->... | Get the wildcards string for the route URI.
@param ReflectionMethod $routable
@return string | [
"Get",
"the",
"wildcards",
"string",
"for",
"the",
"route",
"URI",
"."
] | 5f7ba589c9d03a1fed02125bbe6842b40e801f7c | https://github.com/themsaid/laravel-routes-publisher/blob/5f7ba589c9d03a1fed02125bbe6842b40e801f7c/src/RoutesPublisherCommand.php#L254-L269 |
188,768 | silverstripe/silverstripe-elemental-blocks | src/Block/FileBlock.php | FileBlock.getSummaryThumbnail | public function getSummaryThumbnail()
{
$data = [];
if ($this->File() && $this->File()->exists()) {
if ($this->File()->getIsImage()) {
// Stretch to maximum of 36px either way then trim the extra off
if ($this->File()->getOrientation() === Image_Backend::... | php | public function getSummaryThumbnail()
{
$data = [];
if ($this->File() && $this->File()->exists()) {
if ($this->File()->getIsImage()) {
// Stretch to maximum of 36px either way then trim the extra off
if ($this->File()->getOrientation() === Image_Backend::... | [
"public",
"function",
"getSummaryThumbnail",
"(",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"File",
"(",
")",
"&&",
"$",
"this",
"->",
"File",
"(",
")",
"->",
"exists",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
... | Return a thumbnail of the file, if it's an image. Used in GridField preview summaries.
@return DBHTMLText | [
"Return",
"a",
"thumbnail",
"of",
"the",
"file",
"if",
"it",
"s",
"an",
"image",
".",
"Used",
"in",
"GridField",
"preview",
"summaries",
"."
] | 6c159971897aed446b18e60ff2f34ce456c07411 | https://github.com/silverstripe/silverstripe-elemental-blocks/blob/6c159971897aed446b18e60ff2f34ce456c07411/src/Block/FileBlock.php#L47-L70 |
188,769 | rolandalla/laravelcrud | src/Commands/CrudViewCommand.php | CrudViewCommand.templateIndexVars | public function templateIndexVars($newIndexFile)
{
File::put($newIndexFile, str_replace('%%formHeadingHtml%%', $this->formHeadingHtml, File::get($newIndexFile)));
File::put($newIndexFile, str_replace('%%formBodyHtml%%', $this->formBodyHtml, File::get($newIndexFile)));
File::put($newIndexFile... | php | public function templateIndexVars($newIndexFile)
{
File::put($newIndexFile, str_replace('%%formHeadingHtml%%', $this->formHeadingHtml, File::get($newIndexFile)));
File::put($newIndexFile, str_replace('%%formBodyHtml%%', $this->formBodyHtml, File::get($newIndexFile)));
File::put($newIndexFile... | [
"public",
"function",
"templateIndexVars",
"(",
"$",
"newIndexFile",
")",
"{",
"File",
"::",
"put",
"(",
"$",
"newIndexFile",
",",
"str_replace",
"(",
"'%%formHeadingHtml%%'",
",",
"$",
"this",
"->",
"formHeadingHtml",
",",
"File",
"::",
"get",
"(",
"$",
"ne... | Update values between %% with real values in index view.
@param string $newIndexFile
@return void | [
"Update",
"values",
"between",
"%%",
"with",
"real",
"values",
"in",
"index",
"view",
"."
] | c494bb72b491dd3334fea6d6d553523a71cab2da | https://github.com/rolandalla/laravelcrud/blob/c494bb72b491dd3334fea6d6d553523a71cab2da/src/Commands/CrudViewCommand.php#L288-L296 |
188,770 | rolandalla/laravelcrud | src/Commands/CrudViewCommand.php | CrudViewCommand.templateCreateVars | public function templateCreateVars($newCreateFile)
{
File::put($newCreateFile, str_replace('%%crudName%%', $this->crudName, File::get($newCreateFile)));
File::put($newCreateFile, str_replace('%%modelName%%', $this->modelName, File::get($newCreateFile)));
File::put($newCreateFile, str_replace... | php | public function templateCreateVars($newCreateFile)
{
File::put($newCreateFile, str_replace('%%crudName%%', $this->crudName, File::get($newCreateFile)));
File::put($newCreateFile, str_replace('%%modelName%%', $this->modelName, File::get($newCreateFile)));
File::put($newCreateFile, str_replace... | [
"public",
"function",
"templateCreateVars",
"(",
"$",
"newCreateFile",
")",
"{",
"File",
"::",
"put",
"(",
"$",
"newCreateFile",
",",
"str_replace",
"(",
"'%%crudName%%'",
",",
"$",
"this",
"->",
"crudName",
",",
"File",
"::",
"get",
"(",
"$",
"newCreateFile... | Update values between %% with real values in create view.
@param string $newCreateFile
@return void | [
"Update",
"values",
"between",
"%%",
"with",
"real",
"values",
"in",
"create",
"view",
"."
] | c494bb72b491dd3334fea6d6d553523a71cab2da | https://github.com/rolandalla/laravelcrud/blob/c494bb72b491dd3334fea6d6d553523a71cab2da/src/Commands/CrudViewCommand.php#L305-L311 |
188,771 | rolandalla/laravelcrud | src/Commands/CrudViewCommand.php | CrudViewCommand.templateEditVars | public function templateEditVars($newEditFile)
{
File::put($newEditFile, str_replace('%%crudName%%', $this->crudName, File::get($newEditFile)));
File::put($newEditFile, str_replace('%%crudNameSingular%%', $this->crudNameSingular, File::get($newEditFile)));
File::put($newEditFile, str_replace... | php | public function templateEditVars($newEditFile)
{
File::put($newEditFile, str_replace('%%crudName%%', $this->crudName, File::get($newEditFile)));
File::put($newEditFile, str_replace('%%crudNameSingular%%', $this->crudNameSingular, File::get($newEditFile)));
File::put($newEditFile, str_replace... | [
"public",
"function",
"templateEditVars",
"(",
"$",
"newEditFile",
")",
"{",
"File",
"::",
"put",
"(",
"$",
"newEditFile",
",",
"str_replace",
"(",
"'%%crudName%%'",
",",
"$",
"this",
"->",
"crudName",
",",
"File",
"::",
"get",
"(",
"$",
"newEditFile",
")"... | Update values between %% with real values in edit view.
@param string $newEditFile
@return void | [
"Update",
"values",
"between",
"%%",
"with",
"real",
"values",
"in",
"edit",
"view",
"."
] | c494bb72b491dd3334fea6d6d553523a71cab2da | https://github.com/rolandalla/laravelcrud/blob/c494bb72b491dd3334fea6d6d553523a71cab2da/src/Commands/CrudViewCommand.php#L320-L327 |
188,772 | rolandalla/laravelcrud | src/Commands/CrudViewCommand.php | CrudViewCommand.templateShowVars | public function templateShowVars($newShowFile)
{
File::put($newShowFile, str_replace('%%formHeadingHtml%%', $this->formHeadingHtml, File::get($newShowFile)));
File::put($newShowFile, str_replace('%%formBodyHtml%%', $this->formBodyHtmlForShowView, File::get($newShowFile)));
File::put($newShow... | php | public function templateShowVars($newShowFile)
{
File::put($newShowFile, str_replace('%%formHeadingHtml%%', $this->formHeadingHtml, File::get($newShowFile)));
File::put($newShowFile, str_replace('%%formBodyHtml%%', $this->formBodyHtmlForShowView, File::get($newShowFile)));
File::put($newShow... | [
"public",
"function",
"templateShowVars",
"(",
"$",
"newShowFile",
")",
"{",
"File",
"::",
"put",
"(",
"$",
"newShowFile",
",",
"str_replace",
"(",
"'%%formHeadingHtml%%'",
",",
"$",
"this",
"->",
"formHeadingHtml",
",",
"File",
"::",
"get",
"(",
"$",
"newSh... | Update values between %% with real values in show view.
@param string $newShowFile
@return void | [
"Update",
"values",
"between",
"%%",
"with",
"real",
"values",
"in",
"show",
"view",
"."
] | c494bb72b491dd3334fea6d6d553523a71cab2da | https://github.com/rolandalla/laravelcrud/blob/c494bb72b491dd3334fea6d6d553523a71cab2da/src/Commands/CrudViewCommand.php#L336-L342 |
188,773 | rolandalla/laravelcrud | src/Commands/CrudViewCommand.php | CrudViewCommand.createField | protected function createField($item)
{
switch ($this->typeLookup[$item['type']]) {
case 'password':
return $this->createPasswordField($item);
break;
case 'datetime-local':
case 'time':
return $this->createInputField($item);... | php | protected function createField($item)
{
switch ($this->typeLookup[$item['type']]) {
case 'password':
return $this->createPasswordField($item);
break;
case 'datetime-local':
case 'time':
return $this->createInputField($item);... | [
"protected",
"function",
"createField",
"(",
"$",
"item",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"typeLookup",
"[",
"$",
"item",
"[",
"'type'",
"]",
"]",
")",
"{",
"case",
"'password'",
":",
"return",
"$",
"this",
"->",
"createPasswordField",
"(",
... | Form field generator.
@param string $item
@return string | [
"Form",
"field",
"generator",
"."
] | c494bb72b491dd3334fea6d6d553523a71cab2da | https://github.com/rolandalla/laravelcrud/blob/c494bb72b491dd3334fea6d6d553523a71cab2da/src/Commands/CrudViewCommand.php#L375-L391 |
188,774 | rolandalla/laravelcrud | src/Commands/CrudViewCommand.php | CrudViewCommand.createFormField | protected function createFormField($item)
{
$required = ($item['required'] === true) ? ", 'required' => 'required'" : "";
return $this->wrapField(
$item,
"{!! Form::" . $this->typeLookup[$item['type']] . "('" . $item['name'] . "', null, ['class' => 'form-control'$required]) ... | php | protected function createFormField($item)
{
$required = ($item['required'] === true) ? ", 'required' => 'required'" : "";
return $this->wrapField(
$item,
"{!! Form::" . $this->typeLookup[$item['type']] . "('" . $item['name'] . "', null, ['class' => 'form-control'$required]) ... | [
"protected",
"function",
"createFormField",
"(",
"$",
"item",
")",
"{",
"$",
"required",
"=",
"(",
"$",
"item",
"[",
"'required'",
"]",
"===",
"true",
")",
"?",
"\", 'required' => 'required'\"",
":",
"\"\"",
";",
"return",
"$",
"this",
"->",
"wrapField",
"... | Create a specific field using the form helper.
@param string $item
@return string | [
"Create",
"a",
"specific",
"field",
"using",
"the",
"form",
"helper",
"."
] | c494bb72b491dd3334fea6d6d553523a71cab2da | https://github.com/rolandalla/laravelcrud/blob/c494bb72b491dd3334fea6d6d553523a71cab2da/src/Commands/CrudViewCommand.php#L400-L408 |
188,775 | rolandalla/laravelcrud | src/Commands/CrudViewCommand.php | CrudViewCommand.createInputField | protected function createInputField($item)
{
$required = ($item['required'] === true) ? ", 'required' => 'required'" : "";
return $this->wrapField(
$item,
"{!! Form::input('" . $this->typeLookup[$item['type']] . "', '" . $item['name'] . "', null, ['class' => 'form-control'$r... | php | protected function createInputField($item)
{
$required = ($item['required'] === true) ? ", 'required' => 'required'" : "";
return $this->wrapField(
$item,
"{!! Form::input('" . $this->typeLookup[$item['type']] . "', '" . $item['name'] . "', null, ['class' => 'form-control'$r... | [
"protected",
"function",
"createInputField",
"(",
"$",
"item",
")",
"{",
"$",
"required",
"=",
"(",
"$",
"item",
"[",
"'required'",
"]",
"===",
"true",
")",
"?",
"\", 'required' => 'required'\"",
":",
"\"\"",
";",
"return",
"$",
"this",
"->",
"wrapField",
... | Create a generic input field using the form helper.
@param string $item
@return string | [
"Create",
"a",
"generic",
"input",
"field",
"using",
"the",
"form",
"helper",
"."
] | c494bb72b491dd3334fea6d6d553523a71cab2da | https://github.com/rolandalla/laravelcrud/blob/c494bb72b491dd3334fea6d6d553523a71cab2da/src/Commands/CrudViewCommand.php#L434-L442 |
188,776 | silverstripe/silverstripe-elemental-blocks | src/Form/BlockLinkField.php | BlockLinkField.setValue | public function setValue($value, $data = null)
{
$this->parsedValue = null;
return parent::setValue($value, $data);
} | php | public function setValue($value, $data = null)
{
$this->parsedValue = null;
return parent::setValue($value, $data);
} | [
"public",
"function",
"setValue",
"(",
"$",
"value",
",",
"$",
"data",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"parsedValue",
"=",
"null",
";",
"return",
"parent",
"::",
"setValue",
"(",
"$",
"value",
",",
"$",
"data",
")",
";",
"}"
] | Reset the cached parsed value when setting a new value
{@inheritDoc} | [
"Reset",
"the",
"cached",
"parsed",
"value",
"when",
"setting",
"a",
"new",
"value"
] | 6c159971897aed446b18e60ff2f34ce456c07411 | https://github.com/silverstripe/silverstripe-elemental-blocks/blob/6c159971897aed446b18e60ff2f34ce456c07411/src/Form/BlockLinkField.php#L37-L41 |
188,777 | silverstripe/silverstripe-elemental-blocks | src/Form/BlockLinkField.php | BlockLinkField.setShowLinkText | public function setShowLinkText($showLinkText)
{
$this->showLinkText = (bool) $showLinkText;
$this->setAttribute('data-showlinktext', (int) $this->showLinkText);
return $this;
} | php | public function setShowLinkText($showLinkText)
{
$this->showLinkText = (bool) $showLinkText;
$this->setAttribute('data-showlinktext', (int) $this->showLinkText);
return $this;
} | [
"public",
"function",
"setShowLinkText",
"(",
"$",
"showLinkText",
")",
"{",
"$",
"this",
"->",
"showLinkText",
"=",
"(",
"bool",
")",
"$",
"showLinkText",
";",
"$",
"this",
"->",
"setAttribute",
"(",
"'data-showlinktext'",
",",
"(",
"int",
")",
"$",
"this... | Set whether to display the link text field
@param bool $showLinkText
@return $this | [
"Set",
"whether",
"to",
"display",
"the",
"link",
"text",
"field"
] | 6c159971897aed446b18e60ff2f34ce456c07411 | https://github.com/silverstripe/silverstripe-elemental-blocks/blob/6c159971897aed446b18e60ff2f34ce456c07411/src/Form/BlockLinkField.php#L132-L139 |
188,778 | silverstripe/silverstripe-elemental-blocks | src/Block/BannerBlock.php | BannerBlock.getSummary | public function getSummary()
{
if ($this->File() && $this->File()->exists()) {
return $this->getSummaryThumbnail() . $this->dbObject('Content')->Summary(20);
}
return '';
} | php | public function getSummary()
{
if ($this->File() && $this->File()->exists()) {
return $this->getSummaryThumbnail() . $this->dbObject('Content')->Summary(20);
}
return '';
} | [
"public",
"function",
"getSummary",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"File",
"(",
")",
"&&",
"$",
"this",
"->",
"File",
"(",
")",
"->",
"exists",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getSummaryThumbnail",
"(",
")",
".",
"... | Add the banner content instead of the image title
{@inheritDoc} | [
"Add",
"the",
"banner",
"content",
"instead",
"of",
"the",
"image",
"title"
] | 6c159971897aed446b18e60ff2f34ce456c07411 | https://github.com/silverstripe/silverstripe-elemental-blocks/blob/6c159971897aed446b18e60ff2f34ce456c07411/src/Block/BannerBlock.php#L69-L75 |
188,779 | DevMarketer/LaraFlash | src/DevMarketer/LaraFlash/Notification.php | Notification.setOptions | public function setOptions($options = [], $update = false)
{
if (! $update) {
$defaults = $this->setOptionDefaults();
} else {
$defaults = $this->getOptions();
}
$options = array_intersect_key(array_filter($options), $defaults);
$options = array_merge($options, array_diff_key($defaults, $options)... | php | public function setOptions($options = [], $update = false)
{
if (! $update) {
$defaults = $this->setOptionDefaults();
} else {
$defaults = $this->getOptions();
}
$options = array_intersect_key(array_filter($options), $defaults);
$options = array_merge($options, array_diff_key($defaults, $options)... | [
"public",
"function",
"setOptions",
"(",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"update",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"update",
")",
"{",
"$",
"defaults",
"=",
"$",
"this",
"->",
"setOptionDefaults",
"(",
")",
";",
"}",
"else",
... | Set Notification options to instance.
@param array $options
@param bool $update
@return $this | [
"Set",
"Notification",
"options",
"to",
"instance",
"."
] | 9dad87b942b75b7bbda8c397cf4af5e14e6291a9 | https://github.com/DevMarketer/LaraFlash/blob/9dad87b942b75b7bbda8c397cf4af5e14e6291a9/src/DevMarketer/LaraFlash/Notification.php#L52-L66 |
188,780 | DevMarketer/LaraFlash | src/DevMarketer/LaraFlash/LaraFlash.php | LaraFlash.add | public function add($content = NULL, $options = [])
{
if (!empty($content)) $options['content'] = $content;
$this->notifications->push(new Notification($options));
return $this->flash();
} | php | public function add($content = NULL, $options = [])
{
if (!empty($content)) $options['content'] = $content;
$this->notifications->push(new Notification($options));
return $this->flash();
} | [
"public",
"function",
"add",
"(",
"$",
"content",
"=",
"NULL",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"content",
")",
")",
"$",
"options",
"[",
"'content'",
"]",
"=",
"$",
"content",
";",
"$",
"this",
"... | Add a notification to our collection.
@param string|NULL $content
@param array $options
@return $this | [
"Add",
"a",
"notification",
"to",
"our",
"collection",
"."
] | 9dad87b942b75b7bbda8c397cf4af5e14e6291a9 | https://github.com/DevMarketer/LaraFlash/blob/9dad87b942b75b7bbda8c397cf4af5e14e6291a9/src/DevMarketer/LaraFlash/LaraFlash.php#L42-L47 |
188,781 | DevMarketer/LaraFlash | src/DevMarketer/LaraFlash/LaraFlash.php | LaraFlash.typeShorthand | public function typeShorthand($type, $params = [])
{
$options = [];
$content = NULL;
$count = count($params);
if ($count < 1) {
# no params passed, set last notification type
$this->updateLastNotification(['type' => $type]);
} elseif ($count == 1) {
if (is_array($params[0])) {
# assum... | php | public function typeShorthand($type, $params = [])
{
$options = [];
$content = NULL;
$count = count($params);
if ($count < 1) {
# no params passed, set last notification type
$this->updateLastNotification(['type' => $type]);
} elseif ($count == 1) {
if (is_array($params[0])) {
# assum... | [
"public",
"function",
"typeShorthand",
"(",
"$",
"type",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"[",
"]",
";",
"$",
"content",
"=",
"NULL",
";",
"$",
"count",
"=",
"count",
"(",
"$",
"params",
")",
";",
"if",
"(",
"$"... | Set priority property for chaining notification
@param $params
@return $this | [
"Set",
"priority",
"property",
"for",
"chaining",
"notification"
] | 9dad87b942b75b7bbda8c397cf4af5e14e6291a9 | https://github.com/DevMarketer/LaraFlash/blob/9dad87b942b75b7bbda8c397cf4af5e14e6291a9/src/DevMarketer/LaraFlash/LaraFlash.php#L81-L117 |
188,782 | DevMarketer/LaraFlash | src/DevMarketer/LaraFlash/LaraFlash.php | LaraFlash.override | public function override($key = -1, $options = [])
{
if ($key >= 0) {
$notification = $this->notifications->get($key);
} else {
$notification = $this->notifications->last();
}
$notification->setOptions($options, false);
return $this->flash();
} | php | public function override($key = -1, $options = [])
{
if ($key >= 0) {
$notification = $this->notifications->get($key);
} else {
$notification = $this->notifications->last();
}
$notification->setOptions($options, false);
return $this->flash();
} | [
"public",
"function",
"override",
"(",
"$",
"key",
"=",
"-",
"1",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"key",
">=",
"0",
")",
"{",
"$",
"notification",
"=",
"$",
"this",
"->",
"notifications",
"->",
"get",
"(",
"$",
"ke... | Override a notification with a new one, instantiates new
notification and sets it equal to options
@param int $key
@param array $options
@return $this | [
"Override",
"a",
"notification",
"with",
"a",
"new",
"one",
"instantiates",
"new",
"notification",
"and",
"sets",
"it",
"equal",
"to",
"options"
] | 9dad87b942b75b7bbda8c397cf4af5e14e6291a9 | https://github.com/DevMarketer/LaraFlash/blob/9dad87b942b75b7bbda8c397cf4af5e14e6291a9/src/DevMarketer/LaraFlash/LaraFlash.php#L422-L431 |
188,783 | taq/pdooci | src/Statement.php | Statement.bindValue | public function bindValue($param, $value, $type=null)
{
$ok = false;
try {
$param = $this->_getBindVar($param);
if (PDO::PARAM_LOB == $type) {
$lob = \oci_new_descriptor($this->_con, \OCI_D_LOB);
$ok = \oci_bind_by_name($this->_stmt, $param, $... | php | public function bindValue($param, $value, $type=null)
{
$ok = false;
try {
$param = $this->_getBindVar($param);
if (PDO::PARAM_LOB == $type) {
$lob = \oci_new_descriptor($this->_con, \OCI_D_LOB);
$ok = \oci_bind_by_name($this->_stmt, $param, $... | [
"public",
"function",
"bindValue",
"(",
"$",
"param",
",",
"$",
"value",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"ok",
"=",
"false",
";",
"try",
"{",
"$",
"param",
"=",
"$",
"this",
"->",
"_getBindVar",
"(",
"$",
"param",
")",
";",
"if",
... | Binds a value
@param mixed $param param (column)
@param mixed $value value for param
@param mixed $type optional data type
@return bool bound | [
"Binds",
"a",
"value"
] | 45d2cb5791f3d374e776f5d7eb1666876e0e30d1 | https://github.com/taq/pdooci/blob/45d2cb5791f3d374e776f5d7eb1666876e0e30d1/src/Statement.php#L70-L90 |
188,784 | taq/pdooci | src/Statement.php | Statement.bindParam | public function bindParam($param, &$value, $type=null, $leng=null, $driver=null)
{
$ok = false;
try {
$param = $this->_getBindVar($param);
if ($type && $leng) {
$ok = \oci_bind_by_name($this->_stmt, $param, $value, $leng, $this->_pdoToOciType($type));
... | php | public function bindParam($param, &$value, $type=null, $leng=null, $driver=null)
{
$ok = false;
try {
$param = $this->_getBindVar($param);
if ($type && $leng) {
$ok = \oci_bind_by_name($this->_stmt, $param, $value, $leng, $this->_pdoToOciType($type));
... | [
"public",
"function",
"bindParam",
"(",
"$",
"param",
",",
"&",
"$",
"value",
",",
"$",
"type",
"=",
"null",
",",
"$",
"leng",
"=",
"null",
",",
"$",
"driver",
"=",
"null",
")",
"{",
"$",
"ok",
"=",
"false",
";",
"try",
"{",
"$",
"param",
"=",
... | Binds a param
@param mixed $param param (column)
@param mixed $value value for param
@param mixed $type optional data type
@param mixed $leng optional length
@param mixed $driver driver data
@return bool bound | [
"Binds",
"a",
"param"
] | 45d2cb5791f3d374e776f5d7eb1666876e0e30d1 | https://github.com/taq/pdooci/blob/45d2cb5791f3d374e776f5d7eb1666876e0e30d1/src/Statement.php#L103-L118 |
188,785 | taq/pdooci | src/Statement.php | Statement.rowCount | public function rowCount()
{
set_error_handler(array($this->_pdooci,"errorHandler"));
$rows = null;
try {
$rows = \oci_num_rows($this->_stmt);
} catch (\Exception $e) {
throw new \PDOException($e->getMessage());
}
restore_error_handler();
... | php | public function rowCount()
{
set_error_handler(array($this->_pdooci,"errorHandler"));
$rows = null;
try {
$rows = \oci_num_rows($this->_stmt);
} catch (\Exception $e) {
throw new \PDOException($e->getMessage());
}
restore_error_handler();
... | [
"public",
"function",
"rowCount",
"(",
")",
"{",
"set_error_handler",
"(",
"array",
"(",
"$",
"this",
"->",
"_pdooci",
",",
"\"errorHandler\"",
")",
")",
";",
"$",
"rows",
"=",
"null",
";",
"try",
"{",
"$",
"rows",
"=",
"\\",
"oci_num_rows",
"(",
"$",
... | Get the number of affected rows
@return int number of rows | [
"Get",
"the",
"number",
"of",
"affected",
"rows"
] | 45d2cb5791f3d374e776f5d7eb1666876e0e30d1 | https://github.com/taq/pdooci/blob/45d2cb5791f3d374e776f5d7eb1666876e0e30d1/src/Statement.php#L192-L203 |
188,786 | taq/pdooci | src/Statement.php | Statement.closeCursor | public function closeCursor()
{
set_error_handler(array($this->_pdooci,"errorHandler"));
try {
\oci_free_statement($this->_stmt);
} catch (\Exception $e) {
throw new \PDOException($e->getMessage());
}
restore_error_handler();
$this->_stmt = nul... | php | public function closeCursor()
{
set_error_handler(array($this->_pdooci,"errorHandler"));
try {
\oci_free_statement($this->_stmt);
} catch (\Exception $e) {
throw new \PDOException($e->getMessage());
}
restore_error_handler();
$this->_stmt = nul... | [
"public",
"function",
"closeCursor",
"(",
")",
"{",
"set_error_handler",
"(",
"array",
"(",
"$",
"this",
"->",
"_pdooci",
",",
"\"errorHandler\"",
")",
")",
";",
"try",
"{",
"\\",
"oci_free_statement",
"(",
"$",
"this",
"->",
"_stmt",
")",
";",
"}",
"cat... | Close the current cursor
@return null
@throws \PDOException | [
"Close",
"the",
"current",
"cursor"
] | 45d2cb5791f3d374e776f5d7eb1666876e0e30d1 | https://github.com/taq/pdooci/blob/45d2cb5791f3d374e776f5d7eb1666876e0e30d1/src/Statement.php#L211-L221 |
188,787 | taq/pdooci | src/Statement.php | Statement.fetch | public function fetch($style = null, $orientation = null, $offset = null)
{
set_error_handler(array($this->_pdooci,"errorHandler"));
try {
$style = is_null($style) ? $this->_fetch_sty : $style;
$this->_fetch_sty = $style;
$rst = null;
switch ($style... | php | public function fetch($style = null, $orientation = null, $offset = null)
{
set_error_handler(array($this->_pdooci,"errorHandler"));
try {
$style = is_null($style) ? $this->_fetch_sty : $style;
$this->_fetch_sty = $style;
$rst = null;
switch ($style... | [
"public",
"function",
"fetch",
"(",
"$",
"style",
"=",
"null",
",",
"$",
"orientation",
"=",
"null",
",",
"$",
"offset",
"=",
"null",
")",
"{",
"set_error_handler",
"(",
"array",
"(",
"$",
"this",
"->",
"_pdooci",
",",
"\"errorHandler\"",
")",
")",
";"... | Fetch a value
@param int $style to fetch values
@param int $orientation cursor orientation
@param int $offset offset
@return mixed
@throws \PDOException | [
"Fetch",
"a",
"value"
] | 45d2cb5791f3d374e776f5d7eb1666876e0e30d1 | https://github.com/taq/pdooci/blob/45d2cb5791f3d374e776f5d7eb1666876e0e30d1/src/Statement.php#L233-L265 |
188,788 | taq/pdooci | src/Statement.php | Statement.fetchObject | public function fetchObject($name='stdClass', $ctor_args=null)
{
try {
$data = $this->fetch(\PDO::FETCH_ASSOC);
return $this->_createObjectFromData($name, $data);
} catch (\Exception $e) {
return null;
}
} | php | public function fetchObject($name='stdClass', $ctor_args=null)
{
try {
$data = $this->fetch(\PDO::FETCH_ASSOC);
return $this->_createObjectFromData($name, $data);
} catch (\Exception $e) {
return null;
}
} | [
"public",
"function",
"fetchObject",
"(",
"$",
"name",
"=",
"'stdClass'",
",",
"$",
"ctor_args",
"=",
"null",
")",
"{",
"try",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"fetch",
"(",
"\\",
"PDO",
"::",
"FETCH_ASSOC",
")",
";",
"return",
"$",
"this",
... | Fetch data and create an object
@param string $name class name
@param mixed $ctor_args constructor args
@return mixed object | [
"Fetch",
"data",
"and",
"create",
"an",
"object"
] | 45d2cb5791f3d374e776f5d7eb1666876e0e30d1 | https://github.com/taq/pdooci/blob/45d2cb5791f3d374e776f5d7eb1666876e0e30d1/src/Statement.php#L372-L380 |
188,789 | taq/pdooci | src/Statement.php | Statement._createObjectFromData | private function _createObjectFromData($name, $data)
{
try {
$cls = new $name();
foreach ($data as $key => $value) {
if ($name !== 'stdClass' && !array_key_exists(strtolower($key), get_object_vars($cls))) {
var_dump(get_object_vars($cls));
... | php | private function _createObjectFromData($name, $data)
{
try {
$cls = new $name();
foreach ($data as $key => $value) {
if ($name !== 'stdClass' && !array_key_exists(strtolower($key), get_object_vars($cls))) {
var_dump(get_object_vars($cls));
... | [
"private",
"function",
"_createObjectFromData",
"(",
"$",
"name",
",",
"$",
"data",
")",
"{",
"try",
"{",
"$",
"cls",
"=",
"new",
"$",
"name",
"(",
")",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
... | Create a new object from data
@param string $name class name
@param mixed $data data to use on class
@return new object | [
"Create",
"a",
"new",
"object",
"from",
"data"
] | 45d2cb5791f3d374e776f5d7eb1666876e0e30d1 | https://github.com/taq/pdooci/blob/45d2cb5791f3d374e776f5d7eb1666876e0e30d1/src/Statement.php#L390-L406 |
188,790 | taq/pdooci | src/Statement.php | Statement.insertMarks | public static function insertMarks($query)
{
$pos = -1;
$regex = '/(?<!\')\?(?!\')/';
return preg_replace_callback($regex, function($matches) use (&$pos) { $pos++; return ":pdooci_m$pos"; }, $query);
} | php | public static function insertMarks($query)
{
$pos = -1;
$regex = '/(?<!\')\?(?!\')/';
return preg_replace_callback($regex, function($matches) use (&$pos) { $pos++; return ":pdooci_m$pos"; }, $query);
} | [
"public",
"static",
"function",
"insertMarks",
"(",
"$",
"query",
")",
"{",
"$",
"pos",
"=",
"-",
"1",
";",
"$",
"regex",
"=",
"'/(?<!\\')\\?(?!\\')/'",
";",
"return",
"preg_replace_callback",
"(",
"$",
"regex",
",",
"function",
"(",
"$",
"matches",
")",
... | Convert a query to use bind marks
@param string $query to insert bind marks
@return string query with bind marks | [
"Convert",
"a",
"query",
"to",
"use",
"bind",
"marks"
] | 45d2cb5791f3d374e776f5d7eb1666876e0e30d1 | https://github.com/taq/pdooci/blob/45d2cb5791f3d374e776f5d7eb1666876e0e30d1/src/Statement.php#L415-L420 |
188,791 | taq/pdooci | src/Statement.php | Statement._checkBinds | private function _checkBinds()
{
if ($this->_fetch_sty!=\PDO::FETCH_BOUND) {
return;
}
foreach ($this->_binds as $key => &$value) {
if (is_numeric($key)) {
$key --;
} else {
$key = strtoupper($key);
}
... | php | private function _checkBinds()
{
if ($this->_fetch_sty!=\PDO::FETCH_BOUND) {
return;
}
foreach ($this->_binds as $key => &$value) {
if (is_numeric($key)) {
$key --;
} else {
$key = strtoupper($key);
}
... | [
"private",
"function",
"_checkBinds",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_fetch_sty",
"!=",
"\\",
"PDO",
"::",
"FETCH_BOUND",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"_binds",
"as",
"$",
"key",
"=>",
"&",
"$",
"v... | Check what binds are needed
@return null | [
"Check",
"what",
"binds",
"are",
"needed"
] | 45d2cb5791f3d374e776f5d7eb1666876e0e30d1 | https://github.com/taq/pdooci/blob/45d2cb5791f3d374e776f5d7eb1666876e0e30d1/src/Statement.php#L488-L504 |
188,792 | taq/pdooci | src/Statement.php | Statement.debugDumpParams | public function debugDumpParams()
{
$str = "SQL: [".strlen($this->_statement)."] ".$this->_statement."\n";
$str .= "Params: ".sizeof($this->_binds)."\n";
foreach ($this->_binds as $key => $value) {
$str .= "Key: Name: [".strlen($key)."] $key\n";
$str .= "name=[".strl... | php | public function debugDumpParams()
{
$str = "SQL: [".strlen($this->_statement)."] ".$this->_statement."\n";
$str .= "Params: ".sizeof($this->_binds)."\n";
foreach ($this->_binds as $key => $value) {
$str .= "Key: Name: [".strlen($key)."] $key\n";
$str .= "name=[".strl... | [
"public",
"function",
"debugDumpParams",
"(",
")",
"{",
"$",
"str",
"=",
"\"SQL: [\"",
".",
"strlen",
"(",
"$",
"this",
"->",
"_statement",
")",
".",
"\"] \"",
".",
"$",
"this",
"->",
"_statement",
".",
"\"\\n\"",
";",
"$",
"str",
".=",
"\"Params: \"",
... | Debug dump params
@return string params | [
"Debug",
"dump",
"params"
] | 45d2cb5791f3d374e776f5d7eb1666876e0e30d1 | https://github.com/taq/pdooci/blob/45d2cb5791f3d374e776f5d7eb1666876e0e30d1/src/Statement.php#L529-L539 |
188,793 | taq/pdooci | src/Statement.php | Statement.getColumnMeta | public function getColumnMeta($colnum=0)
{
if (!$this->_stmt) {
return null;
}
$name = \oci_field_name($this->_stmt, $colnum+1);
$len = \oci_field_size($this->_stmt, $colnum+1);
$prec = \oci_field_scale($this->_stmt, $colnum+1);
$type = \oci_field_type($t... | php | public function getColumnMeta($colnum=0)
{
if (!$this->_stmt) {
return null;
}
$name = \oci_field_name($this->_stmt, $colnum+1);
$len = \oci_field_size($this->_stmt, $colnum+1);
$prec = \oci_field_scale($this->_stmt, $colnum+1);
$type = \oci_field_type($t... | [
"public",
"function",
"getColumnMeta",
"(",
"$",
"colnum",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_stmt",
")",
"{",
"return",
"null",
";",
"}",
"$",
"name",
"=",
"\\",
"oci_field_name",
"(",
"$",
"this",
"->",
"_stmt",
",",
"$",
... | Get column meta data
@param int $colnum column number
@return mixed column meta data | [
"Get",
"column",
"meta",
"data"
] | 45d2cb5791f3d374e776f5d7eb1666876e0e30d1 | https://github.com/taq/pdooci/blob/45d2cb5791f3d374e776f5d7eb1666876e0e30d1/src/Statement.php#L593-L603 |
188,794 | taq/pdooci | src/Statement.php | Statement._fixResultKeys | private function _fixResultKeys($result)
{
if (!$this->_case || $this->_case === \PDO::CASE_NATURAL) {
return $result;
}
switch($this->_case)
{
case \PDO::CASE_LOWER:
$case = CASE_LOWER;
break;
case \PDO::CASE_UPPER:
$c... | php | private function _fixResultKeys($result)
{
if (!$this->_case || $this->_case === \PDO::CASE_NATURAL) {
return $result;
}
switch($this->_case)
{
case \PDO::CASE_LOWER:
$case = CASE_LOWER;
break;
case \PDO::CASE_UPPER:
$c... | [
"private",
"function",
"_fixResultKeys",
"(",
"$",
"result",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_case",
"||",
"$",
"this",
"->",
"_case",
"===",
"\\",
"PDO",
"::",
"CASE_NATURAL",
")",
"{",
"return",
"$",
"result",
";",
"}",
"switch",
"(",... | Fix the result keys
If natural, there's no need to do something. Otherwise, change to lower
or upper case
@param mixed $result data result
@return mixed $result with the keys fixed | [
"Fix",
"the",
"result",
"keys"
] | 45d2cb5791f3d374e776f5d7eb1666876e0e30d1 | https://github.com/taq/pdooci/blob/45d2cb5791f3d374e776f5d7eb1666876e0e30d1/src/Statement.php#L625-L651 |
188,795 | taq/pdooci | src/Statement.php | Statement._pdoToOciType | private function _pdoToOciType($pdotype)
{
$ocitype = SQLT_CHR;
$pdotype = $pdotype & ~ PDO::PARAM_INPUT_OUTPUT;
switch ($pdotype) {
case PDO::PARAM_STR:
case PDO::PARAM_NULL:
$ocitype = SQLT_CHR;
break;
case PDO::PARAM_INT:
$ocit... | php | private function _pdoToOciType($pdotype)
{
$ocitype = SQLT_CHR;
$pdotype = $pdotype & ~ PDO::PARAM_INPUT_OUTPUT;
switch ($pdotype) {
case PDO::PARAM_STR:
case PDO::PARAM_NULL:
$ocitype = SQLT_CHR;
break;
case PDO::PARAM_INT:
$ocit... | [
"private",
"function",
"_pdoToOciType",
"(",
"$",
"pdotype",
")",
"{",
"$",
"ocitype",
"=",
"SQLT_CHR",
";",
"$",
"pdotype",
"=",
"$",
"pdotype",
"&",
"~",
"PDO",
"::",
"PARAM_INPUT_OUTPUT",
";",
"switch",
"(",
"$",
"pdotype",
")",
"{",
"case",
"PDO",
... | Return the correct OCI type
@param mixed $pdotype - PDO type
@author John Yendt <@normcf>
@return correc type | [
"Return",
"the",
"correct",
"OCI",
"type"
] | 45d2cb5791f3d374e776f5d7eb1666876e0e30d1 | https://github.com/taq/pdooci/blob/45d2cb5791f3d374e776f5d7eb1666876e0e30d1/src/Statement.php#L662-L686 |
188,796 | taq/pdooci | src/PDO.php | PDO.getAttribute | public function getAttribute($attr)
{
switch($attr)
{
case \PDO::ATTR_AUTOCOMMIT:
return $this->_autocommit;
case \PDO::ATTR_DRIVER_NAME:
return 'oci';
case \PDO::ATTR_CASE:
return $this->_case;
}
return null;
} | php | public function getAttribute($attr)
{
switch($attr)
{
case \PDO::ATTR_AUTOCOMMIT:
return $this->_autocommit;
case \PDO::ATTR_DRIVER_NAME:
return 'oci';
case \PDO::ATTR_CASE:
return $this->_case;
}
return null;
} | [
"public",
"function",
"getAttribute",
"(",
"$",
"attr",
")",
"{",
"switch",
"(",
"$",
"attr",
")",
"{",
"case",
"\\",
"PDO",
"::",
"ATTR_AUTOCOMMIT",
":",
"return",
"$",
"this",
"->",
"_autocommit",
";",
"case",
"\\",
"PDO",
"::",
"ATTR_DRIVER_NAME",
":"... | Return an attribute
@param int $attr attribute
@return mixed attribute value | [
"Return",
"an",
"attribute"
] | 45d2cb5791f3d374e776f5d7eb1666876e0e30d1 | https://github.com/taq/pdooci/blob/45d2cb5791f3d374e776f5d7eb1666876e0e30d1/src/PDO.php#L202-L214 |
188,797 | taq/pdooci | src/PDO.php | PDO.setError | public function setError($obj=null)
{
$obj = $obj ? $obj : $this->_con;
if (!is_resource($obj)) {
return;
}
$error = \oci_error($obj);
if (!$error) {
return null;
}
$this->_last_error = $error;
} | php | public function setError($obj=null)
{
$obj = $obj ? $obj : $this->_con;
if (!is_resource($obj)) {
return;
}
$error = \oci_error($obj);
if (!$error) {
return null;
}
$this->_last_error = $error;
} | [
"public",
"function",
"setError",
"(",
"$",
"obj",
"=",
"null",
")",
"{",
"$",
"obj",
"=",
"$",
"obj",
"?",
"$",
"obj",
":",
"$",
"this",
"->",
"_con",
";",
"if",
"(",
"!",
"is_resource",
"(",
"$",
"obj",
")",
")",
"{",
"return",
";",
"}",
"$... | Sets the last error found
@param mixed $obj optional object to extract error from
@return null | [
"Sets",
"the",
"last",
"error",
"found"
] | 45d2cb5791f3d374e776f5d7eb1666876e0e30d1 | https://github.com/taq/pdooci/blob/45d2cb5791f3d374e776f5d7eb1666876e0e30d1/src/PDO.php#L285-L296 |
188,798 | taq/pdooci | src/PDO.php | PDO.errorInfo | public function errorInfo()
{
if (!$this->_last_error) {
return null;
}
return array($this->_last_error["code"],
$this->_last_error["code"],
$this->_last_error["message"]);
} | php | public function errorInfo()
{
if (!$this->_last_error) {
return null;
}
return array($this->_last_error["code"],
$this->_last_error["code"],
$this->_last_error["message"]);
} | [
"public",
"function",
"errorInfo",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_last_error",
")",
"{",
"return",
"null",
";",
"}",
"return",
"array",
"(",
"$",
"this",
"->",
"_last_error",
"[",
"\"code\"",
"]",
",",
"$",
"this",
"->",
"_last_e... | Returns the last error info
@return array error info | [
"Returns",
"the",
"last",
"error",
"info"
] | 45d2cb5791f3d374e776f5d7eb1666876e0e30d1 | https://github.com/taq/pdooci/blob/45d2cb5791f3d374e776f5d7eb1666876e0e30d1/src/PDO.php#L316-L324 |
188,799 | taq/pdooci | src/PDO.php | PDO.errorHandler | public function errorHandler($errno, $errstr, $errfile, $errline)
{
preg_match('/(ORA-)(\d+)/', $errstr, $ora_error);
if ($ora_error) {
$this->_last_error = intval($ora_error[2]);
} else {
$this->setError($this->_con);
}
} | php | public function errorHandler($errno, $errstr, $errfile, $errline)
{
preg_match('/(ORA-)(\d+)/', $errstr, $ora_error);
if ($ora_error) {
$this->_last_error = intval($ora_error[2]);
} else {
$this->setError($this->_con);
}
} | [
"public",
"function",
"errorHandler",
"(",
"$",
"errno",
",",
"$",
"errstr",
",",
"$",
"errfile",
",",
"$",
"errline",
")",
"{",
"preg_match",
"(",
"'/(ORA-)(\\d+)/'",
",",
"$",
"errstr",
",",
"$",
"ora_error",
")",
";",
"if",
"(",
"$",
"ora_error",
")... | Trigger stupid errors who should be exceptions
@param int $errno error number
@param string $errstr error message
@param mixed $errfile error file
@param int $errline error line
@return null | [
"Trigger",
"stupid",
"errors",
"who",
"should",
"be",
"exceptions"
] | 45d2cb5791f3d374e776f5d7eb1666876e0e30d1 | https://github.com/taq/pdooci/blob/45d2cb5791f3d374e776f5d7eb1666876e0e30d1/src/PDO.php#L350-L358 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.