repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
vaibhavpandeyvpz/sandesh | src/Stream.php | Stream.tell | public function tell()
{
if (!isset($this->resource)) {
throw new \RuntimeException('Cannot determine position from detached resource');
}
$position = ftell($this->resource);
if ($position !== false) {
return $position;
}
throw new \RuntimeExce... | php | public function tell()
{
if (!isset($this->resource)) {
throw new \RuntimeException('Cannot determine position from detached resource');
}
$position = ftell($this->resource);
if ($position !== false) {
return $position;
}
throw new \RuntimeExce... | [
"public",
"function",
"tell",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"resource",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Cannot determine position from detached resource'",
")",
";",
"}",
"$",
"position",
"=",... | {@inheritdoc} | [
"{"
] | train | https://github.com/vaibhavpandeyvpz/sandesh/blob/bea2d06c7cac099ed82da973c922859de4158de0/src/Stream.php#L209-L219 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/ProjectAnalyzer.php | ProjectAnalyzer.analyze | public function analyze(ProjectDescriptor $projectDescriptor)
{
$this->unresolvedParentClassesCount = 0;
$elementCounter = array();
foreach ($this->findAllElements($projectDescriptor) as $element) {
$elementCounter = $this->addElementToCounter($elementCounter, $element);
... | php | public function analyze(ProjectDescriptor $projectDescriptor)
{
$this->unresolvedParentClassesCount = 0;
$elementCounter = array();
foreach ($this->findAllElements($projectDescriptor) as $element) {
$elementCounter = $this->addElementToCounter($elementCounter, $element);
... | [
"public",
"function",
"analyze",
"(",
"ProjectDescriptor",
"$",
"projectDescriptor",
")",
"{",
"$",
"this",
"->",
"unresolvedParentClassesCount",
"=",
"0",
";",
"$",
"elementCounter",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"findAllElem... | Analyzes the given project descriptor and populates this object's properties.
@param ProjectDescriptor $projectDescriptor
@return void | [
"Analyzes",
"the",
"given",
"project",
"descriptor",
"and",
"populates",
"this",
"object",
"s",
"properties",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/ProjectAnalyzer.php#L45-L58 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/ProjectAnalyzer.php | ProjectAnalyzer.addElementToCounter | protected function addElementToCounter($classCounters, $element)
{
if (!isset($classCounters[get_class($element)])) {
$classCounters[get_class($element)] = 0;
}
$classCounters[get_class($element)]++;
return $classCounters;
} | php | protected function addElementToCounter($classCounters, $element)
{
if (!isset($classCounters[get_class($element)])) {
$classCounters[get_class($element)] = 0;
}
$classCounters[get_class($element)]++;
return $classCounters;
} | [
"protected",
"function",
"addElementToCounter",
"(",
"$",
"classCounters",
",",
"$",
"element",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"classCounters",
"[",
"get_class",
"(",
"$",
"element",
")",
"]",
")",
")",
"{",
"$",
"classCounters",
"[",
"get_... | Increments the counter for element's class in the class counters.
@param array $classCounters
@param DescriptorAbstract $element
@return array | [
"Increments",
"the",
"counter",
"for",
"element",
"s",
"class",
"in",
"the",
"class",
"counters",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/ProjectAnalyzer.php#L94-L102 |
heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Xslt/Extension.php | Extension.path | public static function path($fqsen)
{
$projectDescriptor = self::$descriptorBuilder->getProjectDescriptor();
$elementList = $projectDescriptor->getIndexes()->get('elements');
$node = $fqsen;
if (isset($elementList[$fqsen])) {
$node = $elementList[$fqsen];
} elsei... | php | public static function path($fqsen)
{
$projectDescriptor = self::$descriptorBuilder->getProjectDescriptor();
$elementList = $projectDescriptor->getIndexes()->get('elements');
$node = $fqsen;
if (isset($elementList[$fqsen])) {
$node = $elementList[$fqsen];
} elsei... | [
"public",
"static",
"function",
"path",
"(",
"$",
"fqsen",
")",
"{",
"$",
"projectDescriptor",
"=",
"self",
"::",
"$",
"descriptorBuilder",
"->",
"getProjectDescriptor",
"(",
")",
";",
"$",
"elementList",
"=",
"$",
"projectDescriptor",
"->",
"getIndexes",
"(",... | Returns a relative URL from the webroot if the given FQSEN exists in the project.
Example usage inside template would be (where @link is an attribute called link):
```
<xsl:value-of select="php:function('phpDocumentor\Plugin\Core\Xslt\Extension::path', string(@link))" />
```
@param string $fqsen
@return bool|string | [
"Returns",
"a",
"relative",
"URL",
"from",
"the",
"webroot",
"if",
"the",
"given",
"FQSEN",
"exists",
"in",
"the",
"project",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Xslt/Extension.php#L72-L92 |
sergmoro1/yii2-lookup | src/models/Lookup.php | Lookup.items | public static function items($property, $byId = false)
{
$property_id = self::getPropertyId($property, $byId);
if(!isset(self::$_items[$property_id]))
self::loadItems($property_id);
return self::$_items[$property_id];
} | php | public static function items($property, $byId = false)
{
$property_id = self::getPropertyId($property, $byId);
if(!isset(self::$_items[$property_id]))
self::loadItems($property_id);
return self::$_items[$property_id];
} | [
"public",
"static",
"function",
"items",
"(",
"$",
"property",
",",
"$",
"byId",
"=",
"false",
")",
"{",
"$",
"property_id",
"=",
"self",
"::",
"getPropertyId",
"(",
"$",
"property",
",",
"$",
"byId",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"self",
... | Returns the items for the specified type.
@param string | integer property name or ID
@return array item names indexed by item code. The items are order by their position values.
@param boolean slug or integer ID
An empty array is returned if the item type does not exist. | [
"Returns",
"the",
"items",
"for",
"the",
"specified",
"type",
"."
] | train | https://github.com/sergmoro1/yii2-lookup/blob/deff08a2612b3c54d313a6c60a74fcaae1193b21/src/models/Lookup.php#L43-L49 |
sergmoro1/yii2-lookup | src/models/Lookup.php | Lookup.item | public static function item($property, $code, $byId = false)
{
$property_id = self::getPropertyId($property, $byId);
if(!isset(self::$_items[$property_id]))
self::loadItems($property_id);
return isset(self::$_items[$property_id][$code]) ? self::$_items[$property_id][$code] : false;
} | php | public static function item($property, $code, $byId = false)
{
$property_id = self::getPropertyId($property, $byId);
if(!isset(self::$_items[$property_id]))
self::loadItems($property_id);
return isset(self::$_items[$property_id][$code]) ? self::$_items[$property_id][$code] : false;
} | [
"public",
"static",
"function",
"item",
"(",
"$",
"property",
",",
"$",
"code",
",",
"$",
"byId",
"=",
"false",
")",
"{",
"$",
"property_id",
"=",
"self",
"::",
"getPropertyId",
"(",
"$",
"property",
",",
"$",
"byId",
")",
";",
"if",
"(",
"!",
"iss... | Returns the item name for the specified property and code.
@param string | integer property name or ID
@param integer the item code (corresponding to the 'code' column value)
@param boolean slug or integer ID
@return string the item name for the specified the code. False is returned if the item type or code does not ex... | [
"Returns",
"the",
"item",
"name",
"for",
"the",
"specified",
"property",
"and",
"code",
"."
] | train | https://github.com/sergmoro1/yii2-lookup/blob/deff08a2612b3c54d313a6c60a74fcaae1193b21/src/models/Lookup.php#L58-L64 |
sergmoro1/yii2-lookup | src/models/Lookup.php | Lookup.loadItems | private static function loadItems($property_id)
{
self::$_items[$property_id] = [];
$models = static::find()
->where('property_id=:property_id', [':property_id' => $property_id])
->orderBy('position')
->all();
foreach($models as $model)
self::$_items[$property_id][$model->code] = $model->name;
} | php | private static function loadItems($property_id)
{
self::$_items[$property_id] = [];
$models = static::find()
->where('property_id=:property_id', [':property_id' => $property_id])
->orderBy('position')
->all();
foreach($models as $model)
self::$_items[$property_id][$model->code] = $model->name;
} | [
"private",
"static",
"function",
"loadItems",
"(",
"$",
"property_id",
")",
"{",
"self",
"::",
"$",
"_items",
"[",
"$",
"property_id",
"]",
"=",
"[",
"]",
";",
"$",
"models",
"=",
"static",
"::",
"find",
"(",
")",
"->",
"where",
"(",
"'property_id=:pro... | Loads the lookup items for the specified property ID.
@param string the item type | [
"Loads",
"the",
"lookup",
"items",
"for",
"the",
"specified",
"property",
"ID",
"."
] | train | https://github.com/sergmoro1/yii2-lookup/blob/deff08a2612b3c54d313a6c60a74fcaae1193b21/src/models/Lookup.php#L74-L83 |
thienhungho/yii2-product-management | src/modules/ProductManage/controllers/ProductController.php | ProductController.actionCreate | public function actionCreate($slug = 'product')
{
if (!is_product_type_slug($slug)) {
throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
}
$product_type = ProductType::find()
->where(['slug' => $slug])
->one();
... | php | public function actionCreate($slug = 'product')
{
if (!is_product_type_slug($slug)) {
throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
}
$product_type = ProductType::find()
->where(['slug' => $slug])
->one();
... | [
"public",
"function",
"actionCreate",
"(",
"$",
"slug",
"=",
"'product'",
")",
"{",
"if",
"(",
"!",
"is_product_type_slug",
"(",
"$",
"slug",
")",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
"t",
"(",
"'app'",
",",
"'The requested page does not exi... | @param string $slug
@return string|\yii\web\Response
@throws NotFoundHttpException
@throws \yii\db\Exception | [
"@param",
"string",
"$slug"
] | train | https://github.com/thienhungho/yii2-product-management/blob/72e1237bba123faf671e44491bd93077b50adde9/src/modules/ProductManage/controllers/ProductController.php#L89-L127 |
thienhungho/yii2-product-management | src/modules/ProductManage/controllers/ProductController.php | ProductController.actionUpdate | public function actionUpdate($id)
{
if (request()->post('_asnew') == '1') {
$model = new Product();
} else {
$model = $this->findModel($id);
}
if ($model->loadAll(request()->post())) {
if ($model->saveAll()) {
set_flash_has... | php | public function actionUpdate($id)
{
if (request()->post('_asnew') == '1') {
$model = new Product();
} else {
$model = $this->findModel($id);
}
if ($model->loadAll(request()->post())) {
if ($model->saveAll()) {
set_flash_has... | [
"public",
"function",
"actionUpdate",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"request",
"(",
")",
"->",
"post",
"(",
"'_asnew'",
")",
"==",
"'1'",
")",
"{",
"$",
"model",
"=",
"new",
"Product",
"(",
")",
";",
"}",
"else",
"{",
"$",
"model",
"=",
... | @param $id
@return string
@throws NotFoundHttpException
@throws \yii\db\Exception | [
"@param",
"$id"
] | train | https://github.com/thienhungho/yii2-product-management/blob/72e1237bba123faf671e44491bd93077b50adde9/src/modules/ProductManage/controllers/ProductController.php#L136-L157 |
thienhungho/yii2-product-management | src/modules/ProductManage/controllers/ProductController.php | ProductController.actionSaveAsNewLanguage | public function actionSaveAsNewLanguage($id)
{
if (request()->post('_asnew') == '1') {
$product = $this->findModel($id);
$model = new Product();
$model->feature_img = $product->feature_img;
$model->gallery = $product->gallery;
$model->status... | php | public function actionSaveAsNewLanguage($id)
{
if (request()->post('_asnew') == '1') {
$product = $this->findModel($id);
$model = new Product();
$model->feature_img = $product->feature_img;
$model->gallery = $product->gallery;
$model->status... | [
"public",
"function",
"actionSaveAsNewLanguage",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"request",
"(",
")",
"->",
"post",
"(",
"'_asnew'",
")",
"==",
"'1'",
")",
"{",
"$",
"product",
"=",
"$",
"this",
"->",
"findModel",
"(",
"$",
"id",
")",
";",
"$"... | @param $id
@return string|\yii\web\Response
@throws NotFoundHttpException
@throws \yii\db\Exception | [
"@param",
"$id"
] | train | https://github.com/thienhungho/yii2-product-management/blob/72e1237bba123faf671e44491bd93077b50adde9/src/modules/ProductManage/controllers/ProductController.php#L166-L195 |
thienhungho/yii2-product-management | src/modules/ProductManage/controllers/ProductController.php | ProductController.actionDelete | public function actionDelete($id)
{
$model = $this->findModel($id);
if ($model->deleteWithRelated()) {
delete_seo_data($model->product_type, $model->primaryKey);
Meta::deleteAll([
'obj_type' => $model->product_type,
'obj_id' => $model-... | php | public function actionDelete($id)
{
$model = $this->findModel($id);
if ($model->deleteWithRelated()) {
delete_seo_data($model->product_type, $model->primaryKey);
Meta::deleteAll([
'obj_type' => $model->product_type,
'obj_id' => $model-... | [
"public",
"function",
"actionDelete",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"findModel",
"(",
"$",
"id",
")",
";",
"if",
"(",
"$",
"model",
"->",
"deleteWithRelated",
"(",
")",
")",
"{",
"delete_seo_data",
"(",
"$",
"model",... | @param $id
@return \yii\web\Response
@throws NotFoundHttpException
@throws \yii\db\Exception | [
"@param",
"$id"
] | train | https://github.com/thienhungho/yii2-product-management/blob/72e1237bba123faf671e44491bd93077b50adde9/src/modules/ProductManage/controllers/ProductController.php#L204-L223 |
thienhungho/yii2-product-management | src/modules/ProductManage/controllers/ProductController.php | ProductController.actionSaveAsNew | public function actionSaveAsNew($id)
{
$model = new Product();
if (request()->post('_asnew') != '1') {
$model = $this->findModel($id);
}
if ($model->loadAll(request()->post())) {
if ($model->saveAll()) {
set_flash_has_been_saved();
... | php | public function actionSaveAsNew($id)
{
$model = new Product();
if (request()->post('_asnew') != '1') {
$model = $this->findModel($id);
}
if ($model->loadAll(request()->post())) {
if ($model->saveAll()) {
set_flash_has_been_saved();
... | [
"public",
"function",
"actionSaveAsNew",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"new",
"Product",
"(",
")",
";",
"if",
"(",
"request",
"(",
")",
"->",
"post",
"(",
"'_asnew'",
")",
"!=",
"'1'",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->"... | @param $id
@return string|\yii\web\Response
@throws NotFoundHttpException
@throws \yii\db\Exception | [
"@param",
"$id"
] | train | https://github.com/thienhungho/yii2-product-management/blob/72e1237bba123faf671e44491bd93077b50adde9/src/modules/ProductManage/controllers/ProductController.php#L310-L333 |
syzygypl/page-media-set-bundle | DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('page_media_set');
$rootNode->children()->booleanNode('indexer')->defaultFalse();
/** @var ArrayNodeDefinition $types */
$types = $rootNode->children()->arrayNode('type... | php | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('page_media_set');
$rootNode->children()->booleanNode('indexer')->defaultFalse();
/** @var ArrayNodeDefinition $types */
$types = $rootNode->children()->arrayNode('type... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"rootNode",
"=",
"$",
"treeBuilder",
"->",
"root",
"(",
"'page_media_set'",
")",
";",
"$",
"rootNode",
"->",
"children",
"(",
")... | {@inheritdoc} | [
"{"
] | train | https://github.com/syzygypl/page-media-set-bundle/blob/013d5321518755b07d292d63d5b3f1ddeb635107/DependencyInjection/Configuration.php#L20-L48 |
VincentChalnot/SidusDataGridBundle | Form/Type/LinkType.php | LinkType.configureOptions | public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'route' => null,
'route_parameters' => [],
'uri' => null,
'attr' => [
'class' => 'btn btn-default btn-light',
... | php | public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'route' => null,
'route_parameters' => [],
'uri' => null,
'attr' => [
'class' => 'btn btn-default btn-light',
... | [
"public",
"function",
"configureOptions",
"(",
"OptionsResolver",
"$",
"resolver",
")",
"{",
"$",
"resolver",
"->",
"setDefaults",
"(",
"[",
"'route'",
"=>",
"null",
",",
"'route_parameters'",
"=>",
"[",
"]",
",",
"'uri'",
"=>",
"null",
",",
"'attr'",
"=>",
... | @param OptionsResolver $resolver
@throws AccessException
@throws UndefinedOptionsException
@throws \UnexpectedValueException | [
"@param",
"OptionsResolver",
"$resolver"
] | train | https://github.com/VincentChalnot/SidusDataGridBundle/blob/aa929113e2208ed335f514d2891affaf7fddf3f6/Form/Type/LinkType.php#L47-L70 |
codezero-be/laravel-localizer | src/Middleware/SetLocale.php | SetLocale.handle | public function handle($request, Closure $next)
{
$locale = $this->localizer->detect();
if ($locale) {
$this->localizer->store($locale);
}
return $next($request);
} | php | public function handle($request, Closure $next)
{
$locale = $this->localizer->detect();
if ($locale) {
$this->localizer->store($locale);
}
return $next($request);
} | [
"public",
"function",
"handle",
"(",
"$",
"request",
",",
"Closure",
"$",
"next",
")",
"{",
"$",
"locale",
"=",
"$",
"this",
"->",
"localizer",
"->",
"detect",
"(",
")",
";",
"if",
"(",
"$",
"locale",
")",
"{",
"$",
"this",
"->",
"localizer",
"->",... | Handle an incoming request.
@param \Illuminate\Http\Request $request
@param \Closure $next
@return mixed | [
"Handle",
"an",
"incoming",
"request",
"."
] | train | https://github.com/codezero-be/laravel-localizer/blob/812692796a73bd38fc205404d8ef90df5bfa0d83/src/Middleware/SetLocale.php#L35-L44 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.hydrate | public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
{
try {
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : CustomerGroupTableMap::translateFieldName('Code', TableMap::TYPE_PHPNAME, $indexType)];
$this->code = (null !== $... | php | public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
{
try {
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : CustomerGroupTableMap::translateFieldName('Code', TableMap::TYPE_PHPNAME, $indexType)];
$this->code = (null !== $... | [
"public",
"function",
"hydrate",
"(",
"$",
"row",
",",
"$",
"startcol",
"=",
"0",
",",
"$",
"rehydrate",
"=",
"false",
",",
"$",
"indexType",
"=",
"TableMap",
"::",
"TYPE_NUM",
")",
"{",
"try",
"{",
"$",
"col",
"=",
"$",
"row",
"[",
"TableMap",
"::... | Hydrates (populates) the object variables with values from the database resultset.
An offset (0-based "start column") is specified so that objects can be hydrated
with a subset of the columns in the resultset rows. This is needed, for example,
for results of JOIN queries where the resultset row includes columns from ... | [
"Hydrates",
"(",
"populates",
")",
"the",
"object",
"variables",
"with",
"values",
"from",
"the",
"database",
"resultset",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L691-L732 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.reload | public function reload($deep = false, ConnectionInterface $con = null)
{
if ($this->isDeleted()) {
throw new PropelException("Cannot reload a deleted object.");
}
if ($this->isNew()) {
throw new PropelException("Cannot reload an unsaved object.");
}
... | php | public function reload($deep = false, ConnectionInterface $con = null)
{
if ($this->isDeleted()) {
throw new PropelException("Cannot reload a deleted object.");
}
if ($this->isNew()) {
throw new PropelException("Cannot reload an unsaved object.");
}
... | [
"public",
"function",
"reload",
"(",
"$",
"deep",
"=",
"false",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isDeleted",
"(",
")",
")",
"{",
"throw",
"new",
"PropelException",
"(",
"\"Cannot reload a deleted... | Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
This will only work if the object has been saved and has a valid primary key set.
@param boolean $deep (optional) Whether to also de-associated any related objects.
@param ConnectionInterface $con (option... | [
"Reloads",
"this",
"object",
"from",
"datastore",
"based",
"on",
"primary",
"key",
"and",
"(",
"optionally",
")",
"resets",
"all",
"associated",
"objects",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L761-L794 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.delete | public function delete(ConnectionInterface $con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getServiceContainer()->getWriteConnection(CustomerGroupTableMap::DATABASE_NAM... | php | public function delete(ConnectionInterface $con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getServiceContainer()->getWriteConnection(CustomerGroupTableMap::DATABASE_NAM... | [
"public",
"function",
"delete",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isDeleted",
"(",
")",
")",
"{",
"throw",
"new",
"PropelException",
"(",
"\"This object has already been deleted.\"",
")",
";",
"}",
... | Removes this object from datastore and sets delete attribute.
@param ConnectionInterface $con
@return void
@throws PropelException
@see CustomerGroup::setDeleted()
@see CustomerGroup::isDeleted() | [
"Removes",
"this",
"object",
"from",
"datastore",
"and",
"sets",
"delete",
"attribute",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L805-L837 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.doSave | protected function doSave(ConnectionInterface $con)
{
$affectedRows = 0; // initialize var to track total num of affected rows
if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
if ($this->isNew() || $this->isModified()) {
// persist changes
... | php | protected function doSave(ConnectionInterface $con)
{
$affectedRows = 0; // initialize var to track total num of affected rows
if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
if ($this->isNew() || $this->isModified()) {
// persist changes
... | [
"protected",
"function",
"doSave",
"(",
"ConnectionInterface",
"$",
"con",
")",
"{",
"$",
"affectedRows",
"=",
"0",
";",
"// initialize var to track total num of affected rows",
"if",
"(",
"!",
"$",
"this",
"->",
"alreadyInSave",
")",
"{",
"$",
"this",
"->",
"al... | Performs the work of inserting or updating the row in the database.
If the object is new, it inserts it; otherwise an update is performed.
All related objects are also updated in this method.
@param ConnectionInterface $con
@return int The number of rows affected by this insert/update and any referri... | [
"Performs",
"the",
"work",
"of",
"inserting",
"or",
"updating",
"the",
"row",
"in",
"the",
"database",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L921-L1004 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.toArray | public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['CustomerGroup'][$this->getPrimaryKey()])) {
return '*RECURSION*';
}
$alreadyDumpedObjects... | php | public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['CustomerGroup'][$this->getPrimaryKey()])) {
return '*RECURSION*';
}
$alreadyDumpedObjects... | [
"public",
"function",
"toArray",
"(",
"$",
"keyType",
"=",
"TableMap",
"::",
"TYPE_PHPNAME",
",",
"$",
"includeLazyLoadColumns",
"=",
"true",
",",
"$",
"alreadyDumpedObjects",
"=",
"array",
"(",
")",
",",
"$",
"includeForeignObjects",
"=",
"false",
")",
"{",
... | Exports the object as an array.
You can specify the key type of the array by passing one of the class
type constants.
@param string $keyType (optional) One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
Defau... | [
"Exports",
"the",
"object",
"as",
"an",
"array",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L1173-L1203 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.fromArray | public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
{
$keys = CustomerGroupTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setCode($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setIsDefault($arr[$keys[1]]);
if (array_key... | php | public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
{
$keys = CustomerGroupTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setCode($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setIsDefault($arr[$keys[1]]);
if (array_key... | [
"public",
"function",
"fromArray",
"(",
"$",
"arr",
",",
"$",
"keyType",
"=",
"TableMap",
"::",
"TYPE_PHPNAME",
")",
"{",
"$",
"keys",
"=",
"CustomerGroupTableMap",
"::",
"getFieldNames",
"(",
"$",
"keyType",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"... | Populates the object using an array.
This is particularly useful when populating an object from one of the
request arrays (e.g. $_POST). This method goes through the column
names, checking to see whether a matching key exists in populated
array. If so the setByName() method is called for that column.
You can specify... | [
"Populates",
"the",
"object",
"using",
"an",
"array",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L1272-L1282 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.buildCriteria | public function buildCriteria()
{
$criteria = new Criteria(CustomerGroupTableMap::DATABASE_NAME);
if ($this->isColumnModified(CustomerGroupTableMap::CODE)) $criteria->add(CustomerGroupTableMap::CODE, $this->code);
if ($this->isColumnModified(CustomerGroupTableMap::IS_DEFAULT)) $criteria->ad... | php | public function buildCriteria()
{
$criteria = new Criteria(CustomerGroupTableMap::DATABASE_NAME);
if ($this->isColumnModified(CustomerGroupTableMap::CODE)) $criteria->add(CustomerGroupTableMap::CODE, $this->code);
if ($this->isColumnModified(CustomerGroupTableMap::IS_DEFAULT)) $criteria->ad... | [
"public",
"function",
"buildCriteria",
"(",
")",
"{",
"$",
"criteria",
"=",
"new",
"Criteria",
"(",
"CustomerGroupTableMap",
"::",
"DATABASE_NAME",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isColumnModified",
"(",
"CustomerGroupTableMap",
"::",
"CODE",
")",
")"... | Build a Criteria object containing the values of all modified columns in this object.
@return Criteria The Criteria object containing all modified values. | [
"Build",
"a",
"Criteria",
"object",
"containing",
"the",
"values",
"of",
"all",
"modified",
"columns",
"in",
"this",
"object",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L1289-L1301 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.copyInto | public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setCode($this->getCode());
$copyObj->setIsDefault($this->getIsDefault());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
$copyObj->setPosition($th... | php | public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setCode($this->getCode());
$copyObj->setIsDefault($this->getIsDefault());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
$copyObj->setPosition($th... | [
"public",
"function",
"copyInto",
"(",
"$",
"copyObj",
",",
"$",
"deepCopy",
"=",
"false",
",",
"$",
"makeNew",
"=",
"true",
")",
"{",
"$",
"copyObj",
"->",
"setCode",
"(",
"$",
"this",
"->",
"getCode",
"(",
")",
")",
";",
"$",
"copyObj",
"->",
"se... | Sets contents of passed object to values from current object.
If desired, this method can also make copies of all associated (fkey referrers)
objects.
@param object $copyObj An object of \CustomerGroup\Model\CustomerGroup (or compatible) type.
@param boolean $deepCopy Whether to also copy all rows that refe... | [
"Sets",
"contents",
"of",
"passed",
"object",
"to",
"values",
"from",
"current",
"object",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L1360-L1391 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.initCustomerCustomerGroups | public function initCustomerCustomerGroups($overrideExisting = true)
{
if (null !== $this->collCustomerCustomerGroups && !$overrideExisting) {
return;
}
$this->collCustomerCustomerGroups = new ObjectCollection();
$this->collCustomerCustomerGroups->setModel('\CustomerGroup... | php | public function initCustomerCustomerGroups($overrideExisting = true)
{
if (null !== $this->collCustomerCustomerGroups && !$overrideExisting) {
return;
}
$this->collCustomerCustomerGroups = new ObjectCollection();
$this->collCustomerCustomerGroups->setModel('\CustomerGroup... | [
"public",
"function",
"initCustomerCustomerGroups",
"(",
"$",
"overrideExisting",
"=",
"true",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"collCustomerCustomerGroups",
"&&",
"!",
"$",
"overrideExisting",
")",
"{",
"return",
";",
"}",
"$",
"this",
... | Initializes the collCustomerCustomerGroups collection.
By default this just sets the collCustomerCustomerGroups collection to an empty array (like clearcollCustomerCustomerGroups());
however, you may wish to override this method in your stub class to provide setting appropriate
to your application -- for example, sett... | [
"Initializes",
"the",
"collCustomerCustomerGroups",
"collection",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L1468-L1475 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.getCustomerCustomerGroups | public function getCustomerCustomerGroups($criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collCustomerCustomerGroupsPartial && !$this->isNew();
if (null === $this->collCustomerCustomerGroups || null !== $criteria || $partial) {
if ($this->isNew() && null === $this... | php | public function getCustomerCustomerGroups($criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collCustomerCustomerGroupsPartial && !$this->isNew();
if (null === $this->collCustomerCustomerGroups || null !== $criteria || $partial) {
if ($this->isNew() && null === $this... | [
"public",
"function",
"getCustomerCustomerGroups",
"(",
"$",
"criteria",
"=",
"null",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collCustomerCustomerGroupsPartial",
"&&",
"!",
"$",
"this",
"->",
"isN... | Gets an array of ChildCustomerCustomerGroup objects which contain a foreign key that references this object.
If the $criteria is not null, it is used to always fetch the results from the database.
Otherwise the results are fetched from the database the first time, then cached.
Next time the same method is called witho... | [
"Gets",
"an",
"array",
"of",
"ChildCustomerCustomerGroup",
"objects",
"which",
"contain",
"a",
"foreign",
"key",
"that",
"references",
"this",
"object",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L1491-L1535 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.setCustomerCustomerGroups | public function setCustomerCustomerGroups(Collection $customerCustomerGroups, ConnectionInterface $con = null)
{
$customerCustomerGroupsToDelete = $this->getCustomerCustomerGroups(new Criteria(), $con)->diff($customerCustomerGroups);
//since at least one column in the foreign key is at the same ti... | php | public function setCustomerCustomerGroups(Collection $customerCustomerGroups, ConnectionInterface $con = null)
{
$customerCustomerGroupsToDelete = $this->getCustomerCustomerGroups(new Criteria(), $con)->diff($customerCustomerGroups);
//since at least one column in the foreign key is at the same ti... | [
"public",
"function",
"setCustomerCustomerGroups",
"(",
"Collection",
"$",
"customerCustomerGroups",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"customerCustomerGroupsToDelete",
"=",
"$",
"this",
"->",
"getCustomerCustomerGroups",
"(",
"new",
... | Sets a collection of CustomerCustomerGroup objects related by a one-to-many relationship
to the current object.
It will also schedule objects for deletion based on a diff between old objects (aka persisted)
and new objects from the given Propel collection.
@param Collection $customerCustomerGroups A Propel collec... | [
"Sets",
"a",
"collection",
"of",
"CustomerCustomerGroup",
"objects",
"related",
"by",
"a",
"one",
"-",
"to",
"-",
"many",
"relationship",
"to",
"the",
"current",
"object",
".",
"It",
"will",
"also",
"schedule",
"objects",
"for",
"deletion",
"based",
"on",
"a... | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L1547-L1570 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.countCustomerCustomerGroups | public function countCustomerCustomerGroups(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collCustomerCustomerGroupsPartial && !$this->isNew();
if (null === $this->collCustomerCustomerGroups || null !== $criteria || $partial) {
if ($th... | php | public function countCustomerCustomerGroups(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collCustomerCustomerGroupsPartial && !$this->isNew();
if (null === $this->collCustomerCustomerGroups || null !== $criteria || $partial) {
if ($th... | [
"public",
"function",
"countCustomerCustomerGroups",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"$",
"distinct",
"=",
"false",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collCustomerCustomer... | Returns the number of related CustomerCustomerGroup objects.
@param Criteria $criteria
@param boolean $distinct
@param ConnectionInterface $con
@return int Count of related CustomerCustomerGroup objects.
@throws PropelException | [
"Returns",
"the",
"number",
"of",
"related",
"CustomerCustomerGroup",
"objects",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L1581-L1604 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.addCustomerCustomerGroup | public function addCustomerCustomerGroup(ChildCustomerCustomerGroup $l)
{
if ($this->collCustomerCustomerGroups === null) {
$this->initCustomerCustomerGroups();
$this->collCustomerCustomerGroupsPartial = true;
}
if (!in_array($l, $this->collCustomerCustomerGroups->ge... | php | public function addCustomerCustomerGroup(ChildCustomerCustomerGroup $l)
{
if ($this->collCustomerCustomerGroups === null) {
$this->initCustomerCustomerGroups();
$this->collCustomerCustomerGroupsPartial = true;
}
if (!in_array($l, $this->collCustomerCustomerGroups->ge... | [
"public",
"function",
"addCustomerCustomerGroup",
"(",
"ChildCustomerCustomerGroup",
"$",
"l",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"collCustomerCustomerGroups",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"initCustomerCustomerGroups",
"(",
")",
";",
"$",
"th... | Method called to associate a ChildCustomerCustomerGroup object to this object
through the ChildCustomerCustomerGroup foreign key attribute.
@param ChildCustomerCustomerGroup $l ChildCustomerCustomerGroup
@return \CustomerGroup\Model\CustomerGroup The current object (for fluent API support) | [
"Method",
"called",
"to",
"associate",
"a",
"ChildCustomerCustomerGroup",
"object",
"to",
"this",
"object",
"through",
"the",
"ChildCustomerCustomerGroup",
"foreign",
"key",
"attribute",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L1613-L1625 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.getCustomerCustomerGroupsJoinCustomer | public function getCustomerCustomerGroupsJoinCustomer($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildCustomerCustomerGroupQuery::create(null, $criteria);
$query->joinWith('Customer', $joinBehavior);
return $this->getCustomerCustomerGroups($query, $con);
... | php | public function getCustomerCustomerGroupsJoinCustomer($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildCustomerCustomerGroupQuery::create(null, $criteria);
$query->joinWith('Customer', $joinBehavior);
return $this->getCustomerCustomerGroups($query, $con);
... | [
"public",
"function",
"getCustomerCustomerGroupsJoinCustomer",
"(",
"$",
"criteria",
"=",
"null",
",",
"$",
"con",
"=",
"null",
",",
"$",
"joinBehavior",
"=",
"Criteria",
"::",
"LEFT_JOIN",
")",
"{",
"$",
"query",
"=",
"ChildCustomerCustomerGroupQuery",
"::",
"c... | If this collection has already been initialized with
an identical criteria, it returns the collection.
Otherwise if this CustomerGroup is new, it will return
an empty collection; or if this CustomerGroup has previously
been saved, it will retrieve related CustomerCustomerGroups from storage.
This method is protected b... | [
"If",
"this",
"collection",
"has",
"already",
"been",
"initialized",
"with",
"an",
"identical",
"criteria",
"it",
"returns",
"the",
"collection",
".",
"Otherwise",
"if",
"this",
"CustomerGroup",
"is",
"new",
"it",
"will",
"return",
"an",
"empty",
"collection",
... | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L1672-L1678 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.initCustomerGroupI18ns | public function initCustomerGroupI18ns($overrideExisting = true)
{
if (null !== $this->collCustomerGroupI18ns && !$overrideExisting) {
return;
}
$this->collCustomerGroupI18ns = new ObjectCollection();
$this->collCustomerGroupI18ns->setModel('\CustomerGroup\Model\CustomerG... | php | public function initCustomerGroupI18ns($overrideExisting = true)
{
if (null !== $this->collCustomerGroupI18ns && !$overrideExisting) {
return;
}
$this->collCustomerGroupI18ns = new ObjectCollection();
$this->collCustomerGroupI18ns->setModel('\CustomerGroup\Model\CustomerG... | [
"public",
"function",
"initCustomerGroupI18ns",
"(",
"$",
"overrideExisting",
"=",
"true",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"collCustomerGroupI18ns",
"&&",
"!",
"$",
"overrideExisting",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
... | Initializes the collCustomerGroupI18ns collection.
By default this just sets the collCustomerGroupI18ns collection to an empty array (like clearcollCustomerGroupI18ns());
however, you may wish to override this method in your stub class to provide setting appropriate
to your application -- for example, setting the init... | [
"Initializes",
"the",
"collCustomerGroupI18ns",
"collection",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L1714-L1721 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.getCustomerGroupI18ns | public function getCustomerGroupI18ns($criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collCustomerGroupI18nsPartial && !$this->isNew();
if (null === $this->collCustomerGroupI18ns || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collCustom... | php | public function getCustomerGroupI18ns($criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collCustomerGroupI18nsPartial && !$this->isNew();
if (null === $this->collCustomerGroupI18ns || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collCustom... | [
"public",
"function",
"getCustomerGroupI18ns",
"(",
"$",
"criteria",
"=",
"null",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collCustomerGroupI18nsPartial",
"&&",
"!",
"$",
"this",
"->",
"isNew",
"... | Gets an array of ChildCustomerGroupI18n objects which contain a foreign key that references this object.
If the $criteria is not null, it is used to always fetch the results from the database.
Otherwise the results are fetched from the database the first time, then cached.
Next time the same method is called without $... | [
"Gets",
"an",
"array",
"of",
"ChildCustomerGroupI18n",
"objects",
"which",
"contain",
"a",
"foreign",
"key",
"that",
"references",
"this",
"object",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L1737-L1781 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.setCustomerGroupI18ns | public function setCustomerGroupI18ns(Collection $customerGroupI18ns, ConnectionInterface $con = null)
{
$customerGroupI18nsToDelete = $this->getCustomerGroupI18ns(new Criteria(), $con)->diff($customerGroupI18ns);
//since at least one column in the foreign key is at the same time a PK
//we... | php | public function setCustomerGroupI18ns(Collection $customerGroupI18ns, ConnectionInterface $con = null)
{
$customerGroupI18nsToDelete = $this->getCustomerGroupI18ns(new Criteria(), $con)->diff($customerGroupI18ns);
//since at least one column in the foreign key is at the same time a PK
//we... | [
"public",
"function",
"setCustomerGroupI18ns",
"(",
"Collection",
"$",
"customerGroupI18ns",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"customerGroupI18nsToDelete",
"=",
"$",
"this",
"->",
"getCustomerGroupI18ns",
"(",
"new",
"Criteria",
"(... | Sets a collection of CustomerGroupI18n objects related by a one-to-many relationship
to the current object.
It will also schedule objects for deletion based on a diff between old objects (aka persisted)
and new objects from the given Propel collection.
@param Collection $customerGroupI18ns A Propel collection.
@p... | [
"Sets",
"a",
"collection",
"of",
"CustomerGroupI18n",
"objects",
"related",
"by",
"a",
"one",
"-",
"to",
"-",
"many",
"relationship",
"to",
"the",
"current",
"object",
".",
"It",
"will",
"also",
"schedule",
"objects",
"for",
"deletion",
"based",
"on",
"a",
... | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L1793-L1816 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.countCustomerGroupI18ns | public function countCustomerGroupI18ns(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collCustomerGroupI18nsPartial && !$this->isNew();
if (null === $this->collCustomerGroupI18ns || null !== $criteria || $partial) {
if ($this->isNew() ... | php | public function countCustomerGroupI18ns(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collCustomerGroupI18nsPartial && !$this->isNew();
if (null === $this->collCustomerGroupI18ns || null !== $criteria || $partial) {
if ($this->isNew() ... | [
"public",
"function",
"countCustomerGroupI18ns",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"$",
"distinct",
"=",
"false",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collCustomerGroupI18nsPa... | Returns the number of related CustomerGroupI18n objects.
@param Criteria $criteria
@param boolean $distinct
@param ConnectionInterface $con
@return int Count of related CustomerGroupI18n objects.
@throws PropelException | [
"Returns",
"the",
"number",
"of",
"related",
"CustomerGroupI18n",
"objects",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L1827-L1850 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.addCustomerGroupI18n | public function addCustomerGroupI18n(ChildCustomerGroupI18n $l)
{
if ($l && $locale = $l->getLocale()) {
$this->setLocale($locale);
$this->currentTranslations[$locale] = $l;
}
if ($this->collCustomerGroupI18ns === null) {
$this->initCustomerGroupI18ns();
... | php | public function addCustomerGroupI18n(ChildCustomerGroupI18n $l)
{
if ($l && $locale = $l->getLocale()) {
$this->setLocale($locale);
$this->currentTranslations[$locale] = $l;
}
if ($this->collCustomerGroupI18ns === null) {
$this->initCustomerGroupI18ns();
... | [
"public",
"function",
"addCustomerGroupI18n",
"(",
"ChildCustomerGroupI18n",
"$",
"l",
")",
"{",
"if",
"(",
"$",
"l",
"&&",
"$",
"locale",
"=",
"$",
"l",
"->",
"getLocale",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setLocale",
"(",
"$",
"locale",
")",
... | Method called to associate a ChildCustomerGroupI18n object to this object
through the ChildCustomerGroupI18n foreign key attribute.
@param ChildCustomerGroupI18n $l ChildCustomerGroupI18n
@return \CustomerGroup\Model\CustomerGroup The current object (for fluent API support) | [
"Method",
"called",
"to",
"associate",
"a",
"ChildCustomerGroupI18n",
"object",
"to",
"this",
"object",
"through",
"the",
"ChildCustomerGroupI18n",
"foreign",
"key",
"attribute",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L1859-L1875 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.getCustomers | public function getCustomers($criteria = null, ConnectionInterface $con = null)
{
if (null === $this->collCustomers || null !== $criteria) {
if ($this->isNew() && null === $this->collCustomers) {
// return empty collection
$this->initCustomers();
} els... | php | public function getCustomers($criteria = null, ConnectionInterface $con = null)
{
if (null === $this->collCustomers || null !== $criteria) {
if ($this->isNew() && null === $this->collCustomers) {
// return empty collection
$this->initCustomers();
} els... | [
"public",
"function",
"getCustomers",
"(",
"$",
"criteria",
"=",
"null",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"collCustomers",
"||",
"null",
"!==",
"$",
"criteria",
")",
"{",
"if",
... | Gets a collection of ChildCustomer objects related by a many-to-many relationship
to the current object by way of the customer_customer_group cross-reference table.
If the $criteria is not null, it is used to always fetch the results from the database.
Otherwise the results are fetched from the database the first time... | [
"Gets",
"a",
"collection",
"of",
"ChildCustomer",
"objects",
"related",
"by",
"a",
"many",
"-",
"to",
"-",
"many",
"relationship",
"to",
"the",
"current",
"object",
"by",
"way",
"of",
"the",
"customer_customer_group",
"cross",
"-",
"reference",
"table",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L1950-L1968 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.setCustomers | public function setCustomers(Collection $customers, ConnectionInterface $con = null)
{
$this->clearCustomers();
$currentCustomers = $this->getCustomers();
$this->customersScheduledForDeletion = $currentCustomers->diff($customers);
foreach ($customers as $customer) {
if ... | php | public function setCustomers(Collection $customers, ConnectionInterface $con = null)
{
$this->clearCustomers();
$currentCustomers = $this->getCustomers();
$this->customersScheduledForDeletion = $currentCustomers->diff($customers);
foreach ($customers as $customer) {
if ... | [
"public",
"function",
"setCustomers",
"(",
"Collection",
"$",
"customers",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"clearCustomers",
"(",
")",
";",
"$",
"currentCustomers",
"=",
"$",
"this",
"->",
"getCustomers",
"("... | Sets a collection of Customer objects related by a many-to-many relationship
to the current object by way of the customer_customer_group cross-reference table.
It will also schedule objects for deletion based on a diff between old objects (aka persisted)
and new objects from the given Propel collection.
@param Collec... | [
"Sets",
"a",
"collection",
"of",
"Customer",
"objects",
"related",
"by",
"a",
"many",
"-",
"to",
"-",
"many",
"relationship",
"to",
"the",
"current",
"object",
"by",
"way",
"of",
"the",
"customer_customer_group",
"cross",
"-",
"reference",
"table",
".",
"It"... | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L1980-L1996 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.countCustomers | public function countCustomers($criteria = null, $distinct = false, ConnectionInterface $con = null)
{
if (null === $this->collCustomers || null !== $criteria) {
if ($this->isNew() && null === $this->collCustomers) {
return 0;
} else {
$query = Custome... | php | public function countCustomers($criteria = null, $distinct = false, ConnectionInterface $con = null)
{
if (null === $this->collCustomers || null !== $criteria) {
if ($this->isNew() && null === $this->collCustomers) {
return 0;
} else {
$query = Custome... | [
"public",
"function",
"countCustomers",
"(",
"$",
"criteria",
"=",
"null",
",",
"$",
"distinct",
"=",
"false",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"collCustomers",
"||",
"null",
"!==... | Gets the number of ChildCustomer objects related by a many-to-many relationship
to the current object by way of the customer_customer_group cross-reference table.
@param Criteria $criteria Optional query object to filter the query
@param boolean $distinct Set to true to force count distinct
@param Conne... | [
"Gets",
"the",
"number",
"of",
"ChildCustomer",
"objects",
"related",
"by",
"a",
"many",
"-",
"to",
"-",
"many",
"relationship",
"to",
"the",
"current",
"object",
"by",
"way",
"of",
"the",
"customer_customer_group",
"cross",
"-",
"reference",
"table",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L2008-L2026 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.addCustomer | public function addCustomer(ChildCustomer $customer)
{
if ($this->collCustomers === null) {
$this->initCustomers();
}
if (!$this->collCustomers->contains($customer)) { // only add it if the **same** object is not already associated
$this->doAddCustomer($customer);
... | php | public function addCustomer(ChildCustomer $customer)
{
if ($this->collCustomers === null) {
$this->initCustomers();
}
if (!$this->collCustomers->contains($customer)) { // only add it if the **same** object is not already associated
$this->doAddCustomer($customer);
... | [
"public",
"function",
"addCustomer",
"(",
"ChildCustomer",
"$",
"customer",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"collCustomers",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"initCustomers",
"(",
")",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"... | Associate a ChildCustomer object to this object
through the customer_customer_group cross reference table.
@param ChildCustomer $customer The ChildCustomerCustomerGroup object to relate
@return ChildCustomerGroup The current object (for fluent API support) | [
"Associate",
"a",
"ChildCustomer",
"object",
"to",
"this",
"object",
"through",
"the",
"customer_customer_group",
"cross",
"reference",
"table",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L2035-L2047 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.clearAllReferences | public function clearAllReferences($deep = false)
{
if ($deep) {
if ($this->collCustomerCustomerGroups) {
foreach ($this->collCustomerCustomerGroups as $o) {
$o->clearAllReferences($deep);
}
}
if ($this->collCustomerGrou... | php | public function clearAllReferences($deep = false)
{
if ($deep) {
if ($this->collCustomerCustomerGroups) {
foreach ($this->collCustomerCustomerGroups as $o) {
$o->clearAllReferences($deep);
}
}
if ($this->collCustomerGrou... | [
"public",
"function",
"clearAllReferences",
"(",
"$",
"deep",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"deep",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"collCustomerCustomerGroups",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"collCustomerCustomerGroups",
"... | Resets all references to other model objects or collections of model objects.
This method is a user-space workaround for PHP's inability to garbage collect
objects with circular references (even in PHP 5.3). This is currently necessary
when using Propel in certain daemon or large-volume/high-memory operations.
@param... | [
"Resets",
"all",
"references",
"to",
"other",
"model",
"objects",
"or",
"collections",
"of",
"model",
"objects",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L2116-L2143 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.getTranslation | public function getTranslation($locale = 'en_US', ConnectionInterface $con = null)
{
if (!isset($this->currentTranslations[$locale])) {
if (null !== $this->collCustomerGroupI18ns) {
foreach ($this->collCustomerGroupI18ns as $translation) {
if ($translation->ge... | php | public function getTranslation($locale = 'en_US', ConnectionInterface $con = null)
{
if (!isset($this->currentTranslations[$locale])) {
if (null !== $this->collCustomerGroupI18ns) {
foreach ($this->collCustomerGroupI18ns as $translation) {
if ($translation->ge... | [
"public",
"function",
"getTranslation",
"(",
"$",
"locale",
"=",
"'en_US'",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"currentTranslations",
"[",
"$",
"locale",
"]",
")",
")",
"{",
"... | Returns the current translation for a given locale
@param string $locale Locale to use for the translation, e.g. 'fr_FR'
@param ConnectionInterface $con an optional connection object
@return ChildCustomerGroupI18n | [
"Returns",
"the",
"current",
"translation",
"for",
"a",
"given",
"locale"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L2202-L2227 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.isLast | public function isLast(ConnectionInterface $con = null)
{
return $this->getPosition() == ChildCustomerGroupQuery::create()->getMaxRankArray($con);
} | php | public function isLast(ConnectionInterface $con = null)
{
return $this->getPosition() == ChildCustomerGroupQuery::create()->getMaxRankArray($con);
} | [
"public",
"function",
"isLast",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"getPosition",
"(",
")",
"==",
"ChildCustomerGroupQuery",
"::",
"create",
"(",
")",
"->",
"getMaxRankArray",
"(",
"$",
"con",
")",
"... | Check if the object is last in the list, i.e. if its rank is the highest rank
@param ConnectionInterface $con optional connection
@return boolean | [
"Check",
"if",
"the",
"object",
"is",
"last",
"in",
"the",
"list",
"i",
".",
"e",
".",
"if",
"its",
"rank",
"is",
"the",
"highest",
"rank"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L2356-L2359 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.getNext | public function getNext(ConnectionInterface $con = null)
{
$query = ChildCustomerGroupQuery::create();
$query->filterByRank($this->getPosition() + 1);
return $query->findOne($con);
} | php | public function getNext(ConnectionInterface $con = null)
{
$query = ChildCustomerGroupQuery::create();
$query->filterByRank($this->getPosition() + 1);
return $query->findOne($con);
} | [
"public",
"function",
"getNext",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"query",
"=",
"ChildCustomerGroupQuery",
"::",
"create",
"(",
")",
";",
"$",
"query",
"->",
"filterByRank",
"(",
"$",
"this",
"->",
"getPosition",
"(",
")"... | Get the next item in the list, i.e. the one for which rank is immediately higher
@param ConnectionInterface $con optional connection
@return ChildCustomerGroup | [
"Get",
"the",
"next",
"item",
"in",
"the",
"list",
"i",
".",
"e",
".",
"the",
"one",
"for",
"which",
"rank",
"is",
"immediately",
"higher"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L2368-L2377 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.insertAtRank | public function insertAtRank($rank, ConnectionInterface $con = null)
{
$maxRank = ChildCustomerGroupQuery::create()->getMaxRankArray($con);
if ($rank < 1 || $rank > $maxRank + 1) {
throw new PropelException('Invalid rank ' . $rank);
}
// move the object in the list, at th... | php | public function insertAtRank($rank, ConnectionInterface $con = null)
{
$maxRank = ChildCustomerGroupQuery::create()->getMaxRankArray($con);
if ($rank < 1 || $rank > $maxRank + 1) {
throw new PropelException('Invalid rank ' . $rank);
}
// move the object in the list, at th... | [
"public",
"function",
"insertAtRank",
"(",
"$",
"rank",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"maxRank",
"=",
"ChildCustomerGroupQuery",
"::",
"create",
"(",
")",
"->",
"getMaxRankArray",
"(",
"$",
"con",
")",
";",
"if",
"(",
... | Insert at specified rank
The modifications are not persisted until the object is saved.
@param integer $rank rank value
@param ConnectionInterface $con optional connection
@return ChildCustomerGroup the current object
@throws PropelException | [
"Insert",
"at",
"specified",
"rank",
"The",
"modifications",
"are",
"not",
"persisted",
"until",
"the",
"object",
"is",
"saved",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L2408-L2425 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.insertAtBottom | public function insertAtBottom(ConnectionInterface $con = null)
{
$this->setPosition(ChildCustomerGroupQuery::create()->getMaxRankArray($con) + 1);
return $this;
} | php | public function insertAtBottom(ConnectionInterface $con = null)
{
$this->setPosition(ChildCustomerGroupQuery::create()->getMaxRankArray($con) + 1);
return $this;
} | [
"public",
"function",
"insertAtBottom",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setPosition",
"(",
"ChildCustomerGroupQuery",
"::",
"create",
"(",
")",
"->",
"getMaxRankArray",
"(",
"$",
"con",
")",
"+",
"1",
")",
... | Insert in the last rank
The modifications are not persisted until the object is saved.
@param ConnectionInterface $con optional connection
@return ChildCustomerGroup the current object
@throws PropelException | [
"Insert",
"in",
"the",
"last",
"rank",
"The",
"modifications",
"are",
"not",
"persisted",
"until",
"the",
"object",
"is",
"saved",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L2437-L2442 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.moveToRank | public function moveToRank($newRank, ConnectionInterface $con = null)
{
if ($this->isNew()) {
throw new PropelException('New objects cannot be moved. Please use insertAtRank() instead');
}
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(C... | php | public function moveToRank($newRank, ConnectionInterface $con = null)
{
if ($this->isNew()) {
throw new PropelException('New objects cannot be moved. Please use insertAtRank() instead');
}
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(C... | [
"public",
"function",
"moveToRank",
"(",
"$",
"newRank",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isNew",
"(",
")",
")",
"{",
"throw",
"new",
"PropelException",
"(",
"'New objects cannot be moved. Please use... | Move the object to a new rank, and shifts the rank
Of the objects inbetween the old and new rank accordingly
@param integer $newRank rank value
@param ConnectionInterface $con optional connection
@return ChildCustomerGroup the current object
@throws PropelException | [
"Move",
"the",
"object",
"to",
"a",
"new",
"rank",
"and",
"shifts",
"the",
"rank",
"Of",
"the",
"objects",
"inbetween",
"the",
"old",
"and",
"new",
"rank",
"accordingly"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L2466-L2500 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.swapWith | public function swapWith($object, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(CustomerGroupTableMap::DATABASE_NAME);
}
$con->beginTransaction();
try {
$oldRank = $this->getPosition();
... | php | public function swapWith($object, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(CustomerGroupTableMap::DATABASE_NAME);
}
$con->beginTransaction();
try {
$oldRank = $this->getPosition();
... | [
"public",
"function",
"swapWith",
"(",
"$",
"object",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"getWriteConnecti... | Exchange the rank of the object with the one passed as argument, and saves both objects
@param ChildCustomerGroup $object
@param ConnectionInterface $con optional connection
@return ChildCustomerGroup the current object
@throws Exception if the database cannot execute the two updates | [
"Exchange",
"the",
"rank",
"of",
"the",
"object",
"with",
"the",
"one",
"passed",
"as",
"argument",
"and",
"saves",
"both",
"objects"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L2512-L2534 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.moveUp | public function moveUp(ConnectionInterface $con = null)
{
if ($this->isFirst()) {
return $this;
}
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(CustomerGroupTableMap::DATABASE_NAME);
}
$con->beginTransaction();
t... | php | public function moveUp(ConnectionInterface $con = null)
{
if ($this->isFirst()) {
return $this;
}
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(CustomerGroupTableMap::DATABASE_NAME);
}
$con->beginTransaction();
t... | [
"public",
"function",
"moveUp",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isFirst",
"(",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con... | Move the object higher in the list, i.e. exchanges its rank with the one of the previous object
@param ConnectionInterface $con optional connection
@return ChildCustomerGroup the current object | [
"Move",
"the",
"object",
"higher",
"in",
"the",
"list",
"i",
".",
"e",
".",
"exchanges",
"its",
"rank",
"with",
"the",
"one",
"of",
"the",
"previous",
"object"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L2543-L2562 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.moveDown | public function moveDown(ConnectionInterface $con = null)
{
if ($this->isLast($con)) {
return $this;
}
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(CustomerGroupTableMap::DATABASE_NAME);
}
$con->beginTransaction();
... | php | public function moveDown(ConnectionInterface $con = null)
{
if ($this->isLast($con)) {
return $this;
}
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(CustomerGroupTableMap::DATABASE_NAME);
}
$con->beginTransaction();
... | [
"public",
"function",
"moveDown",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isLast",
"(",
"$",
"con",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"... | Move the object higher in the list, i.e. exchanges its rank with the one of the next object
@param ConnectionInterface $con optional connection
@return ChildCustomerGroup the current object | [
"Move",
"the",
"object",
"higher",
"in",
"the",
"list",
"i",
".",
"e",
".",
"exchanges",
"its",
"rank",
"with",
"the",
"one",
"of",
"the",
"next",
"object"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L2571-L2590 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.moveToTop | public function moveToTop(ConnectionInterface $con = null)
{
if ($this->isFirst()) {
return $this;
}
return $this->moveToRank(1, $con);
} | php | public function moveToTop(ConnectionInterface $con = null)
{
if ($this->isFirst()) {
return $this;
}
return $this->moveToRank(1, $con);
} | [
"public",
"function",
"moveToTop",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isFirst",
"(",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"return",
"$",
"this",
"->",
"moveToRank",
"(",
"1",
",",
... | Move the object to the top of the list
@param ConnectionInterface $con optional connection
@return ChildCustomerGroup the current object | [
"Move",
"the",
"object",
"to",
"the",
"top",
"of",
"the",
"list"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L2599-L2606 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.moveToBottom | public function moveToBottom(ConnectionInterface $con = null)
{
if ($this->isLast($con)) {
return false;
}
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(CustomerGroupTableMap::DATABASE_NAME);
}
$con->beginTransaction();
... | php | public function moveToBottom(ConnectionInterface $con = null)
{
if ($this->isLast($con)) {
return false;
}
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(CustomerGroupTableMap::DATABASE_NAME);
}
$con->beginTransaction();
... | [
"public",
"function",
"moveToBottom",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isLast",
"(",
"$",
"con",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{"... | Move the object to the bottom of the list
@param ConnectionInterface $con optional connection
@return integer the old object's rank | [
"Move",
"the",
"object",
"to",
"the",
"bottom",
"of",
"the",
"list"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L2615-L2634 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.removeFromList | public function removeFromList()
{
// Keep the list modification query for the save() transaction
$this->sortableQueries[] = array(
'callable' => array('\CustomerGroup\Model\CustomerGroupQuery', 'sortableShiftRank'),
'arguments' => array(-1, $this->getPosition() + 1, null)
... | php | public function removeFromList()
{
// Keep the list modification query for the save() transaction
$this->sortableQueries[] = array(
'callable' => array('\CustomerGroup\Model\CustomerGroupQuery', 'sortableShiftRank'),
'arguments' => array(-1, $this->getPosition() + 1, null)
... | [
"public",
"function",
"removeFromList",
"(",
")",
"{",
"// Keep the list modification query for the save() transaction",
"$",
"this",
"->",
"sortableQueries",
"[",
"]",
"=",
"array",
"(",
"'callable'",
"=>",
"array",
"(",
"'\\CustomerGroup\\Model\\CustomerGroupQuery'",
",",... | Removes the current object from the list.
The modifications are not persisted until the object is saved.
@return ChildCustomerGroup the current object | [
"Removes",
"the",
"current",
"object",
"from",
"the",
"list",
".",
"The",
"modifications",
"are",
"not",
"persisted",
"until",
"the",
"object",
"is",
"saved",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L2642-L2654 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroup.php | CustomerGroup.processSortableQueries | protected function processSortableQueries($con)
{
foreach ($this->sortableQueries as $query) {
$query['arguments'][]= $con;
call_user_func_array($query['callable'], $query['arguments']);
}
$this->sortableQueries = array();
} | php | protected function processSortableQueries($con)
{
foreach ($this->sortableQueries as $query) {
$query['arguments'][]= $con;
call_user_func_array($query['callable'], $query['arguments']);
}
$this->sortableQueries = array();
} | [
"protected",
"function",
"processSortableQueries",
"(",
"$",
"con",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"sortableQueries",
"as",
"$",
"query",
")",
"{",
"$",
"query",
"[",
"'arguments'",
"]",
"[",
"]",
"=",
"$",
"con",
";",
"call_user_func_array",... | Execute queries that were saved to be run inside the save transaction | [
"Execute",
"queries",
"that",
"were",
"saved",
"to",
"be",
"run",
"inside",
"the",
"save",
"transaction"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroup.php#L2659-L2666 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/Builder/Reflector/MethodAssembler.php | MethodAssembler.create | public function create($data)
{
$methodDescriptor = new MethodDescriptor();
$this->mapReflectorToDescriptor($data, $methodDescriptor);
$this->assembleDocBlock($data->getDocBlock(), $methodDescriptor);
$this->addArguments($data, $methodDescriptor);
$this->addVariadicArgument(... | php | public function create($data)
{
$methodDescriptor = new MethodDescriptor();
$this->mapReflectorToDescriptor($data, $methodDescriptor);
$this->assembleDocBlock($data->getDocBlock(), $methodDescriptor);
$this->addArguments($data, $methodDescriptor);
$this->addVariadicArgument(... | [
"public",
"function",
"create",
"(",
"$",
"data",
")",
"{",
"$",
"methodDescriptor",
"=",
"new",
"MethodDescriptor",
"(",
")",
";",
"$",
"this",
"->",
"mapReflectorToDescriptor",
"(",
"$",
"data",
",",
"$",
"methodDescriptor",
")",
";",
"$",
"this",
"->",
... | Creates a Descriptor from the provided data.
@param MethodReflector $data
@return MethodDescriptor | [
"Creates",
"a",
"Descriptor",
"from",
"the",
"provided",
"data",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/MethodAssembler.php#L46-L56 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/Builder/Reflector/MethodAssembler.php | MethodAssembler.mapReflectorToDescriptor | protected function mapReflectorToDescriptor($reflector, $descriptor)
{
$descriptor->setFullyQualifiedStructuralElementName($reflector->getName() . '()');
$descriptor->setName($reflector->getShortName());
$descriptor->setVisibility($reflector->getVisibility() ? : 'public');
$descripto... | php | protected function mapReflectorToDescriptor($reflector, $descriptor)
{
$descriptor->setFullyQualifiedStructuralElementName($reflector->getName() . '()');
$descriptor->setName($reflector->getShortName());
$descriptor->setVisibility($reflector->getVisibility() ? : 'public');
$descripto... | [
"protected",
"function",
"mapReflectorToDescriptor",
"(",
"$",
"reflector",
",",
"$",
"descriptor",
")",
"{",
"$",
"descriptor",
"->",
"setFullyQualifiedStructuralElementName",
"(",
"$",
"reflector",
"->",
"getName",
"(",
")",
".",
"'()'",
")",
";",
"$",
"descri... | Maps the fields to the reflector to the descriptor.
@param MethodReflector $reflector
@param MethodDescriptor $descriptor
@return void | [
"Maps",
"the",
"fields",
"to",
"the",
"reflector",
"to",
"the",
"descriptor",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/MethodAssembler.php#L66-L75 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/Builder/Reflector/MethodAssembler.php | MethodAssembler.addArguments | protected function addArguments($reflector, $descriptor)
{
foreach ($reflector->getArguments() as $argument) {
$this->addArgument($argument, $descriptor);
}
} | php | protected function addArguments($reflector, $descriptor)
{
foreach ($reflector->getArguments() as $argument) {
$this->addArgument($argument, $descriptor);
}
} | [
"protected",
"function",
"addArguments",
"(",
"$",
"reflector",
",",
"$",
"descriptor",
")",
"{",
"foreach",
"(",
"$",
"reflector",
"->",
"getArguments",
"(",
")",
"as",
"$",
"argument",
")",
"{",
"$",
"this",
"->",
"addArgument",
"(",
"$",
"argument",
"... | Adds the reflected Arguments to the Descriptor.
@param MethodReflector $reflector
@param MethodDescriptor $descriptor
@return void | [
"Adds",
"the",
"reflected",
"Arguments",
"to",
"the",
"Descriptor",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/MethodAssembler.php#L85-L90 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/Builder/Reflector/MethodAssembler.php | MethodAssembler.addArgument | protected function addArgument($argument, $descriptor)
{
$params = $descriptor->getTags()->get('param', array());
if (!$this->argumentAssembler->getBuilder()) {
$this->argumentAssembler->setBuilder($this->builder);
}
$argumentDescriptor = $this->argumentAssembler->create... | php | protected function addArgument($argument, $descriptor)
{
$params = $descriptor->getTags()->get('param', array());
if (!$this->argumentAssembler->getBuilder()) {
$this->argumentAssembler->setBuilder($this->builder);
}
$argumentDescriptor = $this->argumentAssembler->create... | [
"protected",
"function",
"addArgument",
"(",
"$",
"argument",
",",
"$",
"descriptor",
")",
"{",
"$",
"params",
"=",
"$",
"descriptor",
"->",
"getTags",
"(",
")",
"->",
"get",
"(",
"'param'",
",",
"array",
"(",
")",
")",
";",
"if",
"(",
"!",
"$",
"t... | Adds a single reflected Argument to the Method Descriptor.
@param ArgumentReflector $argument
@param MethodDescriptor $descriptor
@return void | [
"Adds",
"a",
"single",
"reflected",
"Argument",
"to",
"the",
"Method",
"Descriptor",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/MethodAssembler.php#L100-L110 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/Builder/Reflector/MethodAssembler.php | MethodAssembler.addVariadicArgument | protected function addVariadicArgument($data, $methodDescriptor)
{
if (!$data->getDocBlock()) {
return;
}
$paramTags = $data->getDocBlock()->getTagsByName('param');
/** @var ParamTag $lastParamTag */
$lastParamTag = end($paramTags);
if (!$lastParamTag) {... | php | protected function addVariadicArgument($data, $methodDescriptor)
{
if (!$data->getDocBlock()) {
return;
}
$paramTags = $data->getDocBlock()->getTagsByName('param');
/** @var ParamTag $lastParamTag */
$lastParamTag = end($paramTags);
if (!$lastParamTag) {... | [
"protected",
"function",
"addVariadicArgument",
"(",
"$",
"data",
",",
"$",
"methodDescriptor",
")",
"{",
"if",
"(",
"!",
"$",
"data",
"->",
"getDocBlock",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"paramTags",
"=",
"$",
"data",
"->",
"getDocBlock",
... | Checks if there is a variadic argument in the `@param` tags and adds it to the list of Arguments in
the Descriptor unless there is already one present.
@param MethodReflector $data
@param MethodDescriptor $methodDescriptor
@return void | [
"Checks",
"if",
"there",
"is",
"a",
"variadic",
"argument",
"in",
"the",
"@param",
"tags",
"and",
"adds",
"it",
"to",
"the",
"list",
"of",
"Arguments",
"in",
"the",
"Descriptor",
"unless",
"there",
"is",
"already",
"one",
"present",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/MethodAssembler.php#L121-L149 |
Jimdo/jimphle-data-structure | src/Jimphle/DataStructure/Base.php | Base.fromArray | public static function fromArray(array $data)
{
foreach ($data as $property => $value) {
if ($value instanceof BaseInterface) {
continue;
}
if (is_object($value)) {
$data[$property] = Map::fromObject($value);
}
if (i... | php | public static function fromArray(array $data)
{
foreach ($data as $property => $value) {
if ($value instanceof BaseInterface) {
continue;
}
if (is_object($value)) {
$data[$property] = Map::fromObject($value);
}
if (i... | [
"public",
"static",
"function",
"fromArray",
"(",
"array",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"property",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"BaseInterface",
")",
"{",
"continue",
";",
"}",
... | You should use this:
* If you want to convert an associative array into a map:
\Jimphle\DataStructure\Map::fromArray(array("foo" => "bar"));
* If you want to convert a sequential indexed array into a vector:
\Jimphle\DataStructure\Vector::fromArray(array("foo", "bar"));
@param array $data
@return BaseInterface | [
"You",
"should",
"use",
"this",
":",
"*",
"If",
"you",
"want",
"to",
"convert",
"an",
"associative",
"array",
"into",
"a",
"map",
":",
"\\",
"Jimphle",
"\\",
"DataStructure",
"\\",
"Map",
"::",
"fromArray",
"(",
"array",
"(",
"foo",
"=",
">",
"bar",
... | train | https://github.com/Jimdo/jimphle-data-structure/blob/15f784e4af48520079f8639748ab68b074dbc005/src/Jimphle/DataStructure/Base.php#L104-L122 |
KodiComponents/Support | src/Extendable.php | Extendable.extend | public function extend($name, ExtensionInterface $extension)
{
$this->getExtensions()->put($name, $extension);
$extension->set($this);
return $extension;
} | php | public function extend($name, ExtensionInterface $extension)
{
$this->getExtensions()->put($name, $extension);
$extension->set($this);
return $extension;
} | [
"public",
"function",
"extend",
"(",
"$",
"name",
",",
"ExtensionInterface",
"$",
"extension",
")",
"{",
"$",
"this",
"->",
"getExtensions",
"(",
")",
"->",
"put",
"(",
"$",
"name",
",",
"$",
"extension",
")",
";",
"$",
"extension",
"->",
"set",
"(",
... | @param string $name
@param ExtensionInterface $extension
@return ExtensionInterface | [
"@param",
"string",
"$name",
"@param",
"ExtensionInterface",
"$extension"
] | train | https://github.com/KodiComponents/Support/blob/9090543605a2354c7454d707650a0abdb815b60a/src/Extendable.php#L22-L29 |
Erdiko/core | src/Template.php | Template.initiate | public function initiate($template = null, $data = null, $templateRootFolder = ERDIKO_APP)
{
$template = ($template === null) ? $this->getDefaultTemplate() : $template;
$this->setTemplate($template);
$this->setData($data);
$this->setTemplateRootFolder($templateRootFolder);
} | php | public function initiate($template = null, $data = null, $templateRootFolder = ERDIKO_APP)
{
$template = ($template === null) ? $this->getDefaultTemplate() : $template;
$this->setTemplate($template);
$this->setData($data);
$this->setTemplateRootFolder($templateRootFolder);
} | [
"public",
"function",
"initiate",
"(",
"$",
"template",
"=",
"null",
",",
"$",
"data",
"=",
"null",
",",
"$",
"templateRootFolder",
"=",
"ERDIKO_APP",
")",
"{",
"$",
"template",
"=",
"(",
"$",
"template",
"===",
"null",
")",
"?",
"$",
"this",
"->",
"... | Constructor like initiation
@param string $template , Theme Object (Contaier)
@param mixed $data | [
"Constructor",
"like",
"initiation"
] | train | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Template.php#L33-L39 |
Erdiko/core | src/Template.php | Template.getTemplateFile | public function getTemplateFile($filename, $data)
{
if (is_file($filename.'.php')) {
ob_start();
include $filename.'.php';
return ob_get_clean();
} elseif (is_file($filename.'.html')) {
return $this->renderMustache($filename, $data);
} elseif... | php | public function getTemplateFile($filename, $data)
{
if (is_file($filename.'.php')) {
ob_start();
include $filename.'.php';
return ob_get_clean();
} elseif (is_file($filename.'.html')) {
return $this->renderMustache($filename, $data);
} elseif... | [
"public",
"function",
"getTemplateFile",
"(",
"$",
"filename",
",",
"$",
"data",
")",
"{",
"if",
"(",
"is_file",
"(",
"$",
"filename",
".",
"'.php'",
")",
")",
"{",
"ob_start",
"(",
")",
";",
"include",
"$",
"filename",
".",
"'.php'",
";",
"return",
... | Get rendered template file
Accepts one of the types of template files in this order:
php (.php), html/mustache (.html), markdown (.md)
@param string $filename , file without extension
@param array $data , associative array of data
@throws \Exception , template file does not exist | [
"Get",
"rendered",
"template",
"file",
"Accepts",
"one",
"of",
"the",
"types",
"of",
"template",
"files",
"in",
"this",
"order",
":",
"php",
"(",
".",
"php",
")",
"html",
"/",
"mustache",
"(",
".",
"html",
")",
"markdown",
"(",
".",
"md",
")"
] | train | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Template.php#L143-L159 |
Erdiko/core | src/Template.php | Template.toHtml | public function toHtml()
{
$filename = $this->getTemplateFolder().$this->getTemplate();
$data = (is_subclass_of($this->_data, 'erdiko\core\Container')) ? $this->_data->toHtml() : $this->_data;
return $this->getTemplateFile($filename, $data);
} | php | public function toHtml()
{
$filename = $this->getTemplateFolder().$this->getTemplate();
$data = (is_subclass_of($this->_data, 'erdiko\core\Container')) ? $this->_data->toHtml() : $this->_data;
return $this->getTemplateFile($filename, $data);
} | [
"public",
"function",
"toHtml",
"(",
")",
"{",
"$",
"filename",
"=",
"$",
"this",
"->",
"getTemplateFolder",
"(",
")",
".",
"$",
"this",
"->",
"getTemplate",
"(",
")",
";",
"$",
"data",
"=",
"(",
"is_subclass_of",
"(",
"$",
"this",
"->",
"_data",
","... | Render container to HTML
@return string $html | [
"Render",
"container",
"to",
"HTML"
] | train | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Template.php#L187-L193 |
heidelpay/PhpDoc | src/phpDocumentor/Plugin/Scrybe/Converter/BaseConverter.php | BaseConverter.convert | public function convert(Collection $source, TemplateInterface $template)
{
$this->fileset = $source;
$this->assets->setProjectRoot($this->fileset->getProjectRoot());
$template->setExtension(current($this->definition->getOutputFormat()->getExtensions()));
$this->configure();
... | php | public function convert(Collection $source, TemplateInterface $template)
{
$this->fileset = $source;
$this->assets->setProjectRoot($this->fileset->getProjectRoot());
$template->setExtension(current($this->definition->getOutputFormat()->getExtensions()));
$this->configure();
... | [
"public",
"function",
"convert",
"(",
"Collection",
"$",
"source",
",",
"TemplateInterface",
"$",
"template",
")",
"{",
"$",
"this",
"->",
"fileset",
"=",
"$",
"source",
";",
"$",
"this",
"->",
"assets",
"->",
"setProjectRoot",
"(",
"$",
"this",
"->",
"f... | Converts the given $source using the formats that belong to this
converter.
This method will return null unless the 'scrybe://result' is used.
@param Collection $source Collection of input files.
@param TemplateInterface $template Template used to decorate the
output with.
@return string[]|null | [
"Converts",
"the",
"given",
"$source",
"using",
"the",
"formats",
"that",
"belong",
"to",
"this",
"converter",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Scrybe/Converter/BaseConverter.php#L198-L212 |
heidelpay/PhpDoc | src/phpDocumentor/Plugin/Scrybe/Converter/BaseConverter.php | BaseConverter.addTemplateAssets | protected function addTemplateAssets($template)
{
/** @var SplFileInfo $file_info */
foreach ($template->getAssets() as $filename => $file_info) {
$this->assets->set($filename, $file_info->getRelativePathname());
}
} | php | protected function addTemplateAssets($template)
{
/** @var SplFileInfo $file_info */
foreach ($template->getAssets() as $filename => $file_info) {
$this->assets->set($filename, $file_info->getRelativePathname());
}
} | [
"protected",
"function",
"addTemplateAssets",
"(",
"$",
"template",
")",
"{",
"/** @var SplFileInfo $file_info */",
"foreach",
"(",
"$",
"template",
"->",
"getAssets",
"(",
")",
"as",
"$",
"filename",
"=>",
"$",
"file_info",
")",
"{",
"$",
"this",
"->",
"asset... | Adds the assets of the template to the Assets manager.
@param TemplateInterface $template
@return void | [
"Adds",
"the",
"assets",
"of",
"the",
"template",
"to",
"the",
"Assets",
"manager",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Scrybe/Converter/BaseConverter.php#L221-L227 |
heidelpay/PhpDoc | src/phpDocumentor/Plugin/Scrybe/Converter/BaseConverter.php | BaseConverter.getDestinationFilenameRelativeToProjectRoot | public function getDestinationFilenameRelativeToProjectRoot(File $file)
{
return substr($this->getDestinationFilename($file), strlen($this->fileset->getProjectRoot()));
} | php | public function getDestinationFilenameRelativeToProjectRoot(File $file)
{
return substr($this->getDestinationFilename($file), strlen($this->fileset->getProjectRoot()));
} | [
"public",
"function",
"getDestinationFilenameRelativeToProjectRoot",
"(",
"File",
"$",
"file",
")",
"{",
"return",
"substr",
"(",
"$",
"this",
"->",
"getDestinationFilename",
"(",
"$",
"file",
")",
",",
"strlen",
"(",
"$",
"this",
"->",
"fileset",
"->",
"getPr... | Returns the filename relative to the Project Root of the fileset.
@param File $file
@return string | [
"Returns",
"the",
"filename",
"relative",
"to",
"the",
"Project",
"Root",
"of",
"the",
"fileset",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Scrybe/Converter/BaseConverter.php#L248-L251 |
mithun12000/yii2-process | src/components/Process.php | Process.create | public function create(Action $action, $timeout = 0, ProcessPool $pcontrol = null){
if($pcontrol && $pcontrol->control instanceof Control){
$this->control = $pcontrol->control;
}else{
$this->createControl();
}
$this->process = new Child($action, $this->control, $timeout);
} | php | public function create(Action $action, $timeout = 0, ProcessPool $pcontrol = null){
if($pcontrol && $pcontrol->control instanceof Control){
$this->control = $pcontrol->control;
}else{
$this->createControl();
}
$this->process = new Child($action, $this->control, $timeout);
} | [
"public",
"function",
"create",
"(",
"Action",
"$",
"action",
",",
"$",
"timeout",
"=",
"0",
",",
"ProcessPool",
"$",
"pcontrol",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"pcontrol",
"&&",
"$",
"pcontrol",
"->",
"control",
"instanceof",
"Control",
")",
"... | Create a process
@param Action $action
@param number $timeout
@param ProcessPool $pcontrol | [
"Create",
"a",
"process"
] | train | https://github.com/mithun12000/yii2-process/blob/d4c660010381fee76159eb4c92d4b75e38442d3c/src/components/Process.php#L41-L48 |
jnaxo/country-codes | src/Country.php | Country.getInlcudeResources | public function getInlcudeResources($resource)
{
switch ($resource) {
case 'administrative_areas':
return $this->administrativeAreas()->getQuery();
case 'cities':
return $this->cities()->getQuery()->select("ctrystore_cities.*");
}
retur... | php | public function getInlcudeResources($resource)
{
switch ($resource) {
case 'administrative_areas':
return $this->administrativeAreas()->getQuery();
case 'cities':
return $this->cities()->getQuery()->select("ctrystore_cities.*");
}
retur... | [
"public",
"function",
"getInlcudeResources",
"(",
"$",
"resource",
")",
"{",
"switch",
"(",
"$",
"resource",
")",
"{",
"case",
"'administrative_areas'",
":",
"return",
"$",
"this",
"->",
"administrativeAreas",
"(",
")",
"->",
"getQuery",
"(",
")",
";",
"case... | Check if resource is related with the model. Then return resource query.
@param string $resource
@return boolean | [
"Check",
"if",
"resource",
"is",
"related",
"with",
"the",
"model",
".",
"Then",
"return",
"resource",
"query",
"."
] | train | https://github.com/jnaxo/country-codes/blob/ab1f24886e1b49eef5fd4b4eb4fb37aa7faeacd9/src/Country.php#L61-L70 |
eghojansu/moe | src/tools/Audit.php | Audit.email | function email($str,$mx=TRUE) {
$hosts=array();
return is_string(filter_var($str,FILTER_VALIDATE_EMAIL)) &&
(!$mx || getmxrr(substr($str,strrpos($str,'@')+1),$hosts));
} | php | function email($str,$mx=TRUE) {
$hosts=array();
return is_string(filter_var($str,FILTER_VALIDATE_EMAIL)) &&
(!$mx || getmxrr(substr($str,strrpos($str,'@')+1),$hosts));
} | [
"function",
"email",
"(",
"$",
"str",
",",
"$",
"mx",
"=",
"TRUE",
")",
"{",
"$",
"hosts",
"=",
"array",
"(",
")",
";",
"return",
"is_string",
"(",
"filter_var",
"(",
"$",
"str",
",",
"FILTER_VALIDATE_EMAIL",
")",
")",
"&&",
"(",
"!",
"$",
"mx",
... | Return TRUE if string is a valid e-mail address;
Check DNS MX records if specified
@return bool
@param $str string
@param $mx boolean | [
"Return",
"TRUE",
"if",
"string",
"is",
"a",
"valid",
"e",
"-",
"mail",
"address",
";",
"Check",
"DNS",
"MX",
"records",
"if",
"specified"
] | train | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/tools/Audit.php#L34-L38 |
chubbyphp/chubbyphp-negotiation | src/AcceptLanguageNegotiator.php | AcceptLanguageNegotiator.negotiate | public function negotiate(Request $request)
{
if ([] === $this->supportedLocales) {
return null;
}
if (!$request->hasHeader('Accept-Language')) {
return null;
}
$aggregatedValues = $this->aggregatedValues($request->getHeaderLine('Accept-Language'));
... | php | public function negotiate(Request $request)
{
if ([] === $this->supportedLocales) {
return null;
}
if (!$request->hasHeader('Accept-Language')) {
return null;
}
$aggregatedValues = $this->aggregatedValues($request->getHeaderLine('Accept-Language'));
... | [
"public",
"function",
"negotiate",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"[",
"]",
"===",
"$",
"this",
"->",
"supportedLocales",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",
"$",
"request",
"->",
"hasHeader",
"(",
"'Accept-Langu... | @param Request $request
@return NegotiatedValueInterface|null | [
"@param",
"Request",
"$request"
] | train | https://github.com/chubbyphp/chubbyphp-negotiation/blob/f4f8a10f2f067ecd868db9177c81f00428c42049/src/AcceptLanguageNegotiator.php#L40-L53 |
chubbyphp/chubbyphp-negotiation | src/AcceptLanguageNegotiator.php | AcceptLanguageNegotiator.compareAgainstSupportedLocales | private function compareAgainstSupportedLocales(array $aggregatedValues)
{
if (null !== $negotiatedValue = $this->exactCompareAgainstSupportedLocales($aggregatedValues)) {
return $negotiatedValue;
}
if (null !== $negotiatedValue = $this->languageCompareAgainstSupportedLocales($a... | php | private function compareAgainstSupportedLocales(array $aggregatedValues)
{
if (null !== $negotiatedValue = $this->exactCompareAgainstSupportedLocales($aggregatedValues)) {
return $negotiatedValue;
}
if (null !== $negotiatedValue = $this->languageCompareAgainstSupportedLocales($a... | [
"private",
"function",
"compareAgainstSupportedLocales",
"(",
"array",
"$",
"aggregatedValues",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"negotiatedValue",
"=",
"$",
"this",
"->",
"exactCompareAgainstSupportedLocales",
"(",
"$",
"aggregatedValues",
")",
")",
"{",
... | @param array $aggregatedValues
@return NegotiatedValueInterface|null | [
"@param",
"array",
"$aggregatedValues"
] | train | https://github.com/chubbyphp/chubbyphp-negotiation/blob/f4f8a10f2f067ecd868db9177c81f00428c42049/src/AcceptLanguageNegotiator.php#L91-L106 |
chubbyphp/chubbyphp-negotiation | src/AcceptLanguageNegotiator.php | AcceptLanguageNegotiator.exactCompareAgainstSupportedLocales | private function exactCompareAgainstSupportedLocales(array $aggregatedValues)
{
foreach ($aggregatedValues as $locale => $attributes) {
if ('*' === $locale) {
continue;
}
if (in_array($locale, $this->supportedLocales, true)) {
return new N... | php | private function exactCompareAgainstSupportedLocales(array $aggregatedValues)
{
foreach ($aggregatedValues as $locale => $attributes) {
if ('*' === $locale) {
continue;
}
if (in_array($locale, $this->supportedLocales, true)) {
return new N... | [
"private",
"function",
"exactCompareAgainstSupportedLocales",
"(",
"array",
"$",
"aggregatedValues",
")",
"{",
"foreach",
"(",
"$",
"aggregatedValues",
"as",
"$",
"locale",
"=>",
"$",
"attributes",
")",
"{",
"if",
"(",
"'*'",
"===",
"$",
"locale",
")",
"{",
... | @param array $aggregatedValues
@return NegotiatedValueInterface|null | [
"@param",
"array",
"$aggregatedValues"
] | train | https://github.com/chubbyphp/chubbyphp-negotiation/blob/f4f8a10f2f067ecd868db9177c81f00428c42049/src/AcceptLanguageNegotiator.php#L113-L126 |
chubbyphp/chubbyphp-negotiation | src/AcceptLanguageNegotiator.php | AcceptLanguageNegotiator.languageCompareAgainstSupportedLocales | private function languageCompareAgainstSupportedLocales(array $aggregatedValues)
{
foreach ($aggregatedValues as $locale => $attributes) {
if ('*' === $locale) {
continue;
}
$localeParts = explode('-', $locale);
if (2 !== count($localeParts)) ... | php | private function languageCompareAgainstSupportedLocales(array $aggregatedValues)
{
foreach ($aggregatedValues as $locale => $attributes) {
if ('*' === $locale) {
continue;
}
$localeParts = explode('-', $locale);
if (2 !== count($localeParts)) ... | [
"private",
"function",
"languageCompareAgainstSupportedLocales",
"(",
"array",
"$",
"aggregatedValues",
")",
"{",
"foreach",
"(",
"$",
"aggregatedValues",
"as",
"$",
"locale",
"=>",
"$",
"attributes",
")",
"{",
"if",
"(",
"'*'",
"===",
"$",
"locale",
")",
"{",... | @param array $aggregatedValues
@return NegotiatedValueInterface|null | [
"@param",
"array",
"$aggregatedValues"
] | train | https://github.com/chubbyphp/chubbyphp-negotiation/blob/f4f8a10f2f067ecd868db9177c81f00428c42049/src/AcceptLanguageNegotiator.php#L133-L153 |
php-lug/lug | src/Component/Behat/Context/FormContext.php | FormContext.assertSelectOptionFound | public function assertSelectOptionFound($field, $option)
{
\PHPUnit_Framework_Assert::assertTrue(
in_array($option, $this->findSelectOptions($field), true),
sprintf('The select option "%s" from the select "%s" does not exist.', $option, $field)
);
} | php | public function assertSelectOptionFound($field, $option)
{
\PHPUnit_Framework_Assert::assertTrue(
in_array($option, $this->findSelectOptions($field), true),
sprintf('The select option "%s" from the select "%s" does not exist.', $option, $field)
);
} | [
"public",
"function",
"assertSelectOptionFound",
"(",
"$",
"field",
",",
"$",
"option",
")",
"{",
"\\",
"PHPUnit_Framework_Assert",
"::",
"assertTrue",
"(",
"in_array",
"(",
"$",
"option",
",",
"$",
"this",
"->",
"findSelectOptions",
"(",
"$",
"field",
")",
... | @param string $field
@param string $option
@Then the option ":option" from the select ":field" should exist | [
"@param",
"string",
"$field",
"@param",
"string",
"$option"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Behat/Context/FormContext.php#L64-L70 |
php-lug/lug | src/Component/Behat/Context/FormContext.php | FormContext.assertSelectOptionNotFound | public function assertSelectOptionNotFound($field, $option)
{
\PHPUnit_Framework_Assert::assertFalse(
in_array($option, $this->findSelectOptions($field), true),
sprintf('The select option "%s" from the select "%s" exists.', $option, $field)
);
} | php | public function assertSelectOptionNotFound($field, $option)
{
\PHPUnit_Framework_Assert::assertFalse(
in_array($option, $this->findSelectOptions($field), true),
sprintf('The select option "%s" from the select "%s" exists.', $option, $field)
);
} | [
"public",
"function",
"assertSelectOptionNotFound",
"(",
"$",
"field",
",",
"$",
"option",
")",
"{",
"\\",
"PHPUnit_Framework_Assert",
"::",
"assertFalse",
"(",
"in_array",
"(",
"$",
"option",
",",
"$",
"this",
"->",
"findSelectOptions",
"(",
"$",
"field",
")"... | @param string $field
@param string $option
@Then the option ":option" from the select ":field" should not exist | [
"@param",
"string",
"$field",
"@param",
"string",
"$option"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Behat/Context/FormContext.php#L78-L84 |
php-lug/lug | src/Component/Behat/Context/FormContext.php | FormContext.findEmbedField | private function findEmbedField($field)
{
$page = $node = $this->getPage();
$followingSiblingXPath = '/following-sibling::*';
$labelXpathPattern = '//label[contains(text(), "%s")]';
$labels = array_map('trim', explode('->', $field));
foreach ($labels as $label) {
... | php | private function findEmbedField($field)
{
$page = $node = $this->getPage();
$followingSiblingXPath = '/following-sibling::*';
$labelXpathPattern = '//label[contains(text(), "%s")]';
$labels = array_map('trim', explode('->', $field));
foreach ($labels as $label) {
... | [
"private",
"function",
"findEmbedField",
"(",
"$",
"field",
")",
"{",
"$",
"page",
"=",
"$",
"node",
"=",
"$",
"this",
"->",
"getPage",
"(",
")",
";",
"$",
"followingSiblingXPath",
"=",
"'/following-sibling::*'",
";",
"$",
"labelXpathPattern",
"=",
"'//label... | @param string $field
@return NodeElement | [
"@param",
"string",
"$field"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Behat/Context/FormContext.php#L122-L158 |
php-lug/lug | src/Component/Behat/Context/FormContext.php | FormContext.findSelectOptions | private function findSelectOptions($field)
{
\PHPUnit_Framework_Assert::assertNotNull(
$select = $this->getPage()->findField($field),
sprintf('The select field "%s" does not exist.', $field)
);
$options = [];
foreach ($select->find('xpath', '/option') as $op... | php | private function findSelectOptions($field)
{
\PHPUnit_Framework_Assert::assertNotNull(
$select = $this->getPage()->findField($field),
sprintf('The select field "%s" does not exist.', $field)
);
$options = [];
foreach ($select->find('xpath', '/option') as $op... | [
"private",
"function",
"findSelectOptions",
"(",
"$",
"field",
")",
"{",
"\\",
"PHPUnit_Framework_Assert",
"::",
"assertNotNull",
"(",
"$",
"select",
"=",
"$",
"this",
"->",
"getPage",
"(",
")",
"->",
"findField",
"(",
"$",
"field",
")",
",",
"sprintf",
"(... | @param $field
@return string[] | [
"@param",
"$field"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Behat/Context/FormContext.php#L165-L179 |
InactiveProjects/limoncello-illuminate | app/Database/Migrations/MigrateComments.php | MigrateComments.apply | public function apply()
{
Schema::create(Model::TABLE_NAME, function (Blueprint $table) {
$table->increments(Model::FIELD_ID);
$table->unsignedInteger(Model::FIELD_ID_USER);
$table->unsignedInteger(Model::FIELD_ID_POST);
$table->text(Model::FIELD_TEXT);
... | php | public function apply()
{
Schema::create(Model::TABLE_NAME, function (Blueprint $table) {
$table->increments(Model::FIELD_ID);
$table->unsignedInteger(Model::FIELD_ID_USER);
$table->unsignedInteger(Model::FIELD_ID_POST);
$table->text(Model::FIELD_TEXT);
... | [
"public",
"function",
"apply",
"(",
")",
"{",
"Schema",
"::",
"create",
"(",
"Model",
"::",
"TABLE_NAME",
",",
"function",
"(",
"Blueprint",
"$",
"table",
")",
"{",
"$",
"table",
"->",
"increments",
"(",
"Model",
"::",
"FIELD_ID",
")",
";",
"$",
"table... | @inheritdoc
@SuppressWarnings(PHPMD.StaticAccess) | [
"@inheritdoc"
] | train | https://github.com/InactiveProjects/limoncello-illuminate/blob/cae6fc26190efcf090495a5c3582c10fa2430897/app/Database/Migrations/MigrateComments.php#L18-L36 |
bariew/yii2-i18n-cms-module | models/SourceMessage.php | SourceMessage.categoryList | public static function categoryList()
{
$data = self::find()->orderBy('category')->groupBy(['category'])->select(['category'])->column();
return array_combine($data, $data);
} | php | public static function categoryList()
{
$data = self::find()->orderBy('category')->groupBy(['category'])->select(['category'])->column();
return array_combine($data, $data);
} | [
"public",
"static",
"function",
"categoryList",
"(",
")",
"{",
"$",
"data",
"=",
"self",
"::",
"find",
"(",
")",
"->",
"orderBy",
"(",
"'category'",
")",
"->",
"groupBy",
"(",
"[",
"'category'",
"]",
")",
"->",
"select",
"(",
"[",
"'category'",
"]",
... | Gets all used categories list.
@return array source category list | [
"Gets",
"all",
"used",
"categories",
"list",
"."
] | train | https://github.com/bariew/yii2-i18n-cms-module/blob/18d2394565cdd8b5070a287a739c9007705ef18a/models/SourceMessage.php#L91-L95 |
j-d/draggy | src/Draggy/Autocode/Attribute.php | Attribute.isEntitySubtype | public function isEntitySubtype()
{
return $this->getSubtype() !== null && (null === $this->getEntity() || !in_array($this->getSubtype(), array_keys($this->getEntity()->getProject()->getAttributeTypes())));
} | php | public function isEntitySubtype()
{
return $this->getSubtype() !== null && (null === $this->getEntity() || !in_array($this->getSubtype(), array_keys($this->getEntity()->getProject()->getAttributeTypes())));
} | [
"public",
"function",
"isEntitySubtype",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"getSubtype",
"(",
")",
"!==",
"null",
"&&",
"(",
"null",
"===",
"$",
"this",
"->",
"getEntity",
"(",
")",
"||",
"!",
"in_array",
"(",
"$",
"this",
"->",
"getSubtype",... | <user-additions part="otherMethods"> | [
"<user",
"-",
"additions",
"part",
"=",
"otherMethods",
">"
] | train | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Attribute.php#L189-L192 |
inhere/php-librarys | src/Traits/LiteEventTrait.php | LiteEventTrait.on | public function on($name, callable $cb, $replace = false)
{
if ($replace || !isset($this->_events[$name])) {
$this->_events[$name] = $cb;
}
} | php | public function on($name, callable $cb, $replace = false)
{
if ($replace || !isset($this->_events[$name])) {
$this->_events[$name] = $cb;
}
} | [
"public",
"function",
"on",
"(",
"$",
"name",
",",
"callable",
"$",
"cb",
",",
"$",
"replace",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"replace",
"||",
"!",
"isset",
"(",
"$",
"this",
"->",
"_events",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
... | register a event callback
@param string $name event name
@param callable $cb event callback
@param bool $replace replace exists's event cb | [
"register",
"a",
"event",
"callback"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Traits/LiteEventTrait.php#L34-L39 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/Builder/Reflector/InterfaceAssembler.php | InterfaceAssembler.create | public function create($data)
{
$interfaceDescriptor = new InterfaceDescriptor();
$interfaceDescriptor->setFullyQualifiedStructuralElementName($data->getName());
$interfaceDescriptor->setName($data->getShortName());
$interfaceDescriptor->setLine($data->getLinenumber());
$int... | php | public function create($data)
{
$interfaceDescriptor = new InterfaceDescriptor();
$interfaceDescriptor->setFullyQualifiedStructuralElementName($data->getName());
$interfaceDescriptor->setName($data->getShortName());
$interfaceDescriptor->setLine($data->getLinenumber());
$int... | [
"public",
"function",
"create",
"(",
"$",
"data",
")",
"{",
"$",
"interfaceDescriptor",
"=",
"new",
"InterfaceDescriptor",
"(",
")",
";",
"$",
"interfaceDescriptor",
"->",
"setFullyQualifiedStructuralElementName",
"(",
"$",
"data",
"->",
"getName",
"(",
")",
")"... | Creates a Descriptor from the provided data.
@param InterfaceReflector $data
@return InterfaceDescriptor | [
"Creates",
"a",
"Descriptor",
"from",
"the",
"provided",
"data",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/InterfaceAssembler.php#L31-L54 |
lukasz-adamski/teamspeak3-framework | src/TeamSpeak3/Node.php | Node.iconGetName | public function iconGetName($key)
{
$iconid = ($this[$key] < 0) ? (pow(2, 32))-($this[$key]*-1) : $this[$key];
return new Str("/icon_" . $iconid);
} | php | public function iconGetName($key)
{
$iconid = ($this[$key] < 0) ? (pow(2, 32))-($this[$key]*-1) : $this[$key];
return new Str("/icon_" . $iconid);
} | [
"public",
"function",
"iconGetName",
"(",
"$",
"key",
")",
"{",
"$",
"iconid",
"=",
"(",
"$",
"this",
"[",
"$",
"key",
"]",
"<",
"0",
")",
"?",
"(",
"pow",
"(",
"2",
",",
"32",
")",
")",
"-",
"(",
"$",
"this",
"[",
"$",
"key",
"]",
"*",
"... | Returns the internal path of the node icon.
@param string $key
@return Str | [
"Returns",
"the",
"internal",
"path",
"of",
"the",
"node",
"icon",
"."
] | train | https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node.php#L145-L150 |
lukasz-adamski/teamspeak3-framework | src/TeamSpeak3/Node.php | Node.filterList | protected function filterList(array $nodes = array(), array $rules = array())
{
if(!empty($rules))
{
foreach($nodes as $node)
{
if(!$node instanceof Node) continue;
$props = $node->getInfo(FALSE);
$props = array_intersect_key($props, $rules);
foreach($props as $ke... | php | protected function filterList(array $nodes = array(), array $rules = array())
{
if(!empty($rules))
{
foreach($nodes as $node)
{
if(!$node instanceof Node) continue;
$props = $node->getInfo(FALSE);
$props = array_intersect_key($props, $rules);
foreach($props as $ke... | [
"protected",
"function",
"filterList",
"(",
"array",
"$",
"nodes",
"=",
"array",
"(",
")",
",",
"array",
"$",
"rules",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"rules",
")",
")",
"{",
"foreach",
"(",
"$",
"nodes",
"as"... | Filters given node list array using specified filter rules.
@param array $nodes
@param array $rules
@return array | [
"Filters",
"given",
"node",
"list",
"array",
"using",
"specified",
"filter",
"rules",
"."
] | train | https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node.php#L234-L265 |
Eresus/EresusCMS | src/core/CMS/Page.php | Eresus_CMS_Page.linkStyles | public function linkStyles($url, $media = '')
{
/* Проверяем, не добавлен ли уже этот URL */
for ($i = 0; $i < count($this->head['link']); $i++)
{
if ($this->head['link'][$i]['href'] == $url)
{
return;
}
}
$item = array('r... | php | public function linkStyles($url, $media = '')
{
/* Проверяем, не добавлен ли уже этот URL */
for ($i = 0; $i < count($this->head['link']); $i++)
{
if ($this->head['link'][$i]['href'] == $url)
{
return;
}
}
$item = array('r... | [
"public",
"function",
"linkStyles",
"(",
"$",
"url",
",",
"$",
"media",
"=",
"''",
")",
"{",
"/* Проверяем, не добавлен ли уже этот URL */",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"count",
"(",
"$",
"this",
"->",
"head",
"[",
"'link'",
"]... | Подключение CSS-файла
@param string $url URL файла
@param string $media Тип носителя
@since 2.10 | [
"Подключение",
"CSS",
"-",
"файла"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/CMS/Page.php#L251-L270 |
Eresus/EresusCMS | src/core/CMS/Page.php | Eresus_CMS_Page.addStyles | public function addStyles($content, $media = '')
{
$content = preg_replace(array('/^(\s)+/m', '/^(\S)/m'), array(' ', ' \1'), $content);
$content = rtrim($content);
$item = array('content' => $content);
if (!empty($media))
{
$item['media'] = $media;
}
... | php | public function addStyles($content, $media = '')
{
$content = preg_replace(array('/^(\s)+/m', '/^(\S)/m'), array(' ', ' \1'), $content);
$content = rtrim($content);
$item = array('content' => $content);
if (!empty($media))
{
$item['media'] = $media;
}
... | [
"public",
"function",
"addStyles",
"(",
"$",
"content",
",",
"$",
"media",
"=",
"''",
")",
"{",
"$",
"content",
"=",
"preg_replace",
"(",
"array",
"(",
"'/^(\\s)+/m'",
",",
"'/^(\\S)/m'",
")",
",",
"array",
"(",
"'\t\t'",
",",
"'\t\\1'",
")",
",",
"$",... | Встраивание CSS
@param string $content Стили CSS
@param string $media Тип носителя
@since 2.10 | [
"Встраивание",
"CSS"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/CMS/Page.php#L280-L290 |
Eresus/EresusCMS | src/core/CMS/Page.php | Eresus_CMS_Page.linkScripts | public function linkScripts($url)
{
foreach ($this->head['scripts'] as $script)
{
/** @var HtmlScriptElement $script */
if ($script->getAttribute('src') == $url)
{
return;
}
}
foreach ($this->head['jslibs'] as $script)
... | php | public function linkScripts($url)
{
foreach ($this->head['scripts'] as $script)
{
/** @var HtmlScriptElement $script */
if ($script->getAttribute('src') == $url)
{
return;
}
}
foreach ($this->head['jslibs'] as $script)
... | [
"public",
"function",
"linkScripts",
"(",
"$",
"url",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"head",
"[",
"'scripts'",
"]",
"as",
"$",
"script",
")",
"{",
"/** @var HtmlScriptElement $script */",
"if",
"(",
"$",
"script",
"->",
"getAttribute",
"(",
"... | Подключение клиентского скрипта
В качестве дополнительных параметров метод может принимать:
<b>Типы скриптов</b>
- ecma, text/ecmascript
- javascript, text/javascript
- jscript, text/jscript
- vbscript, text/vbscript
<b>Параметры загрузки скриптов</b>
- async
- defer
- top
Если скрипту передан параметр defer, то ск... | [
"Подключение",
"клиентского",
"скрипта"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/CMS/Page.php#L318-L397 |
Eresus/EresusCMS | src/core/CMS/Page.php | Eresus_CMS_Page.addScripts | public function addScripts($code)
{
$script = new HtmlScriptElement($code);
$args = func_get_args();
// Отбрасываем $code
array_shift($args);
// По умолчанию помещаем скрипты в <head>
$body = false;
foreach ($args as $arg)
{
switch (strt... | php | public function addScripts($code)
{
$script = new HtmlScriptElement($code);
$args = func_get_args();
// Отбрасываем $code
array_shift($args);
// По умолчанию помещаем скрипты в <head>
$body = false;
foreach ($args as $arg)
{
switch (strt... | [
"public",
"function",
"addScripts",
"(",
"$",
"code",
")",
"{",
"$",
"script",
"=",
"new",
"HtmlScriptElement",
"(",
"$",
"code",
")",
";",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"// Отбрасываем $code",
"array_shift",
"(",
"$",
"args",
")",
";... | Встраивает в страницу клиентские скрипты
<b>Типы скриптов</b>
- ecma, text/ecmascript
- javascript, text/javascript
- jscript, text/jscript
- vbscript, text/vbscript
<b>Параметры загрузки скриптов</b>
- head - вставить в секцию <head> (по умолчанию)
- body - вставить в секцию <body>
@param string $code Код скрипта
... | [
"Встраивает",
"в",
"страницу",
"клиентские",
"скрипты"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/CMS/Page.php#L417-L462 |
Eresus/EresusCMS | src/core/CMS/Page.php | Eresus_CMS_Page.linkJsLib | public function linkJsLib($library)
{
$args = func_get_args();
array_shift($args);
$root = Eresus_CMS::getLegacyKernel()->root;
switch ($library)
{
case 'jquery':
$this->linkScripts($root . 'core/jquery/jquery.min.js', 'lib');
if (i... | php | public function linkJsLib($library)
{
$args = func_get_args();
array_shift($args);
$root = Eresus_CMS::getLegacyKernel()->root;
switch ($library)
{
case 'jquery':
$this->linkScripts($root . 'core/jquery/jquery.min.js', 'lib');
if (i... | [
"public",
"function",
"linkJsLib",
"(",
"$",
"library",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"array_shift",
"(",
"$",
"args",
")",
";",
"$",
"root",
"=",
"Eresus_CMS",
"::",
"getLegacyKernel",
"(",
")",
"->",
"root",
";",
"switch... | Подключает библиотеку JavaScript
При множественном вызове метода, библиотека будет подключена только один раз.
Доступные библиотеки:
- jquery — {@link http://jquery.com/ jQuery}
- modernizr — {@link http://modernizr.com/ Modernizr}
- webshim — {@link http://afarkas.github.com/webshim/demos/ Webshim}
- webshims — уст... | [
"Подключает",
"библиотеку",
"JavaScript"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/CMS/Page.php#L488-L517 |
Eresus/EresusCMS | src/core/CMS/Page.php | Eresus_CMS_Page.renderHeadSection | public function renderHeadSection()
{
$result = array();
/* <meta> теги */
if (count($this->head['meta-http']))
{
foreach ($this->head['meta-http'] as $key => $value)
{
$result[] = ' <meta http-equiv="' . $key . '" content="' . $value . '" />';... | php | public function renderHeadSection()
{
$result = array();
/* <meta> теги */
if (count($this->head['meta-http']))
{
foreach ($this->head['meta-http'] as $key => $value)
{
$result[] = ' <meta http-equiv="' . $key . '" content="' . $value . '" />';... | [
"public",
"function",
"renderHeadSection",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"/* <meta> теги */",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"head",
"[",
"'meta-http'",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
... | Отрисовка секции <head>
@return string Отрисованная секция <head> | [
"Отрисовка",
"секции",
"<head",
">"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/CMS/Page.php#L524-L586 |
Eresus/EresusCMS | src/core/CMS/Page.php | Eresus_CMS_Page.renderBodySection | protected function renderBodySection()
{
$result = array();
/*
* <script>
*/
foreach ($this->body['scripts'] as $script)
{
/** @var HtmlScriptElement $script */
$result[] = $script->getHTML();
}
$result = implode("\n", $resul... | php | protected function renderBodySection()
{
$result = array();
/*
* <script>
*/
foreach ($this->body['scripts'] as $script)
{
/** @var HtmlScriptElement $script */
$result[] = $script->getHTML();
}
$result = implode("\n", $resul... | [
"protected",
"function",
"renderBodySection",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"/*\n * <script>\n */",
"foreach",
"(",
"$",
"this",
"->",
"body",
"[",
"'scripts'",
"]",
"as",
"$",
"script",
")",
"{",
"/** @var HtmlScri... | Отрисовка секции <body>
@return string HTML | [
"Отрисовка",
"секции",
"<body",
">"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/CMS/Page.php#L593-L607 |
thelia-modules/CustomerGroup | Model/CustomerQuery.php | CustomerQuery.addCustomerGroupsFilter | public static function addCustomerGroupsFilter(ModelCriteria $query, array $customerGroups)
{
if (!is_array($customerGroups) || empty($customerGroups)) {
return $query;
}
$query
// join to customer_customer_group
->addJoin(
CustomerTableMa... | php | public static function addCustomerGroupsFilter(ModelCriteria $query, array $customerGroups)
{
if (!is_array($customerGroups) || empty($customerGroups)) {
return $query;
}
$query
// join to customer_customer_group
->addJoin(
CustomerTableMa... | [
"public",
"static",
"function",
"addCustomerGroupsFilter",
"(",
"ModelCriteria",
"$",
"query",
",",
"array",
"$",
"customerGroups",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"customerGroups",
")",
"||",
"empty",
"(",
"$",
"customerGroups",
")",
")",
"{... | Filter the query by customer groups.
@param ModelCriteria $query The query to filter.
@param array $customerGroups An array of customer groups codes.
@return ModelCriteria The query. | [
"Filter",
"the",
"query",
"by",
"customer",
"groups",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/CustomerQuery.php#L48-L89 |
mothership-ec/composer | src/Composer/Autoload/AutoloadGenerator.php | AutoloadGenerator.createLoader | public function createLoader(array $autoloads)
{
$loader = new ClassLoader();
if (isset($autoloads['psr-0'])) {
foreach ($autoloads['psr-0'] as $namespace => $path) {
$loader->add($namespace, $path);
}
}
if (isset($autoloads['psr-4'])) {
... | php | public function createLoader(array $autoloads)
{
$loader = new ClassLoader();
if (isset($autoloads['psr-0'])) {
foreach ($autoloads['psr-0'] as $namespace => $path) {
$loader->add($namespace, $path);
}
}
if (isset($autoloads['psr-4'])) {
... | [
"public",
"function",
"createLoader",
"(",
"array",
"$",
"autoloads",
")",
"{",
"$",
"loader",
"=",
"new",
"ClassLoader",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"autoloads",
"[",
"'psr-0'",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"autoloads",
... | Registers an autoloader based on an autoload map returned by parseAutoloads
@param array $autoloads see parseAutoloads return value
@return ClassLoader | [
"Registers",
"an",
"autoloader",
"based",
"on",
"an",
"autoload",
"map",
"returned",
"by",
"parseAutoloads"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Autoload/AutoloadGenerator.php#L328-L345 |
mothership-ec/composer | src/Composer/Repository/Vcs/SvnDriver.php | SvnDriver.getComposerInformation | public function getComposerInformation($identifier)
{
$identifier = '/' . trim($identifier, '/') . '/';
if ($res = $this->cache->read($identifier.'.json')) {
$this->infoCache[$identifier] = JsonFile::parseJson($res);
}
if (!isset($this->infoCache[$identifier])) {
... | php | public function getComposerInformation($identifier)
{
$identifier = '/' . trim($identifier, '/') . '/';
if ($res = $this->cache->read($identifier.'.json')) {
$this->infoCache[$identifier] = JsonFile::parseJson($res);
}
if (!isset($this->infoCache[$identifier])) {
... | [
"public",
"function",
"getComposerInformation",
"(",
"$",
"identifier",
")",
"{",
"$",
"identifier",
"=",
"'/'",
".",
"trim",
"(",
"$",
"identifier",
",",
"'/'",
")",
".",
"'/'",
";",
"if",
"(",
"$",
"res",
"=",
"$",
"this",
"->",
"cache",
"->",
"rea... | {@inheritDoc} | [
"{"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Repository/Vcs/SvnDriver.php#L121-L167 |
soda-framework/eloquent-closure | src/Franzose/ClosureTable/Generators/Migration.php | Migration.create | public function create(array $options)
{
$paths = [];
$entityClass = $this->getClassName($options['entity-table']);
$closureClass = $this->getClassName($options['closure-table']);
$useInnoDB = $options['use-innodb'];
$stubPrefix = $useInnoDB ? '-innodb' : '';
$paths... | php | public function create(array $options)
{
$paths = [];
$entityClass = $this->getClassName($options['entity-table']);
$closureClass = $this->getClassName($options['closure-table']);
$useInnoDB = $options['use-innodb'];
$stubPrefix = $useInnoDB ? '-innodb' : '';
$paths... | [
"public",
"function",
"create",
"(",
"array",
"$",
"options",
")",
"{",
"$",
"paths",
"=",
"[",
"]",
";",
"$",
"entityClass",
"=",
"$",
"this",
"->",
"getClassName",
"(",
"$",
"options",
"[",
"'entity-table'",
"]",
")",
";",
"$",
"closureClass",
"=",
... | Creates migration files.
@param array $options
@return array | [
"Creates",
"migration",
"files",
"."
] | train | https://github.com/soda-framework/eloquent-closure/blob/0747773b476c3e15f599b97977261c51503d2f00/src/Franzose/ClosureTable/Generators/Migration.php#L25-L52 |
soda-framework/eloquent-closure | src/Franzose/ClosureTable/Generators/Migration.php | Migration.getPath | protected function getPath($name, $path)
{
$timestamp = Carbon::now();
if (in_array($timestamp, $this->usedTimestamps)) {
$timestamp->addSecond();
}
$this->usedTimestamps[] = $timestamp;
return $path . '/' . $timestamp->format('Y_m_d_His') . '_' . $this->getName... | php | protected function getPath($name, $path)
{
$timestamp = Carbon::now();
if (in_array($timestamp, $this->usedTimestamps)) {
$timestamp->addSecond();
}
$this->usedTimestamps[] = $timestamp;
return $path . '/' . $timestamp->format('Y_m_d_His') . '_' . $this->getName... | [
"protected",
"function",
"getPath",
"(",
"$",
"name",
",",
"$",
"path",
")",
"{",
"$",
"timestamp",
"=",
"Carbon",
"::",
"now",
"(",
")",
";",
"if",
"(",
"in_array",
"(",
"$",
"timestamp",
",",
"$",
"this",
"->",
"usedTimestamps",
")",
")",
"{",
"$... | Constructs path to migration file in Laravel style.
@param $name
@param $path
@return string | [
"Constructs",
"path",
"to",
"migration",
"file",
"in",
"Laravel",
"style",
"."
] | train | https://github.com/soda-framework/eloquent-closure/blob/0747773b476c3e15f599b97977261c51503d2f00/src/Franzose/ClosureTable/Generators/Migration.php#L83-L93 |
kiwi-suite/frontend42 | src/Block/Service/BlockAbstractFactory.php | BlockAbstractFactory.canCreate | public function canCreate(ContainerInterface $container, $requestedName)
{
/** @var BlockPluginManager $blockPluginManager */
$blockPluginManager = $container->get(BlockPluginManager::class);
$blocks = $blockPluginManager->getAvailableBlocks();
return in_array($requestedName, $block... | php | public function canCreate(ContainerInterface $container, $requestedName)
{
/** @var BlockPluginManager $blockPluginManager */
$blockPluginManager = $container->get(BlockPluginManager::class);
$blocks = $blockPluginManager->getAvailableBlocks();
return in_array($requestedName, $block... | [
"public",
"function",
"canCreate",
"(",
"ContainerInterface",
"$",
"container",
",",
"$",
"requestedName",
")",
"{",
"/** @var BlockPluginManager $blockPluginManager */",
"$",
"blockPluginManager",
"=",
"$",
"container",
"->",
"get",
"(",
"BlockPluginManager",
"::",
"cl... | Can the factory create an instance for the service?
@param ContainerInterface $container
@param string $requestedName
@return bool | [
"Can",
"the",
"factory",
"create",
"an",
"instance",
"for",
"the",
"service?"
] | train | https://github.com/kiwi-suite/frontend42/blob/67e5208387957823ac84f7833eba83d4a8dab8cd/src/Block/Service/BlockAbstractFactory.php#L21-L28 |
expectation-php/expect | src/matcher/ToHaveLength.php | ToHaveLength.match | public function match($actual)
{
$this->actual = $actual;
if (is_string($this->actual)) {
$this->type = 'string';
$this->length = mb_strlen($this->actual);
} elseif (is_array($this->actual)) {
$this->type = 'array';
$this->length = count($this... | php | public function match($actual)
{
$this->actual = $actual;
if (is_string($this->actual)) {
$this->type = 'string';
$this->length = mb_strlen($this->actual);
} elseif (is_array($this->actual)) {
$this->type = 'array';
$this->length = count($this... | [
"public",
"function",
"match",
"(",
"$",
"actual",
")",
"{",
"$",
"this",
"->",
"actual",
"=",
"$",
"actual",
";",
"if",
"(",
"is_string",
"(",
"$",
"this",
"->",
"actual",
")",
")",
"{",
"$",
"this",
"->",
"type",
"=",
"'string'",
";",
"$",
"thi... | {@inheritdoc} | [
"{"
] | train | https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/matcher/ToHaveLength.php#L66-L82 |
expectation-php/expect | src/matcher/ToHaveLength.php | ToHaveLength.reportFailed | public function reportFailed(FailedMessage $message)
{
$message->appendText('Expected ')
->appendText($this->type)
->appendText(' to have a length of ')
->appendText($this->expected)
->appendText("\n\n")
->appendText(' expected: ')
-... | php | public function reportFailed(FailedMessage $message)
{
$message->appendText('Expected ')
->appendText($this->type)
->appendText(' to have a length of ')
->appendText($this->expected)
->appendText("\n\n")
->appendText(' expected: ')
-... | [
"public",
"function",
"reportFailed",
"(",
"FailedMessage",
"$",
"message",
")",
"{",
"$",
"message",
"->",
"appendText",
"(",
"'Expected '",
")",
"->",
"appendText",
"(",
"$",
"this",
"->",
"type",
")",
"->",
"appendText",
"(",
"' to have a length of '",
")",... | {@inheritdoc} | [
"{"
] | train | https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/matcher/ToHaveLength.php#L87-L99 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/ProjectDescriptorBuilder.php | ProjectDescriptorBuilder.buildDescriptor | public function buildDescriptor($data)
{
$assembler = $this->getAssembler($data);
if (!$assembler) {
throw new \InvalidArgumentException(
'Unable to build a Descriptor; the provided data did not match any Assembler '. get_class($data)
);
}
if ... | php | public function buildDescriptor($data)
{
$assembler = $this->getAssembler($data);
if (!$assembler) {
throw new \InvalidArgumentException(
'Unable to build a Descriptor; the provided data did not match any Assembler '. get_class($data)
);
}
if ... | [
"public",
"function",
"buildDescriptor",
"(",
"$",
"data",
")",
"{",
"$",
"assembler",
"=",
"$",
"this",
"->",
"getAssembler",
"(",
"$",
"data",
")",
";",
"if",
"(",
"!",
"$",
"assembler",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
... | Takes the given data and attempts to build a Descriptor from it.
@param mixed $data
@throws \InvalidArgumentException if no Assembler could be found that matches the given data.
@return DescriptorAbstract|Collection|null | [
"Takes",
"the",
"given",
"data",
"and",
"attempts",
"to",
"build",
"a",
"Descriptor",
"from",
"it",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/ProjectDescriptorBuilder.php#L128-L152 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/ProjectDescriptorBuilder.php | ProjectDescriptorBuilder.validate | public function validate($descriptor)
{
$violations = $this->validator->validate($descriptor);
$errors = new Collection();
/** @var ConstraintViolation $violation */
foreach ($violations as $violation) {
$errors->add(
new Error(
$this-... | php | public function validate($descriptor)
{
$violations = $this->validator->validate($descriptor);
$errors = new Collection();
/** @var ConstraintViolation $violation */
foreach ($violations as $violation) {
$errors->add(
new Error(
$this-... | [
"public",
"function",
"validate",
"(",
"$",
"descriptor",
")",
"{",
"$",
"violations",
"=",
"$",
"this",
"->",
"validator",
"->",
"validate",
"(",
"$",
"descriptor",
")",
";",
"$",
"errors",
"=",
"new",
"Collection",
"(",
")",
";",
"/** @var ConstraintViol... | Validates the contents of the Descriptor and outputs warnings and error if something is amiss.
@param DescriptorAbstract $descriptor
@return Collection | [
"Validates",
"the",
"contents",
"of",
"the",
"Descriptor",
"and",
"outputs",
"warnings",
"and",
"error",
"if",
"something",
"is",
"amiss",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/ProjectDescriptorBuilder.php#L185-L203 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.