query
stringlengths 7
5.25k
| document
stringlengths 15
1.06M
| metadata
dict | negatives
sequencelengths 3
101
| negative_scores
sequencelengths 3
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
---|---|---|---|---|---|---|
Retrieve relation name from relation class | public function retrieveRelation(RelationEntityInterface $relationEntity): string|false
{
foreach ($this->getRelations() as $name => $relation) {
if ($relation === $relationEntity) {
return $name;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function relationName(): string;",
"public function getRelationFieldName() {}",
"public function getRelationshipName();",
"public function getRelation(): string\n {\n return $this->relation;\n }",
"public static function getRelationName(): Name\n {\n return new Name('composer-in-residence');\n }",
"public function getRelationshipClassName() {\n\t\treturn self::RelationshipClassNamePrefix . static::from_field_name() . static::to_field_name() . self::RelationshipClassNameSuffix;\n\t}",
"public function getRelationshipName() {\n\t\treturn self::RelationshipNamePrefix . $this->getToName() . self::RelationshipNameSuffix;\n\t}",
"public static function getRelationName(): Name\n {\n return new Name('crowdfunding');\n }",
"public static function getRelationName(): Name\n {\n return new Name('crowdfunding');\n }",
"public function getRelatedClass()\n\t{\n\t\treturn empty($this->related_class) ? ucfirst(Db_Inflector::singularize($this->getProperty())) : $this->related_class;\n\t}",
"public function getRelationModelName() {\n return $this->relationModelName;\n }",
"public function getRelationName()\n {\n if ($this->_poll_name == null) {\n //throw exception? wasn't added via Doctrine_Pollable_Storage::addGenerator()\n }\n\n return $this->_poll_name . $this->_name;\n }",
"private function getHasManyClass($obj, $relation_name) {\n\t\t$has_many = $obj->has_many();\n\t\t$rtn = '';\n\t\tforeach ($has_many as $k=>$v) {\n\t\t\tif($k == $relation_name) {\n\t\t\t\t$rtn = $v;\n\t\t\t\tbreak;\n\t\t\t} \t\n\t\t}\n\t\treturn $rtn;\n\t}",
"public static function getRelationName(): Name\n {\n return new Name('part of');\n }",
"public static function getRelationName(): Name\n {\n return new Name('glass mastered');\n }",
"public static function getRelationName(): Name\n {\n return new Name('commissioned');\n }",
"public static function getRelationName(): Name\n {\n return new Name('mixed at');\n }",
"function getRelatedClassName($column)\n {\n return $column->getRelatedClassName();\n }",
"public static function getRelationName(): Name\n {\n return new Name('allmusic');\n }",
"public function getName() {\n\n //$local_column\n switch($this->type) {\n case self::ONE_TO_ONE:\n $name = $this->getReferencedTable()->getName();\n break;\n case self::MANY_TO_ONE:\n //in this case we need to name the relation based on the column, trimming off _id (if it exists)\n $name = $this->local_columns[0]->getName();\n if(substr($name, -3) === '_id')\n $name = substr($name, 0, -3);\n break;\n case self::ONE_TO_MANY:\n //slightly more complex to remove collisions between m2m names\n $name = Wave\\Inflector::pluralize($this->getReferencedTable()->getName());\n $ref_name = $this->referenced_columns[0]->getName();\n if(substr($ref_name, -3) === '_id')\n $ref_name = substr($ref_name, 0, -3);\n if($ref_name !== $this->getLocalTable()->getName())\n $name .= '_' . $ref_name;\n break;\n case self::MANY_TO_MANY:\n $columns = $this->target_relation->getLocalColumns();\n $name = $columns[0]->getMetadata('relation_name');\n if($name === null) {\n $name = $this->target_relation->getReferencedTable()->getName();\n }\n\n $name = Wave\\Inflector::pluralize($name);\n break;\n }\n\n return Wave\\Inflector::camelize($name);\n\n }",
"public function getRelationName($attributeName);",
"public function getRelation($relation);",
"private function getHasOManyClass($obj, $relation_name) {\n\t\t$has_many = $obj->has_many();\n\t\t$rtn = '';\n\t\tforeach ($has_many as $k=>$v) {\n\t\t\tif($k == $relation_name) {\n\t\t\t\t$rtn = $v;\n\t\t\t\tbreak;\n\t\t\t} \t\n\t\t}\n\t\treturn $rtn;\n\t}",
"public function getRelationshipName(): ?string;",
"public static function getRelationName(): Name\n {\n return new Name('get the score');\n }",
"public function getRelation()\n {\n return $this->relation;\n }",
"public function getRelation()\r\n {\r\n return $this->relation;\r\n }",
"public static function getRelationName(): Name\n {\n return new Name('legal representation');\n }",
"public function getRelationPhpName(Relation $relation, $plural = false)\n {\n if ($relation->getField()) {\n if ($plural) {\n return ucfirst($this->getBuilder()->getPluralizer()->getPluralForm($relation->getField()));\n }\n\n return ucfirst($relation->getField());\n }\n\n $className = $relation->getForeignEntity()->getName();\n if ($plural) {\n $className = $this->getBuilder()->getPluralizer()->getPluralForm($className);\n }\n\n return ucfirst($className . $this->getRelatedBySuffix($relation));\n }",
"public function getRefRelationPhpName(Relation $relation, $plural = false)\n {\n $pluralizer = $this->getBuilder()->getPluralizer();\n if ($relation->getRefField()) {\n return ucfirst($plural ? $pluralizer->getPluralForm($relation->getRefField()) : $relation->getRefField());\n }\n\n $className = $relation->getEntity()->getName();\n if ($plural) {\n $className = $pluralizer->getPluralForm($className);\n }\n\n return ucfirst($className . $this->getRefRelatedBySuffix($relation));\n }",
"public function instance_slug() {\n\t\t\treturn 'relations';\n\t\t}",
"protected function getRelationTable(string $relation) : string\n {\n return $this->builder\n ->getModel()\n ->{$relation}()\n ->getRelated()\n ->getTable();\n }",
"public static function getRelationName(): Name\n {\n return new Name('online data');\n }",
"public function getRelaterName()\n {\n $value = $this->get(self::RELATER_NAME);\n return $value === null ? (string)$value : $value;\n }",
"public function getRefRelationCollVarName(Relation $relation)\n {\n return lcfirst($this->getRefRelationPhpName($relation, true));\n }",
"public function getRelationType()\n {\n return $this->relationType;\n }",
"public function getRelationType()\n {\n return $this->relationType;\n }",
"private function getHasOneClass($obj, $relation_name, $flip = false) {\n\t\t$has_one = $obj->has_one();\n\t\t$has_one = $flip ? array_flip($has_one) : $has_one;\n\t\t$rtn = '';\n\t\tforeach ($has_one as $k=>$v) {\n\t\t\tif($k == $relation_name) {\n\t\t\t\t$rtn = $v;\n\t\t\t\tbreak;\n\t\t\t} \t\n\t\t}\n\t\treturn $rtn;\n\t}",
"public function getRelationType()\n {\n return $this->relation_type;\n }",
"public function getRelationTableName()\n {\n if (!empty($this->relationTableName)) {\n return $this->relationTableName;\n }\n $relationTableName = 'tx_' . str_replace('_', '', $this->domainObject->getExtension()->getExtensionKey()) . '_';\n $relationTableName .= strtolower($this->domainObject->getName());\n\n if ($this->useExtendedRelationTableName) {\n $relationTableName .= '_' . strtolower($this->getName());\n }\n $relationTableName .= '_' . strtolower($this->getForeignModelName()) . '_mm';\n\n return $relationTableName;\n }",
"private static function getRelatedModel($model, $relationColumn) {\n return $model->foreign_keys[$relationColumn]['classname'];\n }",
"public function relationNames()\n {\n return [\n 'immobilien',\n 'kunde'\n ];\n }",
"public function relationNames()\r\n {\r\n return [\n 'especie',\n 'lance'\n ];\r\n }",
"public function getRelated(): string\n {\n return $this->related;\n }",
"public static function getRelationName(): Name\n {\n return new Name('history site');\n }",
"public function relationNames()\n {\n return [\n 'pegawais'\n ];\n }",
"public function name(): string\n {\n if (isset($this->name)) {\n return $this->name;\n }\n\n $relation = Str::studly($this->pivotRelationName);\n\n return 'detach'.$relation.'On'.$this->modelSchema->getTypename();\n }",
"public function relationNames()\n {\n return [\n 'educador',\n 'user',\n 'planoEducadorLicencas'\n ];\n }",
"protected function guessInverseRelation()\n {\n return strtolower ( str_plural ( class_basename ( $this->getParent () ) ) );\n }",
"public function relationNames()\n {\n return [\n 'akumulasiPoint',\n 'sanksi',\n 'siswa'\n ];\n }",
"public function getQualifiedForeignKeyName(): string\n {\n return $this->related->getQualifiedKeyName();\n }",
"protected function getRelatedBySuffix(Relation $relation)\n {\n $relField = '';\n foreach ($relation->getLocalForeignMapping() as $localFieldName => $foreignFieldName) {\n $localEntity = $relation->getEntity();\n $localField = $localEntity->getField($localFieldName);\n if (!$localField) {\n throw new BuildException(\n sprintf('Could not fetch field: %s in entity %s.', $localFieldName, $localEntity->getName())\n );\n }\n\n if (count($localEntity->getRelationsReferencingEntity($relation->getForeignEntityName())) > 1\n || count($relation->getForeignEntity()->getRelationsReferencingEntity($relation->getEntityName())) > 0\n || $relation->getForeignEntityName() == $relation->getEntityName()\n ) {\n // self referential foreign key, or several foreign keys to the same entity, or cross-reference fkey\n $relField .= $localField->getName();\n }\n }\n\n if (!empty($relField)) {\n $relField = 'RelatedBy' . $relField;\n }\n\n return $relField;\n }",
"public function getPKRefRelationVarName(Relation $relation)\n {\n return lcfirst($this->getRefRelationPhpName($relation, false));\n }",
"public function relationNames()\n {\n return [\n 'detailbeasiswas'\n ];\n }",
"private static function getHasOneOrManyForeignKeyName(HasOneOrMany $relation)\n {\n if (method_exists($relation, 'getPlainForeignKey')) {\n return $relation->getPlainForeignKey();\n } else {\n // for laravel 5.4+\n return $relation->getForeignKeyName();\n }\n }",
"function name_child_relationship($class_name,$foreign_key)\n\t{\n\t\tif($class_name == 'vehicle' && $foreign_key == 'supplier_id')\n\t\t{\n\t\t\treturn \"supplier\";\n\t\t}\n\t\telse if($class_name == 'delivery' && $foreign_key == 'vehicle_id')\n\t\t{\n\t\t\treturn \"vehicle\";\n\t\t}\n\t\telse if($class_name == 'delivery' && $foreign_key == 'venue_id')\n\t\t{\n\t\t\treturn \"venue\";\n\t\t}\n\t\telse if($class_name == 'delivery' && $foreign_key == 'status_id')\n\t\t{\n\t\t\treturn \"status\";\n\t\t}\n\t\telse if($class_name == 'driver' && $foreign_key == 'supplier_id')\n\t\t{\n\t\t\treturn \"supplier\";\n\t\t}\n\t\t\n\t}",
"public function relationNames()\n {\n return [];\n }",
"public function relationNames()\r\n {\r\n return [\r\n 'kelas',\r\n 'siswa'\r\n ];\r\n }",
"public static function getRelationName(): Name\n {\n return new Name('writer');\n }",
"public static function getRelationName(): Name\n {\n return new Name('distributed');\n }",
"public function getSource()\n {\n return 'cms_tag_relation';\n }",
"public static function getRelationName(): Name\n {\n return new Name('setlistfm');\n }",
"public function relationNames()\n {\n return [\n 'siswa'\n ];\n }",
"public function getRelationNames()\n\t{\n\t\treturn array_keys($this->relations);\n\t}",
"protected function frontEndDetermineRelationClassName($relationName)\n {\n if (!isset(self::$_front_end_determine_relation_classname[$relationName])) {\n $hasOne = Config::inst()->get($this->recordBeingEdited->ClassName, \"has_one\");\n if (isset($hasOne[$relationName])) {\n self::$_front_end_determine_relation_classname = $hasOne[$relationName];\n } else {\n $hasMany = Config::inst()->get($this->recordBeingEdited->ClassName, \"has_many\");\n if (isset($hasMany[$relationName])) {\n self::$_front_end_determine_relation_classname = $hasMany[$relationName];\n } else {\n $manyMany = Config::inst()->get($this->recordBeingEdited->ClassName, \"many_many\");\n if (isset($manyMany[$relationName])) {\n self::$_front_end_determine_relation_classname = $manyMany[$relationName];\n } else {\n $belongsManyMany = Config::inst()->get($this->recordBeingEdited->ClassName, \"belongs_many_many\");\n if (isset($belongsManyMany[$relationName])) {\n self::$_front_end_determine_relation_classname = $belongsManyMany[$relationName];\n } else {\n user_error(\"type could not be found\", E_USER_NOTICE);\n }\n }\n }\n }\n }\n return self::$_front_end_determine_relation_classname;\n }",
"protected function determineCategoryRelationName()\n {\n // pick a name and see if it conflicts with anything\n $tryNames = config('pxlcms.generator.standard_models.category_relation_names', []);\n\n $this->categoryRelationName = null;\n\n foreach ($tryNames as $tryName) {\n\n $tryName = trim($tryName);\n\n if ( ! $this->doesRelationNameConflict($tryName)) {\n\n $this->categoryRelationName = $tryName;\n break;\n }\n }\n\n if (empty($this->categoryRelationName)) {\n $this->context->log(\n \"Unable to find a non-conflicting category relation name for model #{$this->data->module}. \"\n . \"Relation omitted.\",\n Generator::LOG_LEVEL_ERROR\n );\n }\n\n return $this->categoryRelationName;\n }",
"protected static function getRefRelatedBySuffix(Relation $relation)\n {\n $relField = '';\n foreach ($relation->getLocalForeignMapping() as $localFieldName => $foreignFieldName) {\n $localEntity = $relation->getEntity();\n $localField = $localEntity->getField($localFieldName);\n if (!$localField) {\n throw new BuildException(\n sprintf('Could not fetch field: %s in entity %s.', $localFieldName, $localEntity->getName())\n );\n }\n $foreignKeysToForeignEntity = $localEntity->getRelationsReferencingEntity(\n $relation->getForeignEntityName()\n );\n if ($relation->getForeignEntityName() == $relation->getEntityName()) {\n // self referential foreign key\n $relField .= $relation->getForeignEntity()->getField($foreignFieldName)->getName();\n if (count($foreignKeysToForeignEntity) > 1) {\n // several self-referential foreign keys\n $relField .= array_search($relation, $foreignKeysToForeignEntity);\n }\n } elseif (count($foreignKeysToForeignEntity) > 1 || count(\n $relation->getForeignEntity()->getRelationsReferencingEntity($relation->getEntityName())\n ) > 0\n ) {\n // several foreign keys to the same entity, or symmetrical foreign key in foreign entity\n $relField .= $localField->getName();\n }\n }\n\n if (!empty($relField)) {\n $relField = 'RelatedBy' . $relField;\n }\n\n return $relField;\n }",
"public function getRel(): string;",
"public function getRelationship($name);",
"public static function getRelationName(): Name\n {\n return new Name('phonographic copyright');\n }",
"public function getQualifiedForeignKeyName()\n {\n return $this->foreignKey;\n }",
"public final function getRelation()\n {\n if ($this->_relation === null)\n {\n $this->_relation = $this->getTable()\n ->getRelation($this->getRelationAlias());\n }\n\n return $this->_relation;\n }",
"private function getRelationName(string $rangeName): ?string\n {\n if (!isset($this->classes[$rangeName])) {\n return null;\n }\n\n $class = $this->classes[$rangeName];\n\n if (null !== $class->interfaceName()) {\n if (isset($this->config['types'][$rangeName]['namespaces']['interface'])) {\n return sprintf('%s\\\\%s', $this->config['types'][$class->name()]['namespaces']['interface'], $class->interfaceName());\n }\n\n if (isset($this->config['namespaces']['interface'])) {\n return sprintf('%s\\\\%s', $this->config['namespaces']['interface'], $class->interfaceName());\n }\n\n return $class->interfaceName();\n }\n\n if (isset($this->config['types'][$rangeName]['namespaces']['class'])) {\n return sprintf('%s\\\\%s', $this->config['types'][$class->name()]['namespaces']['class'], $class->name());\n }\n\n if (isset($this->config['namespaces']['entity'])) {\n return sprintf('%s\\\\%s', $this->config['namespaces']['entity'], $rangeName);\n }\n\n return $rangeName;\n }",
"private function getPropertyName(): string\n {\n $name = $this->foreignKey->getLocalTableName();\n if ($this->hasLocalUniqueIndex()) {\n $name = TDBMDaoGenerator::toSingular($name);\n }\n return TDBMDaoGenerator::toCamelCase($name);\n }",
"public function relationNames()\n {\n return [\n 'siswas'\n ];\n }",
"public static function getRelationName(): Name\n {\n return new Name('last.fm');\n }",
"public function getRelatedTableName()\n\t{\n\t\tif ($this->related) {\n\t\t\tif (\\App\\Config::performance('SEARCH_REFERENCE_BY_AJAX')) {\n\t\t\t\treturn [$this->fieldModel->getTableName() . $this->related['sourceField'] . '.' . $this->fieldModel->getColumnName()];\n\t\t\t}\n\t\t\t$relatedModuleModel = \\Vtiger_Module_Model::getInstance($this->related['relatedModule']);\n\t\t\t$fieldModel = $relatedModuleModel->getField($this->related['relatedField']);\n\t\t\treturn $this->getRelatedTables($fieldModel->getReferenceList(), $this->related['relatedField']);\n\t\t}\n\t\treturn $this->getRelatedTables($this->getTables(), $this->fieldModel->getName());\n\t}",
"public function relationNames()\r\n {\r\n return [\n 'vendas'\n ];\r\n }",
"public function getName()\n\t{\n\t\tif(empty($this->name))\n\t\t{\n\t\t\tthrow new Db_Descriptor_MissingValueException('relation name', $this->getParentDescriptor()->getClass());\n\t\t}\n\t\t\n\t\treturn $this->name;\n\t}",
"public function getRelatedDescriptor()\n\t{\n\t\treturn Db::getDescriptor($this->getRelatedClass());\n\t}",
"private function getRelationName(string $rangeName): ?string\n {\n if (!isset($this->classes[$rangeName])) {\n return null;\n }\n\n $class = $this->classes[$rangeName];\n\n if (isset($class['interfaceName'])) {\n return $class['interfaceName'];\n }\n\n if (isset($this->config['types'][$rangeName]['namespaces']['class'])) {\n return sprintf('%s\\\\%s', $this->config['types'][$class['name']]['namespaces']['class'], $class['name']);\n }\n\n if (isset($this->config['namespaces']['entity'])) {\n return sprintf('%s\\\\%s', $this->config['namespaces']['entity'], $rangeName);\n }\n\n return $rangeName;\n }",
"public function getRel()\n {\n return $this->rel;\n }",
"public function relatedModelRelationAttribute(): string\n {\n return static::CARD_ID;\n }",
"private function _getModelForRel() {\n return substr($this->model, 0, -3);\n }",
"public function getRel()\r\n {\r\n return $this->rel;\r\n }",
"public static function getRelationName(): Name\n {\n return new Name('streaming music');\n }",
"public function getRelationTypeId()\n {\n return $this->relation_type_id;\n }",
"public function getRelationship(string $relation)\n {\n return $this->getDaoRepository()->getRelation($this, $relation);\n }",
"public static function getRelationNames(): array\n {\n return [\n 'countries',\n 'books',\n ];\n }",
"public function relationNames()\n {\n return [\n 'release'\n ];\n }",
"public function relationDataType($fieldName) {\n\t\t$configuration = $this->getConfiguration($fieldName);\n\t\treturn $configuration['foreign_table'];\n\t}",
"protected function generateRelationName($relations, $className, $table, $key, $multiple)\r\n {\r\n if (!empty($key) && substr_compare($key, 'id', -2, 2, true) === 0 && strcasecmp($key, 'id')) {\r\n $key = rtrim(substr($key, 0, -2), '_');\r\n }\r\n if ($multiple) {\r\n $key = Inflector::pluralize($key);\r\n }\r\n $name = $rawName = Inflector::id2camel($key, '_');\r\n $i = 0;\r\n while (isset($table->columns[lcfirst($name)])) {\r\n $name = $rawName . ($i++);\r\n }\r\n while (isset($relations[$className][lcfirst($name)])) {\r\n $name = $rawName . ($i++);\r\n }\r\n\r\n return $name;\r\n }",
"public function getQualifiedForeignKeyName()\n {\n return $this->farChild->qualifyColumn($this->secondKey);\n }",
"public function getIrelation()\n {\n return $this->irelation;\n }",
"public function getBeanClassName(): string\n {\n return $this->namingStrategy->getBeanClassName($this->foreignKey->getLocalTableName());\n }",
"private function getModelName() : string\n {\n return collect(explode('\\\\', get_class($this)))->last();\n }",
"public static function getRelationName(): Name\n {\n return new Name('video channel');\n }",
"public static function getRelationName(): Name\n {\n return new Name('video channel');\n }",
"public function getRelationId()\n {\n return $this->relation_id;\n }",
"public function getName() {\n $path = explode('\\\\', get_class($this->object[\"data\"]));\n return array_pop($path);\n }",
"protected function getRelationHandlerClass()\n\t{\n\t\t$t = $this->getType();\n\t\t\n\t\tswitch($t)\n\t\t{\n\t\t\tcase Db_Descriptor::HAS_MANY:\n\t\t\t\treturn 'Db_Descriptor_Relation_HasMany';\n\t\t\t\t\n\t\t\tcase Db_Descriptor::HAS_ONE:\n\t\t\t\treturn 'Db_Descriptor_Relation_HasOne';\n\t\t\t\t\n\t\t\tcase Db_Descriptor::BELONGS_TO:\n\t\t\t\treturn 'Db_Descriptor_Relation_BelongsTo';\n\t\t\t\n\t\t\tcase Db_Descriptor::MANY_TO_MANY:\n\t\t\t\treturn 'Db_Descriptor_Relation_ManyToMany';\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tthrow new UnexpectedValueException($t);\n\t\t}\n\t}"
] | [
"0.8022727",
"0.77870536",
"0.77120626",
"0.7447031",
"0.7285246",
"0.7265965",
"0.7161337",
"0.71433103",
"0.71433103",
"0.7131366",
"0.70228827",
"0.69844544",
"0.6982895",
"0.69592804",
"0.69205254",
"0.6908572",
"0.69024783",
"0.6875385",
"0.6821428",
"0.6811344",
"0.67848116",
"0.6776766",
"0.67460567",
"0.6719775",
"0.6696205",
"0.6684511",
"0.6682477",
"0.66768205",
"0.66663814",
"0.665507",
"0.66247475",
"0.6622049",
"0.66077346",
"0.6599934",
"0.65512407",
"0.65255374",
"0.65255374",
"0.65185857",
"0.6517109",
"0.6510699",
"0.650147",
"0.6492974",
"0.64886963",
"0.6487377",
"0.6485805",
"0.64712566",
"0.64660025",
"0.6456286",
"0.6448193",
"0.6447307",
"0.64457786",
"0.64250207",
"0.6413888",
"0.64016026",
"0.63905287",
"0.63781846",
"0.63612765",
"0.6360664",
"0.6321675",
"0.62982374",
"0.62945575",
"0.62906164",
"0.6267382",
"0.6259058",
"0.62462175",
"0.62460667",
"0.6227212",
"0.6207022",
"0.61793995",
"0.61760056",
"0.61747056",
"0.61561966",
"0.6149136",
"0.6133074",
"0.6129023",
"0.6121096",
"0.61035204",
"0.60994077",
"0.6098228",
"0.60891575",
"0.6056729",
"0.6051614",
"0.60099983",
"0.59973264",
"0.59965336",
"0.59803534",
"0.5968109",
"0.59676087",
"0.59670866",
"0.5939956",
"0.5931401",
"0.59301335",
"0.5926227",
"0.592521",
"0.59022975",
"0.590121",
"0.5889589",
"0.5889589",
"0.5885783",
"0.58842355",
"0.58841413"
] | 0.0 | -1 |
Get all relations or a relation if it exists | public function getRelations(?string $relation = null): array|RelationEntityInterface
{
return $relation ? ($this->relations[$relation] ?? []) : $this->relations;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getWithRelations();",
"public function getRelations();",
"public function getRelations();",
"abstract public static function relations() : ? array;",
"public function all($relations = null);",
"public function getRelations()\n {\n return $this->discoverRelations();\n }",
"public function relations()\r\n {\r\n return $this->relations;\r\n }",
"abstract function relations();",
"public function getRelations()\n {\n return $this->relations;\n }",
"public function getRelations()\n {\n return $this->relations;\n }",
"public function getRelationships(): ?array;",
"protected function getRelations()\n {\n return array();\n }",
"protected static function _relations() {\n\n\t}",
"public function fetchRelatedEagerReturnsEmptyArrayForEmptyRelationNotHasOne() {}",
"public function getRelationList();",
"public function all($relation = [])\n {\n return $this->model->with($relation)->get();\n }",
"public function getRelations()\n\t{\n\t\treturn $this->relations;\n\t}",
"public function getRelations()\n\t{\n\t\treturn $this->relations;\n\t}",
"abstract public function included(): ?JsonApiParser\\Collections\\Relations;",
"public function getRelation($relation);",
"public function getRelations()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('relations');\n }",
"public function getWithRelations() {\n\n return $this->with_relations;\n \n }",
"public function related(): ?array;",
"public function getRelation($name)\n {\n if (isset($this->dyn_eagerLoad[$name])) {\n return $this->getDynRelation($name);\n } else {\n return parent::getRelation($name);\n }\n }",
"public function findAllWithRelation()\n {\n return $this->model\n ->with(static::$relations)\n ->orderBy('is_top', 'DESC')\n ->orderBy('is_published')\n ->orderBy('created_at', 'DESC')\n ->get();\n }",
"public function fetchRelatedEagerReturnsNullForEmptyRelationHasOne() {}",
"protected function getArrayableRelations()\n {\n return $this->relations;\n }",
"public function relations()\n {\n $hasOne = $this->hasOne();\n $hasMany = $this->hasMany();\n $belongsTo = $this->belongsTo();\n $objects = new stdClass();\n\n if ($hasOne && !empty($hasOne)) {\n foreach ($hasOne as $id => $value) {\n\n $objects->$id = Relationships::hasOne(isset($value[0]) ? $value[0] : null, isset($value[1]) ? $value[1] : null, isset($value[2]) ? $value[2] : array());\n }\n }\n if ($hasMany && !empty($hasMany)) {\n foreach ($hasMany as $id => $value) {\n $objects->$id = Relationships::hasMany(isset($value[0]) ? $value[0] : null, isset($value[1]) ? $value[1] : null, isset($value[2]) ? $value[2] : array());\n }\n\n }\n if ($belongsTo && !empty($belongsTo)) {\n foreach ($belongsTo as $id => $value) {\n $objects->$id = Relationships::belongsTo(isset($value[0]) ? $value[0] : null, isset($value[1]) ? $value[1] : null, isset($value[2]) ? $value[2] : array());\n }\n }\n return $objects;\n }",
"public function getRelAll ()\n {\n \treturn ($this->db_object->getRowsAll (\"Select * from \".$this->table_prefix.$this->quiz_tables['rel']));\n }",
"public function getRelationships(ResourceInterface $resource): iterable;",
"protected function loadRelations($property) {\n if (isset($this->_related[$property])) {\n return $this->_related[$property];\n }\n if (isset($this->relationships[$property])) {\n if (is_callable($this->relationships[$property])) {\n $this->_related[$property] = $this->relationships[$property]($this);\n } else {\n list($relation, $class, $field) = $this->relationships[$property];\n switch($relation) {\n case self::BELONGS_TO:\n $this->_related[$property] = new $class($this->$field);\n break;\n case self::HAS_MANY:\n $tmp = new $class; \n $this->_related[$property] = $tmp->getAll($field.'=?', array($this->id));\n break;\n case self::HAS_ONE:\n $tmp = new $class;\n $this->_related[$property] = $tmp->getWithWhere($field.'=?', array($this->id));\n break; \n }\n }\n return isset($this->_related[$property]) ? $this->_related[$property] : null;\n }\n\n return null;\n }",
"protected function discoverRelations()\n {\n if ($this->relations === null) {\n $this->relations = [];\n\n Std::each(function ($name) {\n // Check that the relationship method is there.\n if (!method_exists($this->model, $name)) {\n throw new LackOfCoffeeException(vsprintf(\n 'The model declares a relationship named \"%s\" but' .\n ' there is no method with that name.',\n [$name]\n ));\n }\n\n $relationReflector = new ReflectionMethod(\n $this->model,\n $name\n );\n\n if (!$relationReflector->isPublic()) {\n throw new LackOfCoffeeException(vsprintf(\n 'The method for the relationship named \"%s\" should' .\n ' be public.',\n [$name]\n ));\n }\n\n $argumentCount = $relationReflector->getNumberOfParameters();\n if ($argumentCount > 0) {\n throw new LackOfCoffeeException(vsprintf(\n 'The method for the relationship named \"%s\" should' .\n ' take 0 arguments. However, it requires %d.',\n [$name, $argumentCount]\n ));\n }\n\n $relation = $this->model->$name();\n\n if (!$relation instanceof Relation) {\n throw new LackOfCoffeeException(vsprintf(\n 'The method for the relationship named \"%s\" should' .\n ' return an instance of %s. Got %s.',\n [$name, Relation::class, TypeHound::fetch($relation)]\n ));\n }\n\n $this->relations[$name] = $relation;\n }, $this->model->getRelated());\n }\n\n return $this->relations;\n }",
"public function getRelationship($name);",
"public function getRelation(string $name) {\n // We want to run a relationship query without any constrains so that we will\n // not have to remove these where clauses manually which gets really hacky\n // and error prone. We don't want constraints because we add eager ones.\n try {\n /** @var Relation $relation */\n $relation = $this->getModel()->{$name}();\n } catch (\\Exception $e) {\n throw $e;\n };\n\n $nested = $this->relationsNestedUnder($name);\n\n // If there are nested relationships set on the query, we will put those onto\n // the query instances so that they can be handled after this relationship\n // is loaded. In this way they will all trickle down as they are loaded.\n if (count($nested) > 0) {\n $relation->getQuery()->with($nested);\n }\n\n return $relation;\n }",
"protected function relationships(): array\n {\n return [];\n }",
"public function getRelation()\r\n {\r\n return $this->relation;\r\n }",
"public function loadRelated()\n {\n return;\n }",
"public function getRelation()\n {\n return $this->relation;\n }",
"public function getItemRelations()\n {\n return [];\n }",
"public function load($relations);",
"public function get_active_relations() {\n\t\t\treturn $this->_active_relations;\n\t\t}",
"public function getMandatoryRelations()\n {\n return $this->with;\n }",
"public abstract function getCustomizedRelationList();",
"public function defineRelations()\n\t{\n\t\treturn array();\n\t}",
"public function hasRelations()\r\n {\r\n return !empty($this->relations);\r\n }",
"public final function getRelation()\n {\n if ($this->_relation === null)\n {\n $this->_relation = $this->getTable()\n ->getRelation($this->getRelationAlias());\n }\n\n return $this->_relation;\n }",
"protected function _getRelation(array $params, array $args = null)\n {\n $array = array();\n\n $column = $params['column'];\n $object = $params['foreignClass'];\n $foreignColumn = $params['foreignColumn'];\n\n $object = 'model\\\\' . strtolower($object) . '\\\\' . $object;\n\n if($params['type'] == self::MANY_TO_MANY)\n {\n $relationClass = $params['relationClass'];\n $relationClass = 'model\\\\' . strtolower($relationClass) . '\\\\' . $relationClass;\n\n $left_col = static::_getTableName() . '_' . $column;\n $right_col = strtolower($object) . '_' . $foreignColumn;\n\n $relationObjects = $relationClass::find(array($left_col => $this->$column));\n\n foreach($relationObjects as $obj)\n {\n array_push($array, $object::find(array($foreignColumn => $obj->$right_col)));\n }\n }\n else\n {\n $array = $object::find(array($foreignColumn => $this->$column));\n }\n\n $params['objs'] = $array;\n array_merge($this->_dataRelations, $params);\n\n return isset($this->_dataRelations[0]['objs'][0]) ? $this->_dataRelations[0]['objs'][0] : array();\n }",
"public function &getRelation($name)\n\t{\n\t\tif (!isset($this->relations[$name]))\n\t\t{\n\t\t\tthrow new DataModel\\Relation\\Exception\\RelationNotFound(\"Relation '$name' not found\");\n\t\t}\n\n\t\treturn $this->relations[$name];\n\t}",
"private static function getsRelationsHasOne(array $relationMap) : ? array {\n $relations = static::relations();\n\n foreach ($relations as $key => $value) {\n if ($value['has'] == 'one') {\n $relationMap[$key] = $value;\n\n $classNamespace = '\\\\' . $value['model'];\n //$childRelations = $classNamespace::relations();\n\n\n\n }\n }\n var_dump($relationMap);die;\n return $relationMap;\n }",
"public function relations()\n\t{\n\t\tYii::import('application.modules.profile.models.*');\n\n\t\t//$relations = Yii::app()->cache->get('yum_user_relations');\n $relations=false;\n\t\tif($relations === false) {\n\t\t\t$relations = array();\n\n\t\t\t\t\t\n\n\t\t\tif (Yum::hasModule('profile')) {\n\t\t\t\t$relations['visits'] = array(\n\t\t\t\t\t\tself::HAS_MANY, 'YumProfileVisit', 'visited_id');\n\t\t\t\t$relations['visited'] = array(\n\t\t\t\t\t\tself::HAS_MANY, 'YumProfileVisit', 'visitor_id');\n\t\t\t\t$relations['profile'] = array(\n\t\t\t\t\t\tself::HAS_ONE, 'YumProfile', 'user_id');\n\t\t\t\t$relations['privacy'] = array(\n\t\t\t\t\t\tself::HAS_ONE, 'YumPrivacySetting', 'user_id');\n\t\t\t}\n \n $relations['role'] = array(\n\t\t\t\t\t\tself::MANY_MANY, 'Role',\n\t\t\t\t\t\t UserRole::model()->tableName().'(user_id, role_id)');\n \n\t\t\tYii::app()->cache->set('yum_user_relations', $relations, 3600);\n\t\t}\n\n\t\treturn $relations;\n\t}",
"public function getRelations()\n\t{\n\t\t$relations = $this->resource->relations;\n\n\t\t$results = array();\n\t\tforeach($relations as $relation)\n\t\t{\n\t\t\t$other = $relation->other;\n\t\t\t$name = $relation->name;\n\n\t\t\t$otherClass = null;\n\t\t\tif( ! is_null($other))\n\t\t\t{\n\t\t\t\t$otherClass = $other->getNamespaceFor('model').'\\\\'.$other->name;\n\t\t\t}\n\n\t\t\t$stub = layla_module_stubs_path().'model/'.strtolower($relation->type).'.stub';\n\t\t\t$data = compact('name', 'otherClass');\n\n\t\t\t$content = eval_blade($stub, $data);\n\n\t\t\t$results[] = $this->increaseTabs($content);\n\t\t}\n\n\t\treturn $results;\n\t}",
"public function getPossibleRelations()\n {\n return $this->possibleRelations;\n }",
"public function getRelated($alias, $arguments=null) {}",
"public function get_related_tables(){\n\t\treturn $this->related;\n\t}",
"public function getEmpty()\n\t{\n\t\t$entity = new $this->entityClass();\n\t\treturn $this->loadRelations($entity);\n\t}",
"public function getRelationships()\n {\n return $this->getSchema()->getRelationships( $this->getName() );\n }",
"public function getRelationshipAll()\n {\n $rootCategories = $this->category->whereNull('parent_id')->get();\n\n foreach ($rootCategories as $category) {\n $categories[] = $category->getDescendantsAndSelf()->toHierarchy();\n }\n $collection = new Collection();\n foreach ($categories as $category) {\n foreach ($category as $item) {\n $collection->push($item);\n }\n }\n return $collection;\n }",
"public function fill()\n {\n $relationships = $this->relationships;\n $modelRelations = $this->loadRequiredRelationships();\n\n return collect($relationships)->transform(function($relations, $key) use($modelRelations) {\n $merge = array_get($modelRelations, $key);\n return $merge ? $this->mergeRelations($merge, $relations) : $relations;\n })->all();\n }",
"public function eagerLoadsRelation(): bool\n {\n return $this->eagerLoadsRelation;\n }",
"public function getRelated()\n {\n throw new \\Exception('No related in HasOneOrManyBy');\n }",
"public function getRelationQuery()\r\n\t{\r\n\t\treturn $this->relationQuery;\r\n\t}",
"public function has_or_relation()\n {\n }",
"public function hasRelationship() {\n return $this->_has(1);\n }",
"public function relations()\n\t{\n\t\t$relations = $this->defineRelations();\n\n\t\tforeach ($relations as $name => &$config)\n\t\t{\n\t\t\t$this->_normalizeRelation($name, $config);\n\n\t\t\t// Unset any keys that CActiveRecord isn't expecting\n\t\t\tunset($config['required'], $config['unique'], $config['onDelete']);\n\t\t}\n\n\t\treturn $relations;\n\t}",
"public function relationNames()\n {\n return [];\n }",
"protected function loadRequiredRelationships()\n {\n $model = $this->model;\n $relationships = $this->relationships;\n $relations = $this->filterRelationsToLoad($relationships);\n\n $model->load($relations);\n $relations = $model->getRelations();\n $model->setRelations([]);\n\n return $relations;\n }",
"public function getQueueableRelations();",
"public function getQueueableRelations();",
"public function get($relation = [], $id)\n {\n return $this->model->with($relation)->find($id);\n }",
"private static function relations()\n {\n $files = ['OneToOne', 'OneToMany', 'ManyToMany', 'BelongsTo'];\n $folder = static::$root.'MVC/Relations'.'/';\n\n self::call($files, $folder);\n\n $files = ['ManyRelationException', 'ModelNotFindedException'];\n $folder = static::$root.'MVC/Relations/Exceptions'.'/';\n\n self::call($files, $folder);\n }",
"public function loadMissing($relations);",
"public function isRelated();",
"public function getRelationshipWhere(string $relation, array $constraints = []) : Collection\n {\n return $this->getDaoRepository()->getRelationWhere($this, $relation, $constraints);\n }",
"public function getAllMorphologysAttribute()\n {\n // There two calls return collections as defined in relations.\n $r1 = $this->morphologys1;\n $r2 = $this->morphologys2;\n\n // Merge collections and return single collection.\n return $r1->merge($r2);\n }",
"public function fetch(string $id, array $relations): Collection\n {\n }",
"public function getMorphByUserRelation($relationship);",
"public function with($relations){\n return $this->model->with($relations);\n }",
"public function getAllRefitsAttribute()\n {\n // There two calls return collections as defined in relations.\n $r1 = $this->refits1;\n $r2 = $this->refits2;\n\n // Merge collections and return single collection.\n return $r1->merge($r2);\n }",
"public function getRelatedResources()\r\n {\r\n return $this->related_resources;\r\n }",
"public function with($relations);",
"public function with( $relations );",
"public function getRelations($onlyown = true)\n {\n $tablename = $this->_table->getInternalTableName();\n $tid = Clip_Util::getTidFromString($tablename);\n\n return Clip_Util::getPubType($tid)->getRelations($onlyown);\n }",
"public function getRelated_resources()\r\n {\r\n return $this->related_resources;\r\n }",
"protected function getRelation($relation)\n\t{\n\t\t$query = $this->getModel()->$relation();\n\n\t\t// If there are nosted relationships set on the query, we will put those onto\n\t\t// the query instance so that they can be handled after this relationship\n\t\t// is loaded. In this way they'll all trickle down as they are loaded.\n\t\t$nested = $this->nestedRelations($relation);\n\n\t\tif (count($nested) > 0)\n\t\t{\n\t\t\t$query->getQuery()->with($nested);\n\t\t}\n\n\t\treturn $query;\n\t}",
"public function getEager()\n {\n return $this->getModels(['*'], false);\n }",
"protected function getRelationsAlias()\n\t{\n\t\t$method = 'get' . ucfirst($this->actionName === 'index' ? 'list' : $this->actionName) . 'Display';\n\t\tif(!method_exists($this->configuration, $method))\n\t\t{\n\t\t\t$method = 'getFormDisplay';\n\t\t}\n\t\t$fieldsets = $this->configuration->$method();\n\t\tswitch($this->actionName)\n\t\t{\n\t\t\tcase 'filter':\n\t\t\t\t$fieldsets = $this->configuration->getFilterDisplay();\n\t\t\t\tbreak;\n\t\t\tcase 'index':\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$fieldsets = array_merge($fieldsets, $this->configuration->getFormDisplay());\n\t\t\t\tbreak;\n\t\t}\n\t\t$relations = array();\n\n\t\tswitch($this->actionName)\n\t\t{\n\t\t\tcase 'filter':\n\t\t\t\treturn $this->doGetRelations($fieldsets);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tforeach($fieldsets as $fieldset=>$fields)\n\t\t\t\t{\n\t\t\t\t\tif(!is_array($fields)){\n\t\t\t\t\t\treturn $this->doGetRelations($fieldsets);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$relations = array_merge($relations, $this->doGetRelations($fields));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\treturn array_unique(array_diff($relations, array_keys($this->getDmModule()->getTable()->getRelationHolder()->getLocals())));\n\t}",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function load()\r\n\t{\r\n\t\t$entities = $this->query($this->entity, $this->relation)->getResults($this->relation);\r\n\t\t\r\n\t\t$this->loaded = true;\r\n\r\n\t\treturn $entities;\r\n\t}",
"public static function with($relations);",
"public function getRelatedPosts() {}",
"public function getLoadedRelation($relation)\n {\n if (!$this->relationLoaded($relation)) {\n $this->load($relation);\n }\n return $this->relations[$relation];\n }",
"protected function getArrayableRelations()\n\t{\n\t\treturn array_except($this->getArrayableItems($this->relations), ['data_attributes', 'dataAttributes', 'media']);\n\t}"
] | [
"0.75283116",
"0.72362983",
"0.72362983",
"0.6938541",
"0.6803234",
"0.6706036",
"0.66925234",
"0.6675745",
"0.66133076",
"0.66133076",
"0.6553688",
"0.6543287",
"0.65279835",
"0.6480925",
"0.64746624",
"0.6459365",
"0.6420765",
"0.6420765",
"0.6392417",
"0.63908726",
"0.6323156",
"0.6302642",
"0.62061447",
"0.61846566",
"0.61602485",
"0.61326516",
"0.6095287",
"0.60191613",
"0.59961176",
"0.5940865",
"0.59200686",
"0.59128296",
"0.5906217",
"0.5890144",
"0.5877702",
"0.5875858",
"0.5850369",
"0.58471864",
"0.58460367",
"0.5845424",
"0.5774144",
"0.57678026",
"0.57601786",
"0.57584745",
"0.5742652",
"0.5739565",
"0.57177174",
"0.5717693",
"0.57173455",
"0.57104784",
"0.57022303",
"0.5671795",
"0.56634486",
"0.5659784",
"0.5654129",
"0.5635522",
"0.5624078",
"0.5602473",
"0.5575252",
"0.5548581",
"0.5545878",
"0.55458635",
"0.5541889",
"0.553714",
"0.5535994",
"0.55215186",
"0.55116904",
"0.55116904",
"0.55053186",
"0.5494875",
"0.5488554",
"0.548186",
"0.54750973",
"0.5458515",
"0.54454625",
"0.54432744",
"0.544312",
"0.5427709",
"0.5412796",
"0.54099953",
"0.5402656",
"0.5402421",
"0.5397912",
"0.5391175",
"0.5384797",
"0.5376511",
"0.5362858",
"0.5362858",
"0.5362858",
"0.5362858",
"0.5362858",
"0.5362858",
"0.5362858",
"0.5362858",
"0.5362858",
"0.5360707",
"0.5358944",
"0.5347369",
"0.5344388",
"0.53410125"
] | 0.62164515 | 22 |
code should be inside a method | public function index() {
$events[] = \Calendar::event(
'Event One', //event title
false, //full day event?
'2016-04-01T0800', //start time (you can also use Carbon instead of DateTime)
'2016-04-01T1200', //end time (you can also use Carbon instead of DateTime)
0 //optionally, you can specify an event ID
);
//$eloquentEvent = EventModel::first(); //EventModel implements MaddHatter\LaravelFullcalendar\Event
$calendar = \Calendar::addEvents($events) //add an array with addEvents
->setOptions([ //set fullcalendar options
'firstDay' => 1
])->setCallbacks([ //set fullcalendar callback options (will not be JSON encoded)
'viewRender' => 'function() {alert("Callbacks!");}'
]);
return view('calendar', compact('calendar'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function helper()\n\t{\n\t\n\t}",
"public function method() {\n\t}",
"private function method1()\n\t{\n\t}",
"private function method2()\n\t{\n\t}",
"public function method()\n {\n\n }",
"public function method();",
"public function method();",
"public function method();",
"public function method();",
"public function someStuff()\n {\n \n }",
"public function work()\n {\n }",
"protected function _process() {}",
"protected function _process() {}",
"protected function _process() {}",
"protected function _process() {}",
"abstract protected function _run();",
"abstract protected function _run();",
"private function aFunc()\n {\n }",
"protected function process()\n {}",
"protected function test9() {\n\n }",
"private function static_things()\n\t{\n\n\t\t# code...\n\t}",
"public function custom()\n\t{\n\t}",
"public function test_method()\n\t{\n\n\t}",
"function process() ;",
"abstract protected function _process();",
"abstract protected function _process();",
"public function process()\n {\n\n }",
"public function take_action()\n {\n }",
"public function take_action()\n {\n }",
"abstract public function run() ;",
"public function nadar()\n {\n }",
"function run()\r\n {\r\n }",
"function metodo() {\n // Funcion normal\n }",
"protected abstract function run();",
"public function work(): void;",
"abstract function run();",
"public function aaa() {\n\t}",
"public function masodik()\n {\n }",
"public function run()\n\t{\n\t\t//\n\t}",
"public function act()\n\t{\n\t\n\t}",
"function beManaged()\n {\n }",
"public function some()\n {\n }",
"function process() {\r\n }",
"private function _i() {\n }",
"public function process() {\n }",
"public function process() {\n }",
"public function process() {\n }",
"private function __() {\n }",
"protected function protected_method() {}",
"public function serch()\n {\n }",
"public function boleta()\n\t{\n\t\t//\n\t}",
"public function bar()\n {\n }",
"protected function _exec()\n {\n }",
"private function private_method() {}",
"public function oops () {\n }",
"abstract protected function _preProcess();",
"abstract public function run();",
"abstract public function run();",
"abstract public function run();",
"abstract public function run();",
"abstract public function run();",
"abstract public function run();",
"abstract public function run();",
"abstract public function run();",
"public function main()\n\t{\n\t}",
"protected function preProcess() {}",
"public function main()\r\n {\r\n \r\n }",
"function work()\n {\n }",
"public function run()\r\n {\r\n\r\n }",
"public static function run() {\n\t}",
"final function velcom(){\n }",
"private function j() {\n }",
"function handle() ;",
"public function ex4()\n {\n }",
"abstract protected function before();",
"public function run()\n {\n //\n \n }",
"public function run(){}",
"protected abstract function performImpl();",
"public function _check()\n {\n }",
"abstract protected function external();",
"protected abstract function test();",
"protected abstract function test();",
"public function act() {\n\t}",
"public function f02()\n {\n }",
"public function run()\n {\n //leeg private\n\n }",
"protected function before(){}",
"protected function beforeMethod()\n {\n }",
"function execute()\r\n\t{\r\n\t\t\r\n\t}",
"function custom_construction() {\r\n\t\r\n\t\r\n\t}",
"public function performChecks(){\n\t\t\n\t}",
"private function before_execute()\n {\n }",
"public function run()\n {\n }",
"public function run()\n {\n }",
"public function run()\n {\n }",
"abstract protected function handle();",
"function do_something($something) {\r\n // Place your new code here\r\n }",
"function execute()\n {\n }",
"public function obtener()\n {\n }",
"public function run()\n {\n //\n }",
"public function run()\n {\n //\n }",
"public function elso()\n {\n }"
] | [
"0.6880597",
"0.6729176",
"0.6696159",
"0.6657372",
"0.64753956",
"0.64683616",
"0.64683616",
"0.64683616",
"0.64683616",
"0.6466616",
"0.6382116",
"0.63390964",
"0.63390964",
"0.63390964",
"0.63390964",
"0.6263623",
"0.6263623",
"0.61948407",
"0.6170373",
"0.6158115",
"0.61002505",
"0.60717833",
"0.6034256",
"0.60256916",
"0.60041344",
"0.60041344",
"0.5991531",
"0.597703",
"0.597703",
"0.59382135",
"0.59289837",
"0.59226584",
"0.59116894",
"0.5906978",
"0.5903843",
"0.5900615",
"0.589127",
"0.5869785",
"0.5860453",
"0.5857444",
"0.58508444",
"0.58499146",
"0.5846413",
"0.58423835",
"0.5837852",
"0.5837852",
"0.5837852",
"0.58290356",
"0.5810177",
"0.5809001",
"0.57854176",
"0.57837355",
"0.57741094",
"0.57725656",
"0.57611597",
"0.57549953",
"0.5753608",
"0.5753608",
"0.5753608",
"0.5753608",
"0.5753608",
"0.5753608",
"0.5753608",
"0.5753608",
"0.5753108",
"0.5740856",
"0.5739702",
"0.5739308",
"0.57361776",
"0.57317114",
"0.57244366",
"0.5717236",
"0.5715571",
"0.5706294",
"0.56978935",
"0.5683674",
"0.5670785",
"0.56686306",
"0.5664011",
"0.56513405",
"0.56457025",
"0.56457025",
"0.5643954",
"0.564033",
"0.5638783",
"0.56375057",
"0.56357056",
"0.5635183",
"0.5631422",
"0.5627285",
"0.562664",
"0.562582",
"0.562582",
"0.562582",
"0.5623592",
"0.5598974",
"0.55970526",
"0.55911803",
"0.558889",
"0.558889",
"0.55884707"
] | 0.0 | -1 |
Register the service provider. | public function register()
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function register()\n {\n $this->registerServices();\n }",
"public function register()\n {\n // service 由各个应用在 AppServiceProvider 单独绑定对应实现\n }",
"public function register()\n {\n //\n if (env('APP_DEBUG', false) && $this->app->isLocal()) {\n $this->app->register(\\Laravel\\Telescope\\TelescopeServiceProvider::class);\n $this->app->register(TelescopeServiceProvider::class);\n }\n }",
"public function register()\n {\n\n $this->registerBinding();\n }",
"public function register()\n\t{\n\t\t$this->registerCommands();\n\t\t$this->registerHybridAuth();\n\t}",
"public function register()\n {\n $this->registerAuthenticator();\n }",
"public function register()\n {\n $this->loadHelpers();\n \n $this->passportSetting();\n }",
"public function register()\n {\n //Bind service in IoC container\n $this->app->singleton('tenancy', function(){\n return new TenantManager();\n });\n }",
"public function register()\n {\n\n $this->app->register(HookProvider::class);\n $this->app->register(RouteProvider::class);\n// $this->app->register(InstallModuleProvider::class);\n }",
"public function register()\n\t{\n\t\t\n\t\t$this->registerViewManager();\n\t\t$this->registerResponseHandler();\n\t\t$this->registerHttpMethods();\n\t}",
"public function register()\n {\n $this->registerAccountService();\n\n $this->registerCurrentAccount();\n\n //$this->registerMenuService();\n\n //$this->registerReplyService();\n }",
"public function register()\n {\n // ...\n }",
"public function register()\n {\n // ...\n }",
"public function register() {\n $this->registerProviders();\n $this->registerFacades();\n }",
"public function register()\n {\n $this->registerServiceProvider();\n\n $this->addAssetNamespaceHint();\n $this->addStreamsNamespaceHint();\n }",
"public function register()\n {\n $this->registerRequestHandler();\n $this->registerAuthorizationService();\n $this->registerServices();\n }",
"public function register()\n {\n // register its dependencies\n $this->app->register(\\Cviebrock\\EloquentSluggable\\ServiceProvider::class);\n }",
"public function register(){\n $this->registerDependencies();\n $this->registerAlias();\n $this->registerServiceCommands();\n }",
"public function register()\n {\n $this->registerContracts();\n }",
"public function register()\n\t{\n $this->registerApi();\n\t}",
"public function register()\n {\n \n $this->registerLoader();\n $this->registerTranslator();\n }",
"public function register()\r\n {\r\n Passport::ignoreMigrations();\r\n\r\n $this->app->singleton(\r\n CityRepositoryInterface::class,\r\n CityRepository::class\r\n );\r\n\r\n $this->app->singleton(\r\n BarangayRepositoryInterface::class,\r\n BarangayRepository::class\r\n );\r\n }",
"public function register() {\n //\n }",
"public function register() {\n //\n }",
"public function register() {\n //\n }",
"public function register() {\n //\n }",
"public function register() {\n //\n }",
"public function register() {\n //\n }",
"public function register() {\n //\n }",
"public function register() {\n //\n }",
"public function register()\n {\n $this->registerServiceProviders();\n $this->registerSettingsService();\n $this->registerHelpers();\n }",
"public function register()\n {\n /**\n * Register additional service\n * providers if they exist.\n */\n foreach ($this->providers as $provider) {\n if (class_exists($provider)) {\n $this->app->register($provider);\n }\n }\n }",
"public function register()\n {\n $this->registerAssets();\n $this->registerServices();\n }",
"public function register()\n\t{\n\n $this->registerUserService();\n $this->registerCountryService();\n $this->registerMetaService();\n $this->registerLabelService();\n $this->registerTypeService();\n $this->registerGroupeService();\n $this->registerActiviteService();\n $this->registerRiiinglinkService();\n $this->registerInviteService();\n $this->registerTagService();\n $this->registerAuthService();\n $this->registerChangeService();\n $this->registerRevisionService();\n $this->registerUploadService();\n //$this->registerTransformerService();\n }",
"public function register()\n {\n $this->registerFinite();\n }",
"public function register()\n {\n $this->setupConfig();\n\n $this->bindServices();\n }",
"public function register()\n {\n $this->registerServices();\n $this->setupStubPath();\n $this->registerProviders();\n }",
"public function register()\n {\n $this->app['cache'] = $this->app->share(function($app)\n {\n return new CacheManagerMaster($app);\n });\n\n $this->app['memcached.connector'] = $this->app->share(function()\n {\n return new MemcachedConnector;\n });\n\n $this->registerCommands();\n }",
"public function register()\n {\n $this->registerFactory();\n $this->registerManager();\n $this->registerBindings();\n }",
"public function register()\n {\n $this->registerFactory();\n $this->registerManager();\n $this->registerBindings();\n }",
"public function register()\n {\n $this->registerFactory();\n $this->registerManager();\n $this->registerBindings();\n }",
"public function register()\n {\n $this->registerBrowser();\n\n $this->registerViewFinder();\n }",
"public function register()\n {\n $this->registerCacheManager();\n $this->registerCourier();\n }",
"public function register()\n {\n $this->app->singleton(Adapter::class, function () {\n\n return new Adapter(config('services.sso.id'), config('services.sso.secret'));\n\n });\n }",
"public function register()\n {\n $this->registerRollbar();\n }",
"public function register()\n {\n $this->configure();\n }",
"public function register()\n {\n $this->registerFactory();\n $this->registerManager();\n }",
"public function register(): void\n {\n parent::register();\n\n $this->singleton(RouteViewerContract::class, RouteViewer::class);\n }",
"public function register() {\n\n }",
"public function register()\n {\n $this->registerFlareFacade();\n $this->registerServiceProviders();\n $this->registerBindings();\n }",
"public function register()\n {\n $this->registerBindings();\n $this->registerEventListeners();\n }",
"public function register()\n {\n //\n if ($this->app->environment() !== 'production') {\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n }\n\n\n\n\n $this->app->register(ResponseMacroServiceProvider::class);\n $this->app->register(TwitterServiceProvider::class);\n }",
"public function register()\n {\n $this->app->singleton(Service\\TagsSynchronizer::class, function ($app) {\n return new Service\\TagsSynchronizer();\n });\n }",
"public function register() {\n }",
"public function register() {\n }",
"public function register() {\n }",
"public function register() {\n }"
] | [
"0.71774215",
"0.7054453",
"0.6968271",
"0.69677705",
"0.6952019",
"0.6931252",
"0.6926226",
"0.6918423",
"0.6899592",
"0.6895726",
"0.6894278",
"0.68906504",
"0.68906504",
"0.6883112",
"0.6872877",
"0.6865099",
"0.68640506",
"0.68627584",
"0.68624485",
"0.68491566",
"0.6823619",
"0.68196595",
"0.681956",
"0.681956",
"0.681956",
"0.681956",
"0.681956",
"0.681956",
"0.681956",
"0.681956",
"0.68090034",
"0.68089324",
"0.6807419",
"0.6803942",
"0.6802752",
"0.679191",
"0.67904466",
"0.67874974",
"0.6785141",
"0.6785141",
"0.6785141",
"0.6780175",
"0.67768264",
"0.6776666",
"0.6770326",
"0.6762759",
"0.67627436",
"0.67611307",
"0.6757141",
"0.67570823",
"0.67548144",
"0.6753397",
"0.6753232",
"0.67504245",
"0.67504245",
"0.67504245",
"0.67504245"
] | 0.0 | -1 |
Bootstrap the application events. | public function boot()
{
// Publish the Configuration File
$this->publishConfigurationFile();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function boot()\n {\n\n Event::listen('pages.menuitem.listTypes', function () {\n return [\n 'portfolio-item' => 'depcore.portfolio::lang.portfolioitem.label' ,\n 'all-portfolio-items' => 'depcore.portfolio::lang.portfolioitems.menu_label',\n ];\n });\n\n Event::listen('pages.menuitem.getTypeInfo', function ($type) {\n if ($type === 'portfolio-item' or $type == 'all-portfolio-items') {\n return PortfolioItem::getMenuTypeInfo($type);\n }\n });\n\n Event::listen('pages.menuitem.resolveItem', function ($type, $item, $url, $theme) {\n if ($type === 'portfolio-item' or $type == 'all-portfolio-items') {\n return PortfolioItem::resolveMenuItem($item, $url, $theme);\n }\n });\n\n }",
"public function boot()\n {\n Event::listen(\n AppointmentConfirmed::class,\n [SendConfirmMail::class, 'handle']\n );\n\n Event::listen(\n DoctorAccepted::class,\n [SendDoctorAcceptanceMail::class, 'handle']\n );\n\n Event::listen(\n ClinicAccepted::class,\n [SendClinicAcceptanceMail::class, 'handle']\n );\n \n Event::listen(\n NewRegistered::class,\n [SendCodeMail::class, 'handle']\n );\n }",
"public function boot()\n {\n // Observe event\n // For example:\n // User::observe( new UserObserver );\n }",
"public function boot()\n {\n Schema::defaultStringLength(191);\n\n Paginator::useBootstrap();\n\n SiteMenu::observe(SiteMenuObserver::class);\n Art::observe(ArtObserver::class);\n }",
"public function boot()\n {\n Event::listen(ServingNova::class, function () {\n Nova::script('awesome-nova-tool-actions', dirname(__DIR__) . '/dist/js/actions.js');\n });\n }",
"public function boot(): void\n {\n $this->publishAndLoadPackageComponents();\n\n $this->registerAndScheduleCommands();\n\n $this->setPaginatorStyling();\n }",
"public function boot()\n {\n $this->bootModulesMenu();\n $this->bootSkinComposer();\n $this->bootCustomBladeDirectives();\n }",
"protected function boot()\n {\n //Nothing to do here, but you can override this function in child classes.\n }",
"public function boot()\n {\n $this->configuration();\n $this->assets();\n $this->fonts();\n $this->views();\n }",
"public function boot()\n {\n $this->setupListeners();\n }",
"public function boot()\n\t{\n\t\t$this->setupLogging();\n\t}",
"public function boot()\n {\n BelongsTo::setEventDispatcher($this->app['events']);\n HasMany::setEventDispatcher($this->app['events']);\n HasOne::setEventDispatcher($this->app['events']);\n MorphMany::setEventDispatcher($this->app['events']);\n MorphOne::setEventDispatcher($this->app['events']);\n MorphTo::setEventDispatcher($this->app['events']);\n }",
"public function boot()\n {\n $this->handleConfig();\n }",
"public function boot(): void\n {\n $this->registerEvents();\n $this->registerQueueConnectors();\n }",
"public function boot()\n {\n // Event Listeners\n $this->eventListeners($this->events);\n\n // Event Subscriptions\n $this->eventSubscriptions($this->eventSubscribers);\n\n // Observers\n $this->addObservers($this->observers);\n\n // Extensions\n $this->registerExtensions($this->extensions);\n\n // Features\n $this->registerFeatures($this->features);\n\n // Permissions\n $this->registerPermissions($this->permissions);\n }",
"public function boot()\n {\n //\n // View::share('assetDir', env('APP_ENV') == 'production' ? 'build/' : '');\n // View::share('assetPath', env('APP_ENV') == 'production' ? 'mix' : 'asset');\n\n // TODO: Model Observer\n// Change::observe(ChangeObserver::class);\n }",
"protected static function boot()\n {\n static::addGlobalScope(new EventScope);\n static::addGlobalScope(new ApprovedEventScope);\n parent::boot();\n }",
"protected static function boot()\n {\n }",
"public function boot()\n {\n Book::observe(BookObserver::class);\n }",
"public function boot()\n {\n $this->setupConfig();\n }",
"public function boot()\n {\n $this->setupConfig();\n }",
"public function boot()\n {\n $this->setupConfig();\n }",
"public function boot()\n {\n $this->setupConfig();\n }",
"public function boot()\n {\n $this->setupConfig();\n }",
"public function boot()\n {\n $this->setupConfig();\n }",
"public function boot()\n {\n $this->setupConfig();\n }",
"public function boot()\n {\n $this->setupConfig();\n }",
"public function boot()\n {\n $this->bootEvents();\n\n $this->bootPublishes();\n\n $this->bootTypes();\n\n $this->bootSchemas();\n\n $this->bootRouter();\n\n $this->bootViews();\n \n $this->bootSecurity();\n }",
"public function boot()\n {\n $this->setupConfig($this->app);\n }",
"public function boot()\n {\n Senha::observe(new SenhaObserver());\n }",
"public function boot()\n {\n $this->dispatch(new SetCoreConnection());\n $this->dispatch(new ConfigureCommandBus());\n $this->dispatch(new ConfigureTranslator());\n $this->dispatch(new LoadStreamsConfiguration());\n\n $this->dispatch(new InitializeApplication());\n $this->dispatch(new AutoloadEntryModels());\n $this->dispatch(new AddAssetNamespaces());\n $this->dispatch(new AddImageNamespaces());\n $this->dispatch(new AddViewNamespaces());\n $this->dispatch(new AddTwigExtensions());\n $this->dispatch(new RegisterAddons());\n }",
"public function boot()\n {\n // Load the user's events, tasks, plugins, and configurations\n $this->credentials->syncConnectionCredentials();\n $this->tasks->registerConfiguredEvents();\n }",
"public function boot()\n {\n\t\t//\n }",
"public function boot(): void\n {\n foreach ($this->observers as $model => $observer) {\n foreach ($observer as $item) {\n $model::observe($item);\n }\n }\n\n foreach ($this->listen as $event => $listeners) {\n foreach (array_unique($listeners, SORT_REGULAR) as $listener) {\n Event::listen($event, $listener);\n }\n }\n }",
"public function boot()\n {\n Transaction::observe(TransactionObserver::class);\n Offer::observe(OfferObserver::class);\n }",
"public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->loadMigrations();\n }\n if(config($this->vendorNamespace. '::config.enabled')){\n Livewire::component($this->vendorNamespace . '::login-form', LoginForm::class);\n $this->loadRoutes();\n $this->loadViews();\n $this->loadMiddlewares();\n $this->loadTranslations();\n }\n }",
"public function boot()\n\t{\n\t\t$this->package('tlr/l4-cms');\n\n\t\t$this->reassignDefaultViews();\n\n\t\t$this->routes( $this->app['router'], $this->app['events'] );\n\n\t\t$this->adminMenu();\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n $this->composeNavigation();\n $this->composeTags();\n $this->composeRecent();\n $this->composeProducts();\n $this->composeListGroup();\n $this->composeAdsIndex();\n }",
"public function boot()\n {\n //Send Menu to wordpress actions hook\n if (is_admin()) {\n $this->app['wp.admin.menu']->send();\n }\n }",
"public function boot() {\n \n }",
"protected static function boot()\n\t{\n\t\tparent::boot();\n\t}",
"public function boot()\r\n {\r\n // Publishing is only necessary when using the CLI.\r\n if ($this->app->runningInConsole()) {\r\n $this->bootForConsole();\r\n }\r\n }",
"public function boot()\n {\n // Bootstrap handles\n //$this->routeHandle();\n $this->configHandle();\n $this->langHandle();\n $this->viewHandle();\n $this->assetHandle();\n $this->migrationHandle();\n $this->pulishControllerStub();\n $this->pulishRouteStub();\n \n }",
"public function boot()\n {\n View::composer('includes.nav', function ($view) {\n $menus = $this->app->make('App\\Services\\MenuService');\n $view->with('menus',$menus->buildSideMenu());\n });\n // automatically create production after purchase order saved\n SaleOrder::observe(SaleOrderObserver::class);\n }",
"public function boot() {\n\n\t\t$this->register_cli_commands();\n\n\t\t$this->register_routes();\n\n\t\t$this->apply_sitemap_optimisations();\n\n\t}",
"public function boot()\n {\n Exchange::observe(ExchangeObserver::class);\n Withdrawal::observe(WithdrawalObserver::class);\n Topup::observe(TopupObserver::class);\n }",
"public function boot()\n {\n $this->bootSetTimeLocale();\n $this->bootBladeHotelRole();\n $this->bootBladeHotelGuest();\n $this->bootBladeIcon();\n }",
"public function boot()\n {\n Event::listen('eloquent.created: *', function($data,$data2) {\n $this->save_event('crear',$data2);\n });\n\n Event::listen('eloquent.updated: *', function($data,$data2) {\n $this->save_event('actualizar',$data2);\n });\n\n Event::listen('eloquent.deleting: *', function($data,$data2) {\n $this->save_event('borrar',$data2);\n });\n }",
"public function boot()\n {\n Banner::observe(BannerObserver::class);\n Booking::observe(BookingObserver::class);\n Coupon::observe(CouponObserver::class);\n Customer::observe(CustomerObserver::class);\n Restaurant::observe(RestaurantObserver::class);\n Facility::observe(FacilityObserver::class);\n Gallery::observe(GalleryObserver::class);\n Menu::observe(MenuObserver::class);\n User::observe(UserObserver::class);\n RoomType::observe(RoomTypeObserver::class);\n Paginator::useBootstrap();\n }",
"public function boot()\n {\n Schema::defaultStringLength(191);\n\n $this->loadTranslationsFrom(__DIR__ .'/resources/lang', __NAMESPACE__);\n\n Blade::directive('module', function ($modules) {\n return \"<?php if(\\EmilMoe\\Base\\Module::loaded($modules)): ?>\";\n });\n\n Blade::directive('endmodule', function () {\n return '<?php endif; ?>';\n });\n\n $this->app->booted(function () {\n $schedule = $this->app->make(Schedule::class);\n $schedule->command('cleanup')->hourly();\n });\n }",
"public function boot()\r\n {\r\n //\r\n }",
"public function boot()\r\n {\r\n //\r\n }",
"public function boot()\r\n {\r\n //\r\n }",
"public function boot()\r\n {\r\n //\r\n }",
"protected static function boot()\n {\n parent::boot();\n\t\n\t\tHomeSection::observe(HomeSectionObserver::class);\n\t\t\n static::addGlobalScope(new ActiveScope());\n }",
"public function boot() : void\n {\n $eventBus = $this->app->make(EventBus::class);\n\n // The projections config contains a list of class names or projectors.\n // Each of these projectors will be subscribed to the given event bus.\n $projectors = $this->app->config->get('event_sourcing.projectors');\n\n foreach ($projectors as $projector) {\n $eventBus->subscribe(\n $this->app->make($projector)\n );\n }\n\n Reconstitution::reconstituteUsing(\n new ReconstituteUsingInstantiatorAndHydrator(\n new Instantiator(),\n new HydrateUsingReflection()\n )\n );\n }",
"public function boot()\n {\n Dictionary::observe(DictionaryObserver::class);\n HouseLevy::observe(HouseLevyObserver::class);\n LandLevy::observe(LandLevyObserver::class);\n Period::observe(PeriodObserver::class);\n }",
"public function boot()\n {\n $this->strapRoutes();\n $this->strapViews();\n $this->strapMigrations();\n $this->strapCommands();\n\n $this->registerPolicies();\n }",
"public function boot() {\n //\n }",
"public function boot() {\n //\n }",
"public function boot() {\n //\n }",
"public function boot()\n {\n Stripe::setApiKey(env('STRIPE_SECRET'));\n Cashier::useCurrency('eur', '€');\n \n View::composer('front.layout', function (\\Illuminate\\Contracts\\View\\View $view) {\n $view->with('menu_games', $this->getPlatformsWithGames());\n });\n \n User::observe(UploadablesObserver::class);\n Team::observe(UploadablesObserver::class);\n Platform::observe(UploadablesObserver::class);\n Game::observe(UploadablesObserver::class);\n Network::observe(UploadablesObserver::class);\n Map::observe(UploadablesObserver::class);\n }",
"public function boot()\n {\n\t $this->composeHubs();//hub list\n\t $this->composeTopMenuDefault();// top menu for default main page\n\t $this->composeTopHubMenu();//top menu for default(overall) hub wise\n\t $this->composeTopmenu();//top menu for hub/country/\n\t \n\t $this->composeSidemenuDefault();\n\t $this->composeSidemenuHub();\n\t $this->composeSidemenu();\n\t $this->composePagemenu();\n }",
"public static function boot ()\n {\n parent::boot();\n self::observe(new UIActionObserver());\n }",
"public function boot()\n {\n $this->bootViews();\n\n $this->bootPublishedFiles();\n }",
"public function boot()\n\t{\n\t\tif(!Menu::instance('sidebar'))\n\t\t{\n\t\t\tMenu::create('sidebar-menu', function ($menu) {\n\t\t\t\t$menu->setPresenter('App\\Presenters\\SidebarMenuPresenter');\n\t\t\t\t$menu->enableOrdering(); // enable ordering\n\t\t\t});\n\t\t}\n\t}",
"public function boot()\n {\n parent::boot();\n\n User::observe($this->app->make(UserObserver::class));\n AnalyticsEvent::observe($this->app->make(AnalyticsEventObserver::class));\n }",
"public static function boot()\n {\n Session::start();\n\n Env::load();\n \n require_once __DIR__ . '/../../app/Routes/routes.php';\n\n require_once __DIR__ . '/globals.php';\n\n Request::setCurrent();\n\n Router::run();\n }",
"public function boot(Dispatcher $events)\n {\n \\URL::forceScheme(parse_url(config('app.url'))['scheme']);\n JetstrapFacade::useAdminLte3();\n\n $this->menu_build($events);\n }",
"public function boot()\n {\n Image::observe(ImageObserver::class);\n Section::observe(SectionObserver::class);\n Post::observe(PostObserver::class);\n Virtual_Book::observe(VirtualBookObserver::class);\n Book::observe(BookObserver::class);\n }",
"public function boot()\n {\n if ($this->app->isLocal()) {\n Redis::enableEvents();\n }\n\n Image::observe(ImageObserver::class);\n Domain::observe(DomainObserver::class);\n }",
"public function boot()\n\t{\n\t\t$ext_translate = new Classes\\Translate();\n\t\t$ext_translate->menu();\n\t}",
"public function boot()\n {\n $this->registerResources();\n $this->registerTab();\n $this->registerViewComposer();\n // $this->publishFiles();\n //$this->registerListener();\n }",
"public static function boot() \n\t{\n parent::boot();\n \n // AuthorizedEmployee::observe(new AuthorizedEmployeeObserver());\n }",
"public function bootstrap()\n {\n if (!$this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrappers());\n }\n\n //$this->app->loadDeferredProviders();\n\n if (!$this->commandsLoaded) {\n //$this->commands();\n\n $this->commandsLoaded = true;\n }\n }",
"protected function bootstrap()\n {\n }",
"public function boot()\n {\n parent::boot();\n User::observe(UserObserver::class);\n Lead::observe(LeadObserver::class);\n Contact::observe(ContactObserver::class);\n Business::observe(BusinessObserver::class);\n Lender::observe(LenderObserver::class);\n Application::observe(ApplicationObserver::class);\n }",
"public function boot()\n\t{\n\t\t\n\t}",
"public function boot()\n\t{\n\t\t\n\t}",
"public function boot() {\n\t\t//\n\t}",
"public function boot() {\n\t\t//\n\t}",
"public function boot(Dispatcher $events)\n {\n parent::boot($events);\n\n //\n require app_path('Events.php');\n }",
"public function boot(): void\n {\n // routes\n $this->loadRoutes();\n // assets\n $this->loadAssets('assets');\n // configuration\n $this->loadConfig('configs');\n // views\n $this->loadViews('views');\n // view extends\n $this->extendViews();\n // translations\n $this->loadTranslates('views');\n // adminer\n $this->loadAdminer('adminer');\n // commands\n $this->loadCommands();\n // gates\n $this->registerGates();\n // listeners\n $this->registerListeners();\n // settings\n $this->applySettings();\n }",
"public function boot()\n {\n $this->publishConfig();\n\t\t\n\t\t$this->publishMigration();\n\n $this->registerBladeExtensions();\n }",
"public function boot() {\n\t\t// TODO: Implement boot() method.\n\t}",
"public function boot()\n {\n //Register Observers\n Employee::observe(EmployeeObserver::class);\n Lead::observe(LeadObserver::class);\n }",
"public function boot()\n {\n //\n ChatConversation::observe(ChatConversationsObserver::class); // 호미차감\n }"
] | [
"0.7476131",
"0.7449455",
"0.74397516",
"0.7425866",
"0.73787534",
"0.73327506",
"0.7290027",
"0.72789234",
"0.7272027",
"0.72545135",
"0.7238835",
"0.72026354",
"0.7201436",
"0.7192646",
"0.7188356",
"0.7178903",
"0.71773785",
"0.7174105",
"0.7166155",
"0.7162653",
"0.7162653",
"0.7162653",
"0.7162653",
"0.7162653",
"0.7162653",
"0.7162653",
"0.7162653",
"0.71624017",
"0.71610874",
"0.7159929",
"0.7154877",
"0.715156",
"0.71493804",
"0.71483296",
"0.71442264",
"0.7142199",
"0.7141091",
"0.71405035",
"0.71405035",
"0.71405035",
"0.71405035",
"0.71405035",
"0.71405035",
"0.71405035",
"0.71405035",
"0.71405035",
"0.71405035",
"0.71405035",
"0.71405035",
"0.71405035",
"0.71405035",
"0.7137912",
"0.71378964",
"0.7135824",
"0.71284986",
"0.71266305",
"0.71235603",
"0.7123048",
"0.71180594",
"0.71144897",
"0.7113977",
"0.71083176",
"0.71005994",
"0.7098269",
"0.7094654",
"0.7094654",
"0.7094654",
"0.7094654",
"0.70886797",
"0.7086045",
"0.70854825",
"0.7082841",
"0.70812273",
"0.70812273",
"0.70812273",
"0.7078593",
"0.7075034",
"0.7070302",
"0.707015",
"0.7066857",
"0.70637494",
"0.7063023",
"0.70608765",
"0.70583516",
"0.70564425",
"0.70559597",
"0.70522034",
"0.70494896",
"0.7049413",
"0.70470536",
"0.7044136",
"0.70391154",
"0.70391154",
"0.70376027",
"0.70376027",
"0.7036983",
"0.70339894",
"0.7032443",
"0.70301145",
"0.70298797",
"0.70274645"
] | 0.0 | -1 |
Publishes the Configuration File. | protected function publishConfigurationFile()
{
// Determine the Local Configuration Path
$source = $this->getLocalConfigurationPath();
// Determine the Application Configuration Path
$destination = $this->getApplicationConfigPath();
// Publish the Configuration File
$this->publishes([$source => $destination], 'config');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function publishConfig()\n {\n $this->publishes([\n $this->basePath('config/flare/config.php') => config_path('flare/config.php'),\n ]);\n }",
"private function publishConfig()\n\t{\n\t\t$config = __DIR__ . '/config/workflow.php';\n\n\t\t$this->publishes([$config => config_path('workflow.php')]);\n\n\t\t$this->mergeConfigFrom($config, 'workflow');\n\t}",
"protected function publishConfig()\n {\n $this->publishes([\n __DIR__ . '/../config/acl.php' => config_path('acl.php'),\n ], 'config');\n }",
"protected function publishConfig()\n {\n $this->publishes([\n $this->packagePath('config/config.php') => config_path($this->package . '.php')\n ], 'config');\n }",
"private function publishesConfig(): void\n {\n $this->publishes([\n __DIR__.'/../config/invite-codes.php' => config_path('invite-codes.php'),\n ], 'invite-codes-config');\n }",
"protected function publishConfig()\n {\n $path = __DIR__.'/../config/disqus.php';\n $this->mergeConfigFrom($path, 'disqus');\n $this->publishes([\n $path => config_path('disqus.php'),\n ], 'disqus');\n }",
"public function publish()\n {\n $this->move('config/auth.php', config_path(), 'auth.php');\n $this->move('config/services.php', config_path(), 'services.php');\n\n $this->notify('Publishing: Config Files');\n }",
"protected function offerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../config/documentation.php' => config_path('documentation.php'),\n ], 'documentation-config');\n }\n }",
"private function setPublishFiles()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/config.php' => config_path('setting.php'),\n ], 'setting');\n }\n }",
"protected function publishFiles()\n {\n $this->publishes([\n __DIR__.'/Config/installer.php' => config_path('installer.php'),\n ], 'nickelcms');\n\n // $this->publishes([\n // __DIR__.'/assets' => resource_path('nicklecms/admin'),\n // ], 'nickelcms_assets');\n\n }",
"private function publishConfig()\n {\n if ($this->app->environment('testing')) {\n return;\n }\n\n $this->publishes(\n [__DIR__ . '/..' . Settings::LARAVEL_PUBLISHABLE_CONFIG => LaravelConfig::configPublishPath()],\n 'config'\n );\n }",
"protected function configHandle()\n {\n $packageConfigPath = __DIR__.'/config/config.php';\n $appConfigPath = config_path('task-management.php');\n\n $this->mergeConfigFrom($packageConfigPath, 'task-management');\n\n $this->publishes([\n $packageConfigPath => $appConfigPath,\n ], 'config');\n }",
"protected function registerPublishableFiles()\n {\n $this->publishes([\n __DIR__.\"/../config/{$this->name}.php\" => config_path(\"{$this->name}.php\"),\n ], 'config');\n }",
"private function registerPublishing(): void\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../config/ethereum.php' => config_path('ethereum.php'),\n ], 'ethereum-config');\n }\n }",
"protected function setPackageConfigurationFile()\n {\n $config = __DIR__ . '/Config/recaptcha.php';\n $path = config_path('recaptcha.php');\n \n $this->publishes([$config => $path], 'config'); \n $this->mergeConfigFrom( $config, 'recaptcha');\n }",
"protected function registerPublishing() : void\n {\n $this->publishes([\n __DIR__ . '/../config/dejavu.php' => config_path('dejavu.php')\n ], 'dejavu-config');\n }",
"private function registerConfiguration()\n {\n $configPath = __DIR__ . '/../config/themify.php';\n $this->mergeConfigFrom($configPath, 'themify');\n $this->publishes([$configPath => config_path('themify.php')]);\n }",
"private function setupConfig()\n {\n $this->publishes([\n __DIR__ . '/config' => config_path(),\n ], 'config');\n\n $this->mergeConfigFrom(__DIR__ . '/../config/package-blueprint.php', 'package-blueprint');\n }",
"protected function configurePublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../stubs/fortify.php' => config_path('fortify.php'),\n ], 'fortify-config');\n\n $this->publishes([\n __DIR__.'/../stubs/CreateNewUser.php' => app_path('Actions/Fortify/CreateNewUser.php'),\n __DIR__.'/../stubs/FortifyServiceProvider.php' => app_path('Providers/FortifyServiceProvider.php'),\n __DIR__.'/../stubs/PasswordValidationRules.php' => app_path('Actions/Fortify/PasswordValidationRules.php'),\n __DIR__.'/../stubs/ResetUserPassword.php' => app_path('Actions/Fortify/ResetUserPassword.php'),\n __DIR__.'/../stubs/UpdateUserProfileInformation.php' => app_path('Actions/Fortify/UpdateUserProfileInformation.php'),\n __DIR__.'/../stubs/UpdateUserPassword.php' => app_path('Actions/Fortify/UpdateUserPassword.php'),\n ], 'fortify-support');\n\n $this->publishes([\n __DIR__.'/../database/migrations' => database_path('migrations'),\n ], 'fortify-migrations');\n }\n }",
"private function bootConfig(): void\n {\n $baseDir = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR;\n $configDir = $baseDir . 'config' . DIRECTORY_SEPARATOR;\n\n $this->publishes([\n $configDir . 'laravel-database-emails.php' => config_path('laravel-database-emails.php'),\n ], 'laravel-database-emails-config');\n }",
"protected function registerPublishing()\n {\n $this->publishes([\n __DIR__.'/../config/ziggeo.php' => config_path('ziggeo.php'),\n ], 'ziggeo-config');\n }",
"protected function publishConfig($configPath)\n {\n $this->publishes([$configPath => config_path('ads.php')], 'config');\n }",
"protected function defineAssetPublishing()\n {\n $this->publishes([\n __DIR__.'/../config/firefly.php' => config_path('firefly.php'),\n ], 'firefly-config');\n\n $this->publishes([\n __DIR__.'/../database/migrations/' => database_path('migrations'),\n ], 'firefly-migrations');\n\n $this->publishes([\n __DIR__.'/../public/' => public_path('vendor/firefly'),\n ], 'firefly-assets');\n }",
"protected function publishConfig($configPath)\n {\n $this->publishes([$configPath => $this->getConfigPath()], 'config');\n }",
"protected function publishFiles()\r\n {\r\n $this->publishes([\r\n __DIR__.'/../Config/installer.php' => base_path('config/installer.php'),\r\n ], 'laravelinstaller');\r\n\r\n $this->publishes([\r\n __DIR__.'/../assets' => public_path('installer'),\r\n ], 'laravelinstaller');\r\n\r\n $this->publishes([\r\n __DIR__.'/../Views' => base_path('resources/views/vendor/installer'),\r\n ], 'laravelinstaller');\r\n\r\n $this->publishes([\r\n __DIR__.'/../Lang' => base_path('resources/lang'),\r\n ], 'laravelinstaller');\r\n }",
"protected function publishConfig( $configPath ) {\n\t\t$this->publishes([$configPath => config_path('cachetags.php')], 'config');\n\t}",
"protected function offerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../config/dashkit.php' => config_path('dashkit.php'),\n ], 'dashkit-config');\n\n $this->publishes([\n __DIR__ . '/../resources/views/dashkit.blade.php' => resource_path('views/' . config('dashkit.view') . '.blade.php'),\n ], 'dashkit-view');\n }\n }",
"public function publishFiles()\n {\n\n $dir = __DIR__;\n\n // config\n $this->publishes([\n $dir . '/../config/permissions.php' => config_path('permissions.php'),\n ], 'config-role');\n\n /**\n * Database\n */\n $migration_path = database_path('migrations/');\n $seeds_path = database_path('seeds/');\n\n // migrations\n $this->publishes([\n $dir . '/../database/migrations/create_roles_table.php.stub' => $migration_path . date('Y_m_d_His', time()) . '_create_roles_table.php',\n $dir . '/../database/migrations/create_role_user_table.php.stub' => $migration_path . date('Y_m_d_His', time()) . '_create_role_user_table.php',\n ], 'migrations-role');\n\n // seeds\n $this->publishes([\n $dir . '/../database/seeds/RoleTableSeeder.php.stub' => $seeds_path . 'RoleTableSeeder.php',\n ], 'seeder-role');\n }",
"protected function registerConfigurations()\n {\n $this->mergeConfigFrom(\n $this->packagePath('config/config.php'), 'password'\n );\n $this->publishes([\n $this->packagePath('config/config.php') => config_path('password.php'),\n ], 'config');\n }",
"protected function registerPublishing(): void\n {\n $this->publishes([\n __DIR__.'/config/permissions_makr.php' => config_path('permissions_makr.php'),\n ]);\n\n $this->publishes([\n __DIR__ . '/database/migrations/' => database_path('migrations')\n ], 'migrations');\n }",
"protected function configure()\n {\n $this->publishes([\n __DIR__ . '/../config/laravel-calendar.php' => config_path('laravel-calendar.php'),\n ], 'config');\n\n $this->mergeConfigFrom(\n __DIR__ . '/../config/laravel-calendar.php',\n 'laravel-calender'\n );\n }",
"protected function bootPublishedFiles()\n {\n $this->publishes(\n [\n __DIR__ . '/../config/tailwindnotifications.php' => config_path(\n 'tailwindnotifications.php'\n ),\n __DIR__ . '/../views' => resource_path(\n 'views/vendor/tailwindnotifications'\n ),\n ]\n );\n }",
"public function publishFiles()\n {\n $this->publishes(\n [ __DIR__ . '/../resources/views' => base_path('themes/avored/default/views/vendor')],\n 'avored-module-views'\n );\n $this->publishes(\n [ __DIR__ . '/../dist/js/front' => base_path('public/js')],\n 'avored-front-js'\n );\n $this->publishes(\n [ __DIR__ . '/../dist/js/admin' => base_path('public/avored-admin/js')],\n 'avored-admin-js'\n );\n\n $this->publishes([\n __DIR__ . '/../database/migrations' => database_path('avored-migrations'),\n ]);\n }",
"protected function registerConfigurations()\n {\n $this->mergeConfigFrom($this->packagePath('config/tarpit.php'), 'tarpit');\n $this->publishes([$this->packagePath('config/config.php') => config_path('tarpit.php')], 'tarpit');\n }",
"public function publishAllFiles()\n {\n $this->publishes([\n $this->package_path('Controllers') => app_path(config('starter.controller.path')),\n $this->package_path('Data/Models') => app_path(config('starter.model.path')),\n $this->package_path('Templates/init-middleware.php') => app_path('Http/Kernel.php'),\n $this->package_path('config/view.php') => base_path('config/view.php'),\n ]);\n }",
"protected function offerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/laratrust.php' => config_path('laratrust.php'),\n ], 'laratrust');\n\n $this->publishes([\n __DIR__. '/../config/laratrust_seeder.php' => config_path('laratrust_seeder.php'),\n ], 'laratrust-seeder');\n \n $this->publishes([\n __DIR__. '/../resources/views/panel' => resource_path('views/vendor/laratrust/panel'),\n ], 'laratrust-views');\n }\n }",
"private function registerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/telescope-error-service-client.php' => config_path('telescope-error-service-client.php'),\n ], 'telescope-error-service-client-config');\n }\n }",
"protected function registerPublishing()\n {\n $this->publishes([\n __DIR__ . '/../config/shop.php' => config_path('shop.php')\n ], 'shop-config');\n /* Views File Publish */\n $this->publishes([\n __DIR__ . '/../resources/views' => resource_path('views/vendor/shop'),\n ], 'shop-views');\n /* Migration File Publish */\n $this->publishes([\n __DIR__ . '/../database/migartions' => database_path('migrations')\n ], 'shop-migrations');\n /* Seed File Publish */\n $this->publishes([\n __DIR__ . '/../database/seeds' => database_path('seeds')\n ], 'shop-seeds');\n }",
"private function registerPublishing()\n {\n $this->publishes([\n __DIR__ . '/../resources/views' => resource_path('views/vendor/sweetalert')\n ], 'sweetalert-view');\n\n $this->publishes([\n __DIR__ . '/config/sweetalert.php' => config_path('sweetalert.php')\n ], 'sweetalert-config');\n\n $this->publishes([\n __DIR__ . '/../resources/js' => public_path('vendor/sweetalert')\n ], 'sweetalert-asset');\n }",
"protected function registerConfigurations()\n {\n $this->mergeConfigFrom(\n $this->packagePath('config/line.php'), 'ferdhika31.linebot'\n );\n $this->publishes([\n $this->packagePath('config/line.php') => config_path('ferdhika31/linebot.php'),\n ], 'config');\n }",
"public function writeConfig() {\n $mergedTemplate = $this->mergeTemplate();\n file_put_contents(\"{$this->settings['paths']['hostConfigDir']}/{$this->params['name']}.cfg\", $mergedTemplate);\n file_put_contents(\"{$this->settings['paths']['hostTrackDir']}/{$this->params['type']}.inf\", \"{$this->params['name']}:{$this->params['instanceId']}\" . PHP_EOL, FILE_APPEND);\n $this->logChange();\n }",
"protected function registerConfigurations()\n {\n $this->mergeConfigFrom(\n $this->packagePath('config/laravel-deploy-helper.php'), 'laravel-deploy-helper'\n );\n $this->publishes([\n $this->packagePath('config/laravel-deploy-helper.php') => config_path('laravel-deploy-helper.php'),\n ], 'ldh-config');\n }",
"protected function publishFiles()\n {\n $this->publishes([\n __DIR__ . '/librerie/sweetalert.css' => base_path('resources/assets/css/sweetalert.css'),\n __DIR__ . '/librerie/sweetalert.js' => base_path('resources/assets/js/sweetalert.js'),\n __DIR__ . '/views/dsalerts.blade.php' => base_path('resources/views/vendor/dsalerts/dsalerts.blade.php'),\n ], 'dsalerts');\n }",
"protected function publishResources()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/rbac.php' => config_path('rbac.php'),\n ], 'rbac-config');\n\n $this->publishes([\n __DIR__.'/../database/migrations' => database_path('migrations'),\n ], 'rbac-config');\n\n $this->loadFactoriesFrom(__DIR__.'/../database/factories');\n }\n }",
"protected function publishFlashedResources()\n {\n $this->publishes([\n __DIR__ . '/../config/' => config_path()\n ], 'flashed');\n\n $this->publishes([\n __DIR__.'/../resources/views' => resource_path('views/vendor/flashed'),\n ], 'flashed');\n }",
"protected function registerConfigPublisher()\n {\n $this->app->singleton('config.publisher', function ($app) {\n $path = $app->make('path.config');\n\n $publisher = new ConfigPublisher($app->make('files'), $path);\n\n $publisher->setPackagePath($app->make('path.base') . '/src');\n\n return $publisher;\n });\n }",
"protected function offerPublishing(): void\n {\n if ($this->app->runningInConsole()) {\n $providerName = 'RabbitEventsServiceProvider';\n\n $this->publishes([\n __DIR__ . \"/../stubs/{$providerName}.stub\" => $this->app->path(\"Providers/{$providerName}.php\"),\n ], 'rabbitevents-provider');\n $this->publishes([\n __DIR__ . '/../config/rabbitevents.php' => $this->app->configPath('rabbitevents.php'),\n ], 'rabbitevents-config');\n }\n }",
"protected function registerPublishables()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/config/algorand.php' => config_path('algorand.php'),\n ], 'config');\n }\n }",
"protected function registerPublishing()\n {\n $this->publishes([\n __DIR__ . '/../config/kustomer.php' => config_path('kustomer.php'),\n ], 'kustomer-config');\n\n $this->publishes([\n __DIR__ . '/../public' => public_path('vendor/kustomer'),\n ], 'kustomer-assets');\n\n $this->publishes([\n __DIR__ . '/../resources/js/components' => resource_path('js/components/Kustomer'),\n ], 'kustomer-vue-component');\n\n $this->publishes([\n __DIR__ . '/../resources/sass' => resource_path('sass'),\n ], 'kustomer-sass-component');\n\n $this->publishes([\n __DIR__ . '/../resources/lang' => resource_path('lang/vendor/kustomer'),\n ], 'kustomer-locales');\n\n $this->publishes(\n [__DIR__ . '/../resources/views' => resource_path('views/vendor/kustomer')],\n 'kustomer-views'\n );\n }",
"public function defineAssetPublishing()\n {\n $this->publishes([\n DOCS_PATH . '/public' => public_path('vendor/documentation'),\n ], 'documentation-assets');\n }",
"public function publishFiles()\n {\n $this->call('vendor:publish', [\n '--provider' => OxyNovaServiceProvider::class,\n '--tag' => ['config', 'translations', 'views', 'database'],\n ]);\n }",
"public function registerDirectories()\n {\n // Publish config files\n $this->publishes(\n [\n // Paths\n $this->getPublishesPath('config'.DIRECTORY_SEPARATOR.'porteiro.php') => config_path('porteiro.php'),\n ],\n ['config', 'sitec', 'sitec-config']\n );\n\n // // Publish porteiro css and js to public directory\n // $this->publishes([\n // $this->getDistPath('porteiro') => public_path('assets/porteiro')\n // ], ['public', 'sitec', 'sitec-public']);\n\n $this->loadViews();\n $this->loadTranslations();\n }",
"protected function defineAssetPublishing()\n {\n if (!$this->app['config']->get('laratrust.panel.register')) {\n return;\n }\n\n $this->publishes([\n __DIR__.'/../public' => public_path('vendor/laratrust'),\n ], 'laratrust-assets');\n }",
"protected function registerPublishing(): void\n {\n $this->publishes([\n __DIR__.'/../config/url_rewrite.php' => config_path('url_rewrite.php'),\n ], 'nova-url-rewrite-config');\n\n $this->publishes([\n __DIR__.'/../database/migrations' => database_path('migrations'),\n ], 'nova-url-rewrite-migrations');\n\n $this->publishes([\n __DIR__.'/../resources/lang/' => resource_path('lang/vendor/nova_url_rewrite'),\n ], 'nova-url-rewrite-translations');\n }",
"public function boot()\r\n {\r\n $this->publishes([\r\n __DIR__ . '/config.php' => config_path('gopay.php'),\r\n ]);\r\n }",
"protected function registerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../../config/knet.php' => $this->app->configPath('knet.php'),\n ], 'knet-config');\n\n $this->publishes([\n __DIR__ . '/../../database/migrations' => $this->app->databasePath('migrations'),\n ], 'knet-migrations');\n\n $this->publishes([\n __DIR__ . '/../../resources/views' => $this->app->resourcePath('views/vendor/knet'),\n ], 'knet-views');\n\n $this->publishes([\n __DIR__ . '/../../public' => public_path('vendor/knet'),\n ], 'knet-assets');\n\n $this->publishes([\n __DIR__ . '/../../stubs/KnetServiceProvider.stub' => app_path('Providers/KnetServiceProvider.php'),\n ], 'knet-provider');\n }\n }",
"public function boot()\n {\n $configPath = __DIR__ . '/../config/' . $this->configName . '.php';\n\n $this->publishes([$configPath => config_path($this->configName . '.php')], 'impersonate');\n }",
"protected function publishMigrations()\n {\n $this->publishes([\n $this->basePath('Flare/Database/Migrations') => base_path('database/migrations'),\n ]);\n }",
"public function boot(): void\n {\n $this->publishes([$this->configPath() => config_path('amfl.php')], 'config');\n }",
"protected function registerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/twilio-verify.php' => $this->app->configPath('twilio-verify.php'),\n ], 'config');\n\n $this->publishes([\n __DIR__.'/../database/migrations' => $this->app->databasePath('migrations'),\n ], 'migrations');\n\n $this->publishes([\n __DIR__ . '/../resources/lang' => resource_path('lang/vendor/twilio-verify'),\n ], 'translations');\n }\n }",
"protected function registerPublishing(): void\n {\n $this->publishes([\n __DIR__.'/../database/migrations' => \\database_path('migrations'),\n ], 'satifest-migrations');\n }",
"public function boot()\n {\n $configPath = __DIR__ . '/../config/cmq.php';\n\n if (function_exists('config_path')) {\n $publishPath = config_path('cmq.php');\n } else {\n $publishPath = base_path('config/cmq.php');\n }\n\n $this->publishes([$configPath => $publishPath], 'config');\n }",
"public function boot()\n {\n $this->publishes([$this->configLocation => config_path('culpa.php')]);\n }",
"protected function prepareResources()\n {\n // Publish config\n $config = realpath(__DIR__.'/../config/config.php');\n\n $this->mergeConfigFrom($config, 'cartalyst.extensions');\n\n $this->publishes([\n $config => config_path('cartalyst.extensions.php'),\n ], 'config');\n }",
"public function boot()\n\t{\n\t\t$this->publishes([\n\t\t\t__DIR__ . '/../../config/config.php' => config_path('lock.php')\n\t\t]);\n\t}",
"public function boot()\n {\n $this->publishes([\n __DIR__.'/../config/config-file.php' => config_path('config-file.php'),\n ]);\n }",
"public function boot()\n {\n $this->publishes(\n [\n //file source => file destination below\n __DIR__ . '/../Config/dlq.php' => config_path('dlq.php'),\n //you can also add more configs here\n ], 'dlq-config'\n );\n }",
"public function boot()\n {\n $config = realpath(__DIR__.'/../resources/config/payant.php');\n\n $this->publishes([\n $config => config_path('payant.php')\n ]);\n }",
"protected function publishMigrations()\n {\n $this->publishes([\n __DIR__ . '/../migrations/' => database_path('migrations'),\n ], 'migrations');\n }",
"public function boot()\n {\n $this->publishes([\n __DIR__ . '/../../config/civic.php' => config_path('civic.php')\n ]);\n }",
"public function boot()\n {\n $this->publishes([\n __DIR__ . '/../config/shopify.php' => config_path('shopify.php'),\n ], 'config');\n }",
"protected function publishEmailsFiles(): void\n {\n $this->call('vendor:publish', [\n '--tag' => 'migrations',\n '--provider' => \"Nesiasoft\\Core\\Emails\\EmailsServiceProvider\",\n ]);\n\n $this->call('vendor:publish', [\n '--tag' => 'config',\n '--provider' => \"Nesiasoft\\Core\\Emails\\EmailsServiceProvider\",\n ]);\n }",
"public function boot() : void\n {\n $this->publishes([\n __DIR__ . '/../../config/euterrorist.php' => config_path('euterrorist.php'),\n ]);\n }",
"public function boot()\n {\n $configPath = $this->configPath();\n\n $this->publishes([\n $configPath => config_path('workflow.php')\n ], 'config');\n }",
"public function boot()\n {\n $this->publishes([\n __DIR__.'/../poolport-sample.php' => config_path('poolport.php')\n ],'config');\n\n }",
"public function boot()\n {\n $this->publishes([\n __DIR__ . \"/../config/config.php\" => config_path(\"instances.php\")\n ]);\n }",
"public function boot()\n {\n $this->publishes([\n __DIR__.'/../config/seniorx.php' => config_path('seniorx.php'),\n ]);\n }",
"public function boot()\n {\n $this->publishes([\n dirname(__DIR__).'/config/cities.php' => config_path('cities.php'),\n ]);\n }",
"public function boot(): void\n {\n $this->publishes([\n __DIR__.'/../../config/aws_sns.php' => config_path('aws_sns.php'),\n ]);\n }",
"protected function publishFaxesFiles(): void\n {\n $this->call('vendor:publish', [\n '--tag' => 'migrations',\n '--provider' => \"Nesiasoft\\Core\\Faxes\\FaxesServiceProvider\",\n ]);\n\n $this->call('vendor:publish', [\n '--tag' => 'config',\n '--provider' => \"Nesiasoft\\Core\\Faxes\\FaxesServiceProvider\",\n ]);\n }",
"protected function publishApprovalsFiles(): void\n {\n $this->call('vendor:publish', [\n '--tag' => 'migrations',\n '--provider' => \"Nesiasoft\\Core\\Approvals\\ApprovalsServiceProvider\",\n ]);\n\n $this->call('vendor:publish', [\n '--tag' => 'config',\n '--provider' => \"Nesiasoft\\Core\\Approvals\\ApprovalsServiceProvider\",\n ]);\n }",
"public function boot()\n {\n $this->publishes([__DIR__ . \"/config/pagseguro.php\" => config_path('pagseguro.php')]);\n }",
"public function boot()\n {\n $this->publishes([\n __DIR__ . '/config' => config_path('knowitfirst'),\n ]);\n \n }",
"private function copyConfigFile()\n {\n $path = $this->getConfigPath();\n\n // if generatords config already exist\n if ($this->files->exists($path) && $this->option('force') === false) {\n $this->error(\"{$path} already exists! Run 'generate:publish-stubs --force' to override the config file.\");\n die;\n }\n\n File::copy(__DIR__ . '/../config/config.php', $path);\n }",
"protected function registerPublishes()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../../database/migrations' => database_path('migrations'),\n ], 'migrations');\n }\n }",
"protected function exportConfig()\n {\n if ($this->option('interactive')) {\n if (! $this->confirm('Install the package config file?')) {\n return;\n }\n }\n if (file_exists(config_path('laravel-mentor.php')) && ! $this->option('force')) {\n if (! $this->confirm('The Laravel Mentor configuration file already exists. Do you want to replace it?')) {\n return;\n }\n }\n copy(\n $this->packagePath('config/laravel-mentor.php'),\n config_path('laravel-mentor.php')\n );\n\n $this->comment('Configuration Files installed successfully.');\n }",
"public function writewebconfig()\n {\n //<add fileExtension=\"supersake\" allowed=\"false\"/>\n }",
"public function boot()\n {\n $this->publishes([realpath(__DIR__.'/../config/watchdog.php') => config_path('watchdog.php')]);\n }",
"public function boot()\n {\n $this->publishes([\n __DIR__.'/../../config/proximage.php' => config_path('proximage.php'),\n ], 'proximage-config');\n }",
"protected function publishDescriptionsFiles(): void\n {\n $this->call('vendor:publish', [\n '--tag' => 'migrations',\n '--provider' => \"Nesiasoft\\Core\\Descriptions\\DescriptionsServiceProvider\",\n ]);\n\n $this->call('vendor:publish', [\n '--tag' => 'config',\n '--provider' => \"Nesiasoft\\Core\\Descriptions\\DescriptionsServiceProvider\",\n ]);\n }",
"protected function loadConfiguration()\n {\n $config_path = __DIR__ . '/../../config/tintin.php';\n\n if (!$this->isLumen()) {\n $this->publishes([\n $config_path => config_path('view.php')\n ], 'config');\n }\n\n $this->mergeConfigFrom($config_path, 'view');\n }",
"public function boot()\n {\n $this->publishes([\n __DIR__ . '/config/tingtalk_robot.php' => config_path('tingtalk_robot.php')\n ]);\n }",
"public function boot()\n {\n $this->publishes([__DIR__.'/../config/kuainiu.php' => config_path('kuainiu.php')]);\n }",
"public function boot()\n {\n $this->publishes( [ __DIR__ . '/config/queuemanager.php' => config_path( 'queuemanager.php' ) ] );\n }",
"public function writeAndPush()\n {\n $this->gitConfig();\n $this->writeFullConfFile();\n $this->writeUsers();\n if($this->commitConfig()) $this->pushConfig();\n }",
"public function boot()\n {\n $this->publishes([\n __DIR__ . '/../config/aws.php' => config_path('aws.php')\n ], 'config');\n }",
"public function boot()\n {\n $this->publishes([\n __DIR__.'/config/atomic.php' => config_path('atomic.php'),\n ]);\n }",
"public function boot()\n {\n $this->publishes([\n __DIR__.'/config.php' => config_path('uvs.php'),\n ]);\n }",
"public function boot()\n {\n $this->publishes([\n __DIR__ . '/../config/sso.php' => config_path('sso.php'),\n ]);\n }",
"protected function publishURLsFiles(): void\n {\n $this->call('vendor:publish', [\n '--tag' => 'migrations',\n '--provider' => \"Nesiasoft\\Core\\URLs\\URLsServiceProvider\",\n ]);\n\n $this->call('vendor:publish', [\n '--tag' => 'config',\n '--provider' => \"Nesiasoft\\Core\\URLs\\URLsServiceProvider\",\n ]);\n }"
] | [
"0.82678056",
"0.8150707",
"0.8066025",
"0.80007505",
"0.77923054",
"0.7743851",
"0.75718474",
"0.74415666",
"0.73615843",
"0.72795933",
"0.72750515",
"0.72675",
"0.71052104",
"0.7055335",
"0.69835",
"0.6956444",
"0.68562484",
"0.681237",
"0.6802941",
"0.6791647",
"0.6775968",
"0.67493147",
"0.66528916",
"0.66301566",
"0.66097236",
"0.66081184",
"0.65979964",
"0.6597559",
"0.65746665",
"0.6517184",
"0.64689714",
"0.6458563",
"0.644564",
"0.6421475",
"0.64150494",
"0.64106673",
"0.63986117",
"0.6395196",
"0.63707364",
"0.6337922",
"0.6310011",
"0.61928236",
"0.618732",
"0.6156295",
"0.61525166",
"0.6111814",
"0.6101097",
"0.60879403",
"0.607924",
"0.60715765",
"0.6056668",
"0.5956554",
"0.59476966",
"0.5915092",
"0.5886949",
"0.58845615",
"0.5882782",
"0.5867656",
"0.58461183",
"0.582357",
"0.58196145",
"0.5801235",
"0.57947904",
"0.57936764",
"0.5746555",
"0.5734643",
"0.5730658",
"0.5718475",
"0.57132083",
"0.57096004",
"0.5691089",
"0.5690851",
"0.5682917",
"0.56744474",
"0.56698143",
"0.5649058",
"0.5635337",
"0.5614365",
"0.5613172",
"0.5605439",
"0.559532",
"0.5589351",
"0.55667835",
"0.55516905",
"0.554748",
"0.55448896",
"0.5541835",
"0.55410975",
"0.5518377",
"0.55149037",
"0.55086434",
"0.5499765",
"0.54956543",
"0.5492192",
"0.5485175",
"0.54839694",
"0.547648",
"0.547534",
"0.5470354",
"0.54677373"
] | 0.8816268 | 0 |
Returns the Path to the Configuration File within this Package. | protected function getLocalConfigurationPath()
{
return __DIR__ . '/../config/blueprints.php';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getConfigurationPath() {\n return $this->_configuration_path;\n }",
"protected function getConfigFile()\n {\n return realpath($this->getBasePath() . \"/config/{$this->package}.php\");\n }",
"public function getConfigPath()\n {\n return $this->_configPath;\n }",
"public function getConfigPath() : string\n {\n return $this->configPath;\n }",
"protected function getConfigFilePath()\n {\n return dirname(__DIR__, 2) . '/config.php';\n }",
"public function path(): string\n\t{\n\t\treturn $this->configPath;\n\t}",
"public function getConfigFilePath();",
"public function getConfigPath() {\n return __DIR__ . '/../../config.yml';\n }",
"function config_path()\n {\n $paths = getPaths();\n\n return $paths['config'];\n }",
"public function getConfigPath() {\n\t\treturn __DIR__ . '/config/module.ini';\n\t}",
"public function config_path();",
"public function getConfigPath () {\n\t\tif (!isset(self::$configPath))\n\t\t\tself::$configPath = BASE_PATH.'/configuration.plist';\n\t\t\n\t\treturn self::$configPath;\n\t}",
"protected function getCurrentConfigFilePath()\n {\n return config_path($this->configFileName) . '.php';\n }",
"public function configPath(): string\n {\n return realpath(__DIR__ . '/../config/amfl.php');\n }",
"public function getConfigPath(): string\n {\n return Path::unifyPath(Environment::getConfigPath());\n }",
"protected function getConfigPath()\n {\n return config_path('feed.php');\n }",
"protected function get_config_path()\n\t{\n\t\treturn $this->config_path ?: $this->phpbb_root_path . 'config';\n\t}",
"public function getConfig()\n {\n return $this->_getConfigFile();\n }",
"public function path() {\n\t\t\treturn rtrim($this->application->configuration([ \"packagemanager\", \"directory\" ]), \"/\") . \"/\" . $this->package_directory;\n\t\t}",
"protected function getConfigPath()\n {\n return config_path('view-launcher.php');\n }",
"public function getLocalConfigurationFileLocation() {}",
"public function getConfig()\r\n {\r\n return $this->_file;\r\n }",
"public function getPath()\n {\n return __DIR__ . '/settings';\n }",
"protected function getConfigPath()\n {\n return config_path('ads.php');\n }",
"abstract protected function getConfigPath();",
"private function getConfigPath()\n {\n return config_path('generators.php');\n }",
"public function getProjectConfigurationFilePath() {\n // filesystem between the working directory and the working copy root.\n\n // We allow this because Subversion repositories are hierarchical and\n // may have a \"projects/xyz/\" directory which is meaningfully an entirely\n // different project from \"projects/abc/\".\n\n // You can checkout \"projects/\" and have the \".svn/\" directory appear\n // there, then change into \"abc/\" and expect \"arc\" to operate within the\n // context of the \"abc/\" project.\n\n $paths = Filesystem::walkToRoot($this->getWorkingDirectory());\n $root = $this->getPath();\n foreach ($paths as $path) {\n if (!Filesystem::isDescendant($path, $root)) {\n break;\n }\n\n $candidate = $path.'/.arcconfig';\n if (Filesystem::pathExists($candidate)) {\n return $candidate;\n }\n }\n\n return parent::getProjectConfigurationFilePath();\n }",
"protected static function path()\n {\n return config('app.home_path').'/.eco/config.json';\n }",
"public function getCachedConfigPath()\n {\n return $this['path.storage'].'/framework/config.php';\n }",
"protected function getConfigPath() {\n\t\treturn config_path('cachetags.php');\n\t}",
"public function getConfigFile()\n\t{\n\t\treturn $this->configfile;\n\t}",
"protected function getFactoryConfigurationFileLocation() {}",
"function config_path()\n {\n return base_path() . '/config';\n }",
"public function getPath(): string\n {\n $root = null;\n $currentDirectory = __DIR__;\n\n do {\n $currentDirectory = dirname($currentDirectory);\n $config = $currentDirectory . '/.refresh-database.yml';\n\n if (file_exists($config)) {\n $root = $currentDirectory;\n }\n } while (is_null($root) && $currentDirectory != '/');\n\n return $config;\n }",
"public static function configPath(){\n return \\Illuminate\\Foundation\\Application::configPath();\n }",
"public function getCachedConfigPath();",
"protected function getApplicationConfigPath()\n {\n return config_path('blueprints.php');\n }",
"public function getAdditionalConfigurationFileLocation() {}",
"protected function getConfigPath()\n {\n return config_path('image-optimizer.php');\n }",
"protected function getConfigPath()\n {\n return config_path('xhprof.php');\n }",
"public function getConfigDir() : string\n {\n return $this->configDir;\n }",
"protected function getConfigSource()\n {\n return realpath(__DIR__ . '/config/sinput.php');\n }",
"public function getConfigFile() {\n \t\n \t// Return our configuration file\n \treturn $this->sConfigFile;\n }",
"public function getBaseConfigDir()\n {\n return $this->paths->getBaseConfigDir();\n }",
"public function getConfigCacheFile()\n {\n return $this->getCacheDir() . '/module-config-cache.'.$this->getConfigCacheKey().'.php';\n }",
"protected function getConfigFolder(): string\n {\n return realpath($this->getBasePath().DIRECTORY_SEPARATOR.'fixtures'.DIRECTORY_SEPARATOR.'config');\n }",
"public static function getConfigFile()\n\t\t{\n\t\t\treturn SOFTWARE_PATH . DS . 'wp-config.php';\n\t\t}",
"public static function ConfigFolder()\n {\n return dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR.Configuration::getApplicationFolder().DIRECTORY_SEPARATOR.'Config';\n }",
"public function configurationCacheFilePath();",
"public static function getConfigDir()\r\n\t{\r\n\t\treturn dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'conf' . DIRECTORY_SEPARATOR;\r\n\t}",
"public function getConfigFileName() {\n return \\Config::get('fontello::config.file');\n }",
"public static function getFileLocation()\n {\n $config = Yaml::parseFile(__DIR__.'/../../config.yaml');\n return (isset($config[\"log\"][\"file\"])) ? __DIR__.\"/\".$config[\"log\"][\"file\"] : __DIR__.\"/app.log\";\n }",
"protected function getConfigDir(): string\n {\n return $this->getProjectDir() . DIRECTORY_SEPARATOR . 'config';\n }",
"protected function getPath () {\n\tglobal $Config;\n\treturn $Config->get('dir_root').'/'.$this->dir.'/'.$this->name;\n }",
"public function getDefaultConfigurationFileLocation() {}",
"protected function getConfigFile()\n {\n return __DIR__.'/../Config/LumenConfig.php';\n }",
"public function getFilePath()\n {\n $value = $this->_config->get('file/path');\n\n if ($value === null) {\n $value = '../var/import/import_all_products.csv';\n }\n\n return $value;\n }",
"public function getCaptchaConfigFilePath()\n {\n return $this->captchaConfigFilePath;\n }",
"public function getConfigPath()\n {\n\n return 'services.netcommerce';\n }",
"function getConfigDir()\n\t{\n\t\treturn\t$this->configDir;\n\t}",
"function Event_Config_File()\n {\n return join(\"/\",array($this->Event_Config_Path,$this->Event_Config_File));\n }",
"public function compilePath()\n {\n return $this->config()->compile_path;\n }",
"public function getConfigFilename()\n {\n return 'config.yml';\n }",
"protected function filepath() {\n if (is_null($this->path)) {\n try {\n $path = $this->config->get('path');\n $jar = $this->config->get('jar');\n\n $this->path = rtrim($path, '/') . DIRECTORY_SEPARATOR . $jar;\n } catch (Exception $exception) {\n $this->setErrorFromException($exception);\n }\n }\n\n return $this->path;\n }",
"static function _getConfigFilePath($configName)\n {\n return dirname(__FILE__).\"/Configs/$configName.json\";\n }",
"public function getConfigFileName() {\n return realpath(FileHelper::getPrivateFolderLocation()) . EnvatoLicense::EnvatoLicenseFileNameJSON;\n }",
"public static function getConfigDir()\n {\n return self::getDir('getConfigHome');\n }",
"protected function getAppConfigDir()\n {\n return $this->rootDir . 'src/' . $this->appName . '/conf/';\n }",
"public static function module_path() {\n return static::config()->get('module_path') ?: realpath(__DIR__ . '/../');\n }",
"public function configDir(): string\n {\n return $this->root.'/etc';\n }",
"protected function getConfigFile()\n\t{\n\t\treturn $this->_configFile;\n\t}",
"protected function getCacheFilePath(): string\n {\n return self::env('CONFIG_CACHE_FILE_PATH', Directory::cachePath('config.php'));\n }",
"public function getConfig()\n { // Try the template specific path first\n $fname = APPLICATION_PATH.$this->_paths['pkg_template'].'/config.json';\n if( file_exists($fname) ) {\n return json_decode(file_get_contents($fname));\n }\n // Next try the domain common path\n $fname = APPLICATION_PATH.$this->_paths['pkg_common'].'/config.json';\n if( file_exists($fname) ) {\n return json_decode(file_get_contents($fname));\n }\n // Finally, try the app common path\n $fname = APPLICATION_PATH.$this->_paths['app_common'].'/config.json';\n if( file_exists($fname) ) {\n return json_decode(file_get_contents($fname));\n }\n // If none of these files were found, return false to indicate failure\n if( !$this->_config) throw new CException('Configuration not found');\n }",
"protected function getAppPath()\n {\n return config()->path->app;\n }",
"protected function getFrameworkConfig()\n {\n return dirname(dirname(__FILE__)) . '/conf/base.php';\n }",
"protected function getAdditionalFactoryConfigurationFileLocation() {}",
"private function getTemplateConfigPath(): string\n {\n return $this->_type === 'price'\n ? self::XML_PATH_EMAIL_PRICE_TEMPLATE\n : self::XML_PATH_EMAIL_STOCK_TEMPLATE;\n }",
"protected function getConfigFilesLocation(): string\n {\n if (!empty($this->getConfigFiles([]))) {\n throw new \\RuntimeException(sprintf('Method \"getConfigFiles\" returns non-empty, but \"getConfigFilesLocation\" is not implemented in \"%s\" extension.', $this->getAlias()));\n }\n\n return '';\n }",
"public function getFilepath() : string\n {\n if (is_null($this->filePath)) {\n throw new \\Error(__(\"Not valid value for filePath.\"));\n }\n\n return (string)$this->getConfigValue($this->filePath);\n }",
"public static function getCachedConfigPath(){\n return \\Illuminate\\Foundation\\Application::getCachedConfigPath();\n }",
"protected function getGeneratorConfigPath(): string\n {\n if (null === $this->genConfigPath) {\n\n /**\n * @var $container LightServiceContainerInterface\n */\n $container = $this->getContextVar(\"container\");\n $appDir = $container->getApplicationDir();\n $planet = $this->getContextVar(\"planet\");\n $galaxy = $this->getContextVar(\"galaxy\");\n $planetDir = $this->getContextVar(\"planetDir\");\n $createFile = $this->getContextVar(\"createFile\");\n $tablePrefix = DeveloperWizardGenericHelper::getTablePrefix($planetDir, $createFile);\n $this->genConfigPath = $appDir . \"/config/data/$galaxy.$planet/Ling.Light_BreezeGenerator/$tablePrefix.generated.byml\";\n }\n return $this->genConfigPath;\n }",
"public function getConfigFile();",
"public function getPath() {\r\n\t\t\treturn $this->filePath;\r\n\t\t}",
"public function getConfig()\r\n {\r\n $configFile = GeneralUtility::getFileAbsFileName(\"EXT:centauri_core/Configuration/core.php\");\r\n return (include $configFile);\r\n }",
"public function configPath($path = '')\n {\n return $this->basePath . DIRECTORY_SEPARATOR . 'vendor/owncms/core/Config';\n }",
"public function getPackagePath() {}",
"public static function siteConfig()\n {\n return DirPaths::siteConfig().\n FileNames::CONFIG;\n }",
"public function getFilePath(): string\n {\n return oas_path(\n $this->version . '/components/schemas/' . $this->getFileName() . '.json'\n );\n }",
"public function getDefaultConfigFilePath($configName)\n {\n return realpath(__DIR__ . \"/../config/{$configName}.php\");\n }",
"public function getThemeConfigDir()\n {\n return $this->paths->getThemeConfigDir();\n }",
"public function path()\n {\n return $this->basePath . DIRECTORY_SEPARATOR . 'app';\n }",
"public function path()\n {\n return $this->basePath . DIRECTORY_SEPARATOR . 'app';\n }",
"protected function getParsersConfigPath()\n {\n if (null !== $this->parsersConfigPath) {\n return $this->parsersConfigPath;\n }\n\n $path = sprintf('%s/config/parsers.yml', $this->getProjectDir());\n\n if (!file_exists($path)) {\n throw new \\RuntimeException(sprintf('Configuration file \"%s\" is not found&'));\n }\n\n return $this->parsersConfigPath = $path;\n }",
"private static function GetPath(){\r\n\t return System:::IO:::Path::Combine(\r\n\t self::GetFolder(),\"settings.xml\");\r\n\t }",
"public function getAppConfigFile()\n\t{\n\t\tif (!empty($this->_appConfigFile)) {\n\t\t\t$file = $this->_isAbsolute($this->_appConfigFile)\n\t\t\t\t? $this->_appConfigFile\n\t\t\t\t: ($this->getAppPath() . '/' . $this->_appConfigFile);\n\t\t\treturn is_file($file) ? $file : null;\n\t\t}\n\t\treturn null;\n\t}",
"public function path() {\n return $this->filepath();\n }",
"public function getPackagePath()\n {\n if (!is_null($this->path)) {\n return $this->path;\n }\n\n switch ($this->getPackageType()) {\n case self::TYPE_ROOT:\n $this->path = static::getPackageCwd() . $this->name;\n break;\n case self::TYPE_VENDOR:\n $this->path = sprintf('%s/vendor/%s', static::getPackageCwd(), $this->name);\n break;\n case self::TYPE_PSEUDO:\n default:\n $this->path = false;\n break;\n }\n\n return $this->path;\n }",
"public function getConfigsPath(Container $app);",
"public function getConfigForm() {\r\n\t\treturn parent::getConfigForm()->addElementPath(dirname(__FILE__));\r\n\t}",
"public function getCachedConfigPath()\n {\n if ($this->initialized && env('CACHE_CONFIG_FILE')) {\n $this->cacheFile($this->basePath.'/bootstrap/cache/config.php', $this->configPath);\n return $this->configPath;\n }\n\n return false;\n }"
] | [
"0.8400858",
"0.81793016",
"0.81099343",
"0.803688",
"0.79678786",
"0.7953922",
"0.78645843",
"0.7838922",
"0.7806883",
"0.78031385",
"0.7788501",
"0.7708457",
"0.77043235",
"0.7653395",
"0.7636186",
"0.7634657",
"0.7554444",
"0.7476961",
"0.7463891",
"0.74172485",
"0.74131674",
"0.740843",
"0.73415434",
"0.73368204",
"0.73023266",
"0.72971463",
"0.7268786",
"0.72614557",
"0.72423714",
"0.72346103",
"0.7226592",
"0.72074586",
"0.7184866",
"0.71656704",
"0.7164688",
"0.7154396",
"0.71293515",
"0.7126538",
"0.7093836",
"0.706816",
"0.70588535",
"0.70584553",
"0.7051847",
"0.70375127",
"0.7033609",
"0.7007676",
"0.6981048",
"0.69680846",
"0.69680065",
"0.695807",
"0.69564307",
"0.6949089",
"0.69488764",
"0.69214207",
"0.69142",
"0.6866142",
"0.686381",
"0.6856122",
"0.68402565",
"0.68203294",
"0.6779219",
"0.6765444",
"0.67571676",
"0.6756286",
"0.6752374",
"0.6733606",
"0.67260915",
"0.6702047",
"0.6695103",
"0.6688672",
"0.66677195",
"0.6656678",
"0.6643452",
"0.6638628",
"0.6618938",
"0.6589366",
"0.6584845",
"0.65745896",
"0.65620184",
"0.6560718",
"0.65492773",
"0.65387493",
"0.651257",
"0.64971507",
"0.64956105",
"0.64844996",
"0.6479249",
"0.64140105",
"0.640307",
"0.63710195",
"0.6368099",
"0.6368099",
"0.63665116",
"0.6363512",
"0.6359291",
"0.63555014",
"0.6355476",
"0.63524497",
"0.6346864",
"0.63459057"
] | 0.7559755 | 16 |
Returns the Path to the Configuration File within the Application. | protected function getApplicationConfigPath()
{
return config_path('blueprints.php');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getConfigurationPath() {\n return $this->_configuration_path;\n }",
"protected function getConfigFilePath()\n {\n return dirname(__DIR__, 2) . '/config.php';\n }",
"public function getConfigPath()\n {\n return $this->_configPath;\n }",
"protected function getCurrentConfigFilePath()\n {\n return config_path($this->configFileName) . '.php';\n }",
"public function getConfigPath() {\n\t\treturn __DIR__ . '/config/module.ini';\n\t}",
"public function getConfigPath () {\n\t\tif (!isset(self::$configPath))\n\t\t\tself::$configPath = BASE_PATH.'/configuration.plist';\n\t\t\n\t\treturn self::$configPath;\n\t}",
"function config_path()\n {\n $paths = getPaths();\n\n return $paths['config'];\n }",
"public function configPath(): string\n {\n return realpath(__DIR__ . '/../config/amfl.php');\n }",
"public function config_path();",
"public function getConfigPath() : string\n {\n return $this->configPath;\n }",
"protected function get_config_path()\n\t{\n\t\treturn $this->config_path ?: $this->phpbb_root_path . 'config';\n\t}",
"public static function configPath(){\n return \\Illuminate\\Foundation\\Application::configPath();\n }",
"protected function getConfigPath()\n {\n return config_path('view-launcher.php');\n }",
"public function getConfigPath() {\n return __DIR__ . '/../../config.yml';\n }",
"public function path(): string\n\t{\n\t\treturn $this->configPath;\n\t}",
"public function getConfigFilePath();",
"public function getConfigPath(): string\n {\n return Path::unifyPath(Environment::getConfigPath());\n }",
"protected function getAppPath()\n {\n return config()->path->app;\n }",
"protected function getConfigFile()\n {\n return realpath($this->getBasePath() . \"/config/{$this->package}.php\");\n }",
"protected function getLocalConfigurationPath()\n {\n return __DIR__ . '/../config/blueprints.php';\n }",
"protected function getConfigPath()\n {\n return config_path('feed.php');\n }",
"protected static function path()\n {\n return config('app.home_path').'/.eco/config.json';\n }",
"function config_path()\n {\n return base_path() . '/config';\n }",
"public static function ConfigFolder()\n {\n return dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR.Configuration::getApplicationFolder().DIRECTORY_SEPARATOR.'Config';\n }",
"protected function getConfigPath()\n {\n return config_path('ads.php');\n }",
"public function getLocalConfigurationFileLocation() {}",
"protected function getAppConfigDir()\n {\n return $this->rootDir . 'src/' . $this->appName . '/conf/';\n }",
"public function getApplicationPath() {\r\n\t\treturn $this->getFramework()->getPath(Core::PATH_APPLICATION);\r\n\t}",
"public function getAppConfigFile()\n\t{\n\t\tif (!empty($this->_appConfigFile)) {\n\t\t\t$file = $this->_isAbsolute($this->_appConfigFile)\n\t\t\t\t? $this->_appConfigFile\n\t\t\t\t: ($this->getAppPath() . '/' . $this->_appConfigFile);\n\t\t\treturn is_file($file) ? $file : null;\n\t\t}\n\t\treturn null;\n\t}",
"public static function getFileLocation()\n {\n $config = Yaml::parseFile(__DIR__.'/../../config.yaml');\n return (isset($config[\"log\"][\"file\"])) ? __DIR__.\"/\".$config[\"log\"][\"file\"] : __DIR__.\"/app.log\";\n }",
"public function getCachedConfigPath()\n {\n return $this['path.storage'].'/framework/config.php';\n }",
"protected function getConfigPath()\n {\n return config_path('xhprof.php');\n }",
"public function getCachedConfigPath();",
"public function getPath(): string\n {\n $root = null;\n $currentDirectory = __DIR__;\n\n do {\n $currentDirectory = dirname($currentDirectory);\n $config = $currentDirectory . '/.refresh-database.yml';\n\n if (file_exists($config)) {\n $root = $currentDirectory;\n }\n } while (is_null($root) && $currentDirectory != '/');\n\n return $config;\n }",
"public function getApplicationPath()\n {\n return $this->applicationPath;\n }",
"public function getAppPath() {\n return $this->_application_path;\n }",
"public function getApplicationPath()\n {\n return app_path();\n }",
"public function getConfig()\n {\n return $this->_getConfigFile();\n }",
"public static function getConfigDir()\r\n\t{\r\n\t\treturn dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'conf' . DIRECTORY_SEPARATOR;\r\n\t}",
"protected function getFactoryConfigurationFileLocation() {}",
"abstract protected function getConfigPath();",
"public function getPath()\n {\n return __DIR__ . '/settings';\n }",
"public function getConfigFile()\n\t{\n\t\treturn $this->configfile;\n\t}",
"protected function getConfigFile()\n {\n return __DIR__.'/../Config/LumenConfig.php';\n }",
"public function getProjectConfigurationFilePath() {\n // filesystem between the working directory and the working copy root.\n\n // We allow this because Subversion repositories are hierarchical and\n // may have a \"projects/xyz/\" directory which is meaningfully an entirely\n // different project from \"projects/abc/\".\n\n // You can checkout \"projects/\" and have the \".svn/\" directory appear\n // there, then change into \"abc/\" and expect \"arc\" to operate within the\n // context of the \"abc/\" project.\n\n $paths = Filesystem::walkToRoot($this->getWorkingDirectory());\n $root = $this->getPath();\n foreach ($paths as $path) {\n if (!Filesystem::isDescendant($path, $root)) {\n break;\n }\n\n $candidate = $path.'/.arcconfig';\n if (Filesystem::pathExists($candidate)) {\n return $candidate;\n }\n }\n\n return parent::getProjectConfigurationFilePath();\n }",
"private function getConfigPath()\n {\n return config_path('generators.php');\n }",
"public function getBaseConfigDir()\n {\n return $this->paths->getBaseConfigDir();\n }",
"public function getAdditionalConfigurationFileLocation() {}",
"protected function getConfigPath() {\n\t\treturn config_path('cachetags.php');\n\t}",
"public function getAppPath()\n {\n return $this->_appPath;\n }",
"public function getConfigFile() {\n \t\n \t// Return our configuration file\n \treturn $this->sConfigFile;\n }",
"public function configurationCacheFilePath();",
"public function getConfigsPath(Container $app);",
"protected function getConfigPath()\n {\n return config_path('image-optimizer.php');\n }",
"public function getDefaultConfigurationFileLocation() {}",
"public static function getCachedConfigPath(){\n return \\Illuminate\\Foundation\\Application::getCachedConfigPath();\n }",
"static function _getConfigFilePath($configName)\n {\n return dirname(__FILE__).\"/Configs/$configName.json\";\n }",
"protected function getFrameworkConfig()\n {\n return dirname(dirname(__FILE__)) . '/conf/base.php';\n }",
"public function getConfig()\r\n {\r\n return $this->_file;\r\n }",
"function Event_Config_File()\n {\n return join(\"/\",array($this->Event_Config_Path,$this->Event_Config_File));\n }",
"public static function getConfigDir()\n {\n return self::getDir('getConfigHome');\n }",
"protected function getConfigFolder(): string\n {\n return realpath($this->getBasePath().DIRECTORY_SEPARATOR.'fixtures'.DIRECTORY_SEPARATOR.'config');\n }",
"public function getConfigDir() : string\n {\n return $this->configDir;\n }",
"public static function getConfigFile()\n\t\t{\n\t\t\treturn SOFTWARE_PATH . DS . 'wp-config.php';\n\t\t}",
"protected function getConfigSource()\n {\n return realpath(__DIR__ . '/config/sinput.php');\n }",
"public function getAppPath()\n\t{\n\t\t$appName = $this->getAppName();\n\t\tif (empty($this->_appBasePath) || empty($appName)) {\n\t\t\trequire_once 'Syx/Platform/Exception.php';\n\t\t\tthrow new Syx_Platform_Exception('applications base path and application name must assign before use');\n\t\t}\n\t\treturn $this->_appBasePath . '/' . $appName;\n\t}",
"public static function siteConfig()\n {\n return DirPaths::siteConfig().\n FileNames::CONFIG;\n }",
"public function getWebappPath()\n {\n return $this->getServletConfig()\n ->getApplication()\n ->getWebappPath();\n }",
"protected function getConfigDir(): string\n {\n return $this->getProjectDir() . DIRECTORY_SEPARATOR . 'config';\n }",
"public static function ApplicationFolder()\n {\n return dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR.Configuration::getApplicationFolder();\n }",
"public function getConfigFileName() {\n return \\Config::get('fontello::config.file');\n }",
"public static function module_path() {\n return static::config()->get('module_path') ?: realpath(__DIR__ . '/../');\n }",
"public function getApplicationPath(){\n return Vimerito::getApplicationPath();\n }",
"public function getDefaultConfigFilePath($configName)\n {\n return realpath(__DIR__ . \"/../config/{$configName}.php\");\n }",
"public function getConfigCacheFile()\n {\n return $this->getCacheDir() . '/module-config-cache.'.$this->getConfigCacheKey().'.php';\n }",
"public static function load_app_conf() {\n $app_config = include(CONFIGPATH.'app.conf.php');\n return $app_config;\n }",
"function getConfigDir()\n\t{\n\t\treturn\t$this->configDir;\n\t}",
"public function path()\n {\n return $this->basePath . DIRECTORY_SEPARATOR . 'app';\n }",
"public function path()\n {\n return $this->basePath . DIRECTORY_SEPARATOR . 'app';\n }",
"public function getFilePath()\n {\n $value = $this->_config->get('file/path');\n\n if ($value === null) {\n $value = '../var/import/import_all_products.csv';\n }\n\n return $value;\n }",
"function config_path($path = NULL)\n\t{\n\n\t\t$path = rtrim($path, \".php\");\n\n\t\treturn app()->basePath('config').'/'.$path.'.php';\n\t}",
"public function configDir(): string\n {\n return $this->root.'/etc';\n }",
"protected function filepath() {\n if (is_null($this->path)) {\n try {\n $path = $this->config->get('path');\n $jar = $this->config->get('jar');\n\n $this->path = rtrim($path, '/') . DIRECTORY_SEPARATOR . $jar;\n } catch (Exception $exception) {\n $this->setErrorFromException($exception);\n }\n }\n\n return $this->path;\n }",
"public function path()\n {\n return $this->basePath.DIRECTORY_SEPARATOR.'app';\n }",
"protected function getPath () {\n\tglobal $Config;\n\treturn $Config->get('dir_root').'/'.$this->dir.'/'.$this->name;\n }",
"protected function getAppPath()\n {\n return __DIR__. '/../../../../app/';\n }",
"public function getConfigurationPath($name = null): ?string\n {\n $appConfigPath = $this->basePath . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . $name . '.php';\n if (file_exists($appConfigPath)) {\n return $appConfigPath;\n }\n return null;\n }",
"protected function getCacheFilePath(): string\n {\n return self::env('CONFIG_CACHE_FILE_PATH', Directory::cachePath('config.php'));\n }",
"public function appPath()\n {\n return ltrim($this->basePath().'/app', '/');\n }",
"public function getConfigurationFilePath($sModuleName = null, $sControllerName = null, $sActionName = null)\n {\n return $this->getOptions()->getConfigCachePath() . $this->getCacheFileName($sModuleName, $sControllerName, $sActionName) . '.conf';\n }",
"public function path() {\n\t\t\treturn rtrim($this->application->configuration([ \"packagemanager\", \"directory\" ]), \"/\") . \"/\" . $this->package_directory;\n\t\t}",
"function config_path($path = '')\n {\n return app()->basePath() . '/config' . ($path ? '/' . $path : $path);\n }",
"function config_path($path = '')\n {\n return app()->basePath() . '/config' . ($path ? '/' . $path : $path);\n }",
"function config_path($path = '')\n {\n return app()->basePath() . '/config' . ($path ? '/' . $path : $path);\n }",
"function config_path($path = '')\n {\n return app()->basePath() . '/config' . ($path ? '/' . $path : $path);\n }",
"public function getCaptchaConfigFilePath()\n {\n return $this->captchaConfigFilePath;\n }",
"function config_path($path = '')\n {\n return app()->basePath() . DIRECTORY_SEPARATOR. 'config' . ($path ? DIRECTORY_SEPARATOR . $path : $path);\n }",
"public function getConfig()\r\n {\r\n $configFile = GeneralUtility::getFileAbsFileName(\"EXT:centauri_core/Configuration/core.php\");\r\n return (include $configFile);\r\n }",
"public function configPath($path = '')\n\t{\n\t\treturn $this['path.config'].ltrim($path, '/');\n\t}",
"protected function getRootDir()\n {\n return $this->appConfig->getRootDir();\n }"
] | [
"0.8230728",
"0.81023777",
"0.79440224",
"0.79373485",
"0.79356676",
"0.7935045",
"0.79186463",
"0.79120564",
"0.79036665",
"0.7811609",
"0.7787272",
"0.7785714",
"0.7761872",
"0.77539533",
"0.7709969",
"0.7706753",
"0.7669528",
"0.763602",
"0.7630849",
"0.7622622",
"0.7599377",
"0.7552669",
"0.7496228",
"0.74323064",
"0.7364102",
"0.7345667",
"0.7332231",
"0.73196316",
"0.7288767",
"0.7281711",
"0.72590464",
"0.725112",
"0.7214889",
"0.7193834",
"0.71935314",
"0.7190207",
"0.71758646",
"0.71675646",
"0.71376956",
"0.71323717",
"0.7123223",
"0.71193683",
"0.71110827",
"0.7091005",
"0.70742035",
"0.706604",
"0.70556283",
"0.70392567",
"0.7036801",
"0.7036389",
"0.6988202",
"0.6972723",
"0.6937271",
"0.69058037",
"0.68898594",
"0.6889466",
"0.6887519",
"0.6874992",
"0.68605334",
"0.68521434",
"0.6846179",
"0.6832117",
"0.68272424",
"0.6823435",
"0.6821047",
"0.68106854",
"0.67905307",
"0.6784316",
"0.6759424",
"0.67430955",
"0.67379326",
"0.6737101",
"0.6711339",
"0.6710979",
"0.6709422",
"0.6708071",
"0.67032355",
"0.66820997",
"0.66820997",
"0.6679414",
"0.66416776",
"0.6629115",
"0.66163325",
"0.6587767",
"0.65877175",
"0.6586132",
"0.65809053",
"0.6574908",
"0.6571375",
"0.6564518",
"0.6564098",
"0.65457165",
"0.65457165",
"0.65457165",
"0.65457165",
"0.65412116",
"0.65307844",
"0.6530393",
"0.6527019",
"0.65209514"
] | 0.79092914 | 8 |
Get the services provided by the provider. | public function provides()
{
return [
//
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"final public function getServices()\n {\n if (is_null($this->serviceProviders)) {\n $this->serviceProviders = $this->getServiceProviders();\n }\n\n return $this->serviceProviders;\n }",
"protected function getServices()\n {\n return $this->services;\n }",
"protected static function getServiceProviders()\n {\n return [];\n }",
"public static function get_service_providers(): array {\n\t\treturn self::$service_providers;\n\t}",
"public function getServices();",
"public function getServices()\n {\n return $this->services;\n }",
"public function getServices()\n {\n return $this->services;\n }",
"public function getServices()\n {\n return $this->services;\n }",
"public function services()\n {\n return $this->belongstomany(Service::class);\n }",
"public function getServices() {\n return $this->services;\n }",
"public function getServices() {\n return $this->services;\n }",
"public function getServiceProviders();",
"public function getServices() {\n\n return $this->services;\n\n }",
"public function getServices()\n {\n return $this->pantonoServices;\n }",
"public static function getServices(): array\n {\n return static::$services;\n }",
"public static function get_services() {\n return [ \n Pages\\Admin::class,\n Base\\Enqueue::class,\n Base\\SettingsLinks::class,\n Base\\JsObjectsManager::class,\n Base\\ShortCodesManager::class\n ];\n }",
"private function get_services() {\n\t\treturn [\n\t\t\tServices\\Language_Loader::class,\n\t\t\tServices\\Setup_Database::class,\n\t\t\tServices\\Scripts_And_Templates::class,\n\t\t\tServices\\Admin_Pages::class,\n\t\t\tServices\\Setup_Settings_Page::class,\n\t\t\tServices\\Loggers_Loader::class,\n\t\t\tServices\\Dropins_Loader::class,\n\t\t\tServices\\Setup_Log_Filters::class,\n\t\t\tServices\\Setup_Pause_Resume_Actions::class,\n\t\t\tServices\\Setup_Purge_DB_Cron::class,\n\t\t\tServices\\API::class,\n\t\t\tServices\\Dashboard_Widget::class,\n\t\t\tServices\\Network_Menu_Items::class,\n\t\t\tServices\\Plugin_List_Link::class,\n\t\t];\n\t}",
"public static function get_services()\n {\n return [\n Pages\\Dashboard::class,\n Base\\Enqueue::class,\n Base\\SettingsLink::class,\n Base\\CustomPostTypeController::class,\n ];\n }",
"public static function get_services()\n {\n return [\n Pages\\Admin::class,\n Base\\Enqueue::class,\n Base\\CustomPostType::class,\n Base\\CustomMetaBox::class,\n Base\\Shortcode::class,\n Base\\Cron::class,\n ];\n }",
"public function &getServices(): array {\n return $this->services;\n }",
"public function getServiceLocator()\n {\n return $this->services;\n }",
"public function getServiceProviderList()\n {\n return $this->providers;\n }",
"public function services()\n {\n return $this->getAngularLocation($this->service_path);\n }",
"public function provides()\n {\n return [Client::class, Services\\OAuth::class];\n }",
"public function getServices(): array;",
"public function getServiceProvider();",
"public static function get_services()\n {\n\n //підключаємо всі необхідні класи для активації через масив\n return [\n Pages\\Admin::class,\n Base\\Enqueue::class,\n Base\\SettingsLinks::class\n ];\n }",
"public function provides()\n {\n return [\n SerasaService::class\n ];\n }",
"public function serviceProviders(): ?Collection;",
"public function getServices()\r\n {\r\n if (is_null($this->_services)) {\r\n if ($this->getConfig('auto')) {\r\n $this->_services = array();\r\n $config = Mage::app()->getConfig();\r\n foreach (array('cache', 'full_page_cache', 'fpc') as $cacheType) {\r\n $node = $config->getXpath('global/' . $cacheType . '[1]');\r\n if (isset($node[0]->backend) && in_array((string)$node[0]->backend, array(\r\n 'Cm_Cache_Backend_Redis',\r\n 'Mage_Cache_Backend_Redis'\r\n ))) {\r\n $this->_services[] = $this->_buildServiceArray(\r\n $this->__(str_replace('_', ' ', uc_words($cacheType))),\r\n $node[0]->backend_options->server,\r\n $node[0]->backend_options->port,\r\n $node[0]->backend_options->password,\r\n $node[0]->backend_options->database\r\n );\r\n }\r\n }\r\n // get session\r\n $node = $config->getXpath('global/redis_session');\r\n if ($node) {\r\n $this->_services[] = $this->_buildServiceArray(\r\n $this->__('Session'),\r\n $node[0]->host,\r\n $node[0]->port,\r\n $node[0]->password,\r\n $node[0]->db\r\n );\r\n }\r\n } else {\r\n $this->_services = unserialize($this->getConfig('manual'));\r\n }\r\n }\r\n return $this->_services;\r\n }",
"public function loadServices($providers);",
"public static function get_services(): array\n {\n return [\n Base\\SettingsLinks::class,\n Pages\\Admin::class,\n Base\\Enqueue::class,\n CPT\\EmailCpt::class,\n ];\n }",
"public function services(): array\n {\n return \\array_merge(\n \\array_keys($this->_services),\n \\array_keys($this->aliases)\n );\n }",
"public function get_services() {\n return $this->linkemperor_exec(null, null,\"/api/v2/customers/services.json\");\n }",
"public function getRequestedServices();",
"public function getProviders();",
"public function getProviders();",
"protected function getUserServices()\n\t{\n\t\treturn $this->userServices = new UsersService();\n\t}",
"protected function getServices() {\n\t\treturn [\n\t\t\tMessagesService::class,\n\t\t];\n\t}",
"public static function get_providers() {\n\t\treturn self::$providers;\n\t}",
"public function getRequiredServices();",
"public function getModulesServiceProviders()\n {\n $modulesNamespace = ModulesConfig::getModulesNamespace();\n\n foreach (ModulesConfig::getModulesNames() as $moduleName) {\n // get the Module extra service providers (extra service providers are defined in the modules config file)\n foreach (ModulesConfig::getModulesExtraServiceProviders($moduleName) as $provider) {\n $allServiceProviders[] = $provider;\n }\n // append the Module main service provider\n $allServiceProviders[] = ModulesConfig::buildMainServiceProvider($modulesNamespace, $moduleName);\n }\n\n return array_unique($allServiceProviders) ? : [];\n }",
"public function provides()\n {\n return [\n RouteServiceProvider::class,\n MenuServiceProvider::class,\n ];\n }",
"public function getUsersServices()\r\n {\r\n return $this->usersServices = new UsersService();\r\n }",
"public function getServices()\n\t{\n\t\treturn ['card', 'topup_mobile', 'topup_mobile_post', 'topup_game'];\n\t}",
"public function providerGet()\n {\n $getList = $this->getMethodsName('get');\n $provider = [];\n\n foreach ($getList as $name) {\n $provider[$name] = [\n 'name' => $name,\n 'arguments' => $this->getArgumentsForMethod($name),\n ];\n }\n\n return $provider;\n }",
"public function findServices(): array;",
"public static function get_services()\n {\n $ServicesObj = new Services();\n $Services = array();\n try {\n $stmt = $ServicesObj->read();\n $count = $stmt->rowCount();\n if ($count > 0) {\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n extract($row);\n $p = (object) array(\n \"ServiceID\" => (int) $ServiceID,\n \"ServiceName\" => $ServiceName,\n );\n\n array_push($Services, $p);\n }\n }\n return $Services;\n } catch (Exception $e) {\n throw $e;\n }\n }",
"protected function otherServiceProviders()\n {\n $providers = [\n \\Collective\\Html\\HtmlServiceProvider::class,\n \\Intervention\\Image\\ImageServiceProvider::class,\n \\Acacha\\AdminLTETemplateLaravel\\Providers\\AdminLTETemplateServiceProvider::class,\n \\Serff\\Cms\\Core\\Providers\\InstallationServiceProvider::class,\n \\Serff\\Cms\\Core\\Providers\\AdminServiceProvider::class,\n ];\n\n $manifestPath = app()->getCachedServicesPath();\n\n (new ProviderRepository(app(), new Filesystem, $manifestPath))\n ->load($providers);\n }",
"protected function getProviders() {\n\n\t\treturn $this->providers;\n\t}",
"public function provides()\n {\n return [\n 'sm.callback.factory',\n 'sm.event.dispatcher',\n 'sm.factory',\n Debug::class,\n ];\n }",
"public function get_providers()\n {\n }",
"public function provides()\n {\n return [\n 'freshdesk.factory',\n 'freshdesk',\n 'freshdesk.connection',\n ];\n }",
"public function provides()\n {\n return [\\App\\Services\\ApiPlatformProductFactoryService::class];\n }",
"public function getServiceProvider($provider);",
"public static function getListServices () {\n return self::findByStatus(self::STATUS_ACTIVE);\n }",
"protected function registerServiceProviders()\n {\n if ($this->active()->has('providers')) {\n $providers = $this->active()->get('providers');\n\n foreach ($providers as $provider) {\n App::register($provider);\n }\n }\n }",
"public function provides()\n\t{\n\t\treturn array(\n\t\t\t'mosms',\n\t\t\t'moclient',\n\t\t\t);\n\t}",
"public function provides() {\n $providers = array();\n foreach ($this->providers as $key => $value) {\n $providers[] = $key;\n }\n return $providers;\n }",
"public function getLoadedProviders(): array\n {\n return $this->loadServiceProviders;\n }",
"public function provides()\n {\n AchieveLogger::info(\"Deferred true and I am here in provides()\");\n return['App\\Services\\Utility\\AchieveLoggerService'];\n }",
"public function getModuleServiceProvider()\n {\n return isset($this->config['module']['providers']) ? $this->config['module']['providers'] : [];\n }",
"public function provides()\n {\n return [\n CreateService::class,\n CreateInterface::class,\n CreateProvider::class,\n ];\n }",
"public function setProviders()\n {\n $services = $this->container['services']??null;\n\n if (is_array($services)) {\n foreach ($services as $service) {\n $service::register($this->container);\n $service::boot($this->container);\n }\n }\n }",
"public function provides()\n {\n return [\n ZhyuInfoServiceProvider::class,\n ];\n }",
"public function getProviders()\n {\n return $this->providers;\n }",
"public function getProviders()\n {\n return $this->providers;\n }",
"public function services($ignore_cache = false) {\n if ($this->services === null || $ignore_cache) {\n $this->services = StatusBoard_Service::allForSite($this);\n }\n \n return $this->services;\n }",
"public function getProviders(): array\n {\n return $this->providers;\n }",
"public function getProviders(): array\n {\n return $this->providers;\n }",
"public function get_service() {\n\n\t\treturn $this->provider_instance;\n\t}",
"public function provides()\n {\n return [\n 'digitalocean.adapterfactory',\n 'digitalocean.factory',\n 'digitalocean',\n 'digitalocean.connection',\n ];\n }",
"public function provides()\n {\n return [\n 'dubbo_cli',\n 'dubbo_cli.factory',\n ];\n }",
"public static function getSubscribedServices()\r\n {\r\n return [\r\n MDHelper::class,\r\n LoggerInterface::class\r\n ];\r\n }",
"public function getDependencies()\n {\n return array(\n MongoServiceProvider::SERVICE_NAME\n );\n }",
"protected function getAuth_Provider_Oauth_ServiceCollectionService()\n {\n $this->services['auth.provider.oauth.service_collection'] = $instance = new \\phpbb\\di\\service_collection($this);\n\n $instance->add('auth.provider.oauth.service.bitly');\n $instance->add('auth.provider.oauth.service.facebook');\n $instance->add('auth.provider.oauth.service.google');\n $instance->add('auth.provider.oauth.service.twitter');\n\n return $instance;\n }",
"public function provides()\n {\n return [CardService::class];\n }",
"public function getServices()\n {\n $services = InvoiceService::where('office_id', request('office_id'))->where('name', 'like', '%' . request('q') . '%')->get();\n\n return $services;\n }",
"public function provides()\n {\n return [\n 'auth',\n 'Permit\\CurrentUser\\ContainerInterface',\n 'Permit\\Access\\CheckerInterface',\n 'Permit\\CurrentUser\\LoginValidatorInterface'\n ];\n }",
"public function getProviders($provider)\n {\n $name = is_string($provider) ? $provider : getClass($provider, true);\n \n return Arr::where($this->serviceProviders, function ($value) use ($name) {\n return $value instanceof $name;\n });\n }",
"public function getServiceCheckProviders(): array\n {\n return $this->serviceCheckProviders;\n }",
"public static function getDeferredServices(){\n return \\Illuminate\\Foundation\\Application::getDeferredServices();\n }",
"abstract public function getProviders();",
"private function providers()\n {\n $this->register(new CorsServiceProvider());\n $this->register(new HmacServiceProvider());\n }",
"public function getDeferredServices(): array\n {\n return $this->deferredServices;\n }",
"public function services(){\n\n $facades = Array(\n 'Cache' => 'Disco\\classes\\Cache',\n 'Crypt' => 'Disco\\classes\\Crypt',\n 'Data' => 'Disco\\classes\\Data',\n 'DB' => 'Disco\\classes\\DB',\n 'Email' => 'Disco\\classes\\Email',\n 'Event' => 'Disco\\classes\\Event',\n 'Html' => 'Disco\\classes\\Html',\n 'Form' => 'Disco\\classes\\Form',\n 'Model' => 'Disco\\classes\\ModelFactory',\n 'Queue' => 'Disco\\classes\\Queue',\n 'Session' => 'Disco\\classes\\Session',\n 'Template' => 'Disco\\classes\\Template',\n 'View' => 'Disco\\classes\\View'\n );\n\n foreach($facades as $facade=>$v){\n $this->make($facade,$v);\n }//foreach\n\n $this->as_factory('Router',function(){\n return new \\Disco\\classes\\Router::$base;\n });\n\n }",
"public function provides()\n {\n return [\n EventDispatcher::class,\n Repository::class,\n ];\n }",
"public function getServiceProvider(): Provider\n {\n return $this->serviceProvider;\n }",
"protected function getPuntoAtencionServices()\n {\n return $this->container->get('snc.services.puntoatencion');\n }",
"public function get_services($settings = FALSE)\n\t{\t\n\t\treturn parent::get_objects(array(\n\t\t\t'settings' => $settings\n\t\t));\n\t}",
"public function provides()\n {\n return [\n Factory::class,\n 'flipbox.sdk',\n ];\n }",
"public function provides()\n {\n return array(\n 'icsconfig',\n 'icsview',\n 'icsmessage',\n 'icspdf'\n );\n }",
"public function getAvailableServices();",
"public function provides()\n {\n return [\n ZhyuAuthServiceProvider::class,\n ];\n }",
"public function getServices() {\n $serviceNames = $this->getServiceNames($this->serviceFolderPaths);\n $ret = $ret1 = array();\n// require_once AMFPHP_ROOTPATH.'Plugins/AmfphpDiscovery/CReflection.php';\n foreach ($serviceNames as $serviceName) {\n/* $methods = array();\n $objC = new CReflection(APP_PATH.'/app/controllers/'.$serviceName.'.php');\n $objComment = $objC->getDocComment();\n $arrMethod = $objC->getMethods();\n foreach ($arrMethod as $objMethods)\n {\n $methodComment = $objMethods->getDocComment();\n $parsedMethodComment = $this->parseMethodComment($methodComment);\n $arrParamenter = $objMethods->getParameters();\n foreach ($arrParamenter as $Paramenter)\n {\n $parameterInfo = new AmfphpDiscovery_ParameterDescriptor($Paramenter, '');\n $parameters[] = $parameterInfo;\n }\n $methods[$objMethods->_name] = new AmfphpDiscovery_MethodDescriptor($objMethods->_name, $parameters, $methodComment, $parsedMethodComment['return']);\n }\n\n $ret[$serviceName] = new AmfphpDiscovery_ServiceDescriptor($serviceName, $methods, $objComment); */\n $ret1[] = array('label'=>$serviceName,'date'=>'');\n }\n// var_dump($ret);exit();\n //note : filtering must be done at the end, as for example excluding a Vo class needed by another creates issues\n foreach ($ret as $serviceName => $serviceObj) {\n foreach (self::$excludePaths as $excludePath) {\n if (strpos($serviceName, $excludePath) !== false) {\n unset($ret[$serviceName]);\n break;\n }\n }\n }\n return $ret1;\n }",
"public function providers()\n {\n return $this->request('get', '/api/teams/'.Helpers::config('team').'/providers');\n }",
"public function get_registered_services() {\n\t\t$data = [];\n\t\t$res = self::$dbo->query( 'SELECT storage_service FROM snapshot_storage_credentials' );\n\t\twhile ( $row = $res->fetchArray() ) {\n\t\t\t$data[] = $row['storage_service'];\n\t\t}\n\n\t\treturn $data;\n\t}",
"protected function getPayrollServices()\n\t{\n\t\treturn $this->payrollServices = new PayrollServices();\n\t}",
"public function provides()\n {\n return ['shppcart_service'];\n }",
"public function provides()\n {\n return ['vk_service'];\n }",
"public function provides() {\n\t\treturn array();\n\t}"
] | [
"0.79039633",
"0.7667588",
"0.76229626",
"0.75573224",
"0.7470691",
"0.7423859",
"0.7423859",
"0.7423859",
"0.7409516",
"0.736475",
"0.736475",
"0.7363987",
"0.7322196",
"0.71889",
"0.7162814",
"0.71509963",
"0.7137116",
"0.70622355",
"0.7047945",
"0.70362085",
"0.70213807",
"0.69303095",
"0.6916005",
"0.689161",
"0.6809766",
"0.6804473",
"0.6777694",
"0.67695314",
"0.67489713",
"0.6727971",
"0.6722673",
"0.6699434",
"0.66944385",
"0.6651968",
"0.6645622",
"0.66324407",
"0.66324407",
"0.6616089",
"0.6613961",
"0.6610317",
"0.66008735",
"0.6567814",
"0.6562319",
"0.6529889",
"0.6500722",
"0.6480351",
"0.64535",
"0.645232",
"0.6418372",
"0.6416018",
"0.6413331",
"0.6397339",
"0.63955915",
"0.63899195",
"0.6379133",
"0.63766354",
"0.63379693",
"0.63369566",
"0.63356155",
"0.6335485",
"0.6318311",
"0.6316751",
"0.63084865",
"0.62963986",
"0.6278965",
"0.6264424",
"0.6264424",
"0.62581587",
"0.6252555",
"0.6252555",
"0.62434787",
"0.62404764",
"0.623751",
"0.62194616",
"0.6210146",
"0.6203944",
"0.62002736",
"0.6197869",
"0.61938506",
"0.6188146",
"0.61726904",
"0.6170289",
"0.6163297",
"0.61600006",
"0.61570746",
"0.6152867",
"0.6147815",
"0.6147383",
"0.61295825",
"0.6126574",
"0.6124758",
"0.61204225",
"0.6100293",
"0.60957974",
"0.6073751",
"0.6072919",
"0.60692966",
"0.6069216",
"0.60561067",
"0.604959",
"0.60481"
] | 0.0 | -1 |
Display a listing of the resource. | public function index()
{
return view('back/showshareitem')->with('shareitems', ShareItem::all());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }",
"public function listing();",
"function index() {\n\t\t$this->show_list();\n\t}",
"public function actionList() {\n $this->_getList();\n }",
"public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }",
"public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }",
"public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }",
"function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}",
"public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }",
"public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }",
"public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}",
"function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}",
"public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }",
"public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}",
"public function actionRestList() {\n\t $this->doRestList();\n\t}",
"public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}",
"public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }",
"public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }",
"public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}",
"public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}",
"public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }",
"public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }",
"public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }",
"public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }",
"public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}",
"public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }",
"public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}",
"public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }",
"public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }",
"public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }",
"public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }",
"public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}",
"public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }",
"public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }",
"public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }",
"public function index()\n {\n return Resources::collection(Checking::paginate());\n }",
"public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }",
"public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }",
"public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }",
"public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }",
"public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }",
"public function view(){\n\t\t$this->buildListing();\n\t}",
"public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }",
"public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }",
"public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }",
"public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }",
"public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }",
"public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }",
"public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }",
"public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }",
"public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}",
"public function listAction() {}",
"public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }",
"public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }",
"public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }",
"public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }",
"public function executeList()\n {\n $this->setTemplate('list');\n }",
"function listing() {\r\n\r\n }",
"public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }",
"public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }",
"public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }",
"public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }",
"public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}",
"public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }",
"public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}",
"public function _index(){\n\t $this->_list();\n\t}",
"function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}",
"public function index()\n {\n $this->booklist();\n }",
"public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }",
"public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }",
"public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }",
"public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }",
"public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }",
"public function indexAction() {\n $this->_forward('list');\n }",
"public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }",
"public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }",
"public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }",
"public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}",
"public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }",
"public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }",
"public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }",
"public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }",
"public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}",
"public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }",
"public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }",
"public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }",
"public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}",
"public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }",
"public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }",
"public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }",
"public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }",
"public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }",
"public function index()\n {\n return view('admin.resources.index');\n }",
"public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}"
] | [
"0.7446377",
"0.7361922",
"0.72984487",
"0.7248631",
"0.7162871",
"0.7148215",
"0.7131838",
"0.71028054",
"0.7102395",
"0.70988023",
"0.7048243",
"0.6993516",
"0.6989079",
"0.69341344",
"0.69001913",
"0.6899167",
"0.68920904",
"0.6887188",
"0.68661547",
"0.6849159",
"0.683002",
"0.6801792",
"0.6796645",
"0.67952746",
"0.678579",
"0.6760132",
"0.6741144",
"0.67304057",
"0.6726034",
"0.6723304",
"0.6723304",
"0.6723304",
"0.67188966",
"0.67061126",
"0.67046595",
"0.67042124",
"0.6664004",
"0.6663109",
"0.66603667",
"0.66595376",
"0.6656908",
"0.66536283",
"0.6648508",
"0.6619696",
"0.66191936",
"0.66145146",
"0.66056865",
"0.6600895",
"0.66007215",
"0.6593214",
"0.6587006",
"0.6585572",
"0.6584028",
"0.65802413",
"0.65751636",
"0.6574276",
"0.6572553",
"0.65703243",
"0.6569474",
"0.6563628",
"0.6563418",
"0.65516967",
"0.655156",
"0.65460885",
"0.65367365",
"0.6533626",
"0.6533064",
"0.6527408",
"0.65251255",
"0.6524834",
"0.65202224",
"0.6517302",
"0.65167385",
"0.6516062",
"0.65148616",
"0.6506742",
"0.65018",
"0.6501768",
"0.6494415",
"0.64921784",
"0.6486631",
"0.6485237",
"0.6484199",
"0.64841217",
"0.6479556",
"0.6478558",
"0.6469807",
"0.646858",
"0.64683306",
"0.6466808",
"0.64637285",
"0.64616066",
"0.6458575",
"0.6457558",
"0.64535207",
"0.64534074",
"0.64524984",
"0.64491946",
"0.6448726",
"0.6447211",
"0.64461327"
] | 0.0 | -1 |
Show the form for creating a new resource. | public function create()
{
return view('back/createshareitem')->with("categories", ShareCategory::all());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return view('admin.resources.create');\n }",
"public function create(){\n\n return view('resource.create');\n }",
"public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}",
"public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }",
"public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }",
"public function create()\n {\n return view ('forms.create');\n }",
"public function create ()\n {\n return view('forms.create');\n }",
"public function create()\n\t{\n\t\treturn view('faith.form');\n\t}",
"public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }",
"public function create()\n {\n return view(\"request_form.form\");\n }",
"public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }",
"public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle école'\n\t\t) ) );\n\t}",
"public function create()\n {\n return view($this->forms . '.create');\n }",
"public function create()\n {\n return view('restful.add');\n }",
"public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }",
"public function create()\n {\n return view('admin.createform');\n }",
"public function create()\n {\n return view('admin.forms.create');\n }",
"public function create()\n {\n return view('backend.student.form');\n }",
"public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }",
"public function create()\n {\n return view('client.form');\n }",
"public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }",
"public function create()\n {\n return view('Form');\n }",
"public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }",
"public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}",
"public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }",
"public function create()\n {\n return view('form');\n }",
"public function create()\n {\n return view('form');\n }",
"public function create()\n {\n return view('form');\n }",
"public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }",
"public function create()\n {\n return view('backend.schoolboard.addform');\n }",
"public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}",
"public function create()\n {\n //\n return view('form');\n }",
"public function create()\n {\n return view('rests.create');\n }",
"public function create()\n {\n return $this->showForm();\n }",
"public function create()\n {\n return $this->showForm();\n }",
"public function create()\n {\n return view(\"Add\");\n }",
"public function create(){\n return view('form.create');\n }",
"public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }",
"public function create()\n {\n\n return view('control panel.student.add');\n\n }",
"public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}",
"public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }",
"public function create()\n {\n return $this->cView(\"form\");\n }",
"public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }",
"public function create()\n {\n return view(\"dresses.form\");\n }",
"public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}",
"public function createAction()\n {\n// $this->view->form = $form;\n }",
"public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }",
"public function create()\n {\n return view('fish.form');\n }",
"public function create()\n {\n return view('users.forms.create');\n }",
"public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }",
"public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}",
"public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }",
"public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }",
"public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }",
"public function create()\n {\n return view('essentials::create');\n }",
"public function create()\n {\n return view('student.add');\n }",
"public function create()\n {\n return view('url.form');\n }",
"public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}",
"public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }",
"public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}",
"public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }",
"public function create()\n {\n return view('libro.create');\n }",
"public function create()\n {\n return view('libro.create');\n }",
"public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function create()\n {\n return view('crud/add'); }",
"public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}",
"public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function create()\n {\n return view(\"List.form\");\n }",
"public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}",
"public function create()\n {\n //load create form\n return view('products.create');\n }",
"public function create()\n {\n return view('article.addform');\n }",
"public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }",
"public function create()\n {\n return view('saldo.form');\n }",
"public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}",
"public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}",
"public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }",
"public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }",
"public function create()\n {\n return view('admin.inverty.add');\n }",
"public function create()\n {\n return view('Libro.create');\n }",
"public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }",
"public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }",
"public function create()\n {\n return view(\"familiasPrograma.create\");\n }",
"public function create()\n {\n return view('admin.car.create');\n }",
"public function create()\n {\n return view('admin.car.create');\n }",
"public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}",
"public function create()\n {\n return view(\"create\");\n }",
"public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}",
"public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }",
"public function create()\n {\n return view('forming');\n }",
"public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }",
"public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }",
"public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }",
"public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }",
"public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}",
"public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }",
"public function create()\n {\n return view('student::students.student.create');\n }",
"public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}"
] | [
"0.75936973",
"0.75936973",
"0.7585464",
"0.7576766",
"0.7571166",
"0.7498768",
"0.7434969",
"0.7432511",
"0.7387868",
"0.7351811",
"0.7336364",
"0.73113805",
"0.7293885",
"0.72812635",
"0.7273037",
"0.72410345",
"0.7228987",
"0.7225174",
"0.718589",
"0.71786976",
"0.7172516",
"0.71492815",
"0.7143504",
"0.7143484",
"0.71349627",
"0.71274126",
"0.7122271",
"0.7115064",
"0.7115064",
"0.7115064",
"0.7110841",
"0.70930386",
"0.70841706",
"0.7079425",
"0.7079275",
"0.70567256",
"0.70567256",
"0.7054091",
"0.70386195",
"0.7038531",
"0.7034834",
"0.7032825",
"0.7029208",
"0.70263356",
"0.7025177",
"0.7018699",
"0.70156187",
"0.7004536",
"0.7002615",
"0.7000439",
"0.69960874",
"0.6992934",
"0.6991493",
"0.6988563",
"0.698635",
"0.69649065",
"0.6963641",
"0.69552153",
"0.6950279",
"0.69498897",
"0.69465077",
"0.6943029",
"0.6940043",
"0.6939427",
"0.69359136",
"0.69359136",
"0.69357383",
"0.6933012",
"0.6929994",
"0.69270134",
"0.69259113",
"0.6923401",
"0.6917057",
"0.69144267",
"0.6911519",
"0.6909902",
"0.690978",
"0.6905855",
"0.6903688",
"0.6900189",
"0.68999064",
"0.6898482",
"0.6893158",
"0.6892387",
"0.6891021",
"0.68905854",
"0.6890334",
"0.6890334",
"0.68871844",
"0.68864834",
"0.68854547",
"0.6881966",
"0.68814063",
"0.68788683",
"0.68738896",
"0.6871671",
"0.68716353",
"0.68688464",
"0.6868651",
"0.68685114",
"0.686829"
] | 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request)
{
$this->validate($request, [
'title' => 'required',
'user_name' => 'required',
'image' => 'required',
'category_id' => 'required',
'description' => 'required',
]);
$image = $request->file('image');
$imagename = time() . $image->getClientOriginalName();
$destinationPath = 'img/share/';
$image->move($destinationPath, $imagename);
$images=array();
if($files=$request->file('images')){
foreach($files as $file){
$name=time() . $file->getClientOriginalName();
$file->move($destinationPath, $name);
$images[]='img/share/' . $name;
}
}
$shareitem = new ShareItem;
$shareitem->title = $request->get('title');
$shareitem->user_name = $request->get('user_name');
$shareitem->img = 'img/share/' . $imagename;
$shareitem->show_imgs = implode("|",$images);
$shareitem->category_id = $request->get('category_id');
$shareitem->description = $request->get('description');
if ($shareitem->save())
{
return redirect('/back/shareitem');
} else {
return redirect()->back()->withInput()->withErrors('share item save faild');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }",
"public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }",
"public function createStorage();",
"public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"function storeAndNew() {\n $this->store();\n }",
"public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }",
"public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }",
"public function store()\n\t{\n\t\t\n\t\t//\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}"
] | [
"0.72865677",
"0.7145327",
"0.71325725",
"0.6640912",
"0.66209733",
"0.65685713",
"0.652643",
"0.65095705",
"0.64490104",
"0.637569",
"0.63736665",
"0.63657933",
"0.63657933",
"0.63657933",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437"
] | 0.0 | -1 |
Display the specified resource. | public function show($id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Resource $resource)\n {\n // not available for now\n }",
"public function show(Resource $resource)\n {\n //\n }",
"function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }",
"private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }",
"function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}",
"public function show(ResourceSubject $resourceSubject)\n {\n //\n }",
"public function show(ResourceManagement $resourcesManagement)\n {\n //\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function retrieve(Resource $resource);",
"public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }",
"public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function show(Dispenser $dispenser)\n {\n //\n }",
"public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }",
"public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}",
"public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }",
"public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }",
"function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}",
"public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }",
"public function get(Resource $resource);",
"public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }",
"public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }",
"function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}",
"public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }",
"function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}",
"public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function show(rc $rc)\n {\n //\n }",
"public function show(Resolucion $resolucion)\n {\n //\n }",
"public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show(Resena $resena)\n {\n }",
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }",
"public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}",
"public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }",
"public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }",
"public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }",
"public function display()\n\t{\n\t\tparent::display();\n\t}",
"public function get_resource();",
"public function show()\n\t{\n\t\t\n\t}",
"function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}",
"public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }",
"public function display($title = null)\n {\n echo $this->fetch($title);\n }",
"public function display(){}",
"public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}",
"public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}",
"public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }",
"#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}",
"public function display() {\n echo $this->render();\n }",
"public function show($id)\n\t{\n\t//\n\t}",
"public function show($id)\n\t{\n\t//\n\t}",
"function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }",
"public function show($id)\n {\n //\n $this->_show($id);\n }",
"public function show()\n\t{\n\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {}",
"static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}",
"public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}",
"public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }",
"public abstract function display();",
"abstract public function resource($resource);",
"public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show(Response $response)\n {\n //\n }",
"public function show()\n {\n return auth()->user()->getResource();\n }",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}"
] | [
"0.8233718",
"0.8190437",
"0.6828712",
"0.64986944",
"0.6495974",
"0.6469629",
"0.6462615",
"0.6363665",
"0.6311607",
"0.62817234",
"0.6218966",
"0.6189695",
"0.61804265",
"0.6171014",
"0.61371076",
"0.61207956",
"0.61067593",
"0.6105954",
"0.6094066",
"0.6082806",
"0.6045245",
"0.60389996",
"0.6016584",
"0.598783",
"0.5961788",
"0.59606946",
"0.5954321",
"0.59295714",
"0.59182066",
"0.5904556",
"0.59036547",
"0.59036547",
"0.59036547",
"0.5891874",
"0.58688277",
"0.5868107",
"0.58676815",
"0.5851883",
"0.58144855",
"0.58124036",
"0.58112013",
"0.5803467",
"0.58012545",
"0.5791527",
"0.57901084",
"0.5781528",
"0.5779676",
"0.5757105",
"0.5756208",
"0.57561266",
"0.57453394",
"0.57435393",
"0.57422745",
"0.5736634",
"0.5736634",
"0.5730559",
"0.57259274",
"0.5724891",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5718969",
"0.5713412",
"0.57091093",
"0.5706405",
"0.57057405",
"0.5704541",
"0.5704152",
"0.57026845",
"0.57026845",
"0.56981397",
"0.5693083",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962"
] | 0.0 | -1 |
Show the form for editing the specified resource. | public function edit($id)
{
return view('back/editshareitem')->with('shareitem', ShareItem::find($id))->with("categories", ShareCategory::all());;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }",
"public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function edit()\n {\n return view('hirmvc::edit');\n }",
"public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}",
"public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }",
"public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}",
"public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }",
"public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }",
"private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }",
"public function edit($id)\n {\n return $this->showForm('update', $id);\n }",
"public function edit($id)\n {\n return $this->showForm('update', $id);\n }",
"public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }",
"public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }",
"public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}",
"public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }",
"public function edit($model, $form);",
"function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}",
"public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}",
"public function edit(Form $form)\n {\n //\n }",
"public function edit()\n { \n return view('admin.control.edit');\n }",
"public function edit()\n {\n return view('common::edit');\n }",
"public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\r\n {\r\n return view('petro::edit');\r\n }",
"public function edit($id)\n {\n // show form edit user info\n }",
"public function edit()\n {\n return view('escrow::edit');\n }",
"public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }",
"public function edit()\n {\n return view('commonmodule::edit');\n }",
"public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit(form $form)\n {\n //\n }",
"public function actionEdit($id) { }",
"public function edit()\n {\n return view('admincp::edit');\n }",
"public function edit()\n {\n return view('scaffold::edit');\n }",
"public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }",
"public function edit()\n {\n return view('Person.edit');\n }",
"public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }",
"public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}",
"public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }",
"public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}",
"public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }",
"public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }",
"public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }",
"function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}",
"public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }",
"public function edit($id)\n {\n return $this->showForm($id);\n }",
"public function edit($id)\n {\n return $this->showForm($id);\n }",
"protected function _edit(){\n\t\treturn $this->_editForm();\n\t}",
"public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }",
"public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }",
"public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}",
"public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}",
"public function edit($id)\n {\n return view('models::edit');\n }",
"public function edit()\n {\n return view('home::edit');\n }",
"public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }",
"public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }",
"public function edit()\n {\n return view('user::edit');\n }",
"public function edit()\n {\n return view('user::edit');\n }",
"public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }",
"public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }",
"public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return view('consultas::edit');\n }",
"public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }",
"public function edit()\n {\n return view('dashboard::edit');\n }",
"public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }",
"public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }",
"public function edit() {\n return view('routes::edit');\n }",
"public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }",
"public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }",
"public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }",
"public function edit($id)\n {\n return view('cataloguemodule::edit');\n }",
"public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }",
"public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }",
"public function edit()\n {\n return view('website::edit');\n }",
"public function edit()\n {\n return view('inventory::edit');\n }",
"public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }",
"public function edit()\n {\n return view('initializer::edit');\n }",
"public function edit($id)\n {\n return view('backend::edit');\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }",
"public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }",
"public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}",
"public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }",
"public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }",
"public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }",
"public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }",
"public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }",
"public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}"
] | [
"0.7855416",
"0.769519",
"0.72748375",
"0.724256",
"0.7173659",
"0.7064689",
"0.70549816",
"0.6985127",
"0.6949479",
"0.69474626",
"0.694228",
"0.6929372",
"0.6903047",
"0.6899655",
"0.6899655",
"0.688039",
"0.68649715",
"0.68618995",
"0.68586665",
"0.68477386",
"0.68366665",
"0.6812782",
"0.6807947",
"0.68078786",
"0.6803727",
"0.6796845",
"0.67935634",
"0.67935634",
"0.67894953",
"0.67862976",
"0.67815566",
"0.6777874",
"0.67700446",
"0.6764179",
"0.6747784",
"0.6747784",
"0.67476946",
"0.6746584",
"0.67417157",
"0.67370653",
"0.6727131",
"0.6714694",
"0.66953164",
"0.6693583",
"0.6690321",
"0.66898996",
"0.6689058",
"0.66865313",
"0.6684526",
"0.66717213",
"0.6670211",
"0.6666833",
"0.6666833",
"0.66633433",
"0.6663041",
"0.6661699",
"0.6658396",
"0.6657984",
"0.665473",
"0.6644314",
"0.66343915",
"0.6633082",
"0.6629606",
"0.6629606",
"0.6620677",
"0.6620635",
"0.66180485",
"0.66171867",
"0.6612161",
"0.6610249",
"0.660762",
"0.6597593",
"0.6596027",
"0.6595597",
"0.65925545",
"0.65920216",
"0.65896076",
"0.65822965",
"0.6581996",
"0.65817595",
"0.65770084",
"0.65768373",
"0.6575926",
"0.65713066",
"0.6569505",
"0.656938",
"0.65680295",
"0.65636957",
"0.65636957",
"0.65624565",
"0.65597314",
"0.6559697",
"0.65576696",
"0.65573514",
"0.65564495",
"0.6556307",
"0.655628",
"0.65558994",
"0.6549784",
"0.6549675",
"0.65461886"
] | 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request, $id)
{
$shareitem = ShareItem::find($id);
$shareitem->title = $request->get('title');
$shareitem->user_name = $request->get('user_name');
$shareitem->category_id = $request->get('category_id');
$shareitem->description = $request->get('description');
if ($request->hasFile('image')) {
$image = $request->file('image');
$imagename =time() . $image->getClientOriginalName();
$destinationPath = 'img/share/';
$image->move($destinationPath, $imagename);
$shareitem->img = 'img/share/' . $imagename;
}
if ($shareitem->save()) {
return redirect('/back/shareitem');
} else {
return redirect()->back()->withInput()->withErrors('update faild!');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }",
"public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }",
"public function update(Request $request, Resource $resource)\n {\n //\n }",
"public function updateStream($resource);",
"public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }",
"protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }",
"public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }",
"public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }",
"public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}",
"public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }",
"public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }",
"protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }",
"public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }",
"public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }",
"public function update($path);",
"public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }",
"public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }",
"public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}",
"public function updateStream($path, $resource, Config $config)\n {\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }",
"public function update($data) {}",
"public function update($data) {}",
"public function putStream($resource);",
"public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function update($entity);",
"public function update($entity);",
"public function setResource($resource);",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }",
"public function isUpdateResource();",
"public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }",
"public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }",
"public function store($data, Resource $resource);",
"public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }",
"public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }",
"public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }",
"public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }",
"public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }",
"public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }",
"public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }",
"public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }",
"public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }",
"public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }",
"public function update(Qstore $request, $id)\n {\n //\n }",
"public function update(IEntity $entity);",
"protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }",
"public function update($request, $id);",
"function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}",
"public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }",
"public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }",
"protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }",
"abstract public function put($data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function testUpdateSupplierUsingPUT()\n {\n }",
"public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }",
"public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }",
"public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }",
"public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }",
"public abstract function update($object);",
"public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }",
"public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }",
"public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }",
"public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }",
"public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }",
"public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }",
"public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }",
"public function update($entity)\n {\n \n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }",
"public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }",
"public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }",
"public function update($id, $input);",
"public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }",
"public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}",
"public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }",
"public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }",
"public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }",
"public function update($id);",
"public function update($id);",
"private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }",
"public function put($path, $data = null);",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }",
"public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }",
"public function update(Entity $entity);",
"public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }",
"public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}",
"public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }",
"public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }",
"public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }",
"public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }"
] | [
"0.7425105",
"0.70612276",
"0.70558053",
"0.6896673",
"0.6582159",
"0.64491373",
"0.6346954",
"0.62114537",
"0.6145042",
"0.6119944",
"0.61128503",
"0.6099993",
"0.6087866",
"0.6052593",
"0.6018941",
"0.60060275",
"0.59715486",
"0.5946516",
"0.59400934",
"0.59377414",
"0.5890722",
"0.5860816",
"0.5855127",
"0.5855127",
"0.58513457",
"0.5815068",
"0.5806887",
"0.57525045",
"0.57525045",
"0.57337505",
"0.5723295",
"0.5714311",
"0.5694472",
"0.5691319",
"0.56879413",
"0.5669989",
"0.56565005",
"0.56505877",
"0.5646085",
"0.5636683",
"0.5633498",
"0.5633378",
"0.5632906",
"0.5628826",
"0.56196684",
"0.5609126",
"0.5601397",
"0.55944353",
"0.5582592",
"0.5581908",
"0.55813426",
"0.5575312",
"0.55717176",
"0.55661047",
"0.55624634",
"0.55614686",
"0.55608666",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55573726",
"0.5556878",
"0.5554201",
"0.5553069",
"0.55530256",
"0.5543788",
"0.55435944",
"0.55412996",
"0.55393505",
"0.55368495",
"0.5535236",
"0.5534954",
"0.55237365",
"0.5520468",
"0.55163723",
"0.55125296",
"0.5511168",
"0.5508345",
"0.55072427",
"0.5502385",
"0.5502337",
"0.5501029",
"0.54995877",
"0.54979175",
"0.54949397",
"0.54949397",
"0.54946727",
"0.5494196",
"0.54941916",
"0.54925025",
"0.5491807",
"0.5483321",
"0.5479606",
"0.5479408",
"0.5478678",
"0.54667485",
"0.5463411",
"0.5460588",
"0.5458525"
] | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
ShareItem::find($id)->delete();
return redirect()->back();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }",
"public function destroy(Resource $resource)\n {\n //\n }",
"public function removeResource($resourceID)\n\t\t{\n\t\t}",
"public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }",
"public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }",
"public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }",
"public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }",
"protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }",
"public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }",
"public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }",
"public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }",
"public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}",
"public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}",
"public function delete(): void\n {\n unlink($this->getPath());\n }",
"public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }",
"public function remove($path);",
"function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}",
"public function delete(): void\n {\n unlink($this->path);\n }",
"private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }",
"public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }",
"public function remove() {}",
"public function remove() {}",
"public function remove();",
"public function remove();",
"public function remove();",
"public function remove();",
"function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}",
"public function deleteImage(){\n\n\n Storage::delete($this->image);\n }",
"public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }",
"public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}",
"public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }",
"public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }",
"public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}",
"public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }",
"public function deleteImage(){\n \tStorage::delete($this->image);\n }",
"public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }",
"public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }",
"public function destroy($id)\n {\n Myfile::find($id)->delete();\n }",
"public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }",
"public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }",
"public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }",
"public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }",
"public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }",
"public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }",
"public function delete($path);",
"public function delete($path);",
"public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }",
"public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }",
"public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }",
"public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }",
"public function delete($path, $data = null);",
"public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }",
"public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }",
"public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }",
"public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }",
"public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }",
"public function del($path){\n\t\treturn $this->remove($path);\n\t}",
"public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }",
"public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}",
"public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }",
"public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }",
"public function revoke($resource, $permission = null);",
"public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }",
"function delete($path);",
"public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}",
"public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }",
"public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }",
"public function remove($filePath){\n return Storage::delete($filePath);\n }",
"public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }",
"public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }",
"public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }",
"public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }",
"function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }",
"public function remove($id);",
"public function remove($id);",
"public function deleted(Storage $storage)\n {\n //\n }",
"public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }",
"public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }",
"public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }",
"public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }",
"function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}",
"public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }",
"public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}",
"public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }",
"public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }"
] | [
"0.6672584",
"0.6659381",
"0.6635911",
"0.6632799",
"0.6626075",
"0.65424126",
"0.65416265",
"0.64648265",
"0.62882507",
"0.6175931",
"0.6129922",
"0.60893893",
"0.6054415",
"0.60428125",
"0.60064924",
"0.59337646",
"0.5930772",
"0.59199584",
"0.5919811",
"0.5904504",
"0.5897263",
"0.58962846",
"0.58951396",
"0.58951396",
"0.58951396",
"0.58951396",
"0.5880124",
"0.58690923",
"0.5863659",
"0.5809161",
"0.57735413",
"0.5760811",
"0.5753559",
"0.57492644",
"0.5741712",
"0.57334286",
"0.5726379",
"0.57144034",
"0.57096",
"0.5707689",
"0.5705895",
"0.5705634",
"0.5703902",
"0.5696585",
"0.5684331",
"0.5684331",
"0.56780374",
"0.5677111",
"0.5657287",
"0.5648262",
"0.5648085",
"0.5648012",
"0.5640759",
"0.5637738",
"0.5629985",
"0.5619264",
"0.56167465",
"0.5606877",
"0.56021434",
"0.5601949",
"0.55992156",
"0.5598557",
"0.55897516",
"0.5581397",
"0.5566926",
"0.5566796",
"0.55642897",
"0.55641",
"0.5556583",
"0.5556536",
"0.5550097",
"0.5543172",
"0.55422723",
"0.5540013",
"0.5540013",
"0.55371785",
"0.55365825",
"0.55300397",
"0.552969",
"0.55275744",
"0.55272335",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.5525997",
"0.5525624",
"0.5523911",
"0.5521122",
"0.5517412"
] | 0.0 | -1 |
set up test environment | public function setUp()
{
$this->mockConnection = $this->getMock('stubDatabaseConnection');
$this->mockConnection->expects($this->any())->method('getDatabase')->will($this->returnValue('mock'));
$this->mockQueryBuilder = new TeststubDatabaseQueryBuilder();
$databaseQueryBuilderProvider = $this->getMock('stubDatabaseQueryBuilderProvider', array(), array(), '', false);
$databaseQueryBuilderProvider->expects($this->any())
->method('create')
->will($this->returnValue($this->mockQueryBuilder));
$this->dbFinder = new stubDatabaseFinder($databaseQueryBuilderProvider);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function prepareRealTestEnvironment() {}",
"public function setUp()\n {\n $this->initTestEnvironment('htpasswd_crypt');\n }",
"protected function setUp(): void\n {\n $this->setUpTheTestEnvironment();\n }",
"protected function setUp()\n {\n Kohana::config('database')->default = Kohana::config('database')\n ->unit_testing;\n Auth::instance()->login(TEST_USERNAME, TEST_PASSWORD);\n\n // Index data and start up the search daemon\n exec('indexer --all --config ' . SPHINX_CONF);\n exec('searchd --config ' . SPHINX_CONF);\n }",
"protected function setUp () : void {\n\n $_ENV['foo'] = \"bar\";\n $_SERVER['foo'] = \"baz\";\n\n $_ENV['bar'] = \"lorem\";\n $_SERVER['baz'] = \"ipsum\";\n\n // And quux isn't defined.\n }",
"protected function setUp(): void\n {\n $publicPath = __DIR__ . '/../../src/Provider/public/';\n\n $this->processRunner = new ProcessRunner('php', ['-S', 'localhost:7202', '-t', $publicPath]);\n\n $this->processRunner->run();\n }",
"protected function setUp() {\n parent::setUp();\n Monkey\\setUp();\n }",
"public function setUp() {\n $this->setUpSiteAuditTestEnvironment();\n }",
"protected function setUp()\n {\n parent::setUp();\n\n $this->checkExtension('phalcon');\n\n // Creating the application\n $this->bootstrap = new Bootstrap(self::getConfig());\n $this->app = $this->bootstrap->make($this->kernel());\n $this->app->boot();\n }",
"public static function setup()\n {\n try {\n $env = \\Dotenv\\Dotenv::create(__DIR__ . '/../../private/');\n $env->load();\n $env->required([\n 'ENVIRONMENT',\n ]);\n } catch (\\Exception $e) {\n echo $e;\n }\n }",
"protected function setUpBasicFrontendEnvironment() {}",
"public function setUp()\n {\n require_once 'Zend/Application.php';\n\n // Create application, bootstrap, and run\n $application = new \\Zend_Application(\n APPLICATION_ENV,\n GEMS_ROOT_DIR . '/configs/application.example.ini'\n );\n\n $this->bootstrap = $application;\n\n parent::setUp();\n }",
"protected function setUp() {\n\n\t\tparent::setUp();\n\t\tMonkey\\setUp();\n\t}",
"public function setUp(): void\n {\n $container = Robo::createDefaultContainer(null, new NullOutput());\n $this->setContainer($container);\n $this->setConfig(Robo::config());\n }",
"public function setUp ( )\n {\n $this->bootstrap = new Zend_Application(\n APPLICATION_ENV, ROOT_PATH . '/etc/application.ini'\n );\n\n parent::setUp();\n }",
"public function setUp ( )\n {\n $this->bootstrap = new Zend_Application(\n APPLICATION_ENV, ROOT_PATH . '/etc/application.ini'\n );\n\n parent::setUp();\n }",
"public function setUp()\n {\n /*\n * Force reload of October singletons\n */\n PluginManager::forgetInstance();\n UpdateManager::forgetInstance();\n\n /*\n * Create application instance\n */\n parent::setUp();\n\n /*\n * Switch to the testing environment\n */\n if (file_exists(base_path($this->envTestingFile()))) {\n if (file_get_contents(base_path('.env')) !== file_get_contents(base_path($this->envTestingFile()))) {\n $this->switchEnvironment();\n }\n\n $this->refreshEnvironment();\n }\n\n /*\n * Ensure system is up to date\n */\n $this->runOctoberUpCommand();\n\n /*\n * Detect plugin from test and autoload it\n */\n $this->pluginTestCaseLoadedPlugins = [];\n $pluginCode = $this->guessPluginCodeFromTest();\n\n if ($pluginCode !== false) {\n $this->runPluginRefreshCommand($pluginCode, false);\n }\n\n /*\n * Disable mailer\n */\n Mail::pretend();\n }",
"protected function setUp() {\n\t\tparent::setUp();\n\t\tMonkey\\setUp();\n\t}",
"protected function setUp() {\n\t\tparent::setUp();\n\t\tMonkey\\setUp();\n\t}",
"public function setUp()\n {\n $this->app = $this->createApplication();\n }",
"protected function setUp()\n {\n // base directory for a .env file, and load it if it exists.\n $dotenvDir = __DIR__;\n for ($i = 0; $i < 4; $i++) {\n if (file_exists($dotenvDir.'/.env')) {\n $dotenv = new Dotenv($dotenvDir);\n $dotenv->load();\n break;\n }\n $dotenvDir = dirname($dotenvDir);\n }\n\n $this->memberclicks = new MemberClicks(getenv('MEMBERCLICKS_ORG_ID'), getenv('MEMBERCLICKS_CLIENT_ID'), getenv('MEMBERCLICKS_CLIENT_SECRET'));\n $this->memberclicks->auth();\n }",
"public function setUp() {}",
"public function setUp() {}",
"public function setUp() {}",
"public function setUp(): void {}",
"public function setUp()\n {\n $this->app = Application::instance();\n }",
"public function setUp() : void\n {\n parent::setUp();\n\n config(array(\n 'app.allowexport' => true,\n 'app.readonly' => false, // avoid conflict by confirming default\n ));\n\n $this->token = factory(Token::class)->create();\n\n $this->setTestingUser($this->token->user);\n }",
"public function setUp()\n {\n\n $this->db = Db::getActive();\n $this->response = Response::getActive();\n\n }",
"protected function setUp()\n {\n // Prepare the playground.\n $zip = new ZipArchive();\n $zip->open(__DIR__.'/resources.zip');\n $zip->extractTo(__DIR__.'/playground');\n }",
"public function setUp(): void\n\t{\n\t\t$this->auth = new Arifrh\\Auth\\Auth();\n\t\t$this->auth->testMode();\n\t}",
"protected function setUp() {\r\n $this->application = new TestApplication();\r\n }",
"protected function setUp(): void\n {\n parent::setUp();\n\n $this->setPaths();\n\n $this->files = new Filesystem();\n\n if (!is_dir(env_path())) {\n mkdir(env_path());\n }\n\n copy(__DIR__ . '/../.env.example',env_path('.env'));\n\n $this->artisan('vendor:publish',['--provider' => 'Gecche\\Multidomain\\Foundation\\Providers\\DomainConsoleServiceProvider']);\n\n\n }",
"public function setUp()\n {\n $this->app = RenaApp::getInstance();\n }",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}"
] | [
"0.79760915",
"0.7706559",
"0.7585783",
"0.74595463",
"0.73945946",
"0.7376189",
"0.7366532",
"0.73542905",
"0.7276313",
"0.7202939",
"0.7179787",
"0.7161013",
"0.71607023",
"0.71565884",
"0.71412116",
"0.71412116",
"0.7134437",
"0.7116044",
"0.7116044",
"0.7112601",
"0.7108558",
"0.7095831",
"0.70953214",
"0.7095213",
"0.7091388",
"0.70881635",
"0.70869076",
"0.7082173",
"0.708143",
"0.7069721",
"0.706382",
"0.70567274",
"0.7050074",
"0.7048537",
"0.7048537",
"0.7048537",
"0.7048537",
"0.7048537",
"0.7048537",
"0.7048537",
"0.7048537",
"0.7048537",
"0.7048537",
"0.7048537",
"0.7048537",
"0.7048537",
"0.7048537",
"0.7048537",
"0.704795",
"0.704795",
"0.704795",
"0.704795",
"0.704795",
"0.704795",
"0.704795",
"0.704795",
"0.704795",
"0.704795",
"0.704795",
"0.704795",
"0.704795",
"0.704795",
"0.7047642",
"0.7047642",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565",
"0.70474565"
] | 0.0 | -1 |
test that trying to find a class that does not have an entity annotation throws an exception | public function byPrimaryKeysNonEntity()
{
$this->dbFinder->findByPrimaryKeys($this->mockConnection, new stubReflectionClass('MockNoEntityAnnotationEntity'), array());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testEntityClassExist()\n {\n $this->assertInstanceOf(TreeFactory::class, new TreeFactory());\n }",
"abstract protected function assertEntityClass();",
"public function testValidation()\n {\n $this->driver->loadMetadataForClass(new \\ReflectionClass(InvalidExample::class));\n }",
"public function testNotEntityInitialization()\n {\n $notEntityObj = new \\stdClass();\n\n $this->expectExceptionMessageRegExp('/only accept objects that extend Entity/');\n $layer = new Layer([$notEntityObj], null);\n }",
"public function byCriterionNonEntity()\n {\n $this->dbFinder->findByCriterion($this->mockConnection, $this->getMock('stubCriterion'), new stubReflectionClass('MockNoEntityAnnotationEntity'));\n }",
"public function getMissingEntity()\n {\n $this->setExpectedException(MissingEntityException::class);\n /** @var AbstractEntityService $service */\n $service = $this->getMockForAbstractClass(\n AbstractEntityService::class\n );\n $service->getEntity();\n }",
"public function byCriterionNonEntityClass()\n {\n $this->dbEraser->deleteByCriterion($this->mockConnection, $this->getMock('stubCriterion'), new stubReflectionClass('MockNoEntityAnnotationEntity'));\n }",
"public function testClassExists()\n {\n $this->assertTrue(class_exists('App\\Infrastructure\\DoctrineProducts'));\n }",
"public function testLoadParentClassNotDefined()\r\n\t\t{\r\n\t\t\tORM::init('mysql:host=localhost;dbname=rocket_orm', 'orm_username', 'orm_password');\r\n\t\t\t\r\n\t\t\tORM::load(1);\r\n\t\t}",
"public function testIsVendorClassReturnsFalseIfClassOfObjectIsNotLocatedInVendorDirectory()\n {\n $this->assertFalse(VendorResources::isVendorClass(new ContactType()));\n }",
"public function testAnnotation()\n {\n $fooClass = new ReflectionClass(Foo::class);\n $this->assertFalse($fooClass->isFinal());\n }",
"public function testGetMissingMetadata() {\r\n $uuid = 'abcdefg';\r\n $bool = true;\r\n $int = 1234567;\r\n $string = 'avorium';\r\n // Write data to the database\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$uuid.'\\','.($bool ? 1:0).','.$int.', \\''.$string.'\\')');\r\n // Read data out and cast it to persistent object with incomplete metadata\r\n $this->setExpectedException('Exception', 'The table name of the persistent object could not be determined.');\r\n // Here should come up an exception. It should not be possible to match to an class without knowing from which table to extract the date\r\n $this->getPersistenceAdapter()->get('test_persistence_AbstractPersistenceAdapterTestPersistentObjectWithoutMetadata', $uuid);\r\n }",
"public function testReflectionOnNonClassThrowsException()\n {\n $this->setExpectedException('League\\Container\\Exception\\ReflectionException');\n\n (new Container)->get('FakeClass');\n }",
"public function testNonExistantClass(): void\n {\n $this->expectException(\\RuntimeException::class);\n $this->expectExceptionMessage('Result of class \"stdClass\" has not been set');\n $this->collection->getResult(\\stdClass::class);\n }",
"public function testInvalidClassParam() {\n\t\t$options = $this->_loadOptions;\n\t\t$options['class'] = 'Foo\\bar';\n\t\t$this->expectException('/Unsupported class given/');\n\t\t$posts = Fixture::load('models/Posts', $options);\n\t\t$this->_testLoad($posts);\n\t}",
"public function testEmptyNamespaceMappingException(): void\n {\n $this->expectException(InvalidArgumentException::class);\n\n $this->getEntityFactoryManager()->create(EntityStub::class);\n }",
"public function hasEntityClass(): bool\n {\n return $this->hasDataItem('entity');\n }",
"public function testMorphClassSearchTypeErrorThrowsError()\n {\n $invalidParam = Registry::getDefinition(null);\n }",
"public function testGetHierarchyNotFound()\n {\n $locationId = 'id-test';\n\n $this->locationRepository\n ->expects($this->once())\n ->method('findOneBy')\n ->with(['id' => $locationId])\n ->will($this->returnValue(null));\n\n $this->setExpectedException(\n 'Doctrine\\ORM\\EntityNotFoundException'\n );\n\n $this\n ->locationServiceProviderAdapter\n ->getHierarchy($locationId);\n }",
"public function testNewEntityTypeWithReflectionException(): void {\n\n $res = FormFactory::newEntityType(\"GitHub\", $this->entities);\n $this->assertCount(3, $res);\n }",
"public function it_cant_create_invalid()\n {\n $this->shouldThrow('\\Aspire\\DIC\\Exception\\NotFoundException')->duringGet('SomeClassThatDoesNotExist');\n }",
"public function test_ClassResolver_hasAttribute_objNonConstruct() {\n $this->assertClassHasAttribute('objNonConstruct', \\FightTheIce\\Coding\\ClassResolver::class);\n }",
"abstract protected function getEntityClass();",
"public function testNotFoundEntityFactoryException(): void\n {\n $this->expectException(InvalidArgumentException::class);\n\n $entityFactoryManager = $this->getEntityFactoryManager([\n 'Tests\\EoneoPay\\Externals\\ORM\\Stubs\\Factories\\\\' => 'Tests\\EoneoPay\\Externals\\ORM\\Stubs'\n ]);\n\n $entityFactoryManager->create(EntityCustomRepository::class);\n }",
"public function setInvalidClassName()\n {\n $this->setExpectedException(InvalidEntityClassException::class);\n $this->service->setEntityClass('stdClass');\n }",
"public function testReadUploadableAnnotationReturnsNullWhenNonePresent()\n {\n $reader = $this->getMock('Doctrine\\Common\\Annotations\\Reader');\n $reader\n ->expects($this->once())\n ->method('getClassAnnotation')\n ->will($this->returnValue(null));\n\n $entity = new DummyEntity();\n $driver = new AnnotationDriver($reader);\n $annot = $driver->readUploadable(new \\ReflectionClass($entity));\n\n $this->assertEquals(null, $annot);\n }",
"private static function discoverEntity()\n {\n Structure::indexEntity(static::class);\n }",
"public function testTestModuleEntityMapping()\n {\n $configuration = $this->app['starter.configuration'];\n if (isset($configuration['doctrine']['dbal'])) {\n $mappings = $this->app['orm.em.options']['mappings'];\n $this->assertContains([\n 'type' => 'annotation',\n 'namespace' => 'TestModule\\Entity',\n 'path' => __DIR__ . DIRECTORY_SEPARATOR . 'TestModule/src/Entity'\n ], $mappings);\n }\n }",
"public function testUnannotatedMethodInUnannotatedClassWithException()\n {\n $class = new ReflectionClass(InterceptedClass::class);\n $instance = $class->newInstance();\n\n $this->reader->expects(static::once())->method('getMethodAnnotation')->willReturn(null);\n $this->reader->expects(static::once())->method('getClassAnnotation')->willReturn(null);\n $this->logger->expects(static::once())->method('warning');\n $this->entityManager->expects(static::never())->method('beginTransaction');\n $this->entityManager->expects(static::never())->method('commit');\n $this->entityManager->expects(static::never())->method('rollback');\n\n $hasException = false;\n try {\n $this->assertNull(\n $this->transactionalInterceptor->intercept(\n new MethodInvocation(\n $class->getMethod('bMethodThrowException'),\n $instance,\n array(Exception::class),\n array()\n )\n )\n );\n } catch (Exception $e) {\n $hasException = true;\n }\n $this->assertTrue($hasException);\n }",
"public function testOneAnnotationNoParams() {\n $comment = <<<'EOT'\n/**\n * This is a comment that contains a single annotation with no parameters.\n *\n * @Entity\n */\nEOT;\n \n $annotations = new Annotations($comment);\n $msg = print_r($annotations, true);\n\n $this->assertTrue(isset($annotations['entity']), $msg);\n $this->assertInternalType('boolean', $annotations['entity'], $msg);\n $this->assertEquals(true, $annotations['entity'], $msg);\n }",
"public function testNoEntityLoading() {\n\t\t$file = CAKE . 'VERSION.txt';\n\t\t$xml = <<<XML\n<!DOCTYPE cakephp [\n <!ENTITY payload SYSTEM \"file://$file\" >]>\n<request>\n <xxe>&payload;</xxe>\n</request>\nXML;\n\t\ttry {\n\t\t\t$result = Xml::build($xml);\n\t\t\t$this->assertEquals('', (string)$result->xxe);\n\t\t} catch (Exception $e) {\n\t\t\t$this->assertTrue(true, 'A warning was raised meaning external entities were not loaded');\n\t\t}\n\t}",
"public function testInLocationNotFound()\n {\n $locationId = 'id-test';\n $locationSearchIds = ['id-search1', 'id-search2'];\n\n $this->locationRepository\n ->expects($this->once())\n ->method('findOneBy')\n ->with(['id' => $locationId])\n ->will($this->returnValue(null));\n\n $this->setExpectedException(\n 'Doctrine\\ORM\\EntityNotFoundException'\n );\n\n $this\n ->locationServiceProviderAdapter\n ->in(\n $locationId,\n $locationSearchIds\n );\n }",
"public function testNoAnnotation()\n {\n $fooClass = new ReflectionClass(Foo::class);\n $this->assertTrue($fooClass->isFinal());\n }",
"public function testGuessTypeNoMetadata(): void\n {\n $class = 'FakeClass';\n $property = 'fakeProperty';\n\n $this->modelManager->method('getParentMetadataForProperty')->with($class, $property)\n ->willThrowException(new MappingException());\n\n $result = $this->guesser->guessType($class, $property, $this->modelManager);\n\n $this->assertSame('text', $result->getType());\n $this->assertSame(Guess::LOW_CONFIDENCE, $result->getConfidence());\n }",
"public function testSupportClass(): void\n {\n self::assertTrue($this->userRepository->supportsClass(User::class));\n self::assertFalse($this->userRepository->supportsClass(UserRepository::class));\n }",
"public function testGetLocationNotFound()\n {\n $locationId = 'id-test';\n\n $this->locationRepository\n ->expects($this->once())\n ->method('findOneBy')\n ->with(['id' => $locationId])\n ->will($this->returnValue(null));\n\n $this->setExpectedException(\n 'Doctrine\\ORM\\EntityNotFoundException'\n );\n\n $this\n ->locationServiceProviderAdapter\n ->getLocation($locationId);\n }",
"public function testReturnEntityClass()\n {\n $this->assertInstanceOf(Tree::class, TreeFactory::createFromArray($this->request));\n }",
"public function testGetInvalidFieldType()\r\n\t\t{\r\n\t\t\tORM::init('mysql:host=localhost;dbname=rocket_orm', 'orm_username', 'orm_password');\r\n\t\t\t\r\n\t\t\t$user = User::load(1);\r\n\r\n\t\t\t$user->get(array());\r\n\t\t}",
"public function testLoadInvalidObjectIDType()\r\n\t\t{\r\n\t\t\tORM::init('mysql:host=localhost;dbname=rocket_orm', 'orm_username', 'orm_password');\r\n\t\t\t\r\n\t\t\t$user = User::load(array());\r\n\t\t}",
"public function testIgnoredAnnotationSkippedBeforeReflection() {\n $annotation = 'neverReflectThis';\n $parser = new DocParser();\n $parser->setIgnoredAnnotationNames([$annotation => TRUE]);\n $parser->addNamespace('\\\\Arbitrary\\\\Namespace');\n\n // Register our class loader which will fail if the parser tries to\n // autoload disallowed annotations.\n $autoloader = function ($class_name) use ($annotation) {\n $name_array = explode('\\\\', $class_name);\n $name = array_pop($name_array);\n if ($name == $annotation) {\n $this->fail('Attempted to autoload an ignored annotation: ' . $name);\n }\n };\n spl_autoload_register($autoloader, TRUE, TRUE);\n // Perform the parse.\n $this->assertEmpty($parser->parse('@neverReflectThis'));\n // Clean up after ourselves.\n spl_autoload_unregister($autoloader);\n }",
"public function testReadNoUploadableFieldsWhenNoneExist()\n {\n $entity = new DummyEntity();\n $class = new \\ReflectionClass($entity);\n\n $reader = $this->getMock('Doctrine\\Common\\Annotations\\Reader');\n $reader\n ->expects($this->any())\n ->method('getPropertyAnnotation')\n ->will($this->returnValue(null));\n\n $driver = new AnnotationDriver($reader);\n $fields = $driver->readUploadableFields($class);\n\n $this->assertEquals(0, count($fields));\n }",
"public function testFromInvalidReflectionClass()\n {\n\n // create the reflection class\n $reflectionClass = new ReflectionClass('\\stdClass', array(), array());\n\n // check that the descriptor has not been initialized\n $this->assertNull($this->descriptor->fromReflectionClass($reflectionClass));\n }",
"public function testIsVendorClassReturnsFalseIfNameOfInternalClassIsPassed()\n {\n $this->assertFalse(VendorResources::isVendorClass('\\stdClass'));\n }",
"public function testGetEntityBehaviorsWithUnknownBehavior()\n {\n $this->expectException(\\Magento\\Framework\\Exception\\LocalizedException::class);\n $this->expectExceptionMessage('The behavior token for customer is invalid.');\n\n $this->_importConfig->merge(\n ['entities' => ['customer' => ['behaviorModel' => 'Unknown_Behavior_Class']]]\n );\n $importModel = $this->_model;\n $actualBehaviors = $importModel->getEntityBehaviors();\n $this->assertArrayNotHasKey('customer', $actualBehaviors);\n }",
"public function testIsVendorClassThrowsExceptionIfNoClassNameOrObjectIsPassed()\n {\n $this->expectException('InvalidArgumentException');\n VendorResources::isVendorClass('NoValidClassName');\n }",
"public function testCacheClassNotExist(): void\n {\n $this->config['doctrine']['cache']['array']['class_name'] = 'TestAssets\\NotExistClass';\n\n $factory = new CacheFactory('array');\n $this->expectException(RuntimeException::class);\n $factory($this->getContainer(), 'doctrine.cache.array');\n }",
"public function testEntityNotFound()\n {\n $this->setExpectedException(\n 'Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException',\n 'Entity was not found'\n );\n\n $this\n ->client\n ->request(\n 'GET',\n '/fake/entity/not/found/not-found-id'\n );\n }",
"public function testGetParentsNotFound()\n {\n $locationId = 'id-test';\n\n $this->locationRepository\n ->expects($this->once())\n ->method('findOneBy')\n ->with(['id' => $locationId])\n ->will($this->returnValue(null));\n\n $this->setExpectedException(\n 'Doctrine\\ORM\\EntityNotFoundException'\n );\n\n $this\n ->locationServiceProviderAdapter\n ->getParents($locationId);\n }",
"public function testRequiredTransactionForAnnotatedMethodInUnannotatedClassWithException()\n {\n $class = new ReflectionClass(InterceptedClass::class);\n $instance = $class->newInstance();\n\n $annotation = new Transactional($this->buildTransactionalOptions(Transactional::REQUIRED));\n $this->reader->expects(static::once())->method('getMethodAnnotation')->willReturn($annotation);\n $this->reader->expects(static::never())->method('getClassAnnotation');\n $this->entityManager->expects(static::once())->method('beginTransaction');\n $this->entityManager->expects(static::never())->method('commit');\n $this->entityManager->expects(static::once())->method('rollback');\n\n $hasException = false;\n try {\n $this->transactionalInterceptor->intercept(\n new MethodInvocation($class->getMethod('bMethodThrowException'), $instance, array(Exception::class),\n array()\n )\n );\n } catch (Exception $e) {\n $hasException = true;\n }\n $this->assertTrue($hasException);\n }",
"public function testIsVendorClassReturnsFalseIfClassIsNotLocatedInVendorDirectory()\n {\n $this->assertFalse(VendorResources::isVendorClass('\\Webfactory\\Util\\VendorResources'));\n }",
"public function testGetInvalidFieldName()\r\n\t\t{\r\n\t\t\tORM::init('mysql:host=localhost;dbname=rocket_orm', 'orm_username', 'orm_password');\r\n\t\t\t\r\n\t\t\t$user = User::load(1);\r\n\t\t\t\r\n\t\t\t$user->get('doesnotexistfieldname');\r\n\t\t}",
"public function testRequiredTransactionForUnannotatedMethodInAnnotatedClassWithException()\n {\n $class = new ReflectionClass(InterceptedClass::class);\n $instance = $class->newInstance();\n\n $annotation = new Transactional($this->buildTransactionalOptions(Transactional::REQUIRED));\n $this->reader->expects(static::once())->method('getMethodAnnotation')->willReturn(null);\n $this->reader->expects(static::once())->method('getClassAnnotation')->willReturn($annotation);\n $this->entityManager->expects(static::once())->method('beginTransaction');\n $this->entityManager->expects(static::never())->method('commit');\n $this->entityManager->expects(static::once())->method('rollback');\n\n $hasException = false;\n try {\n $this->transactionalInterceptor->intercept(\n new MethodInvocation($class->getMethod('bMethodThrowException'), $instance, array(Exception::class),\n array()\n )\n );\n } catch (Exception $e) {\n $hasException = true;\n }\n $this->assertTrue($hasException);\n }",
"public function test_create__invalid_class()\n {\n\n (new ElementFactory())->create(['attributes' => ['type' => ElementFactory::class, 'name' => '']]);\n }",
"abstract protected function assertEntity($entity);",
"public function createEntity() {\r\n\t\t$entity = $this->getAnnotation('entity');\r\n\t\tif($entity) {\r\n\t\t\treturn new $entity;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"function macro_is_entity($path)\n{\n return preg_match('/XLite.Model.|XLite.Module.\\w+.\\w+.Model./Ss', $path);\n}",
"public function testSaveNewEmptyEntity() {\n\t\t$entity = new Entity([], ['className' => 'UserEntity']);\n\t\t$table = TableRegistry::get('users');\n\t\t$this->assertFalse($table->save($entity));\n\t}",
"public function testContainerThrowsWhenCannotGetDefinitionToExtend()\n {\n $this->expectException(NotFoundException::class);\n\n $container = new Container;\n\n $this->assertFalse($container->has(Foo::class));\n\n $container->extend(Foo::class);\n }",
"public function getEntityClass();",
"#[@test, @expect('lang.ElementNotFoundException')]\n public function nonExistantPackage() {\n \\lang\\reflect\\Package::forName('@@non-existant-package@@');\n }",
"public function testRequiredTransactionForAnnotatedMethodInUnannotatedClassWithIgnoredException()\n {\n $class = new ReflectionClass(InterceptedClass::class);\n $instance = $class->newInstance();\n\n $annotation = new Transactional(\n $this->buildTransactionalOptions(Transactional::REQUIRED, array(Exception::class))\n );\n $this->reader->expects(static::once())->method('getMethodAnnotation')->willReturn($annotation);\n $this->reader->expects(static::never())->method('getClassAnnotation');\n $this->entityManager->expects(static::once())->method('beginTransaction');\n $this->entityManager->expects(static::once())->method('commit');\n $this->entityManager->expects(static::never())->method('rollback');\n\n $hasException = false;\n try {\n $this->transactionalInterceptor->intercept(\n new MethodInvocation(\n $class->getMethod('bMethodThrowException'),\n $instance,\n array(Exception::class),\n array()\n )\n );\n } catch (Exception $e) {\n $hasException = true;\n }\n $this->assertTrue($hasException);\n }",
"function testFindByIdWithMissingId() {\r\n $this->User =& new User();\r\n \r\n $this->User->contain();\r\n $result = $this->User->findById(99999999, 'username');\r\n $this->assertFalse($result);\r\n }",
"public function testGetNoPersistentObject() {\r\n $uuid = 'abcdefg';\r\n $bool = true;\r\n $int = 1234567;\r\n $string = 'avorium';\r\n // Write data to the database\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$uuid.'\\','.($bool ? 1:0).','.$int.', \\''.$string.'\\')');\r\n // Read data out and cast it to persistent object with incomplete metadata\r\n $this->setExpectedException('Exception', 'The given class is not derived from avorium_core_persistence_PersistentObject. But this is needed to extract the table name!');\r\n $this->getPersistenceAdapter()->get('test_persistence_AbstractPersistenceAdapterTestNoPersistentObject', $uuid);\r\n }",
"public function testGetEntityStringActionReturnsInvalidOnClassnameNotSupplied()\n\t{\n\t\t$this->dispatch(\"/getEntityString\", \"POST\",\n\t\t\t[\n\t\t\t\t\"classname\" => \"\",\n\t\t\t\t\"tablename\" => \"test\",\n\t\t\t\t\"namespace\" => \"test\",\n\t\t\t\t\"entityProperties\" => [\n\t\t\t\t\t0 => [\n\t\t\t\t\t\t\"propertyName\" => \"test\"\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t], true);\n\t\t$this->assertResponseStatusCode(200);\n\t\t$responseContent = json_decode($this->getResponse()->getContent(), true);\n\t\t$this->assertEquals(\n\t\t\t\"error\", $responseContent[\"status\"]\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t\"invalidform\", $responseContent[\"message\"]\n\t\t);\n\t}",
"public function testEntityTypeRestTestCoverage() {\n $problems = [];\n foreach ($this->definitions as $entity_type_id => $info) {\n $class_name_full = $info->getClass();\n $parts = explode('\\\\', $class_name_full);\n $class_name = end($parts);\n $module_name = $parts[1];\n\n $possible_paths = [\n 'Drupal\\Tests\\jsonapi\\Functional\\CLASSTest',\n '\\Drupal\\Tests\\\\' . $module_name . '\\Functional\\Jsonapi\\CLASSTest',\n ];\n foreach ($possible_paths as $path) {\n $missing_tests = [];\n $class = str_replace('CLASS', $class_name, $path);\n if (class_exists($class)) {\n break;\n }\n $missing_tests[] = $class;\n }\n if (!empty($missing_tests)) {\n $missing_tests_list = implode(', ', $missing_tests);\n $problems[] = \"$entity_type_id: $class_name ($class_name_full) (expected tests: $missing_tests_list)\";\n }\n else {\n $config_entity = is_subclass_of($class_name_full, ConfigEntityInterface::class);\n $config_test = is_subclass_of($class, ConfigEntityResourceTestBase::class);\n if ($config_entity && !$config_test) {\n $problems[] = \"$entity_type_id: $class_name is a config entity, but the test is for content entities.\";\n }\n elseif (!$config_entity && $config_test) {\n $problems[] = \"$entity_type_id: $class_name is a content entity, but the test is for config entities.\";\n }\n }\n }\n\n $this->assertSame([], $problems);\n }",
"public function supports(string $entityClass): bool;",
"#[@test, @expect('lang.ElementNotFoundException')]\n public function non_existant() {\n \\lang\\ClassLoader::registerPath('@@non-existant@@');\n }",
"public function testMalformedGetAllRecipeEntities()\n {\n $this->expectException(TypeError::class);\n $input = 'Recipes';\n\n $result = \\Mamoi\\Hydrators\\RecipeEntityHydrator::getAllRecipeEntities($input);\n\n }",
"public function testFindingRepositoryClasses()\n {\n $WriterRepository = $this->em->getRepository(\"ZF2EntityAuditTest\\Entity\\Writer\");\n $ArticleRepository = $this->em->getRepository(\"ZF2EntityAuditTest\\Entity\\Article\");\n\n $this->assertEquals(\"Doctrine\\ORM\\EntityRepository\" , get_class($WriterRepository));\n $this->assertEquals(\"Doctrine\\ORM\\EntityRepository\" , get_class($ArticleRepository));\n\n }",
"public function testGetChildrenNotFound()\n {\n $locationId = 'id-test';\n\n $this->locationRepository\n ->expects($this->once())\n ->method('findOneBy')\n ->with(['id' => $locationId])\n ->will($this->returnValue(null));\n\n $this->setExpectedException(\n 'Doctrine\\ORM\\EntityNotFoundException'\n );\n\n $this\n ->locationServiceProviderAdapter\n ->getChildren($locationId);\n }",
"public function testRequiredTransactionForUnannotatedMethodInAnnotatedClassWithIgnoredException()\n {\n $class = new ReflectionClass(InterceptedClass::class);\n $instance = $class->newInstance();\n\n $annotation = new Transactional(\n $this->buildTransactionalOptions(Transactional::REQUIRED, array(Exception::class)));\n $this->reader->expects(static::once())->method('getMethodAnnotation')->willReturn(null);\n $this->reader->expects(static::once())->method('getClassAnnotation')->willReturn($annotation);\n $this->entityManager->expects(static::once())->method('beginTransaction');\n $this->entityManager->expects(static::once())->method('commit');\n $this->entityManager->expects(static::never())->method('rollback');\n\n $hasException = false;\n try {\n $this->transactionalInterceptor->intercept(\n new MethodInvocation($class->getMethod('bMethodThrowException'), $instance, array(Exception::class),\n array()\n )\n );\n } catch (Exception $e) {\n $hasException = true;\n }\n $this->assertTrue($hasException);\n }",
"public function testEmptyFactoryPathsException(): void\n {\n $this->expectException(InvalidArgumentException::class);\n\n new EntityFactoryManager($this->getEntityManager(), []);\n }",
"public function testAutoloader()\n {\n $this->assertTrue(class_exists('\\ActiveCollab\\DatabaseObject\\Entity\\Entity'));\n $this->assertTrue(class_exists('\\ActiveCollab\\DatabaseObject\\Test\\Fixtures\\Writers\\Writer'));\n }",
"public function test_ClassResolver_hasAttribute_reflection() {\n $this->assertClassHasAttribute('reflection', \\FightTheIce\\Coding\\ClassResolver::class);\n }",
"public function testIsValidTypeInvalid()\n {\n $this->assertFalse($this->annotation->isValidType('INVALID'));\n }",
"public function testFromReflectionClassWithInvalidLocalAnnotation()\n {\n\n // prepare the annotation values\n $values = array();\n\n // create a mock annotation implementation\n $beanAnnotation = $this->getMockBuilder('AppserverIo\\Psr\\EnterpriseBeans\\Annotations\\AbstractBeanAnnotation')\n ->setConstructorArgs(array('Stateless', $values))\n ->getMockForAbstractClass();\n\n // create a mock annotation\n $annotation = $this->getMockBuilder('AppserverIo\\Lang\\Reflection\\ReflectionAnnotation')\n ->setMethods(array('getAnnotationName', 'getValues', 'newInstance'))\n ->setConstructorArgs(array('Stateless', $values))\n ->getMock();\n\n // mock the ReflectionAnnotation methods\n $annotation\n ->expects($this->once())\n ->method('getAnnotationName')\n ->will($this->returnValue('Stateless'));\n $annotation\n ->expects($this->once())\n ->method('getValues')\n ->will($this->returnValue($values));\n $annotation\n ->expects($this->once())\n ->method('newInstance')\n ->will($this->returnValue($beanAnnotation));\n\n // initialize the annotation aliases\n $aliases = array(\n Resource::ANNOTATION => Resource::__getClass(),\n EnterpriseBean::ANNOTATION => EnterpriseBean::__getClass()\n );\n\n // create a mock reflection class\n $reflectionClass = $this->getMockBuilder('AppserverIo\\Lang\\Reflection\\ReflectionClass')\n ->setMethods(array('hasAnnotation'))\n ->setConstructorArgs(array(__CLASS__, array(), $aliases))\n ->getMock();\n $reflectionClass\n ->expects($this->once())\n ->method('hasAnnotation')\n ->with('Local')\n ->will($this->returnValue(true));\n\n // mock the methods\n $this->descriptor\n ->expects($this->once())\n ->method('newAnnotationInstance')\n ->with($reflectionClass)\n ->will($this->returnValue($annotation));\n\n // initialize the descriptor instance\n $this->descriptor->fromReflectionClass($reflectionClass);\n }",
"public function testGetClassesMappingWithWrongType(): void\n {\n \\Config::set(RB::CONF_KEY_CONVERTER_CLASSES, false);\n\n $this->expectException(Ex\\InvalidConfigurationException::class);\n Lockpick::call(Converter::class, 'getClassesMapping');\n }",
"public function testSearchMissAtributeFromException()\n {\n $attrKey = 'test_attribute_name';\n $attrKeySearch = null;\n\n try {\n factory(Post::class)->create([\n $attrKey => true\n ]);\n } catch (QueryException $e) {\n $attrKeySearch = Post::getMissAttributeKey($e);\n }\n\n $this->assertEquals($attrKeySearch, $attrKey);\n }",
"public function testFindPersistedEntities() {\n\t\t$table = TableRegistry::get('users');\n\t\t$table->entity = true;\n\t\t$results = $table->find('all');\n\t\t$this->assertCount(4, $results);\n\t\tforeach ($results as $article) {\n\t\t\t$this->assertFalse($article->isNew());\n\t\t}\n\t}",
"public function testMorphClassSearchUnknownMosaicReturnsFalse()\n {\n $invalidFQN = \"evias.sdk.preconfigured:nem-php\";\n $definition = Registry::getDefinition($invalidFQN);\n\n $this->assertFalse($definition);\n }",
"public function testEntityClass()\n {\n $record = $this->pieceRecords[0];\n\n $layer = new Layer([], 'edition');\n $this->assertEquals('Edition', $layer->entityClass());\n\n $layer = new Layer([$record], 'edition');\n $this->assertEquals('Piece', $layer->entityClass());\n\n $layer = new Layer([$record]);\n $this->assertEquals('Piece', $layer->entityClass());\n }",
"public function testGetMetadata()\n {\n $connection = $this->createMysqlConnection();\n $metadata = $connection->getClassMetadata();\n\n $classes = [\n \"Quizzes\\Quiz\",\n \"Quizzes\\Question\",\n \"Quizzes\\Answer\"\n ];\n\n $names = [];\n\n foreach ($metadata as $k => $v) {\n $names[] = $v->getName();\n\n foreach ($classes as $key => $value) {\n if ($value == $v->getName()) {\n unset($classes[$key]);\n }\n }\n }\n\n $this->assertCount(0, $classes, print_r($names, true));\n\n }",
"public function testParseNoClass()\n {\n $file = '#test';\n $rule = [\n 'directive' => '~#test(\\s*\\(((.*))\\))?~',\n 'replace' => \\Caprice\\Directives\\PhpDirectives::class, // wrong class\n ];\n $extras = []; // extra needed parameters like paths \n\n $this->expectException(CapriceException::class);\n $this->parser->parse($file, $rule, $extras);\n }",
"public function getClassNameFromEntity()\n {\n $post = new Post(['id' => 243]);\n $this->service->setEntity($post);\n $this->assertEquals(Post::class, $this->service->getEntityClassName());\n }",
"#[Group('DDC-3418')]\n public function testMappedSuperclassIndex(): void\n {\n $class = $this->cmf->getMetadataFor(EntityIndexSubClass::class);\n assert($class instanceof ClassMetadata);\n\n self::assertArrayHasKey('mapped1', $class->fieldMappings);\n self::assertArrayHasKey('IDX_NAME_INDEX', $class->table['uniqueConstraints']);\n self::assertArrayHasKey('IDX_MAPPED1_INDEX', $class->table['uniqueConstraints']);\n self::assertArrayHasKey('IDX_MAPPED2_INDEX', $class->table['indexes']);\n }",
"public function testInvalidMappingAsOption()\n {\n $container = $this->createMockDefaultApp();\n\n $container->register(new DoctrineOrmServiceProvider);\n\n $container['orm.em.options'] = array(\n 'mappings' => array(\n 'type' => 'annotation',\n 'namespace' => 'Foo\\Entities',\n 'path' => __DIR__.'/src/Foo/Entities',\n ),\n );\n\n $container['orm.ems.config'];\n }",
"public function test_searchTypeNotAllowed() {\n $this->expectException(\\Exception::class);\n new SpotifySearch('any', 'not_allowed', SingletonTokenContainer::get());\n }",
"protected function isEntity($class)\n {\n return Nishchay::getEntityCollection()->isExist($class);\n }",
"public function shouldSkipClass(ClassMetadata $metadata, Context $context): bool;",
"public function testCreateInstanceWithNotExistentClass()\n {\n $this->assertInstanceOf(TypedObjectArray::class, (new TypedObjectArray(ArrayBadObject::class)));\n }",
"public function testGetAllMissingMetadata() {\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testReadMultipleRecords 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => 'testReadMultipleRecords 2'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testReadMultipleRecords 3']\r\n ];\r\n // Write data to the database\r\n foreach ($records as $record) {\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$record['UUID'].'\\','.($record['bool'] ? 1:0).','.$record['int'].', \\''.$record['string'].'\\')');\r\n }\r\n // Read data out and cast it to persistent object with incomplete metadata\r\n $this->setExpectedException('Exception', 'The table name of the persistent object could not be determined.');\r\n // Here should come up an exception. It should not be possible to match to an class without knowing from which table to extract the date\r\n $this->getPersistenceAdapter()->getAll('test_persistence_AbstractPersistenceAdapterTestPersistentObjectWithoutMetadata');\r\n }",
"public function testGetClassMappingConfigOrThrowWithNoConfig(): void\n {\n $converter = new Converter();\n $model = new TestModel('');\n\n $this->expectException(Ex\\ConfigurationNotFoundException::class);\n Lockpick::call($converter, 'getClassMappingConfigOrThrow', [$model]);\n }",
"public function test_un_email_pertenece_a_un_usuario()\n { \n $email = Email::factory()->create();\n\n $this->assertInstanceOf(User::class, $email->user);\n }",
"public function testQuarantineFindOne()\n {\n\n }",
"public function testFindClassAnnotationFile()\n {\n $file = $this->get('file_locator')->locate('@ExtDirectBundle/Controller/TestController.php');\n $this->assertEquals(\n 'Ext\\DirectBundle\\Controller\\TestController',\n $this->getLoader()->findClass($file)\n );\n }",
"public function testReadUploadableAnnotation()\n {\n $uploadable = $this->getMockBuilder('Vich\\UploaderBundle\\Mapping\\Annotation\\Uploadable')\n ->disableOriginalConstructor()\n ->getMock();\n\n $reader = $this->getMock('Doctrine\\Common\\Annotations\\Reader');\n $reader\n ->expects($this->once())\n ->method('getClassAnnotation')\n ->will($this->returnValue($uploadable));\n\n $entity = new DummyEntity();\n $driver = new AnnotationDriver($reader);\n $annot = $driver->readUploadable(new \\ReflectionClass($entity));\n\n $this->assertEquals($uploadable, $annot);\n }",
"public function testCanFindClasses()\n {\n foreach ($this->classes as $class) {\n $this->assertTrue(class_exists($class) || interface_exists($class));\n }\n }",
"final public function assertHydratedEntity()\n {\n if ($this->isSimpleEntity()) {\n throw ValidationException::create(ERR300_CANNOT_PERSIST_SIMPLE_ENTITY);\n }\n }",
"public function generateSourceEntityClass(): bool\n {\n $folder = $this->getGeneratedEntitiesFolder();\n $repositoryFolder = $this->getGeneratedRepositoriesFolder();\n $file = $this->getSourceClassPath();\n $repositoryFile = $this->getRepositoryClassPath();\n $fileSystem = new Filesystem();\n\n if (!$fileSystem->exists($folder)) {\n $fileSystem->mkdir($folder, 0775);\n }\n if (!$fileSystem->exists($repositoryFolder)) {\n $fileSystem->mkdir($repositoryFolder, 0775);\n }\n\n if (!$fileSystem->exists($file)) {\n $classGenerator = $this->entityGeneratorFactory->createWithCustomRepository($this->nodeType);\n $repositoryGenerator = $this->entityGeneratorFactory->createCustomRepository($this->nodeType);\n $content = $classGenerator->getClassContent();\n $repositoryContent = $repositoryGenerator->getClassContent();\n\n if (false === @file_put_contents($file, $content)) {\n throw new IOException(\"Impossible to write entity class file (\" . $file . \").\", 1);\n }\n if (false === @file_put_contents($repositoryFile, $repositoryContent)) {\n throw new IOException(\"Impossible to write entity class file (\" . $repositoryFile . \").\", 1);\n }\n /*\n * Force Zend OPcache to reset file\n */\n if (function_exists('opcache_invalidate')) {\n opcache_invalidate($file, true);\n opcache_invalidate($repositoryFile, true);\n }\n if (function_exists('apcu_clear_cache')) {\n apcu_clear_cache();\n }\n\n \\clearstatcache(true, $file);\n \\clearstatcache(true, $repositoryFile);\n\n return true;\n }\n return false;\n }",
"public function getEntityClass(): ?string;"
] | [
"0.6984434",
"0.69189644",
"0.64991635",
"0.64503825",
"0.6426407",
"0.62739426",
"0.6247852",
"0.62355465",
"0.61987364",
"0.6142745",
"0.609511",
"0.6081669",
"0.60600954",
"0.60437053",
"0.6042388",
"0.5994202",
"0.5987078",
"0.59817165",
"0.5968141",
"0.5964627",
"0.5936925",
"0.592063",
"0.590821",
"0.59064204",
"0.58884895",
"0.5886419",
"0.5876104",
"0.58390605",
"0.5835338",
"0.58333087",
"0.58199567",
"0.5808879",
"0.58061814",
"0.58036226",
"0.57903737",
"0.5788959",
"0.5785517",
"0.57745063",
"0.5752836",
"0.57204354",
"0.5719317",
"0.5713312",
"0.5710792",
"0.5706807",
"0.5703849",
"0.5685896",
"0.5666034",
"0.565276",
"0.56511205",
"0.56472206",
"0.563773",
"0.562347",
"0.5613114",
"0.56100464",
"0.559898",
"0.55854076",
"0.5568128",
"0.5550901",
"0.55491185",
"0.55305225",
"0.55252343",
"0.550726",
"0.55034024",
"0.5495529",
"0.5495426",
"0.5489375",
"0.5489357",
"0.54784703",
"0.54766315",
"0.5475804",
"0.5475528",
"0.54632884",
"0.5459049",
"0.5450927",
"0.5447465",
"0.54455155",
"0.54433656",
"0.5431252",
"0.54284775",
"0.54283196",
"0.5418432",
"0.54108125",
"0.5409579",
"0.540116",
"0.53994685",
"0.5399412",
"0.53961635",
"0.53954405",
"0.5395334",
"0.5384134",
"0.5382961",
"0.5382889",
"0.53805375",
"0.5377865",
"0.53631437",
"0.5348046",
"0.5340722",
"0.5337489",
"0.5334242",
"0.5333696"
] | 0.53594905 | 95 |
test that finding data of an object with its primary keys | public function byPrimaryKeys()
{
$mockResult = $this->getMock('stubDatabaseResult');
$this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));
$mockResult->expects($this->exactly(2))
->method('fetch')
->will($this->onConsecutiveCalls(false, array('id' => 'mock', 'bar' => 'Here is bar.', 'default' => 'And this is default.')));
$this->assertNull($this->dbFinder->findByPrimaryKeys($this->mockConnection, new stubReflectionClass('MockSinglePrimaryKeyEntity'), array('id' => 'mock')));
$singlePrimaryKey = $this->dbFinder->findByPrimaryKeys($this->mockConnection, new stubReflectionClass('MockSinglePrimaryKeyEntity'), array('id' => 'mock'));
$this->assertEquals('mock', $singlePrimaryKey->getId());
$this->assertEquals('Here is bar.', $singlePrimaryKey->withAnnotation());
$this->assertEquals('And this is default.', $singlePrimaryKey->withDefaultValue());
$this->assertEquals('foo', $this->mockQueryBuilder->getSelect()->getBaseTableName());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testFindByIdIsSuccess()\n {\n $tblGateMock = $this->getMockBuilder(TableGateway::class)\n ->setConstructorArgs(array($this->getDbal()))\n ->setMethodsExcept(['findById', 'setTable'])\n ->getMock();\n $tblGateMock->setTable('Person');\n\n //exercise SUT\n $row = $tblGateMock->findById($this->person['id']);\n\n //assert return value\n $this->assertTrue(is_array($row), 'result not array');\n $this->assertNotEmpty($row, 'result set is empty');\n\n foreach(array_keys($this->person) as $key) {\n $this->assertArrayHasKey($key, $row[0]);\n $this->assertEquals($this->person[$key], $row[0][$key]);\n }\n }",
"public function returnDetailFindByPK($id);",
"public function testFindForId() {\n\t\t$id = 1;\n\n\t\t$result = $this->ItemsTable->findForId($id);\n\t\t$this->assertInternalType(\n\t\t\t'array',\n\t\t\t$result,\n\t\t\t'The result should always be an array.'\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$id,\n\t\t\t$result['id'],\n\t\t\t'The id key/value of the result for id should be equal to the id.'\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t'Candy',\n\t\t\t$result['firstName'],\n\t\t\t'The id key/value of the result for firstName should be equal to `Candy`.'\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t'Crush',\n\t\t\t$result['lastName'],\n\t\t\t'The id key/value of the result for lastName should be equal to `Crush`.'\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t'Stripper',\n\t\t\t$result['occupation'],\n\t\t\t'The id key/value of the result for occupation should be equal to `Stripper`.'\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t'1924 Sucka Drive',\n\t\t\t$result['address'],\n\t\t\t'The id key/value of the result for address should be equal to `1924 Sucka Drive`.'\n\t\t);\n\t\t\n\t}",
"function testGetPrimaryKey1()\n {\n print \"\\n\" . \">testGetPrimaryKey1\";\n $db =& $this->db;\n $primary_key = $db->getPrimaryKey();\n if (PEAR::isError($primary_key)) {\n $success = false;\n print $primary_key->getMessage();\n $this->assertTrue($success);\n return;\n } else {\n $success = is_array($primary_key);\n if (!$success) {\n print \"PrimaryKey is not an array in testGetPrimaryKey1\";\n $this->assertTrue($success);\n return;\n } else {\n $this->assertEquals($primary_key, $this->primary_key);\n }\n }\n }",
"function testFindById() {\r\n $this->User = new User();\r\n \r\n $this->User->contain();\r\n $result = $this->User->findById(1, 'email');\r\n \r\n $expected = array('User' => array( 'email' => '[email protected]' ) );\r\n \r\n $this->assertEqual($result, $expected);\r\n }",
"public function returnFindByPK($id);",
"public function test_findId() {\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 1]]);\n $this->assertNotNull($data);\n $this->assertEquals(1, $data[0]['SampleSet']['id']);\n $this->assertEquals(1, count($data));\n }",
"public function testPrimaryKeyField()\n {\n $field = $this->table->getField($this->table->getPrimaryKeys()[0]);\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Integer',\n $field);\n $this->assertEquals('primaryKeyID', $field->getName());\n }",
"public function testDbFindById()\n {\n $test1 = is_null($this->app->db()->findById('games', 999));\n\n # One result\n $test2 = $this->app->db()->findById('games', 1)['id'] == 1;\n\n return $test1 && $test2;\n }",
"public function testQuarantineFindById()\n {\n\n }",
"public function returnMoreFindByPK($id);",
"public abstract function find($primary_key, $model);",
"public function byPrimaryKeysNonEntity()\n {\n $this->dbFinder->findByPrimaryKeys($this->mockConnection, new stubReflectionClass('MockNoEntityAnnotationEntity'), array());\n }",
"#[@test]\n public function primaryKeySet() {\n $this->assertEquals('true', \n $this->xpath->query('string(/document/table/index[1]/@primary)'));\n }",
"public function findPk($pk)\r\n {\r\n $pkColumns = $this->getObject()->getTable()->getIdentifierColumnNames();\r\n if(($count = count($pkColumns)) > 1)\r\n {\r\n // composite primary key\r\n if(!is_array($pk))\r\n {\r\n throw new Exception(sprintf('Class %s has a composite primary key and expects %s parameters to retrieve a record by pk', $this->class, join(', ', $pkColumns)));\r\n } \r\n else if (is_array($count[0]))\r\n {\r\n // array of arrays\r\n // sorry the finder can't do that on objects with composte primary keys\r\n throw new Exception('Impossible to find a list of Pks on an objects with composite primary keys');\r\n }\r\n for ($i=0; $i < $count; $i++)\r\n { \r\n $this->addCondition('and', $pkColumns[$i], '=', $pk[$i]);\r\n }\r\n return $this->findOne();\r\n }\r\n else\r\n {\r\n // simple primary kay\r\n if(is_array($pk))\r\n {\r\n $this->addCondition('and', $pkColumns[0], ' IN ', $pk);\r\n return $this->find();\r\n }\r\n else\r\n {\r\n $this->addCondition('and', $pkColumns[0], '=', $pk);\r\n return $this->findOne();\r\n }\r\n }\r\n }",
"public function find($data);",
"public static function find($id, $key = 'id');",
"public function testFind() {\n\t\t\tforeach($this->user_ids as $id) {\n\t\t\t\t$_user = User::_find($id);\n\t\t\t\t$this->assertTrue((isset($_user) && !empty($_user)));\n\t\t\t}\n\t\t\t//test finding by ids with cache\n\t\t\tforeach($this->user_ids as $id) {\n\t\t\t\t$_user = User::find($id);\n\t\t\t\t$this->assertTrue((isset($_user) && !empty($_user)));\n\t\t\t}\n\t\t}",
"function isPrimaryKey(): bool;",
"public function test_getByRecordId_exists_executesCorrectly()\r\n\t{\r\n\t\t$recordId = \"aDummyRecordId\";\r\n\t\t\r\n\t\t$this->prepareSetRecordId($recordId);\r\n\t\t$this->prepareFind(true);\r\n\t\r\n\t\t$actual = $this->service->getByRecordId($recordId);\r\n\t\t$this->assertEquals($this->dbObjectMock, $actual);\r\n\t}",
"public function testFind()\n {\n $data = array('id' => 1, 'username' => 'root', 'password' => 'password');\n $mockPDO = $this->getMock('\\\\PDOMock', array('fetchOne'));\n $mockPDO\n ->expects($this->once())\n ->method('fetchOne')\n ->will($this->returnCallback(function($arg1, $arg2) use ($data) {\n $sql = 'SELECT\n *\nFROM\n `users`\nWHERE\n id = :id\nORDER BY\n id ASC';\n\n if($arg1 == $sql && $arg2 == array('id' => 1)) {\n return $data;\n } else {\n return array();\n }\n }))\n ;\n $storage = new AuraExtendedPdo($mockPDO, new QueryFactory('mysql'));\n $result = $storage->find(array('id' => 1), 'users');\n\n $this->assertEquals($data['id'], $result['id']);\n $this->assertEquals($data['username'], $result['username']);\n $this->assertEquals($data['password'], $result['password']);\n }",
"public function testQuarantineFindOne()\n {\n\n }",
"public function find($primaryValue);",
"public function testProfilePrototypeFindByIdQuarantines()\n {\n\n }",
"public function testGetWithKey()\n {\n $result = $this->getQueryBuilderConnection()\n ->select()\n ->from('querybuilder_tests')\n ->where('id', '<', 2)\n ->getWithKey('field');\n\n $expected = [\n 'aaaa' => (object)[\n 'id' => '0',\n 'languageId' => '1',\n 'field' => 'aaaa',\n ],\n 'bbbb' => (object)[\n 'id' => '1',\n 'languageId' => '1',\n 'field' => 'bbbb',\n ],\n ];\n\n $this->assertEquals($expected, $result);\n\n $this->expectException(FieldNotFoundException::class);\n\n $this->getQueryBuilderConnection()\n ->select()\n ->from('querybuilder_tests')\n ->where('id', '<', 2)\n ->getWithKey('asdf');\n }",
"function find($id);",
"public function testGetById()\n {\n // Create and save a record to the DB\n $user = $this->userRepository->make([\n 'first_name' => 'test-first-name',\n 'last_name' => 'test-last-name',\n 'email' => '[email protected]',\n 'password' => '123123',\n ]);\n\n $user->save();\n\n // Get the user from DB with the getById method\n $userFromDb = $this->userRepository->getById($user->id);\n // Make sure the user the proper name and email\n $this->assertEquals('test-first-name', $userFromDb->first_name);\n $this->assertEquals('[email protected]', $userFromDb->email);\n }",
"public function testQueryFetchObject() {\n $records = [];\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25], ['fetch' => \\PDO::FETCH_OBJ]);\n foreach ($result as $record) {\n $records[] = $record;\n $this->assertIsObject($record);\n $this->assertSame('John', $record->name);\n }\n\n $this->assertCount(1, $records, 'There is only one record.');\n }",
"public function findByPrimaryKey(stubBaseReflectionClass $entityClass, array $primaryKeys);",
"abstract function getPrimaryKey();",
"public function testGetOne()\n {\n $result = $this->getQueryBuilderConnection()\n ->select()\n ->from('querybuilder_tests')\n ->where('field', '=', 'ffff')\n ->getOne();\n\n\n $object = (object)[\n 'id' => '5',\n 'languageId' => '2',\n 'field' => 'ffff',\n ];\n\n $this->assertEquals($object, $result);\n }",
"function test_getArrayById() {\r\n\t\t$rowset = array(array(\"memberClassId\" => 1, \"memberClassName\" => \"reader\"),\r\n\t\t\t\tarray(\"memberClassId\" => 2, \"memberClassName\" => \"nosher\"));\r\n\t\t$myArray = MemberClassesDB::getArray($rowset, \"memberClassId\", \"memberClassName\");\r\n\t\t$this->assertEqual($myArray['1'], \"reader\",\r\n\t\t\t\t\"Should return reader for key of 1 but returned \".$myArray['1']);\r\n\t\t$this->assertEqual($myArray['2'], 'nosher',\r\n\t\t\t\t\"Should return nosher for key of 2 but returned \".$myArray['2']);\r\n\t}",
"public function testGetPkValue()\n {\n // pk defaults to 'folderid' (from FolderDO)\n $user = new User(array('id' => '1'));\n $assoc = Mad_Model_Association_Base::factory('hasMany', 'Articles', array(), $user);\n $this->assertEquals('1', $assoc->getPkValue());\n\n // set to get value from a different col as the p\n $user = new User(array('name' => 'asdf'));\n $options = array('primaryKey' => 'name');\n $assoc = Mad_Model_Association_Base::factory('hasMany', 'Articles', $options, $user);\n $this->assertEquals('asdf', $assoc->getPkValue());\n }",
"function findById($id);",
"public function testQuarantineExistsGetQuarantinesidExists()\n {\n\n }",
"public function testPrimaryKey()\n {\n $statement = (new CreateTable($this->mockConnection));\n $return = $statement->primaryKey('id');\n $array = $statement->toArray();\n\n $this->assertInstanceOf(CreateTable::class, $return);\n $this->assertEquals([\n 'constraints' => [\n [\n 'type' => 'primaryKey',\n 'columns' => ['id']\n ]\n ],\n ], $array);\n }",
"public function find($obj){\n\t}",
"abstract public function find($id);",
"public function test_findConfidential() {\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(0, count($data));\n $this->SampleSet->username = 'sub2';\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(1, count($data));\n $this->assertEquals(2, $data[0]['SampleSet']['id']);\n $this->SampleSet->username = 'chem2';\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(1, count($data));\n $this->assertEquals(2, $data[0]['SampleSet']['id']);\n }",
"public function testResultGetAll_Object()\n {\n \t$result = $this->conn->query(\"SELECT * FROM test WHERE status='ACTIVE'\");\n \t$this->assertEquals(array((object)array('id'=>1, 'key'=>'one', 'title'=>'first row', 'status'=>'ACTIVE'), (object)array('id'=>2, 'key'=>'two', 'title'=>'next row', 'status'=>'ACTIVE')), $result->getAll(DB::FETCH_OBJECT));\n }",
"public function testFindById(): void\n {\n // given\n $expectedCategory = new Category();\n $expectedCategory->setName('Test Category');\n $this->categoryRepository->save($expectedCategory);\n\n // when\n $result = $this->categoryService->findOneById($expectedCategory->getId());\n\n // then\n $this->assertEquals($expectedCategory->getId(), $result->getId());\n }",
"abstract public function primaryKey(): string;",
"public function testQuarantineExistsHeadQuarantinesid()\n {\n\n }",
"function findProperty($id);",
"abstract public function getPrimaryKey();",
"abstract public function getPrimaryKey();",
"public function find(int $id) ;",
"function test_find()\n {\n // Arrange\n $brand_name = \"Nike\";\n $test_brand = new Brand($brand_name);\n $test_brand->save();\n $id = $test_brand->getId();\n\n $brand_name2 = \"Adidas\";\n $test_brand2 = new Brand($brand_name2);\n $test_brand2->save();\n\n //Act\n $result = Brand::find($id);\n\n //Assert\n $this->assertEquals($test_brand, $result);\n }",
"public function testPrimaryKeyComposite()\n {\n $statement = (new CreateTable($this->mockConnection));\n $return = $statement->primaryKey('id1', 'id2');\n $array = $statement->toArray();\n\n $this->assertInstanceOf(CreateTable::class, $return);\n $this->assertEquals([\n 'constraints' => [\n [\n 'type' => 'primaryKey',\n 'columns' => ['id1', 'id2']\n ]\n ],\n ], $array);\n }",
"public static function find($primary_key) {\n $table_name = self::table_name();\n return $table_name::unique([\"id\" => intval($primary_key)]); // convert to where struct and pass\n }",
"public function testFind()\n {\n $this->assertEquals(1, $this->object->find(function ($item) {\n return $item === 2;\n })->count());\n $this->assertEquals(2, $this->object->find(function ($item) {\n return $item % 2;\n })->count());\n }",
"public function testFindByAclIdentity()\n {\n $obj = $this->createModelObjectIdentity(2);\n $entry = $this->createEntry();\n $entry\n ->setSecurityIdentity(SecurityIdentity::fromAclIdentity($this->getRoleSecurityIdentity()))\n ->setAclClass($obj->getAclClass())\n ->setMask(64)\n ;\n $obj->addEntry($entry)->save($this->con);\n\n $entries = EntryQuery::create()->findByAclIdentity($this->getAclObjectIdentity(1), array(), $this->con);\n $this->assertCount(1, $entries);\n $this->assertEquals(1, $entries[0]->getObjectIdentityId());\n\n // A class based entry for the wrong ObjectIdentity.\n $classEntry = $this->createEntry();\n $classEntry\n ->setObjectIdentityId(2)\n ->setSecurityIdentity(SecurityIdentity::fromAclIdentity($this->getRoleSecurityIdentity()))\n ->setAclClass($obj->getAclClass())\n ->setMask(64)\n ->save($this->con)\n ;\n\n // A class based entry for the correct ObjectIdentity.\n $classEntry = $this->createEntry();\n $classEntry\n ->setObjectIdentityId(null)\n ->setSecurityIdentity(SecurityIdentity::fromAclIdentity($this->getRoleSecurityIdentity()))\n ->setAclClass($this->getAclClass())\n ->setMask(64)\n ->save($this->con)\n ;\n\n $this->assertEquals(4, EntryQuery::create()->count($this->con));\n\n $entries = EntryQuery::create()->findByAclIdentity($this->getAclObjectIdentity(1), array(), $this->con);\n $this->assertCount(2, $entries);\n $this->assertEquals($obj->getClassId(), $entries[0]->getClassId());\n $this->assertEquals($obj->getClassId(), $entries[1]->getClassId());\n }",
"public function testFindByOrderId(): void\n {\n $order_callback = OrderCallback::findByOrderId(9);\n $this->assertIsObject($order_callback);\n\n $this->assertObjectHasAttribute('errors', $order_callback);\n $this->assertObjectHasAttribute('id', $order_callback);\n $this->assertObjectHasAttribute('order_id', $order_callback);\n $this->assertObjectHasAttribute('callback_url', $order_callback);\n $this->assertObjectHasAttribute('is_callback_sent', $order_callback);\n }",
"#[@test]\n public function primaryKeyNotSet() {\n $this->assertEquals('false', \n $this->xpath->query('string(/document/table/index[2]/@primary)'));\n }",
"public function testCanRetrieveByASpecifiedField()\n {\n\n $orderQ = $this->db->newQuery()\n ->findEvery('Test_Order')\n ->withForeignKey('masterCustomerId', 1);\n\n $orders = $this->db->search($orderQ);\n\n $this->assertType('array', $orders);\n $this->assertEquals(2, count($orders));\n\n // check the orders are correct types\n foreach ($orders as $order)\n {\n $this->assertTrue($order instanceof Test_Order);\n }\n }",
"public function findById($primaryKeyValue){\n //Select* From employers Where $this->primaryKey(noemp)=$primaryKeyValue(1000)\n $array = $this->findWhere($this->primaryKey. \"=$primaryKeyValue\");\n if (count($array) != 1 ) die (\"The ID $primaryKeyValue is not valid\");\n return $array[0];\n }",
"public function testGetUser()\n {\n $user = factory(User::class)->create();\n $userRepo = new UserRepository(new User);\n $found = $userRepo->get($user->id);\n\n $this->assertInstanceOf(User::class, $found);\n foreach ($this->data as $key => $value) {\n \t$this->assertEquals($found->$key, $user->$key);\n }\n }",
"public function fetch($primaryKey);",
"abstract protected function _doContains($id);",
"function testFindByIdWithMissingId() {\r\n $this->User =& new User();\r\n \r\n $this->User->contain();\r\n $result = $this->User->findById(99999999, 'username');\r\n $this->assertFalse($result);\r\n }",
"public function testGetClassesWithKey()\n {\n $result = $this->getQueryBuilderConnection()\n ->select()\n ->from('querybuilder_tests')\n ->where('id', '<', 2)\n ->getClassesWithKey(SampleObject::class, [], 'field');\n\n $expected = [\n 'aaaa' => SampleObject::create('0', '1', 'aaaa'),\n 'bbbb' => SampleObject::create('1', '1', 'bbbb'),\n ];\n\n $this->assertEquals($expected, $result);\n\n $this->expectException(FieldNotFoundException::class);\n\n $this->getQueryBuilderConnection()\n ->select()\n ->from('querybuilder_tests')\n ->where('id', '<', 2)\n ->getClassesWithKey(SampleObject::class, [], 'asdf');\n }",
"function test_getNameById() {\r\n\t\t$myName = MemberClassesDB::getNameById(1);\r\n\t\t$this->assertEqual($myName, \"reader\",\r\n\t\t\t\t\"Should return reader for key of 1 but returned \".$myName);\r\n\t}",
"public function testProfilePrototypeFindByIdLikes()\n {\n\n }",
"public function testFindUser()\n {\n $user = factory(User::class)->create();\n $found = User::query()->find($user->id);\n $this->assertNotEmpty($found);\n $this->assertEquals($user->id, $found->id);\n }",
"public function testSingleResultQuery() {\r\n $uuid = 'abcdefg';\r\n $bool = true;\r\n $int = 1234567;\r\n $string = 'avorium';\r\n // Write data to the database\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$uuid.'\\','.($bool ? 1:0).','.$int.', \\''.$string.'\\')');\r\n // Read data out and cast it to persistent object\r\n $query = 'select * from POTEST where UUID = \\'abcdefg\\'';\r\n $po = $this->getPersistenceAdapter()->executeSingleResultQuery($query, 'test_persistence_AbstractPersistenceAdapterTestPersistentObject');\r\n // Compare properties\r\n $this->assertEquals($uuid, $po->uuid, 'Uuid value from persistent object differs from the UUID value of the database.');\r\n $this->assertEquals($bool, $po->booleanValue, 'Boolean value from persistent object differs from the boolean value of the database.');\r\n $this->assertEquals($int, $po->intValue, 'Integer value from persistent object differs from the int value of the database.');\r\n $this->assertEquals($string, $po->stringValue, 'String value from persistent object differs from the string value of the database.');\r\n }",
"function testObjectRecord()\n {\n $pear = new DataSourceArrayTestStore('pear');\n $doctrine = new DataSourceArrayTestStore('doctrine');\n $propel = new DataSourceArrayTestStore('propel');\n $this->datasource->bind(array(&$pear, &$doctrine, &$propel));\n\n $this->assertEquals(3, $this->datasource->count());\n\n $records = $this->datasource->fetch();\n $this->assertEquals('pear', $records[0]->name);\n $this->assertEquals('pear(tm)', $records[0]->getBrand());\n $this->assertEquals('doctrine', $records[1]->name);\n $this->assertEquals('doctrine(tm)', $records[1]->getBrand());\n $this->assertEquals('propel', $records[2]->name);\n $this->assertEquals('propel(tm)', $records[2]->getBrand());\n\n $this->datasource->sort('name');\n $records = $this->datasource->fetch(1, 1);\n $this->assertEquals('pear', $records[0]->name);\n $this->assertEquals('pear(tm)', $records[0]->getBrand());\n\n $records[0]->name = 'pear2';\n $this->assertEquals('pear2', $pear->name);\n }",
"public function byPrimaryKeysWithoutTableAnnotation()\n {\n $mockResult = $this->getMock('stubDatabaseResult');\n $this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));\n $mockResult->expects($this->exactly(2))\n ->method('fetch')\n ->will($this->onConsecutiveCalls(false, array('id' => 'mock', 'bar' => 'Here is bar.', 'defaultValue' => 'And this is default.')));\n $this->assertNull($this->dbFinder->findByPrimaryKeys($this->mockConnection, new stubReflectionClass('MockNoTableAnnotationEntity'), array('id' => 'mock')));\n $entity = $this->dbFinder->findByPrimaryKeys($this->mockConnection, new stubReflectionClass('MockNoTableAnnotationEntity'), array('id' => 'mock'));\n $this->assertEquals('mock', $entity->getId());\n $this->assertEquals('Here is bar.', $entity->withAnnotation());\n $this->assertEquals('And this is default.', $entity->getDefaultValue());\n $this->assertEquals('MockNoTableAnnotationEntitys', $this->mockQueryBuilder->getSelect()->getBaseTableName());\n }",
"public function testID() {\n $this->assertFalse($this->object->isset_id());\n\n $id = 'test';\n $this->object->set_id($id);\n $this->assertEquals($id, $this->object->get_id());\n $this->assertTrue($this->object->isset_id());\n }",
"public function testCanInsertAndRetrieveData(){\n $cleanPDO = new cleanPDO($this->goodConfig);\n $cleanPDO->beginTransaction();\n $cleanPDO->query(\"INSERT INTO test_table VALUES(null, 1)\");\n\n $id = $cleanPDO->lastInsertId();\n $this->assertTrue($id != 0);\n $stmt = $cleanPDO->query(\"SELECT * FROM `test_table` WHERE `key` = $id\");\n\n $this->assertTrue($cleanPDO->commit());\n $stmt->execute();\n $res = $stmt->fetch();\n $this->assertTrue($res['value'] == 1);\n\n }",
"public function testLoadWithInvalidPrimaryKey()\n {\n $this->assertNull($this->appService->load('invalidPrimaryKey'));\n }",
"public function testQuarantineFind()\n {\n\n }",
"public function findEntity($id);",
"function yy_r142(){ $this->_retvalue = 'primaryKey'; }",
"public function find( $id );",
"public function testShoppingCartCanBeRetrievedById()\n {\n $id1 = new UUID();\n $cart1 = new ShoppingCart($id1);\n $this->gateway->insert($id1, $cart1);\n\n $id2 = new UUID();\n $cart2 = new ShoppingCart($id2);\n $this->gateway->insert($id2, $cart2);\n\n $query = $this->db->query('SELECT * FROM shoppingCart');\n $result = $query->fetchAll(PDO::FETCH_COLUMN);\n\n $cart = $this->gateway->findById($id1);\n\n $this->assertEquals(2, count($result));\n $this->assertInstanceOf('ShoppingCart', $cart);\n $this->assertEquals($id1, $cart->getId());\n }",
"abstract function find($id): array;",
"public function find($pk)\r\n {\r\n $row = $this->getTable()->find($pk);\r\n if(!$row){\r\n return false;\r\n }\r\n $sampleModel = new SampleModel();\r\n $this->_map($sampleModel, $row);\r\n return $sampleModel;\r\n }",
"public function testProfileFindById()\n {\n\n }",
"public function testGetReplenishmentById()\n {\n }",
"public function whereId(string $id): object;",
"public function findByName($id){\n\n }",
"public function findByID($id){\n return $this->Find(self::TABLE,$id);\n }",
"public function testGetValidKidByKidId(): void\n {\n // count the number of rows and save it for later\n $numRows = $this->getConnection()->getRowCount(\"kid\");\n\n $kidId = generateUuidV4();\n $kid = new Kid($kidId, $this->adult->getAdultId(), $this->VALID_AVATAR_URL, $this->VALID_CLOUDINARY_TOKEN, $this->VALID_HASH, $this->VALID_NAME, $this->VALID_USERNAME);\n $kid->insert($this->getPDO());\n\n // grab the data from mySQL and enforce the fields match our expectations\n $pdoKid = Kid::getKidByKidId($this->getPDO(), $kid->getKidId());\n $this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"kid\"));\n $this->assertEquals($pdoKid->getKidId(), $kidId);\n $this->assertEquals($pdoKid->getKidAdultId(), $this->adult->getAdultId());\n $this->assertEquals($pdoKid->getKidAvatarUrl(), $this->VALID_AVATAR_URL);\n $this->assertEquals($pdoKid->getKidCloudinaryToken(), $this->VALID_CLOUDINARY_TOKEN);\n $this->assertEquals($pdoKid->getKidHash(), $this->VALID_HASH);\n $this->assertEquals($pdoKid->getKidName(), $this->VALID_NAME);\n $this->assertEquals($pdoKid->getKidUsername(), $this->VALID_USERNAME);\n }",
"public function testSearchForProductByAttribute()\n {\n // full results flag returns the full data set for the product\n }",
"function findById($id)\n {\n }",
"public function testGetOrderById()\n {\n }",
"public function testFindByCustomer()\n {\n $rand_id = rand(1, 23);\n $project = $this->getRepo()->find($rand_id);\n\n $this->assertGreaterThanOrEqual(1, count($this->getRepoWithQB()->findByCustomer(\n $project->getCustomer()->getId()\n )));\n }",
"public function testid() {\n $tiempo = new TiempoFalso();\n $tarjeta = new Tarjeta( $tiempo );\n $colectivo = new Colectivo(NULL, NULL, NULL);\n\t$id=$tarjeta->obtenerID();\n $boleto = new Boleto(NULL, NULL, $tarjeta, $tarjeta->obtenerID(),NULL, NULL, NULL, NULL, $tiempo);\n\n $this->assertEquals($boleto->obteneriID(), $id);\n }",
"function row_exist($table, $data) {\n\n global $devel, $tablas;\n\n $ids = array(\n 'PRIMARY_KEYS' => false,\n 'UNIQUES_KEYS' => false,\n 'INDEXES_KEYS' => false,\n 'COLUMNS_KEYS' => false,\n );\n extract($ids);\n\n // Buscamos la row por todas sus claves una a una hasta encontrarla\n foreach ($ids as $id => $dummy) {\n\n $keys = keys($table, $id);\n\n if ($keys) {\n\n $$id = true;\n // Si esta vuelta es INDEXES_KEYS o COLUMNS_KEYS y no hemos encontrado nada\n // con PRIMARY_KEYS o UNIQUES_KEYS o estos ultimos no existen en la tabla\n // podemos dar perfectamente por hecho que no existe row.\n if ((($INDEXES_KEYS OR $COLUMNS_KEYS) AND ($PRIMARY_KEYS OR $UNIQUES_KEYS))\n // Si es la vuelta en la que buscamos por COLUMNS_KEYS y ya hemos buscado\n // por INDEXES_KEYS sin encontrar nada, y ademas, en las vueltas de antes\n // con PRIMARY_KEYS o UNIQUES_KEYS tampoco encontramos nada no existe row.\n OR ($INDEXES_KEYS AND $COLUMNS_KEYS AND !$PRIMARY_KEYS AND !$UNIQUES_KEYS)\n // El mismo caso que el anterior pero sin que existan solo PRIMARY_KEYS\n OR ($INDEXES_KEYS AND $COLUMNS_KEYS AND !$PRIMARY_KEYS AND $UNIQUES_KEYS)\n // El mismo caso que el anterior pero sin que existan solo UNIQUES_KEYS\n OR ($INDEXES_KEYS AND $COLUMNS_KEYS AND $PRIMARY_KEYS AND !$UNIQUES_KEYS)\n // O también si hemos llegado a la vuelta COLUMNS_KEYS y no encontramos\n // nada en PRIMARY_KEYS ni UNIQUES_KEYS ni INDEXES_KEYS no existe row\n OR (!$INDEXES_KEYS AND $COLUMNS_KEYS AND !$PRIMARY_KEYS AND !$UNIQUES_KEYS)\n // El mismo caso que el anterior pero sin que existan solo PRIMARY_KEYS\n OR (!$INDEXES_KEYS AND $COLUMNS_KEYS AND !$PRIMARY_KEYS AND $UNIQUES_KEYS)\n // El mismo caso que el anterior pero sin que existan solo UNIQUES_KEYS\n OR (!$INDEXES_KEYS AND $COLUMNS_KEYS AND $PRIMARY_KEYS AND !$UNIQUES_KEYS)) {\n return false;\n }\n\n $WHERE = where($keys, $data);\n $query = \"SELECT * FROM `$table` WHERE $WHERE\";\n $result = db_fetch(db_query($devel, $query));\n\n if ($result) {\n return true;\n }\n }\n }\n\n // Si no encontramos row es que no existe\n return false;\n}",
"public function testGettingId()\n {\n $this->assertEquals('bar', $this->principal->getId());\n }",
"public function testGetDuplicateReplenishmentById()\n {\n }",
"function find($table, $id)\n{\n $data = connect()->query(\"SELECT * FROM $table WHERE id='$id'\");\n\n return $data->fetch_object();\n}",
"public static function findById($id);",
"public function test_getById() {\n\n }",
"function findById($db, $table, $primaryKey, $value, $options = '') {\n\t$query = 'SELECT * FROM ' . $table . ' WHERE ' . $primaryKey . '= :value ' . ' ' . $options ;\n\n\t$parameters = [\n\t\t'value' => $value\n\t];\n\n\t$result = runQuery($db, $query, $parameters);\n\n\treturn $result;\n}",
"function find($id=true,$fetch_type = \\PDO::FETCH_ASSOC)\n {\n $this->db->table($this->getTableFullName());\n if(is_string($id) || is_numeric($id)){\n $this->where($this->getPk(),'=',$id);\n }\n return $this->db->find($fetch_type);\n }",
"public function testFindOneById(): void\n {\n // given\n $event = $this->simpleEvent();\n $expectedId = $event->getId();\n\n // when\n $result = $this->eventService->findOneById($expectedId);\n\n // then\n $this->assertEquals($expectedId, $result->getId());\n }",
"public function testProfilePrototypeFindByIdGroups()\n {\n\n }",
"public static function find($id);",
"public function byPrimaryKeys()\n {\n $entity = new MockNoTableAnnotationEntity();\n $entity->setId('mock');\n $this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($this->getMock('stubDatabaseResult')));\n $this->dbEraser->deleteByPrimaryKeys($this->mockConnection, $entity);\n $this->assertEquals('MockNoTableAnnotationEntitys', $this->mockQueryBuilder->getDeleteTable());\n $this->assertEquals(\"(`MockNoTableAnnotationEntitys`.`id` = 'mock')\", $this->mockQueryBuilder->getDeleteCriterion()->toSQL());\n }"
] | [
"0.6809215",
"0.67438644",
"0.66932243",
"0.66594833",
"0.663723",
"0.64941967",
"0.6440742",
"0.638353",
"0.63748986",
"0.6342824",
"0.63073933",
"0.62981206",
"0.62323785",
"0.621608",
"0.6201697",
"0.61924386",
"0.61577064",
"0.6116611",
"0.6113921",
"0.6097877",
"0.60666513",
"0.6065574",
"0.6064512",
"0.6051885",
"0.5997187",
"0.59918404",
"0.59852904",
"0.5974463",
"0.59712005",
"0.5970465",
"0.59601235",
"0.5949004",
"0.59476686",
"0.59345084",
"0.5924142",
"0.59169847",
"0.5914674",
"0.5914325",
"0.59077907",
"0.59004426",
"0.5893901",
"0.5848987",
"0.5840095",
"0.5833103",
"0.58291507",
"0.58291507",
"0.58223516",
"0.5810794",
"0.5807844",
"0.58026993",
"0.5802517",
"0.5800678",
"0.5799279",
"0.57793874",
"0.5765771",
"0.5753976",
"0.5752871",
"0.5733819",
"0.5720614",
"0.5706457",
"0.5703909",
"0.56936586",
"0.5686102",
"0.5675551",
"0.5673367",
"0.56637913",
"0.56605387",
"0.56590253",
"0.5652367",
"0.5644368",
"0.5617171",
"0.56140125",
"0.5608343",
"0.56053615",
"0.5593964",
"0.55919814",
"0.5591673",
"0.55854696",
"0.5566426",
"0.55655646",
"0.55634344",
"0.5560864",
"0.5558548",
"0.55565155",
"0.55550784",
"0.5552793",
"0.5530499",
"0.55302596",
"0.55231893",
"0.5518541",
"0.55163574",
"0.55137545",
"0.5511317",
"0.5510701",
"0.55075264",
"0.55070853",
"0.55045855",
"0.5501969",
"0.549768",
"0.5496866"
] | 0.68219626 | 0 |
test that finding data of an object with its primary keys | public function byPrimaryKeysWithoutTableAnnotation()
{
$mockResult = $this->getMock('stubDatabaseResult');
$this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));
$mockResult->expects($this->exactly(2))
->method('fetch')
->will($this->onConsecutiveCalls(false, array('id' => 'mock', 'bar' => 'Here is bar.', 'defaultValue' => 'And this is default.')));
$this->assertNull($this->dbFinder->findByPrimaryKeys($this->mockConnection, new stubReflectionClass('MockNoTableAnnotationEntity'), array('id' => 'mock')));
$entity = $this->dbFinder->findByPrimaryKeys($this->mockConnection, new stubReflectionClass('MockNoTableAnnotationEntity'), array('id' => 'mock'));
$this->assertEquals('mock', $entity->getId());
$this->assertEquals('Here is bar.', $entity->withAnnotation());
$this->assertEquals('And this is default.', $entity->getDefaultValue());
$this->assertEquals('MockNoTableAnnotationEntitys', $this->mockQueryBuilder->getSelect()->getBaseTableName());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function byPrimaryKeys()\n {\n $mockResult = $this->getMock('stubDatabaseResult');\n $this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));\n $mockResult->expects($this->exactly(2))\n ->method('fetch')\n ->will($this->onConsecutiveCalls(false, array('id' => 'mock', 'bar' => 'Here is bar.', 'default' => 'And this is default.')));\n $this->assertNull($this->dbFinder->findByPrimaryKeys($this->mockConnection, new stubReflectionClass('MockSinglePrimaryKeyEntity'), array('id' => 'mock')));\n $singlePrimaryKey = $this->dbFinder->findByPrimaryKeys($this->mockConnection, new stubReflectionClass('MockSinglePrimaryKeyEntity'), array('id' => 'mock'));\n $this->assertEquals('mock', $singlePrimaryKey->getId());\n $this->assertEquals('Here is bar.', $singlePrimaryKey->withAnnotation());\n $this->assertEquals('And this is default.', $singlePrimaryKey->withDefaultValue());\n $this->assertEquals('foo', $this->mockQueryBuilder->getSelect()->getBaseTableName());\n }",
"public function testFindByIdIsSuccess()\n {\n $tblGateMock = $this->getMockBuilder(TableGateway::class)\n ->setConstructorArgs(array($this->getDbal()))\n ->setMethodsExcept(['findById', 'setTable'])\n ->getMock();\n $tblGateMock->setTable('Person');\n\n //exercise SUT\n $row = $tblGateMock->findById($this->person['id']);\n\n //assert return value\n $this->assertTrue(is_array($row), 'result not array');\n $this->assertNotEmpty($row, 'result set is empty');\n\n foreach(array_keys($this->person) as $key) {\n $this->assertArrayHasKey($key, $row[0]);\n $this->assertEquals($this->person[$key], $row[0][$key]);\n }\n }",
"public function returnDetailFindByPK($id);",
"public function testFindForId() {\n\t\t$id = 1;\n\n\t\t$result = $this->ItemsTable->findForId($id);\n\t\t$this->assertInternalType(\n\t\t\t'array',\n\t\t\t$result,\n\t\t\t'The result should always be an array.'\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$id,\n\t\t\t$result['id'],\n\t\t\t'The id key/value of the result for id should be equal to the id.'\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t'Candy',\n\t\t\t$result['firstName'],\n\t\t\t'The id key/value of the result for firstName should be equal to `Candy`.'\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t'Crush',\n\t\t\t$result['lastName'],\n\t\t\t'The id key/value of the result for lastName should be equal to `Crush`.'\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t'Stripper',\n\t\t\t$result['occupation'],\n\t\t\t'The id key/value of the result for occupation should be equal to `Stripper`.'\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t'1924 Sucka Drive',\n\t\t\t$result['address'],\n\t\t\t'The id key/value of the result for address should be equal to `1924 Sucka Drive`.'\n\t\t);\n\t\t\n\t}",
"function testGetPrimaryKey1()\n {\n print \"\\n\" . \">testGetPrimaryKey1\";\n $db =& $this->db;\n $primary_key = $db->getPrimaryKey();\n if (PEAR::isError($primary_key)) {\n $success = false;\n print $primary_key->getMessage();\n $this->assertTrue($success);\n return;\n } else {\n $success = is_array($primary_key);\n if (!$success) {\n print \"PrimaryKey is not an array in testGetPrimaryKey1\";\n $this->assertTrue($success);\n return;\n } else {\n $this->assertEquals($primary_key, $this->primary_key);\n }\n }\n }",
"function testFindById() {\r\n $this->User = new User();\r\n \r\n $this->User->contain();\r\n $result = $this->User->findById(1, 'email');\r\n \r\n $expected = array('User' => array( 'email' => '[email protected]' ) );\r\n \r\n $this->assertEqual($result, $expected);\r\n }",
"public function returnFindByPK($id);",
"public function test_findId() {\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 1]]);\n $this->assertNotNull($data);\n $this->assertEquals(1, $data[0]['SampleSet']['id']);\n $this->assertEquals(1, count($data));\n }",
"public function testPrimaryKeyField()\n {\n $field = $this->table->getField($this->table->getPrimaryKeys()[0]);\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Integer',\n $field);\n $this->assertEquals('primaryKeyID', $field->getName());\n }",
"public function testDbFindById()\n {\n $test1 = is_null($this->app->db()->findById('games', 999));\n\n # One result\n $test2 = $this->app->db()->findById('games', 1)['id'] == 1;\n\n return $test1 && $test2;\n }",
"public function testQuarantineFindById()\n {\n\n }",
"public function returnMoreFindByPK($id);",
"public abstract function find($primary_key, $model);",
"public function byPrimaryKeysNonEntity()\n {\n $this->dbFinder->findByPrimaryKeys($this->mockConnection, new stubReflectionClass('MockNoEntityAnnotationEntity'), array());\n }",
"#[@test]\n public function primaryKeySet() {\n $this->assertEquals('true', \n $this->xpath->query('string(/document/table/index[1]/@primary)'));\n }",
"public function findPk($pk)\r\n {\r\n $pkColumns = $this->getObject()->getTable()->getIdentifierColumnNames();\r\n if(($count = count($pkColumns)) > 1)\r\n {\r\n // composite primary key\r\n if(!is_array($pk))\r\n {\r\n throw new Exception(sprintf('Class %s has a composite primary key and expects %s parameters to retrieve a record by pk', $this->class, join(', ', $pkColumns)));\r\n } \r\n else if (is_array($count[0]))\r\n {\r\n // array of arrays\r\n // sorry the finder can't do that on objects with composte primary keys\r\n throw new Exception('Impossible to find a list of Pks on an objects with composite primary keys');\r\n }\r\n for ($i=0; $i < $count; $i++)\r\n { \r\n $this->addCondition('and', $pkColumns[$i], '=', $pk[$i]);\r\n }\r\n return $this->findOne();\r\n }\r\n else\r\n {\r\n // simple primary kay\r\n if(is_array($pk))\r\n {\r\n $this->addCondition('and', $pkColumns[0], ' IN ', $pk);\r\n return $this->find();\r\n }\r\n else\r\n {\r\n $this->addCondition('and', $pkColumns[0], '=', $pk);\r\n return $this->findOne();\r\n }\r\n }\r\n }",
"public function find($data);",
"public static function find($id, $key = 'id');",
"public function testFind() {\n\t\t\tforeach($this->user_ids as $id) {\n\t\t\t\t$_user = User::_find($id);\n\t\t\t\t$this->assertTrue((isset($_user) && !empty($_user)));\n\t\t\t}\n\t\t\t//test finding by ids with cache\n\t\t\tforeach($this->user_ids as $id) {\n\t\t\t\t$_user = User::find($id);\n\t\t\t\t$this->assertTrue((isset($_user) && !empty($_user)));\n\t\t\t}\n\t\t}",
"function isPrimaryKey(): bool;",
"public function test_getByRecordId_exists_executesCorrectly()\r\n\t{\r\n\t\t$recordId = \"aDummyRecordId\";\r\n\t\t\r\n\t\t$this->prepareSetRecordId($recordId);\r\n\t\t$this->prepareFind(true);\r\n\t\r\n\t\t$actual = $this->service->getByRecordId($recordId);\r\n\t\t$this->assertEquals($this->dbObjectMock, $actual);\r\n\t}",
"public function testFind()\n {\n $data = array('id' => 1, 'username' => 'root', 'password' => 'password');\n $mockPDO = $this->getMock('\\\\PDOMock', array('fetchOne'));\n $mockPDO\n ->expects($this->once())\n ->method('fetchOne')\n ->will($this->returnCallback(function($arg1, $arg2) use ($data) {\n $sql = 'SELECT\n *\nFROM\n `users`\nWHERE\n id = :id\nORDER BY\n id ASC';\n\n if($arg1 == $sql && $arg2 == array('id' => 1)) {\n return $data;\n } else {\n return array();\n }\n }))\n ;\n $storage = new AuraExtendedPdo($mockPDO, new QueryFactory('mysql'));\n $result = $storage->find(array('id' => 1), 'users');\n\n $this->assertEquals($data['id'], $result['id']);\n $this->assertEquals($data['username'], $result['username']);\n $this->assertEquals($data['password'], $result['password']);\n }",
"public function testQuarantineFindOne()\n {\n\n }",
"public function find($primaryValue);",
"public function testProfilePrototypeFindByIdQuarantines()\n {\n\n }",
"public function testGetWithKey()\n {\n $result = $this->getQueryBuilderConnection()\n ->select()\n ->from('querybuilder_tests')\n ->where('id', '<', 2)\n ->getWithKey('field');\n\n $expected = [\n 'aaaa' => (object)[\n 'id' => '0',\n 'languageId' => '1',\n 'field' => 'aaaa',\n ],\n 'bbbb' => (object)[\n 'id' => '1',\n 'languageId' => '1',\n 'field' => 'bbbb',\n ],\n ];\n\n $this->assertEquals($expected, $result);\n\n $this->expectException(FieldNotFoundException::class);\n\n $this->getQueryBuilderConnection()\n ->select()\n ->from('querybuilder_tests')\n ->where('id', '<', 2)\n ->getWithKey('asdf');\n }",
"function find($id);",
"public function testGetById()\n {\n // Create and save a record to the DB\n $user = $this->userRepository->make([\n 'first_name' => 'test-first-name',\n 'last_name' => 'test-last-name',\n 'email' => '[email protected]',\n 'password' => '123123',\n ]);\n\n $user->save();\n\n // Get the user from DB with the getById method\n $userFromDb = $this->userRepository->getById($user->id);\n // Make sure the user the proper name and email\n $this->assertEquals('test-first-name', $userFromDb->first_name);\n $this->assertEquals('[email protected]', $userFromDb->email);\n }",
"public function testQueryFetchObject() {\n $records = [];\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25], ['fetch' => \\PDO::FETCH_OBJ]);\n foreach ($result as $record) {\n $records[] = $record;\n $this->assertIsObject($record);\n $this->assertSame('John', $record->name);\n }\n\n $this->assertCount(1, $records, 'There is only one record.');\n }",
"public function findByPrimaryKey(stubBaseReflectionClass $entityClass, array $primaryKeys);",
"abstract function getPrimaryKey();",
"public function testGetOne()\n {\n $result = $this->getQueryBuilderConnection()\n ->select()\n ->from('querybuilder_tests')\n ->where('field', '=', 'ffff')\n ->getOne();\n\n\n $object = (object)[\n 'id' => '5',\n 'languageId' => '2',\n 'field' => 'ffff',\n ];\n\n $this->assertEquals($object, $result);\n }",
"function test_getArrayById() {\r\n\t\t$rowset = array(array(\"memberClassId\" => 1, \"memberClassName\" => \"reader\"),\r\n\t\t\t\tarray(\"memberClassId\" => 2, \"memberClassName\" => \"nosher\"));\r\n\t\t$myArray = MemberClassesDB::getArray($rowset, \"memberClassId\", \"memberClassName\");\r\n\t\t$this->assertEqual($myArray['1'], \"reader\",\r\n\t\t\t\t\"Should return reader for key of 1 but returned \".$myArray['1']);\r\n\t\t$this->assertEqual($myArray['2'], 'nosher',\r\n\t\t\t\t\"Should return nosher for key of 2 but returned \".$myArray['2']);\r\n\t}",
"public function testGetPkValue()\n {\n // pk defaults to 'folderid' (from FolderDO)\n $user = new User(array('id' => '1'));\n $assoc = Mad_Model_Association_Base::factory('hasMany', 'Articles', array(), $user);\n $this->assertEquals('1', $assoc->getPkValue());\n\n // set to get value from a different col as the p\n $user = new User(array('name' => 'asdf'));\n $options = array('primaryKey' => 'name');\n $assoc = Mad_Model_Association_Base::factory('hasMany', 'Articles', $options, $user);\n $this->assertEquals('asdf', $assoc->getPkValue());\n }",
"function findById($id);",
"public function testQuarantineExistsGetQuarantinesidExists()\n {\n\n }",
"public function testPrimaryKey()\n {\n $statement = (new CreateTable($this->mockConnection));\n $return = $statement->primaryKey('id');\n $array = $statement->toArray();\n\n $this->assertInstanceOf(CreateTable::class, $return);\n $this->assertEquals([\n 'constraints' => [\n [\n 'type' => 'primaryKey',\n 'columns' => ['id']\n ]\n ],\n ], $array);\n }",
"abstract public function find($id);",
"public function find($obj){\n\t}",
"public function test_findConfidential() {\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(0, count($data));\n $this->SampleSet->username = 'sub2';\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(1, count($data));\n $this->assertEquals(2, $data[0]['SampleSet']['id']);\n $this->SampleSet->username = 'chem2';\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(1, count($data));\n $this->assertEquals(2, $data[0]['SampleSet']['id']);\n }",
"public function testResultGetAll_Object()\n {\n \t$result = $this->conn->query(\"SELECT * FROM test WHERE status='ACTIVE'\");\n \t$this->assertEquals(array((object)array('id'=>1, 'key'=>'one', 'title'=>'first row', 'status'=>'ACTIVE'), (object)array('id'=>2, 'key'=>'two', 'title'=>'next row', 'status'=>'ACTIVE')), $result->getAll(DB::FETCH_OBJECT));\n }",
"public function testFindById(): void\n {\n // given\n $expectedCategory = new Category();\n $expectedCategory->setName('Test Category');\n $this->categoryRepository->save($expectedCategory);\n\n // when\n $result = $this->categoryService->findOneById($expectedCategory->getId());\n\n // then\n $this->assertEquals($expectedCategory->getId(), $result->getId());\n }",
"abstract public function primaryKey(): string;",
"public function testQuarantineExistsHeadQuarantinesid()\n {\n\n }",
"function findProperty($id);",
"abstract public function getPrimaryKey();",
"abstract public function getPrimaryKey();",
"public function find(int $id) ;",
"function test_find()\n {\n // Arrange\n $brand_name = \"Nike\";\n $test_brand = new Brand($brand_name);\n $test_brand->save();\n $id = $test_brand->getId();\n\n $brand_name2 = \"Adidas\";\n $test_brand2 = new Brand($brand_name2);\n $test_brand2->save();\n\n //Act\n $result = Brand::find($id);\n\n //Assert\n $this->assertEquals($test_brand, $result);\n }",
"public function testPrimaryKeyComposite()\n {\n $statement = (new CreateTable($this->mockConnection));\n $return = $statement->primaryKey('id1', 'id2');\n $array = $statement->toArray();\n\n $this->assertInstanceOf(CreateTable::class, $return);\n $this->assertEquals([\n 'constraints' => [\n [\n 'type' => 'primaryKey',\n 'columns' => ['id1', 'id2']\n ]\n ],\n ], $array);\n }",
"public static function find($primary_key) {\n $table_name = self::table_name();\n return $table_name::unique([\"id\" => intval($primary_key)]); // convert to where struct and pass\n }",
"public function testFind()\n {\n $this->assertEquals(1, $this->object->find(function ($item) {\n return $item === 2;\n })->count());\n $this->assertEquals(2, $this->object->find(function ($item) {\n return $item % 2;\n })->count());\n }",
"public function testFindByAclIdentity()\n {\n $obj = $this->createModelObjectIdentity(2);\n $entry = $this->createEntry();\n $entry\n ->setSecurityIdentity(SecurityIdentity::fromAclIdentity($this->getRoleSecurityIdentity()))\n ->setAclClass($obj->getAclClass())\n ->setMask(64)\n ;\n $obj->addEntry($entry)->save($this->con);\n\n $entries = EntryQuery::create()->findByAclIdentity($this->getAclObjectIdentity(1), array(), $this->con);\n $this->assertCount(1, $entries);\n $this->assertEquals(1, $entries[0]->getObjectIdentityId());\n\n // A class based entry for the wrong ObjectIdentity.\n $classEntry = $this->createEntry();\n $classEntry\n ->setObjectIdentityId(2)\n ->setSecurityIdentity(SecurityIdentity::fromAclIdentity($this->getRoleSecurityIdentity()))\n ->setAclClass($obj->getAclClass())\n ->setMask(64)\n ->save($this->con)\n ;\n\n // A class based entry for the correct ObjectIdentity.\n $classEntry = $this->createEntry();\n $classEntry\n ->setObjectIdentityId(null)\n ->setSecurityIdentity(SecurityIdentity::fromAclIdentity($this->getRoleSecurityIdentity()))\n ->setAclClass($this->getAclClass())\n ->setMask(64)\n ->save($this->con)\n ;\n\n $this->assertEquals(4, EntryQuery::create()->count($this->con));\n\n $entries = EntryQuery::create()->findByAclIdentity($this->getAclObjectIdentity(1), array(), $this->con);\n $this->assertCount(2, $entries);\n $this->assertEquals($obj->getClassId(), $entries[0]->getClassId());\n $this->assertEquals($obj->getClassId(), $entries[1]->getClassId());\n }",
"public function testFindByOrderId(): void\n {\n $order_callback = OrderCallback::findByOrderId(9);\n $this->assertIsObject($order_callback);\n\n $this->assertObjectHasAttribute('errors', $order_callback);\n $this->assertObjectHasAttribute('id', $order_callback);\n $this->assertObjectHasAttribute('order_id', $order_callback);\n $this->assertObjectHasAttribute('callback_url', $order_callback);\n $this->assertObjectHasAttribute('is_callback_sent', $order_callback);\n }",
"#[@test]\n public function primaryKeyNotSet() {\n $this->assertEquals('false', \n $this->xpath->query('string(/document/table/index[2]/@primary)'));\n }",
"public function testCanRetrieveByASpecifiedField()\n {\n\n $orderQ = $this->db->newQuery()\n ->findEvery('Test_Order')\n ->withForeignKey('masterCustomerId', 1);\n\n $orders = $this->db->search($orderQ);\n\n $this->assertType('array', $orders);\n $this->assertEquals(2, count($orders));\n\n // check the orders are correct types\n foreach ($orders as $order)\n {\n $this->assertTrue($order instanceof Test_Order);\n }\n }",
"public function findById($primaryKeyValue){\n //Select* From employers Where $this->primaryKey(noemp)=$primaryKeyValue(1000)\n $array = $this->findWhere($this->primaryKey. \"=$primaryKeyValue\");\n if (count($array) != 1 ) die (\"The ID $primaryKeyValue is not valid\");\n return $array[0];\n }",
"public function testGetUser()\n {\n $user = factory(User::class)->create();\n $userRepo = new UserRepository(new User);\n $found = $userRepo->get($user->id);\n\n $this->assertInstanceOf(User::class, $found);\n foreach ($this->data as $key => $value) {\n \t$this->assertEquals($found->$key, $user->$key);\n }\n }",
"public function fetch($primaryKey);",
"abstract protected function _doContains($id);",
"function testFindByIdWithMissingId() {\r\n $this->User =& new User();\r\n \r\n $this->User->contain();\r\n $result = $this->User->findById(99999999, 'username');\r\n $this->assertFalse($result);\r\n }",
"public function testGetClassesWithKey()\n {\n $result = $this->getQueryBuilderConnection()\n ->select()\n ->from('querybuilder_tests')\n ->where('id', '<', 2)\n ->getClassesWithKey(SampleObject::class, [], 'field');\n\n $expected = [\n 'aaaa' => SampleObject::create('0', '1', 'aaaa'),\n 'bbbb' => SampleObject::create('1', '1', 'bbbb'),\n ];\n\n $this->assertEquals($expected, $result);\n\n $this->expectException(FieldNotFoundException::class);\n\n $this->getQueryBuilderConnection()\n ->select()\n ->from('querybuilder_tests')\n ->where('id', '<', 2)\n ->getClassesWithKey(SampleObject::class, [], 'asdf');\n }",
"function test_getNameById() {\r\n\t\t$myName = MemberClassesDB::getNameById(1);\r\n\t\t$this->assertEqual($myName, \"reader\",\r\n\t\t\t\t\"Should return reader for key of 1 but returned \".$myName);\r\n\t}",
"public function testProfilePrototypeFindByIdLikes()\n {\n\n }",
"public function testFindUser()\n {\n $user = factory(User::class)->create();\n $found = User::query()->find($user->id);\n $this->assertNotEmpty($found);\n $this->assertEquals($user->id, $found->id);\n }",
"public function testSingleResultQuery() {\r\n $uuid = 'abcdefg';\r\n $bool = true;\r\n $int = 1234567;\r\n $string = 'avorium';\r\n // Write data to the database\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$uuid.'\\','.($bool ? 1:0).','.$int.', \\''.$string.'\\')');\r\n // Read data out and cast it to persistent object\r\n $query = 'select * from POTEST where UUID = \\'abcdefg\\'';\r\n $po = $this->getPersistenceAdapter()->executeSingleResultQuery($query, 'test_persistence_AbstractPersistenceAdapterTestPersistentObject');\r\n // Compare properties\r\n $this->assertEquals($uuid, $po->uuid, 'Uuid value from persistent object differs from the UUID value of the database.');\r\n $this->assertEquals($bool, $po->booleanValue, 'Boolean value from persistent object differs from the boolean value of the database.');\r\n $this->assertEquals($int, $po->intValue, 'Integer value from persistent object differs from the int value of the database.');\r\n $this->assertEquals($string, $po->stringValue, 'String value from persistent object differs from the string value of the database.');\r\n }",
"function testObjectRecord()\n {\n $pear = new DataSourceArrayTestStore('pear');\n $doctrine = new DataSourceArrayTestStore('doctrine');\n $propel = new DataSourceArrayTestStore('propel');\n $this->datasource->bind(array(&$pear, &$doctrine, &$propel));\n\n $this->assertEquals(3, $this->datasource->count());\n\n $records = $this->datasource->fetch();\n $this->assertEquals('pear', $records[0]->name);\n $this->assertEquals('pear(tm)', $records[0]->getBrand());\n $this->assertEquals('doctrine', $records[1]->name);\n $this->assertEquals('doctrine(tm)', $records[1]->getBrand());\n $this->assertEquals('propel', $records[2]->name);\n $this->assertEquals('propel(tm)', $records[2]->getBrand());\n\n $this->datasource->sort('name');\n $records = $this->datasource->fetch(1, 1);\n $this->assertEquals('pear', $records[0]->name);\n $this->assertEquals('pear(tm)', $records[0]->getBrand());\n\n $records[0]->name = 'pear2';\n $this->assertEquals('pear2', $pear->name);\n }",
"public function testID() {\n $this->assertFalse($this->object->isset_id());\n\n $id = 'test';\n $this->object->set_id($id);\n $this->assertEquals($id, $this->object->get_id());\n $this->assertTrue($this->object->isset_id());\n }",
"public function testCanInsertAndRetrieveData(){\n $cleanPDO = new cleanPDO($this->goodConfig);\n $cleanPDO->beginTransaction();\n $cleanPDO->query(\"INSERT INTO test_table VALUES(null, 1)\");\n\n $id = $cleanPDO->lastInsertId();\n $this->assertTrue($id != 0);\n $stmt = $cleanPDO->query(\"SELECT * FROM `test_table` WHERE `key` = $id\");\n\n $this->assertTrue($cleanPDO->commit());\n $stmt->execute();\n $res = $stmt->fetch();\n $this->assertTrue($res['value'] == 1);\n\n }",
"public function testLoadWithInvalidPrimaryKey()\n {\n $this->assertNull($this->appService->load('invalidPrimaryKey'));\n }",
"public function testQuarantineFind()\n {\n\n }",
"public function findEntity($id);",
"function yy_r142(){ $this->_retvalue = 'primaryKey'; }",
"public function find( $id );",
"public function testShoppingCartCanBeRetrievedById()\n {\n $id1 = new UUID();\n $cart1 = new ShoppingCart($id1);\n $this->gateway->insert($id1, $cart1);\n\n $id2 = new UUID();\n $cart2 = new ShoppingCart($id2);\n $this->gateway->insert($id2, $cart2);\n\n $query = $this->db->query('SELECT * FROM shoppingCart');\n $result = $query->fetchAll(PDO::FETCH_COLUMN);\n\n $cart = $this->gateway->findById($id1);\n\n $this->assertEquals(2, count($result));\n $this->assertInstanceOf('ShoppingCart', $cart);\n $this->assertEquals($id1, $cart->getId());\n }",
"abstract function find($id): array;",
"public function find($pk)\r\n {\r\n $row = $this->getTable()->find($pk);\r\n if(!$row){\r\n return false;\r\n }\r\n $sampleModel = new SampleModel();\r\n $this->_map($sampleModel, $row);\r\n return $sampleModel;\r\n }",
"public function testProfileFindById()\n {\n\n }",
"public function testGetReplenishmentById()\n {\n }",
"public function whereId(string $id): object;",
"public function findByName($id){\n\n }",
"public function findByID($id){\n return $this->Find(self::TABLE,$id);\n }",
"public function testGetValidKidByKidId(): void\n {\n // count the number of rows and save it for later\n $numRows = $this->getConnection()->getRowCount(\"kid\");\n\n $kidId = generateUuidV4();\n $kid = new Kid($kidId, $this->adult->getAdultId(), $this->VALID_AVATAR_URL, $this->VALID_CLOUDINARY_TOKEN, $this->VALID_HASH, $this->VALID_NAME, $this->VALID_USERNAME);\n $kid->insert($this->getPDO());\n\n // grab the data from mySQL and enforce the fields match our expectations\n $pdoKid = Kid::getKidByKidId($this->getPDO(), $kid->getKidId());\n $this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"kid\"));\n $this->assertEquals($pdoKid->getKidId(), $kidId);\n $this->assertEquals($pdoKid->getKidAdultId(), $this->adult->getAdultId());\n $this->assertEquals($pdoKid->getKidAvatarUrl(), $this->VALID_AVATAR_URL);\n $this->assertEquals($pdoKid->getKidCloudinaryToken(), $this->VALID_CLOUDINARY_TOKEN);\n $this->assertEquals($pdoKid->getKidHash(), $this->VALID_HASH);\n $this->assertEquals($pdoKid->getKidName(), $this->VALID_NAME);\n $this->assertEquals($pdoKid->getKidUsername(), $this->VALID_USERNAME);\n }",
"public function testSearchForProductByAttribute()\n {\n // full results flag returns the full data set for the product\n }",
"function findById($id)\n {\n }",
"public function testGetOrderById()\n {\n }",
"public function testFindByCustomer()\n {\n $rand_id = rand(1, 23);\n $project = $this->getRepo()->find($rand_id);\n\n $this->assertGreaterThanOrEqual(1, count($this->getRepoWithQB()->findByCustomer(\n $project->getCustomer()->getId()\n )));\n }",
"public function testid() {\n $tiempo = new TiempoFalso();\n $tarjeta = new Tarjeta( $tiempo );\n $colectivo = new Colectivo(NULL, NULL, NULL);\n\t$id=$tarjeta->obtenerID();\n $boleto = new Boleto(NULL, NULL, $tarjeta, $tarjeta->obtenerID(),NULL, NULL, NULL, NULL, $tiempo);\n\n $this->assertEquals($boleto->obteneriID(), $id);\n }",
"function row_exist($table, $data) {\n\n global $devel, $tablas;\n\n $ids = array(\n 'PRIMARY_KEYS' => false,\n 'UNIQUES_KEYS' => false,\n 'INDEXES_KEYS' => false,\n 'COLUMNS_KEYS' => false,\n );\n extract($ids);\n\n // Buscamos la row por todas sus claves una a una hasta encontrarla\n foreach ($ids as $id => $dummy) {\n\n $keys = keys($table, $id);\n\n if ($keys) {\n\n $$id = true;\n // Si esta vuelta es INDEXES_KEYS o COLUMNS_KEYS y no hemos encontrado nada\n // con PRIMARY_KEYS o UNIQUES_KEYS o estos ultimos no existen en la tabla\n // podemos dar perfectamente por hecho que no existe row.\n if ((($INDEXES_KEYS OR $COLUMNS_KEYS) AND ($PRIMARY_KEYS OR $UNIQUES_KEYS))\n // Si es la vuelta en la que buscamos por COLUMNS_KEYS y ya hemos buscado\n // por INDEXES_KEYS sin encontrar nada, y ademas, en las vueltas de antes\n // con PRIMARY_KEYS o UNIQUES_KEYS tampoco encontramos nada no existe row.\n OR ($INDEXES_KEYS AND $COLUMNS_KEYS AND !$PRIMARY_KEYS AND !$UNIQUES_KEYS)\n // El mismo caso que el anterior pero sin que existan solo PRIMARY_KEYS\n OR ($INDEXES_KEYS AND $COLUMNS_KEYS AND !$PRIMARY_KEYS AND $UNIQUES_KEYS)\n // El mismo caso que el anterior pero sin que existan solo UNIQUES_KEYS\n OR ($INDEXES_KEYS AND $COLUMNS_KEYS AND $PRIMARY_KEYS AND !$UNIQUES_KEYS)\n // O también si hemos llegado a la vuelta COLUMNS_KEYS y no encontramos\n // nada en PRIMARY_KEYS ni UNIQUES_KEYS ni INDEXES_KEYS no existe row\n OR (!$INDEXES_KEYS AND $COLUMNS_KEYS AND !$PRIMARY_KEYS AND !$UNIQUES_KEYS)\n // El mismo caso que el anterior pero sin que existan solo PRIMARY_KEYS\n OR (!$INDEXES_KEYS AND $COLUMNS_KEYS AND !$PRIMARY_KEYS AND $UNIQUES_KEYS)\n // El mismo caso que el anterior pero sin que existan solo UNIQUES_KEYS\n OR (!$INDEXES_KEYS AND $COLUMNS_KEYS AND $PRIMARY_KEYS AND !$UNIQUES_KEYS)) {\n return false;\n }\n\n $WHERE = where($keys, $data);\n $query = \"SELECT * FROM `$table` WHERE $WHERE\";\n $result = db_fetch(db_query($devel, $query));\n\n if ($result) {\n return true;\n }\n }\n }\n\n // Si no encontramos row es que no existe\n return false;\n}",
"public function testGettingId()\n {\n $this->assertEquals('bar', $this->principal->getId());\n }",
"public function testGetDuplicateReplenishmentById()\n {\n }",
"function find($table, $id)\n{\n $data = connect()->query(\"SELECT * FROM $table WHERE id='$id'\");\n\n return $data->fetch_object();\n}",
"public static function findById($id);",
"public function test_getById() {\n\n }",
"function findById($db, $table, $primaryKey, $value, $options = '') {\n\t$query = 'SELECT * FROM ' . $table . ' WHERE ' . $primaryKey . '= :value ' . ' ' . $options ;\n\n\t$parameters = [\n\t\t'value' => $value\n\t];\n\n\t$result = runQuery($db, $query, $parameters);\n\n\treturn $result;\n}",
"function find($id=true,$fetch_type = \\PDO::FETCH_ASSOC)\n {\n $this->db->table($this->getTableFullName());\n if(is_string($id) || is_numeric($id)){\n $this->where($this->getPk(),'=',$id);\n }\n return $this->db->find($fetch_type);\n }",
"public function testFindOneById(): void\n {\n // given\n $event = $this->simpleEvent();\n $expectedId = $event->getId();\n\n // when\n $result = $this->eventService->findOneById($expectedId);\n\n // then\n $this->assertEquals($expectedId, $result->getId());\n }",
"public function testProfilePrototypeFindByIdGroups()\n {\n\n }",
"public static function find($id);",
"public function byPrimaryKeys()\n {\n $entity = new MockNoTableAnnotationEntity();\n $entity->setId('mock');\n $this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($this->getMock('stubDatabaseResult')));\n $this->dbEraser->deleteByPrimaryKeys($this->mockConnection, $entity);\n $this->assertEquals('MockNoTableAnnotationEntitys', $this->mockQueryBuilder->getDeleteTable());\n $this->assertEquals(\"(`MockNoTableAnnotationEntitys`.`id` = 'mock')\", $this->mockQueryBuilder->getDeleteCriterion()->toSQL());\n }"
] | [
"0.6823479",
"0.68099314",
"0.67452246",
"0.66938764",
"0.6660132",
"0.6637254",
"0.64958185",
"0.6440537",
"0.63842523",
"0.6375718",
"0.63432455",
"0.63085914",
"0.6299177",
"0.62330407",
"0.6217438",
"0.6201941",
"0.6192961",
"0.6159164",
"0.61170703",
"0.6115617",
"0.6098528",
"0.60682386",
"0.60655415",
"0.606473",
"0.6051068",
"0.5998056",
"0.5992028",
"0.5986314",
"0.5972737",
"0.5972184",
"0.5971563",
"0.59599435",
"0.59485376",
"0.59480876",
"0.5934674",
"0.59238744",
"0.591823",
"0.59148043",
"0.5913737",
"0.59079456",
"0.58993983",
"0.5893952",
"0.58500624",
"0.5840288",
"0.5832472",
"0.58302647",
"0.58302647",
"0.5822919",
"0.5810586",
"0.5809091",
"0.58051306",
"0.5802322",
"0.5800977",
"0.57994723",
"0.5780663",
"0.57654375",
"0.57554674",
"0.57533383",
"0.5735754",
"0.5720383",
"0.5706276",
"0.57034117",
"0.5693615",
"0.5685248",
"0.567622",
"0.5672692",
"0.5662846",
"0.5658403",
"0.56533116",
"0.5645174",
"0.561741",
"0.5614207",
"0.5608628",
"0.56058383",
"0.55931747",
"0.55923104",
"0.5591907",
"0.5585368",
"0.5566162",
"0.5564741",
"0.5563942",
"0.5562162",
"0.55595016",
"0.5556533",
"0.5555538",
"0.55530536",
"0.55315536",
"0.5530547",
"0.5525198",
"0.5519048",
"0.55155295",
"0.551477",
"0.55116904",
"0.55111885",
"0.5509229",
"0.55077803",
"0.5504312",
"0.5500734",
"0.5498198",
"0.54980135"
] | 0.56617147 | 67 |
test that trying to find a class that does not have an entity annotation throws an exception | public function byCriterionNonEntity()
{
$this->dbFinder->findByCriterion($this->mockConnection, $this->getMock('stubCriterion'), new stubReflectionClass('MockNoEntityAnnotationEntity'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testEntityClassExist()\n {\n $this->assertInstanceOf(TreeFactory::class, new TreeFactory());\n }",
"abstract protected function assertEntityClass();",
"public function testValidation()\n {\n $this->driver->loadMetadataForClass(new \\ReflectionClass(InvalidExample::class));\n }",
"public function testNotEntityInitialization()\n {\n $notEntityObj = new \\stdClass();\n\n $this->expectExceptionMessageRegExp('/only accept objects that extend Entity/');\n $layer = new Layer([$notEntityObj], null);\n }",
"public function getMissingEntity()\n {\n $this->setExpectedException(MissingEntityException::class);\n /** @var AbstractEntityService $service */\n $service = $this->getMockForAbstractClass(\n AbstractEntityService::class\n );\n $service->getEntity();\n }",
"public function byCriterionNonEntityClass()\n {\n $this->dbEraser->deleteByCriterion($this->mockConnection, $this->getMock('stubCriterion'), new stubReflectionClass('MockNoEntityAnnotationEntity'));\n }",
"public function testClassExists()\n {\n $this->assertTrue(class_exists('App\\Infrastructure\\DoctrineProducts'));\n }",
"public function testLoadParentClassNotDefined()\r\n\t\t{\r\n\t\t\tORM::init('mysql:host=localhost;dbname=rocket_orm', 'orm_username', 'orm_password');\r\n\t\t\t\r\n\t\t\tORM::load(1);\r\n\t\t}",
"public function testIsVendorClassReturnsFalseIfClassOfObjectIsNotLocatedInVendorDirectory()\n {\n $this->assertFalse(VendorResources::isVendorClass(new ContactType()));\n }",
"public function testAnnotation()\n {\n $fooClass = new ReflectionClass(Foo::class);\n $this->assertFalse($fooClass->isFinal());\n }",
"public function testGetMissingMetadata() {\r\n $uuid = 'abcdefg';\r\n $bool = true;\r\n $int = 1234567;\r\n $string = 'avorium';\r\n // Write data to the database\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$uuid.'\\','.($bool ? 1:0).','.$int.', \\''.$string.'\\')');\r\n // Read data out and cast it to persistent object with incomplete metadata\r\n $this->setExpectedException('Exception', 'The table name of the persistent object could not be determined.');\r\n // Here should come up an exception. It should not be possible to match to an class without knowing from which table to extract the date\r\n $this->getPersistenceAdapter()->get('test_persistence_AbstractPersistenceAdapterTestPersistentObjectWithoutMetadata', $uuid);\r\n }",
"public function testReflectionOnNonClassThrowsException()\n {\n $this->setExpectedException('League\\Container\\Exception\\ReflectionException');\n\n (new Container)->get('FakeClass');\n }",
"public function testNonExistantClass(): void\n {\n $this->expectException(\\RuntimeException::class);\n $this->expectExceptionMessage('Result of class \"stdClass\" has not been set');\n $this->collection->getResult(\\stdClass::class);\n }",
"public function testInvalidClassParam() {\n\t\t$options = $this->_loadOptions;\n\t\t$options['class'] = 'Foo\\bar';\n\t\t$this->expectException('/Unsupported class given/');\n\t\t$posts = Fixture::load('models/Posts', $options);\n\t\t$this->_testLoad($posts);\n\t}",
"public function testEmptyNamespaceMappingException(): void\n {\n $this->expectException(InvalidArgumentException::class);\n\n $this->getEntityFactoryManager()->create(EntityStub::class);\n }",
"public function hasEntityClass(): bool\n {\n return $this->hasDataItem('entity');\n }",
"public function testMorphClassSearchTypeErrorThrowsError()\n {\n $invalidParam = Registry::getDefinition(null);\n }",
"public function testGetHierarchyNotFound()\n {\n $locationId = 'id-test';\n\n $this->locationRepository\n ->expects($this->once())\n ->method('findOneBy')\n ->with(['id' => $locationId])\n ->will($this->returnValue(null));\n\n $this->setExpectedException(\n 'Doctrine\\ORM\\EntityNotFoundException'\n );\n\n $this\n ->locationServiceProviderAdapter\n ->getHierarchy($locationId);\n }",
"public function testNewEntityTypeWithReflectionException(): void {\n\n $res = FormFactory::newEntityType(\"GitHub\", $this->entities);\n $this->assertCount(3, $res);\n }",
"public function it_cant_create_invalid()\n {\n $this->shouldThrow('\\Aspire\\DIC\\Exception\\NotFoundException')->duringGet('SomeClassThatDoesNotExist');\n }",
"public function test_ClassResolver_hasAttribute_objNonConstruct() {\n $this->assertClassHasAttribute('objNonConstruct', \\FightTheIce\\Coding\\ClassResolver::class);\n }",
"abstract protected function getEntityClass();",
"public function testNotFoundEntityFactoryException(): void\n {\n $this->expectException(InvalidArgumentException::class);\n\n $entityFactoryManager = $this->getEntityFactoryManager([\n 'Tests\\EoneoPay\\Externals\\ORM\\Stubs\\Factories\\\\' => 'Tests\\EoneoPay\\Externals\\ORM\\Stubs'\n ]);\n\n $entityFactoryManager->create(EntityCustomRepository::class);\n }",
"public function setInvalidClassName()\n {\n $this->setExpectedException(InvalidEntityClassException::class);\n $this->service->setEntityClass('stdClass');\n }",
"public function testReadUploadableAnnotationReturnsNullWhenNonePresent()\n {\n $reader = $this->getMock('Doctrine\\Common\\Annotations\\Reader');\n $reader\n ->expects($this->once())\n ->method('getClassAnnotation')\n ->will($this->returnValue(null));\n\n $entity = new DummyEntity();\n $driver = new AnnotationDriver($reader);\n $annot = $driver->readUploadable(new \\ReflectionClass($entity));\n\n $this->assertEquals(null, $annot);\n }",
"private static function discoverEntity()\n {\n Structure::indexEntity(static::class);\n }",
"public function testTestModuleEntityMapping()\n {\n $configuration = $this->app['starter.configuration'];\n if (isset($configuration['doctrine']['dbal'])) {\n $mappings = $this->app['orm.em.options']['mappings'];\n $this->assertContains([\n 'type' => 'annotation',\n 'namespace' => 'TestModule\\Entity',\n 'path' => __DIR__ . DIRECTORY_SEPARATOR . 'TestModule/src/Entity'\n ], $mappings);\n }\n }",
"public function testUnannotatedMethodInUnannotatedClassWithException()\n {\n $class = new ReflectionClass(InterceptedClass::class);\n $instance = $class->newInstance();\n\n $this->reader->expects(static::once())->method('getMethodAnnotation')->willReturn(null);\n $this->reader->expects(static::once())->method('getClassAnnotation')->willReturn(null);\n $this->logger->expects(static::once())->method('warning');\n $this->entityManager->expects(static::never())->method('beginTransaction');\n $this->entityManager->expects(static::never())->method('commit');\n $this->entityManager->expects(static::never())->method('rollback');\n\n $hasException = false;\n try {\n $this->assertNull(\n $this->transactionalInterceptor->intercept(\n new MethodInvocation(\n $class->getMethod('bMethodThrowException'),\n $instance,\n array(Exception::class),\n array()\n )\n )\n );\n } catch (Exception $e) {\n $hasException = true;\n }\n $this->assertTrue($hasException);\n }",
"public function testOneAnnotationNoParams() {\n $comment = <<<'EOT'\n/**\n * This is a comment that contains a single annotation with no parameters.\n *\n * @Entity\n */\nEOT;\n \n $annotations = new Annotations($comment);\n $msg = print_r($annotations, true);\n\n $this->assertTrue(isset($annotations['entity']), $msg);\n $this->assertInternalType('boolean', $annotations['entity'], $msg);\n $this->assertEquals(true, $annotations['entity'], $msg);\n }",
"public function testNoEntityLoading() {\n\t\t$file = CAKE . 'VERSION.txt';\n\t\t$xml = <<<XML\n<!DOCTYPE cakephp [\n <!ENTITY payload SYSTEM \"file://$file\" >]>\n<request>\n <xxe>&payload;</xxe>\n</request>\nXML;\n\t\ttry {\n\t\t\t$result = Xml::build($xml);\n\t\t\t$this->assertEquals('', (string)$result->xxe);\n\t\t} catch (Exception $e) {\n\t\t\t$this->assertTrue(true, 'A warning was raised meaning external entities were not loaded');\n\t\t}\n\t}",
"public function testInLocationNotFound()\n {\n $locationId = 'id-test';\n $locationSearchIds = ['id-search1', 'id-search2'];\n\n $this->locationRepository\n ->expects($this->once())\n ->method('findOneBy')\n ->with(['id' => $locationId])\n ->will($this->returnValue(null));\n\n $this->setExpectedException(\n 'Doctrine\\ORM\\EntityNotFoundException'\n );\n\n $this\n ->locationServiceProviderAdapter\n ->in(\n $locationId,\n $locationSearchIds\n );\n }",
"public function testNoAnnotation()\n {\n $fooClass = new ReflectionClass(Foo::class);\n $this->assertTrue($fooClass->isFinal());\n }",
"public function testGuessTypeNoMetadata(): void\n {\n $class = 'FakeClass';\n $property = 'fakeProperty';\n\n $this->modelManager->method('getParentMetadataForProperty')->with($class, $property)\n ->willThrowException(new MappingException());\n\n $result = $this->guesser->guessType($class, $property, $this->modelManager);\n\n $this->assertSame('text', $result->getType());\n $this->assertSame(Guess::LOW_CONFIDENCE, $result->getConfidence());\n }",
"public function testSupportClass(): void\n {\n self::assertTrue($this->userRepository->supportsClass(User::class));\n self::assertFalse($this->userRepository->supportsClass(UserRepository::class));\n }",
"public function testGetLocationNotFound()\n {\n $locationId = 'id-test';\n\n $this->locationRepository\n ->expects($this->once())\n ->method('findOneBy')\n ->with(['id' => $locationId])\n ->will($this->returnValue(null));\n\n $this->setExpectedException(\n 'Doctrine\\ORM\\EntityNotFoundException'\n );\n\n $this\n ->locationServiceProviderAdapter\n ->getLocation($locationId);\n }",
"public function testReturnEntityClass()\n {\n $this->assertInstanceOf(Tree::class, TreeFactory::createFromArray($this->request));\n }",
"public function testGetInvalidFieldType()\r\n\t\t{\r\n\t\t\tORM::init('mysql:host=localhost;dbname=rocket_orm', 'orm_username', 'orm_password');\r\n\t\t\t\r\n\t\t\t$user = User::load(1);\r\n\r\n\t\t\t$user->get(array());\r\n\t\t}",
"public function testLoadInvalidObjectIDType()\r\n\t\t{\r\n\t\t\tORM::init('mysql:host=localhost;dbname=rocket_orm', 'orm_username', 'orm_password');\r\n\t\t\t\r\n\t\t\t$user = User::load(array());\r\n\t\t}",
"public function testIgnoredAnnotationSkippedBeforeReflection() {\n $annotation = 'neverReflectThis';\n $parser = new DocParser();\n $parser->setIgnoredAnnotationNames([$annotation => TRUE]);\n $parser->addNamespace('\\\\Arbitrary\\\\Namespace');\n\n // Register our class loader which will fail if the parser tries to\n // autoload disallowed annotations.\n $autoloader = function ($class_name) use ($annotation) {\n $name_array = explode('\\\\', $class_name);\n $name = array_pop($name_array);\n if ($name == $annotation) {\n $this->fail('Attempted to autoload an ignored annotation: ' . $name);\n }\n };\n spl_autoload_register($autoloader, TRUE, TRUE);\n // Perform the parse.\n $this->assertEmpty($parser->parse('@neverReflectThis'));\n // Clean up after ourselves.\n spl_autoload_unregister($autoloader);\n }",
"public function testReadNoUploadableFieldsWhenNoneExist()\n {\n $entity = new DummyEntity();\n $class = new \\ReflectionClass($entity);\n\n $reader = $this->getMock('Doctrine\\Common\\Annotations\\Reader');\n $reader\n ->expects($this->any())\n ->method('getPropertyAnnotation')\n ->will($this->returnValue(null));\n\n $driver = new AnnotationDriver($reader);\n $fields = $driver->readUploadableFields($class);\n\n $this->assertEquals(0, count($fields));\n }",
"public function testFromInvalidReflectionClass()\n {\n\n // create the reflection class\n $reflectionClass = new ReflectionClass('\\stdClass', array(), array());\n\n // check that the descriptor has not been initialized\n $this->assertNull($this->descriptor->fromReflectionClass($reflectionClass));\n }",
"public function testIsVendorClassReturnsFalseIfNameOfInternalClassIsPassed()\n {\n $this->assertFalse(VendorResources::isVendorClass('\\stdClass'));\n }",
"public function testGetEntityBehaviorsWithUnknownBehavior()\n {\n $this->expectException(\\Magento\\Framework\\Exception\\LocalizedException::class);\n $this->expectExceptionMessage('The behavior token for customer is invalid.');\n\n $this->_importConfig->merge(\n ['entities' => ['customer' => ['behaviorModel' => 'Unknown_Behavior_Class']]]\n );\n $importModel = $this->_model;\n $actualBehaviors = $importModel->getEntityBehaviors();\n $this->assertArrayNotHasKey('customer', $actualBehaviors);\n }",
"public function testIsVendorClassThrowsExceptionIfNoClassNameOrObjectIsPassed()\n {\n $this->expectException('InvalidArgumentException');\n VendorResources::isVendorClass('NoValidClassName');\n }",
"public function testCacheClassNotExist(): void\n {\n $this->config['doctrine']['cache']['array']['class_name'] = 'TestAssets\\NotExistClass';\n\n $factory = new CacheFactory('array');\n $this->expectException(RuntimeException::class);\n $factory($this->getContainer(), 'doctrine.cache.array');\n }",
"public function testEntityNotFound()\n {\n $this->setExpectedException(\n 'Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException',\n 'Entity was not found'\n );\n\n $this\n ->client\n ->request(\n 'GET',\n '/fake/entity/not/found/not-found-id'\n );\n }",
"public function testGetParentsNotFound()\n {\n $locationId = 'id-test';\n\n $this->locationRepository\n ->expects($this->once())\n ->method('findOneBy')\n ->with(['id' => $locationId])\n ->will($this->returnValue(null));\n\n $this->setExpectedException(\n 'Doctrine\\ORM\\EntityNotFoundException'\n );\n\n $this\n ->locationServiceProviderAdapter\n ->getParents($locationId);\n }",
"public function testRequiredTransactionForAnnotatedMethodInUnannotatedClassWithException()\n {\n $class = new ReflectionClass(InterceptedClass::class);\n $instance = $class->newInstance();\n\n $annotation = new Transactional($this->buildTransactionalOptions(Transactional::REQUIRED));\n $this->reader->expects(static::once())->method('getMethodAnnotation')->willReturn($annotation);\n $this->reader->expects(static::never())->method('getClassAnnotation');\n $this->entityManager->expects(static::once())->method('beginTransaction');\n $this->entityManager->expects(static::never())->method('commit');\n $this->entityManager->expects(static::once())->method('rollback');\n\n $hasException = false;\n try {\n $this->transactionalInterceptor->intercept(\n new MethodInvocation($class->getMethod('bMethodThrowException'), $instance, array(Exception::class),\n array()\n )\n );\n } catch (Exception $e) {\n $hasException = true;\n }\n $this->assertTrue($hasException);\n }",
"public function testIsVendorClassReturnsFalseIfClassIsNotLocatedInVendorDirectory()\n {\n $this->assertFalse(VendorResources::isVendorClass('\\Webfactory\\Util\\VendorResources'));\n }",
"public function testGetInvalidFieldName()\r\n\t\t{\r\n\t\t\tORM::init('mysql:host=localhost;dbname=rocket_orm', 'orm_username', 'orm_password');\r\n\t\t\t\r\n\t\t\t$user = User::load(1);\r\n\t\t\t\r\n\t\t\t$user->get('doesnotexistfieldname');\r\n\t\t}",
"public function testRequiredTransactionForUnannotatedMethodInAnnotatedClassWithException()\n {\n $class = new ReflectionClass(InterceptedClass::class);\n $instance = $class->newInstance();\n\n $annotation = new Transactional($this->buildTransactionalOptions(Transactional::REQUIRED));\n $this->reader->expects(static::once())->method('getMethodAnnotation')->willReturn(null);\n $this->reader->expects(static::once())->method('getClassAnnotation')->willReturn($annotation);\n $this->entityManager->expects(static::once())->method('beginTransaction');\n $this->entityManager->expects(static::never())->method('commit');\n $this->entityManager->expects(static::once())->method('rollback');\n\n $hasException = false;\n try {\n $this->transactionalInterceptor->intercept(\n new MethodInvocation($class->getMethod('bMethodThrowException'), $instance, array(Exception::class),\n array()\n )\n );\n } catch (Exception $e) {\n $hasException = true;\n }\n $this->assertTrue($hasException);\n }",
"public function test_create__invalid_class()\n {\n\n (new ElementFactory())->create(['attributes' => ['type' => ElementFactory::class, 'name' => '']]);\n }",
"abstract protected function assertEntity($entity);",
"public function createEntity() {\r\n\t\t$entity = $this->getAnnotation('entity');\r\n\t\tif($entity) {\r\n\t\t\treturn new $entity;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"function macro_is_entity($path)\n{\n return preg_match('/XLite.Model.|XLite.Module.\\w+.\\w+.Model./Ss', $path);\n}",
"public function testSaveNewEmptyEntity() {\n\t\t$entity = new Entity([], ['className' => 'UserEntity']);\n\t\t$table = TableRegistry::get('users');\n\t\t$this->assertFalse($table->save($entity));\n\t}",
"public function testContainerThrowsWhenCannotGetDefinitionToExtend()\n {\n $this->expectException(NotFoundException::class);\n\n $container = new Container;\n\n $this->assertFalse($container->has(Foo::class));\n\n $container->extend(Foo::class);\n }",
"public function getEntityClass();",
"#[@test, @expect('lang.ElementNotFoundException')]\n public function nonExistantPackage() {\n \\lang\\reflect\\Package::forName('@@non-existant-package@@');\n }",
"public function testRequiredTransactionForAnnotatedMethodInUnannotatedClassWithIgnoredException()\n {\n $class = new ReflectionClass(InterceptedClass::class);\n $instance = $class->newInstance();\n\n $annotation = new Transactional(\n $this->buildTransactionalOptions(Transactional::REQUIRED, array(Exception::class))\n );\n $this->reader->expects(static::once())->method('getMethodAnnotation')->willReturn($annotation);\n $this->reader->expects(static::never())->method('getClassAnnotation');\n $this->entityManager->expects(static::once())->method('beginTransaction');\n $this->entityManager->expects(static::once())->method('commit');\n $this->entityManager->expects(static::never())->method('rollback');\n\n $hasException = false;\n try {\n $this->transactionalInterceptor->intercept(\n new MethodInvocation(\n $class->getMethod('bMethodThrowException'),\n $instance,\n array(Exception::class),\n array()\n )\n );\n } catch (Exception $e) {\n $hasException = true;\n }\n $this->assertTrue($hasException);\n }",
"function testFindByIdWithMissingId() {\r\n $this->User =& new User();\r\n \r\n $this->User->contain();\r\n $result = $this->User->findById(99999999, 'username');\r\n $this->assertFalse($result);\r\n }",
"public function testGetNoPersistentObject() {\r\n $uuid = 'abcdefg';\r\n $bool = true;\r\n $int = 1234567;\r\n $string = 'avorium';\r\n // Write data to the database\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$uuid.'\\','.($bool ? 1:0).','.$int.', \\''.$string.'\\')');\r\n // Read data out and cast it to persistent object with incomplete metadata\r\n $this->setExpectedException('Exception', 'The given class is not derived from avorium_core_persistence_PersistentObject. But this is needed to extract the table name!');\r\n $this->getPersistenceAdapter()->get('test_persistence_AbstractPersistenceAdapterTestNoPersistentObject', $uuid);\r\n }",
"public function testGetEntityStringActionReturnsInvalidOnClassnameNotSupplied()\n\t{\n\t\t$this->dispatch(\"/getEntityString\", \"POST\",\n\t\t\t[\n\t\t\t\t\"classname\" => \"\",\n\t\t\t\t\"tablename\" => \"test\",\n\t\t\t\t\"namespace\" => \"test\",\n\t\t\t\t\"entityProperties\" => [\n\t\t\t\t\t0 => [\n\t\t\t\t\t\t\"propertyName\" => \"test\"\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t], true);\n\t\t$this->assertResponseStatusCode(200);\n\t\t$responseContent = json_decode($this->getResponse()->getContent(), true);\n\t\t$this->assertEquals(\n\t\t\t\"error\", $responseContent[\"status\"]\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t\"invalidform\", $responseContent[\"message\"]\n\t\t);\n\t}",
"public function testEntityTypeRestTestCoverage() {\n $problems = [];\n foreach ($this->definitions as $entity_type_id => $info) {\n $class_name_full = $info->getClass();\n $parts = explode('\\\\', $class_name_full);\n $class_name = end($parts);\n $module_name = $parts[1];\n\n $possible_paths = [\n 'Drupal\\Tests\\jsonapi\\Functional\\CLASSTest',\n '\\Drupal\\Tests\\\\' . $module_name . '\\Functional\\Jsonapi\\CLASSTest',\n ];\n foreach ($possible_paths as $path) {\n $missing_tests = [];\n $class = str_replace('CLASS', $class_name, $path);\n if (class_exists($class)) {\n break;\n }\n $missing_tests[] = $class;\n }\n if (!empty($missing_tests)) {\n $missing_tests_list = implode(', ', $missing_tests);\n $problems[] = \"$entity_type_id: $class_name ($class_name_full) (expected tests: $missing_tests_list)\";\n }\n else {\n $config_entity = is_subclass_of($class_name_full, ConfigEntityInterface::class);\n $config_test = is_subclass_of($class, ConfigEntityResourceTestBase::class);\n if ($config_entity && !$config_test) {\n $problems[] = \"$entity_type_id: $class_name is a config entity, but the test is for content entities.\";\n }\n elseif (!$config_entity && $config_test) {\n $problems[] = \"$entity_type_id: $class_name is a content entity, but the test is for config entities.\";\n }\n }\n }\n\n $this->assertSame([], $problems);\n }",
"#[@test, @expect('lang.ElementNotFoundException')]\n public function non_existant() {\n \\lang\\ClassLoader::registerPath('@@non-existant@@');\n }",
"public function supports(string $entityClass): bool;",
"public function testMalformedGetAllRecipeEntities()\n {\n $this->expectException(TypeError::class);\n $input = 'Recipes';\n\n $result = \\Mamoi\\Hydrators\\RecipeEntityHydrator::getAllRecipeEntities($input);\n\n }",
"public function testFindingRepositoryClasses()\n {\n $WriterRepository = $this->em->getRepository(\"ZF2EntityAuditTest\\Entity\\Writer\");\n $ArticleRepository = $this->em->getRepository(\"ZF2EntityAuditTest\\Entity\\Article\");\n\n $this->assertEquals(\"Doctrine\\ORM\\EntityRepository\" , get_class($WriterRepository));\n $this->assertEquals(\"Doctrine\\ORM\\EntityRepository\" , get_class($ArticleRepository));\n\n }",
"public function testRequiredTransactionForUnannotatedMethodInAnnotatedClassWithIgnoredException()\n {\n $class = new ReflectionClass(InterceptedClass::class);\n $instance = $class->newInstance();\n\n $annotation = new Transactional(\n $this->buildTransactionalOptions(Transactional::REQUIRED, array(Exception::class)));\n $this->reader->expects(static::once())->method('getMethodAnnotation')->willReturn(null);\n $this->reader->expects(static::once())->method('getClassAnnotation')->willReturn($annotation);\n $this->entityManager->expects(static::once())->method('beginTransaction');\n $this->entityManager->expects(static::once())->method('commit');\n $this->entityManager->expects(static::never())->method('rollback');\n\n $hasException = false;\n try {\n $this->transactionalInterceptor->intercept(\n new MethodInvocation($class->getMethod('bMethodThrowException'), $instance, array(Exception::class),\n array()\n )\n );\n } catch (Exception $e) {\n $hasException = true;\n }\n $this->assertTrue($hasException);\n }",
"public function testGetChildrenNotFound()\n {\n $locationId = 'id-test';\n\n $this->locationRepository\n ->expects($this->once())\n ->method('findOneBy')\n ->with(['id' => $locationId])\n ->will($this->returnValue(null));\n\n $this->setExpectedException(\n 'Doctrine\\ORM\\EntityNotFoundException'\n );\n\n $this\n ->locationServiceProviderAdapter\n ->getChildren($locationId);\n }",
"public function testEmptyFactoryPathsException(): void\n {\n $this->expectException(InvalidArgumentException::class);\n\n new EntityFactoryManager($this->getEntityManager(), []);\n }",
"public function testAutoloader()\n {\n $this->assertTrue(class_exists('\\ActiveCollab\\DatabaseObject\\Entity\\Entity'));\n $this->assertTrue(class_exists('\\ActiveCollab\\DatabaseObject\\Test\\Fixtures\\Writers\\Writer'));\n }",
"public function test_ClassResolver_hasAttribute_reflection() {\n $this->assertClassHasAttribute('reflection', \\FightTheIce\\Coding\\ClassResolver::class);\n }",
"public function testIsValidTypeInvalid()\n {\n $this->assertFalse($this->annotation->isValidType('INVALID'));\n }",
"public function testFromReflectionClassWithInvalidLocalAnnotation()\n {\n\n // prepare the annotation values\n $values = array();\n\n // create a mock annotation implementation\n $beanAnnotation = $this->getMockBuilder('AppserverIo\\Psr\\EnterpriseBeans\\Annotations\\AbstractBeanAnnotation')\n ->setConstructorArgs(array('Stateless', $values))\n ->getMockForAbstractClass();\n\n // create a mock annotation\n $annotation = $this->getMockBuilder('AppserverIo\\Lang\\Reflection\\ReflectionAnnotation')\n ->setMethods(array('getAnnotationName', 'getValues', 'newInstance'))\n ->setConstructorArgs(array('Stateless', $values))\n ->getMock();\n\n // mock the ReflectionAnnotation methods\n $annotation\n ->expects($this->once())\n ->method('getAnnotationName')\n ->will($this->returnValue('Stateless'));\n $annotation\n ->expects($this->once())\n ->method('getValues')\n ->will($this->returnValue($values));\n $annotation\n ->expects($this->once())\n ->method('newInstance')\n ->will($this->returnValue($beanAnnotation));\n\n // initialize the annotation aliases\n $aliases = array(\n Resource::ANNOTATION => Resource::__getClass(),\n EnterpriseBean::ANNOTATION => EnterpriseBean::__getClass()\n );\n\n // create a mock reflection class\n $reflectionClass = $this->getMockBuilder('AppserverIo\\Lang\\Reflection\\ReflectionClass')\n ->setMethods(array('hasAnnotation'))\n ->setConstructorArgs(array(__CLASS__, array(), $aliases))\n ->getMock();\n $reflectionClass\n ->expects($this->once())\n ->method('hasAnnotation')\n ->with('Local')\n ->will($this->returnValue(true));\n\n // mock the methods\n $this->descriptor\n ->expects($this->once())\n ->method('newAnnotationInstance')\n ->with($reflectionClass)\n ->will($this->returnValue($annotation));\n\n // initialize the descriptor instance\n $this->descriptor->fromReflectionClass($reflectionClass);\n }",
"public function testGetClassesMappingWithWrongType(): void\n {\n \\Config::set(RB::CONF_KEY_CONVERTER_CLASSES, false);\n\n $this->expectException(Ex\\InvalidConfigurationException::class);\n Lockpick::call(Converter::class, 'getClassesMapping');\n }",
"public function testSearchMissAtributeFromException()\n {\n $attrKey = 'test_attribute_name';\n $attrKeySearch = null;\n\n try {\n factory(Post::class)->create([\n $attrKey => true\n ]);\n } catch (QueryException $e) {\n $attrKeySearch = Post::getMissAttributeKey($e);\n }\n\n $this->assertEquals($attrKeySearch, $attrKey);\n }",
"public function testMorphClassSearchUnknownMosaicReturnsFalse()\n {\n $invalidFQN = \"evias.sdk.preconfigured:nem-php\";\n $definition = Registry::getDefinition($invalidFQN);\n\n $this->assertFalse($definition);\n }",
"public function testFindPersistedEntities() {\n\t\t$table = TableRegistry::get('users');\n\t\t$table->entity = true;\n\t\t$results = $table->find('all');\n\t\t$this->assertCount(4, $results);\n\t\tforeach ($results as $article) {\n\t\t\t$this->assertFalse($article->isNew());\n\t\t}\n\t}",
"public function testEntityClass()\n {\n $record = $this->pieceRecords[0];\n\n $layer = new Layer([], 'edition');\n $this->assertEquals('Edition', $layer->entityClass());\n\n $layer = new Layer([$record], 'edition');\n $this->assertEquals('Piece', $layer->entityClass());\n\n $layer = new Layer([$record]);\n $this->assertEquals('Piece', $layer->entityClass());\n }",
"public function testGetMetadata()\n {\n $connection = $this->createMysqlConnection();\n $metadata = $connection->getClassMetadata();\n\n $classes = [\n \"Quizzes\\Quiz\",\n \"Quizzes\\Question\",\n \"Quizzes\\Answer\"\n ];\n\n $names = [];\n\n foreach ($metadata as $k => $v) {\n $names[] = $v->getName();\n\n foreach ($classes as $key => $value) {\n if ($value == $v->getName()) {\n unset($classes[$key]);\n }\n }\n }\n\n $this->assertCount(0, $classes, print_r($names, true));\n\n }",
"public function testParseNoClass()\n {\n $file = '#test';\n $rule = [\n 'directive' => '~#test(\\s*\\(((.*))\\))?~',\n 'replace' => \\Caprice\\Directives\\PhpDirectives::class, // wrong class\n ];\n $extras = []; // extra needed parameters like paths \n\n $this->expectException(CapriceException::class);\n $this->parser->parse($file, $rule, $extras);\n }",
"public function getClassNameFromEntity()\n {\n $post = new Post(['id' => 243]);\n $this->service->setEntity($post);\n $this->assertEquals(Post::class, $this->service->getEntityClassName());\n }",
"public function testInvalidMappingAsOption()\n {\n $container = $this->createMockDefaultApp();\n\n $container->register(new DoctrineOrmServiceProvider);\n\n $container['orm.em.options'] = array(\n 'mappings' => array(\n 'type' => 'annotation',\n 'namespace' => 'Foo\\Entities',\n 'path' => __DIR__.'/src/Foo/Entities',\n ),\n );\n\n $container['orm.ems.config'];\n }",
"#[Group('DDC-3418')]\n public function testMappedSuperclassIndex(): void\n {\n $class = $this->cmf->getMetadataFor(EntityIndexSubClass::class);\n assert($class instanceof ClassMetadata);\n\n self::assertArrayHasKey('mapped1', $class->fieldMappings);\n self::assertArrayHasKey('IDX_NAME_INDEX', $class->table['uniqueConstraints']);\n self::assertArrayHasKey('IDX_MAPPED1_INDEX', $class->table['uniqueConstraints']);\n self::assertArrayHasKey('IDX_MAPPED2_INDEX', $class->table['indexes']);\n }",
"public function test_searchTypeNotAllowed() {\n $this->expectException(\\Exception::class);\n new SpotifySearch('any', 'not_allowed', SingletonTokenContainer::get());\n }",
"public function shouldSkipClass(ClassMetadata $metadata, Context $context): bool;",
"protected function isEntity($class)\n {\n return Nishchay::getEntityCollection()->isExist($class);\n }",
"public function testCreateInstanceWithNotExistentClass()\n {\n $this->assertInstanceOf(TypedObjectArray::class, (new TypedObjectArray(ArrayBadObject::class)));\n }",
"public function testGetClassMappingConfigOrThrowWithNoConfig(): void\n {\n $converter = new Converter();\n $model = new TestModel('');\n\n $this->expectException(Ex\\ConfigurationNotFoundException::class);\n Lockpick::call($converter, 'getClassMappingConfigOrThrow', [$model]);\n }",
"public function testGetAllMissingMetadata() {\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testReadMultipleRecords 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => 'testReadMultipleRecords 2'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testReadMultipleRecords 3']\r\n ];\r\n // Write data to the database\r\n foreach ($records as $record) {\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$record['UUID'].'\\','.($record['bool'] ? 1:0).','.$record['int'].', \\''.$record['string'].'\\')');\r\n }\r\n // Read data out and cast it to persistent object with incomplete metadata\r\n $this->setExpectedException('Exception', 'The table name of the persistent object could not be determined.');\r\n // Here should come up an exception. It should not be possible to match to an class without knowing from which table to extract the date\r\n $this->getPersistenceAdapter()->getAll('test_persistence_AbstractPersistenceAdapterTestPersistentObjectWithoutMetadata');\r\n }",
"public function test_un_email_pertenece_a_un_usuario()\n { \n $email = Email::factory()->create();\n\n $this->assertInstanceOf(User::class, $email->user);\n }",
"public function testQuarantineFindOne()\n {\n\n }",
"public function testFindClassAnnotationFile()\n {\n $file = $this->get('file_locator')->locate('@ExtDirectBundle/Controller/TestController.php');\n $this->assertEquals(\n 'Ext\\DirectBundle\\Controller\\TestController',\n $this->getLoader()->findClass($file)\n );\n }",
"public function byPrimaryKeysNonEntity()\n {\n $this->dbFinder->findByPrimaryKeys($this->mockConnection, new stubReflectionClass('MockNoEntityAnnotationEntity'), array());\n }",
"public function testReadUploadableAnnotation()\n {\n $uploadable = $this->getMockBuilder('Vich\\UploaderBundle\\Mapping\\Annotation\\Uploadable')\n ->disableOriginalConstructor()\n ->getMock();\n\n $reader = $this->getMock('Doctrine\\Common\\Annotations\\Reader');\n $reader\n ->expects($this->once())\n ->method('getClassAnnotation')\n ->will($this->returnValue($uploadable));\n\n $entity = new DummyEntity();\n $driver = new AnnotationDriver($reader);\n $annot = $driver->readUploadable(new \\ReflectionClass($entity));\n\n $this->assertEquals($uploadable, $annot);\n }",
"public function testCanFindClasses()\n {\n foreach ($this->classes as $class) {\n $this->assertTrue(class_exists($class) || interface_exists($class));\n }\n }",
"final public function assertHydratedEntity()\n {\n if ($this->isSimpleEntity()) {\n throw ValidationException::create(ERR300_CANNOT_PERSIST_SIMPLE_ENTITY);\n }\n }",
"public function testInvalidMigrationClass(): void\n {\n // This test is designed to test/cover specific implementation rather than functionality and\n // needed to simulate very specific situation.\n\n /** @var Mock $inOut */\n $inOut = Mockery::mock(IoInterface::class);\n $inOut->shouldReceive('writeWarning')->once()->withAnyArgs()->andReturnSelf();\n\n /** @var IoInterface $inOut */\n\n $runner = Mockery::mock(BaseMigrationRunner::class);\n $runner->makePartial();\n\n $container = $this->createContainer();\n\n $method = new ReflectionMethod(BaseMigrationRunner::class, 'setIO');\n $method->setAccessible(true);\n $method->invoke($runner, $inOut);\n\n $method = new ReflectionMethod(BaseMigrationRunner::class, 'createMigration');\n $method->setAccessible(true);\n $nullMigration = $method->invoke($runner, 'non-existing-class', $container);\n\n $this->assertNull($nullMigration);\n }",
"public function generateSourceEntityClass(): bool\n {\n $folder = $this->getGeneratedEntitiesFolder();\n $repositoryFolder = $this->getGeneratedRepositoriesFolder();\n $file = $this->getSourceClassPath();\n $repositoryFile = $this->getRepositoryClassPath();\n $fileSystem = new Filesystem();\n\n if (!$fileSystem->exists($folder)) {\n $fileSystem->mkdir($folder, 0775);\n }\n if (!$fileSystem->exists($repositoryFolder)) {\n $fileSystem->mkdir($repositoryFolder, 0775);\n }\n\n if (!$fileSystem->exists($file)) {\n $classGenerator = $this->entityGeneratorFactory->createWithCustomRepository($this->nodeType);\n $repositoryGenerator = $this->entityGeneratorFactory->createCustomRepository($this->nodeType);\n $content = $classGenerator->getClassContent();\n $repositoryContent = $repositoryGenerator->getClassContent();\n\n if (false === @file_put_contents($file, $content)) {\n throw new IOException(\"Impossible to write entity class file (\" . $file . \").\", 1);\n }\n if (false === @file_put_contents($repositoryFile, $repositoryContent)) {\n throw new IOException(\"Impossible to write entity class file (\" . $repositoryFile . \").\", 1);\n }\n /*\n * Force Zend OPcache to reset file\n */\n if (function_exists('opcache_invalidate')) {\n opcache_invalidate($file, true);\n opcache_invalidate($repositoryFile, true);\n }\n if (function_exists('apcu_clear_cache')) {\n apcu_clear_cache();\n }\n\n \\clearstatcache(true, $file);\n \\clearstatcache(true, $repositoryFile);\n\n return true;\n }\n return false;\n }"
] | [
"0.69851595",
"0.69185287",
"0.65015507",
"0.64515525",
"0.62725055",
"0.6247503",
"0.6237198",
"0.61998886",
"0.61451256",
"0.6096532",
"0.6082327",
"0.60641176",
"0.6046623",
"0.6044867",
"0.59945697",
"0.59862095",
"0.5983751",
"0.5967937",
"0.596706",
"0.5938923",
"0.59237844",
"0.5907321",
"0.590569",
"0.5889163",
"0.5886824",
"0.5874794",
"0.5837336",
"0.58370996",
"0.58318716",
"0.5819291",
"0.5808024",
"0.5807965",
"0.5804573",
"0.57921827",
"0.57877684",
"0.5786955",
"0.5775459",
"0.575289",
"0.5721804",
"0.5719858",
"0.57166743",
"0.5713983",
"0.5707439",
"0.5705883",
"0.5688643",
"0.56651485",
"0.5652294",
"0.5652162",
"0.56495535",
"0.563848",
"0.5624497",
"0.5616423",
"0.5609455",
"0.559849",
"0.55858934",
"0.55670804",
"0.5553736",
"0.55486494",
"0.55329525",
"0.5526186",
"0.5506942",
"0.5504918",
"0.5496183",
"0.54957175",
"0.5492461",
"0.5489329",
"0.5478521",
"0.54770446",
"0.54764974",
"0.54760873",
"0.5463845",
"0.5460894",
"0.5453976",
"0.5448517",
"0.5447852",
"0.5446316",
"0.54317045",
"0.5430619",
"0.5427217",
"0.5419234",
"0.541274",
"0.54126513",
"0.54004496",
"0.53991765",
"0.5399097",
"0.5398393",
"0.539773",
"0.53947574",
"0.5386994",
"0.538498",
"0.53837705",
"0.5381836",
"0.5378157",
"0.5363791",
"0.5358412",
"0.53491074",
"0.5344242",
"0.5335622",
"0.53354686",
"0.53336734"
] | 0.64253527 | 4 |
test that finding data of an object with a criterion works as expected | public function byCriterion()
{
$mockCriterion = $this->getMock('stubCriterion');
$mockCriterion->expects($this->any())->method('toSQL')->will($this->returnValue('example'));
$mockResult = $this->getMock('stubDatabaseResult');
$this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));
$mockResult->expects($this->exactly(2))
->method('fetchAll')
->will($this->onConsecutiveCalls(false, array(array('bar' => 'Here is bar.', 'default' => 'And this is default.'))));
$finderResult = $this->dbFinder->findByCriterion($this->mockConnection, $mockCriterion, new stubReflectionClass('MockSinglePrimaryKeyEntity'));
$this->assertEquals(0, $finderResult->count());
$finderResult = $this->dbFinder->findByCriterion($this->mockConnection, $mockCriterion, new stubReflectionClass('MockSinglePrimaryKeyEntity'));
$this->assertEquals(1, $finderResult->count());
$data = $finderResult->current();
$this->assertEquals('Here is bar.', $data->withAnnotation());
$this->assertEquals('And this is default.', $data->withDefaultValue());
$select = $this->mockQueryBuilder->getSelect();
$this->assertEquals('foo', $select->getBaseTableName());
$this->assertEquals('bar ASC', $select->getOrderedBy());
$this->assertTrue($select->hasCriterion());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testFind()\n {\n $this->assertEquals(1, $this->object->find(function ($item) {\n return $item === 2;\n })->count());\n $this->assertEquals(2, $this->object->find(function ($item) {\n return $item % 2;\n })->count());\n }",
"public function testFindFirst()\n {\n $this->assertEquals(2, $this->object->findFirst(function ($item) {\n return $item === 2;\n }));\n $this->assertEquals(1, $this->object->findFirst(function ($item) {\n return $item % 2;\n }));\n }",
"public function matching(Criteria $criteria);",
"public function testFindWhere() {\n\t\t$array = array(\n\t\t\tarray('a' => 1, 'b' => 'testing'),\n\t\t\tarray('a' => 2, 'b' => 'testing'),\n\t\t\tarray('a' => 3, 'b' => 'one'),\n\t\t\tarray('a' => 2, 'b' => 'two'),\n\t\t\tarray('a' => 4, 'b' => 'three'),\n\t\t);\n\t\t$result = _::findWhere($array, array('b' => 'testing'), true);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(2, $result);\n\t\t$this->assertEquals(1, $result['a']);\n\t\t$this->assertEquals('testing', $result['b']);\n\t}",
"public function testSearchForProductByAttribute()\n {\n // full results flag returns the full data set for the product\n }",
"public function matching(Criteria $criteria)\n {\n }",
"public function find($data);",
"public function testObjectResult()\n {\n $result = $this->searchResult->objectResult();\n\n $this->assertObjectHasAttribute('results', $result);\n $this->assertObjectHasAttribute('status', $result);\n }",
"public function testQuery(\\Jazzee\\Entity\\Answer $answer, \\stdClass $obj);",
"public function find($obj){\n\t}",
"public abstract function findOperationBy(array $criteria);",
"public function getCriteria();",
"public function testQuarantineFind()\n {\n\n }",
"public function testSearch() {\n\t\t$operacionBusqueda = new Operacion;\n\t\t$operacionBusqueda->nombre = 'Radicado';\n\t\t$operacions = $operacionBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $operacions ), 1 );\n\t}",
"public function testPredicate()\n {\n $this->persistToursLambert93(false);\n $pointO = $this->persistPointO();\n $this->persistPointA();\n $this->persistPointB();\n\n $query = $this->getEntityManager()->createQuery(\n // phpcs:disable Generic.Files.LineLength.MaxExceeded\n 'SELECT p FROM LongitudeOne\\Spatial\\Tests\\Fixtures\\PointEntity p WHERE ST_EQUALS(p.point, ST_Point(:x, :y)) = true'\n // phpcs:enable\n );\n $query->setParameter('x', 0, 'integer');\n $query->setParameter('y', 0, 'integer');\n\n $result = $query->getResult();\n\n static::assertCount(1, $result);\n static::assertEquals($pointO, $result[0]);\n }",
"public abstract function findHolderBy(array $criteria);",
"static public function findFirst($subject, $predicate, $object, $attrs=0) {\r\n $found=array_shift(SimpleRdf::find($subject, $predicate, $object, $attrs, 1));\r\n return $found;\r\n }",
"public function testFindBy() {\n\t\t\tforeach($this->users as $user) {\n\t\t\t\t$_user = User::find_by(array('conditions' => \"name = '\" . $user . \"'\"));\n\t\t\t\t$lamda = call_user_func(strtolower($user));\n\t\t\t\t//lots of redudent checking here to make sure the lamda function is also returning the right data\n\t\t\t\t$this->assertEquals($lamda->name, $_user->name);\n\t\t\t\t$this->assertEquals($user, $lamda->name);\n\t\t\t\t$this->assertEquals($user, $_user->name);\n\t\t\t\t$this->assertEquals($lamda, $_user);\n\t\t\t}\n\t\t}",
"abstract protected function findOneBy(array $criteria);",
"public function test_findAggregation() {\n $data = $this->SampleSet->find('all', ['conditions' => ['set_code LIKE' => 'tn%']]);\n // One confidential and one old version have being filtered\n $this->assertEquals(1, count($data));\n $this->SampleSet->username = 'sub2';\n $data = $this->SampleSet->find('all', ['conditions' => ['set_code LIKE' => 'tn%']]);\n // The confidential one has nolonger being filtered\n $this->assertEquals(2, count($data));\n }",
"public abstract function find();",
"public function hasCriteria();",
"public function testDoCount() {\n\n $c = new Criteria();\n\n try\n {\n $this->assertEquals(2, $this->object->doCount($c));\n }catch (Exception $e)\n {\n throw $e;\n }\n\n }",
"public function byCriterion()\n {\n $mockCriterion = $this->getMock('stubCriterion');\n $mockCriterion->expects($this->any())->method('toSQL')->will($this->returnValue('example'));\n $mockResult = $this->getMock('stubDatabaseResult');\n $this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));\n $mockResult->expects($this->exactly(2))->method('count')->will($this->onConsecutiveCalls(0, 1));\n $data = $this->dbEraser->deleteByCriterion($this->mockConnection, $mockCriterion, new stubReflectionClass('MockNoTableAnnotationEntity'));\n $this->assertEquals(0, $data);\n $data = $this->dbEraser->deleteByCriterion($this->mockConnection, $mockCriterion, new stubReflectionClass('MockNoTableAnnotationEntity'));\n $this->assertEquals(1, $data);\n $this->assertEquals('MockNoTableAnnotationEntitys', $this->mockQueryBuilder->getDeleteTable());\n $this->assertEquals('example', $this->mockQueryBuilder->getDeleteCriterion()->toSQL());\n }",
"function testGetCriteria()\n {\n $criteria1 = $this->RubricsCriteria->getCriteria(1);\n // Compare result to fixture data\n $this->assertTrue(!empty($criteria1));\n $this->assertNotNull($criteria1);\n $this->assertEqual($criteria1[0]['RubricsCriteria']['criteria'],\n 'Participated in Team Meetings');\n $this->assertEqual($criteria1[1]['RubricsCriteria']['criteria'],\n 'Was Helpful and Co-operative');\n $this->assertEqual($criteria1[2]['RubricsCriteria']['criteria'],\n 'Submitted Work on Time');\n\n }",
"public function testProfilePrototypeFindByIdLikes()\n {\n\n }",
"public function match( $data );",
"public function testWhere() {\n\t\t$array = array(\n\t\t\tarray('a' => 1, 'b' => 'testing'),\n\t\t\tarray('a' => 2, 'b' => 'testing'),\n\t\t\tarray('a' => 3, 'b' => 'one'),\n\t\t\tarray('a' => 2, 'b' => 'two'),\n\t\t\tarray('a' => 4, 'b' => 'three'),\n\t\t);\n\t\t$result = _::where($array);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(0, $result);\n\n\t\t// test matching a single field in an array\n\t\t$result = _::where($array, array('b' => 'testing'));\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(2, $result);\n\t\t$this->assertEquals(1, $result[0]['a']);\n\t\t$this->assertEquals('testing', $result[0]['b']);\n\t\t$this->assertEquals(2, $result[1]['a']);\n\t\t$this->assertEquals('testing', $result[1]['b']);\n\n\t\t// test finding the first element by a single field in an array\n\t\t$result = _::where($array, array('b' => 'testing'), true);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(2, $result);\n\t\t$this->assertEquals(1, $result['a']);\n\t\t$this->assertEquals('testing', $result['b']);\n\n\t\t// test matching objects in an array\n\t\tforeach ($array as $i => $item) {\n\t\t\t$array[$i] = (object)$item;\n\t\t}\n\t\t$result = _::where($array, array('a' => 2));\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(2, $result);\n\t\t$this->assertEquals(2, $result[1]->a);\n\t\t$this->assertEquals('testing', $result[1]->b);\n\t\t$this->assertEquals(2, $result[3]->a);\n\t\t$this->assertEquals('two', $result[3]->b);\n\t}",
"abstract public function findBy($criteria);",
"public function testFind() {\n\t\t$array = array(1, 2, 3);\n\t\t$result = _::find($array, function($value) {\n\t\t\treturn (4 == $value);\n\t\t});\n\t\t$this->assertEquals(null, $result);\n\n\t\t// test finding an element\n\t\t$result = _::find($array, function($value) {\n\t\t\treturn (2 == $value);\n\t\t});\n\t\t$this->assertEquals(2, $result);\n\n\t\t// test finding the first element\n\t\t$result = _::find($array, function($value) {\n\t\t\treturn ($value % 2);\n\t\t});\n\t\t$this->assertEquals(1, $result);\n\t}",
"public function testOk() {\n\t\t$a = new Finder('bannane', ['KIWI', \"banane\"]);\n\n // on verifie que le test entree est égale à la variable\n $this->assertEquals('banane', $a->First());\n }",
"public function testSearchForProductByAttributeType()\n {\n // full results flag returns the full data set for the product\n }",
"public function GCheck (\\stdClass $param);",
"public function find(array $criteria);",
"function findPropertyBy(array $criteria);",
"function testPersonSearchByBoolean() {\n\t\t$this->setUrl('/search/advanced?r=per&q[per_can_call][value]=FALSE');\n\t\t$this->app->go();\n\t\t$this->assertPattern('/id=\"qb_per_can_call\"/', $this->view->output);\n\t\t$this->assertPattern('/<th>Can Call<\\/th>/', $this->view->output);\n\t\t$this->assertPattern('/<td><img src=\"\\/graphics\\/tactile\\/false.png\" alt=\"f\" \\/><\\/td>/', $this->view->output);\n\t\t$collection = $this->view->get('collection');\n\t\t$this->assertIsA($collection, 'Omelette_PersonCollection');\n\t\t$names = $collection->pluck('name');\n\t\t$this->assertEqual($names, array('Greg Jones', 'Simon Kamina'));\n\t}",
"public function byCriterionNonEntity()\n {\n $this->dbFinder->findByCriterion($this->mockConnection, $this->getMock('stubCriterion'), new stubReflectionClass('MockNoEntityAnnotationEntity'));\n }",
"static public function regExpFind($subject, $predicate, $object, $attrs=0, $limit=0, $haystack=false, $_recursion=0) {\r\n \r\n $subject=SimpleRdf::regExpFindPrepareInput($subject);\r\n $predicate=SimpleRdf::regExpFindPrepareInput($predicate);\r\n $object=SimpleRdf::regExpFindPrepareInput($object); \r\n\r\n // If RDF_RESOLVE_CONTAINER then it must match objects of container type even if the object pattern does not match...\r\n if ($attrs & RDF_RESOLVE_CONTAINER) {\r\n $object[]=NS_RDF.'Bag';\r\n $object[]=NS_RDF.'Seq'; \r\n $object[]=NS_RDF.'Alt';\r\n }\r\n \r\n // Find\r\n $return=array();\r\n $haystack=(is_array($haystack) ? $haystack : SimpleRdf::$statements);\r\n foreach($haystack as $id=>$statement) {\r\n if ($limit && count($return) >= $limit) {\r\n\tbreak;\r\n }\r\n \r\n // @todo Use === operator\r\n if (\r\n\t SimpleRdf::regExpFindMatch($subject, $statement->getSubject()->getValue()) &&\r\n\t SimpleRdf::regExpFindMatch($predicate, $statement->getPredicate()->getValue()) &&\r\n\t SimpleRdf::regExpFindMatch($object, $statement->getObject()->getValue())\t \r\n\t ) {\r\n\t$return[$id]=$statement;\r\n }\r\n }\r\n // echo \" [ found: \".count($return).\" ]\\n \";\r\n return SimpleRdf::findResolveAttributes($subject, $predicate, $object, $attrs, $limit, $return, $haystack, $_recursion);\r\n }",
"public function find();",
"abstract public function matches($object) : bool;",
"public function getResultAgainstMetric();",
"public function getInfo($criteria)\n {\n }",
"public function byCriterionOverruleLimitClause()\n {\n $mockCriterion = $this->getMock('stubCriterion');\n $mockCriterion->expects($this->any())->method('toSQL')->will($this->returnValue('example'));\n $mockResult = $this->getMock('stubDatabaseResult');\n $this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));\n $mockResult->expects($this->once())\n ->method('fetchAll')\n ->will($this->returnValue(array(array('bar' => 'Here is bar.', 'default' => 'And this is default.'))));\n $finderResult = $this->dbFinder->findByCriterion($this->mockConnection, $mockCriterion, new stubReflectionClass('MockSinglePrimaryKeyEntity'), null, 50, 10);\n $this->assertEquals(1, $finderResult->count());\n $data = $finderResult->current();\n $this->assertEquals('Here is bar.', $data->withAnnotation());\n $this->assertEquals('And this is default.', $data->withDefaultValue());\n $select = $this->mockQueryBuilder->getSelect();\n $this->assertEquals('foo', $select->getBaseTableName());\n $this->assertEquals('bar ASC', $select->getOrderedBy());\n $this->assertTrue($select->hasLimit());\n $this->assertEquals(50, $select->getOffset());\n $this->assertEquals(10, $select->getAmount());\n $this->assertTrue($select->hasCriterion());\n }",
"public function Search($objeto);",
"public function testResult() {\n\t\t$object = (object)array(\n\t\t\t'one' => 1,\n\t\t\t'two' => 2,\n\t\t\t'three' => function() {\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t);\n\t\t$result = _::result($object, 'one');\n\t\t$this->assertEquals(1, $result);\n\n\t\t// test getting the result a method on an object\n\t\t$result = _::result($object, 'three');\n\t\t$this->assertEquals(3, $result);\n\t}",
"function findPropertiesBy(array $criteria);",
"public function testQueryFetchObject() {\n $records = [];\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25], ['fetch' => \\PDO::FETCH_OBJ]);\n foreach ($result as $record) {\n $records[] = $record;\n $this->assertIsObject($record);\n $this->assertSame('John', $record->name);\n }\n\n $this->assertCount(1, $records, 'There is only one record.');\n }",
"function testFindSearchcontentSco() {\n\t}",
"public function canHandle($criterion): bool;",
"public function testFind()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}",
"public function find(callable $predicate): Maybe;",
"public function testHasInCacheSearch()\n {\n // save to cache\n $saveSearchCriteria = $this->searchCriteriaBuilder\n ->setContextName('cloud')\n ->setEntityName('customer')\n ->setFieldList(['id', 'name'])\n ->setIdName('id')\n ->build();\n\n $data = [['id' => 20, 'name' => 'Sergii']];\n\n $actualSave = $this->cacheManager->save($saveSearchCriteria, $data);\n $this->assertTrue($actualSave);\n\n // search\n $searchCriteria = $this->searchCriteriaBuilder\n ->setContextName('cloud')\n ->setEntityName('customer')\n ->setIdList([20, 21, 22])\n ->setFieldList(['id', 'name'])\n ->setIdName('id')\n ->build();\n\n $searchResult = $this->cacheManager->search($searchCriteria);\n $this->assertTrue($searchResult->hasData());\n $this->assertEquals(1, $searchResult->count());\n $this->assertCount(2, $searchResult->getMissedData());\n\n // validate result\n $resultData = $searchResult->getData();\n $iteratorResultData = new \\ArrayIterator($resultData);\n $iteratorData = new \\ArrayIterator($data);\n\n $multipleIterator = new \\MultipleIterator(\\MultipleIterator::MIT_NEED_ALL|\\MultipleIterator::MIT_KEYS_ASSOC);\n $multipleIterator->attachIterator($iteratorResultData, 'actual');\n $multipleIterator->attachIterator($iteratorData, 'expected');\n\n foreach($multipleIterator as $item) {\n $this->assertEquals($item['expected'], $item['actual']->get());\n }\n }",
"public function testProfilePrototypeFindByIdReviews()\n {\n\n }",
"public function getCriteria()\n {\n $this->assertEquals(array(), $this->denyValidator->getCriteria());\n }",
"public function find(array $conditions = []);",
"public function Search($criteria);",
"public function getPredicate();",
"public function testProfileFind()\n {\n\n }",
"public function testPDONewWhere()\n {\n $mod = Read::Factory($this->_table, $this->_db, \"MysqlPDO\");\n\n $where = [\n \"(\",\n\n \"(\",\n ['fend_test.`db`.user_id', 14],\n ['users.user_name', 'oak'],\n ['`users`.user_id', \">=\", 0],\n \")\",\n\n \"OR\",\n\n \"(\",\n ['`user_id`', \"<=\", 10000],\n ['user_id', \"like\", '57%'],\n \")\",\n\n \")\",\n\n \"OR\",\n\n ['user_id', \"in\", [1, 2, 3, 4, 5, 6]],\n\n \"OR\",\n\n \"(\",\n ['user_id', \"not in\", ['a', 'c', 'd', 'f']],\n \" `user_name` = 'yes' \",\n \")\",\n\n ];\n $mod->where($where);\n $sql = $mod->getSql();\n self::assertEquals('SELECT * FROM users WHERE ( ( `fend_test`.`db`.`user_id` = \\'14\\' AND `users`.`user_name` = \\'oak\\' AND `users`.`user_id` >= \\'0\\' ) OR ( `user_id` <= \\'10000\\' AND `user_id` like \\'57%\\' ) ) OR `user_id` in (\\'1\\',\\'2\\',\\'3\\',\\'4\\',\\'5\\',\\'6\\') OR ( `user_id` not in (\\'a\\',\\'c\\',\\'d\\',\\'f\\') AND `user_name` = \\'yes\\' ) ', $sql);\n\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n $make = Cars::where(\"make\"|\"id\",10);\n if ($make == \"ford\") {\n return true;\n }\n elseif ($make == \"honda\") {\n return true;\n }\n elseif ($make == \"toyota\") {\n return true;\n } else {\n return false;\n }\n }",
"public function testFindSum()\n {\n\n $json = Scraper::start();\n $array = json_decode($json, true);\n //print_r($array['total']);\n $input = $array['results'];\n $total = $array['total'];\n\n $sumFinder = new SumFinderClass($input);\n $this->assertEquals($total, $sumFinder->findSum());\n }",
"public function testConvertCriteria()\n {\n $api = $this->getApi();\n\n $result = $api->convertSimpleCriteria(array());\n $this->assertEquals(array(), $result);\n\n $result = $api->convertSimpleCriteria(array(array('field' => 'apiReference', 'value' => 'd')));\n $this->assertEquals(array(array('field' => 'apiReference', 'value' => 'd')), $result);\n\n $result = $api->convertSimpleCriteria(array('apiReference' => 'd'));\n $this->assertEquals(array(array('field' => 'api_reference', 'value' => 'd', 'criteria' => '=')), $result);\n\n $result = $api->convertSimpleCriteria(array('apiReference' => 'd'), 'like');\n $this->assertEquals(array(array('field' => 'api_reference', 'value' => 'd', 'criteria' => 'like')), $result);\n }",
"public function hasPredicateMatched(){\n return $this->_has(1);\n }",
"static public function wildcardFindFirst($subject, $predicate, $object, $attrs=0) {\r\n $found=array_shift(SimpleRdf::wildcardFind($subject, $predicate, $object, $attrs, 1));\r\n return $found;\r\n }",
"abstract public function findBy($attributes, $value);",
"function searchObject($object){\r\n\t\tif($this->getElem($object->value)!=null) return true;\r\n\t\t\telse false;\r\n\t}",
"public function testProfilePrototypeFindByIdGroups()\n {\n\n }",
"public function testCopyFindData() {\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyFindData(1),\n\t\t\t$this->expectedFromFixtures[0]\n\t\t);\n\t}",
"public function testGetLowStockByFilter()\n {\n }",
"public function testSearchBy(): void\n {\n// $model::query();\n }",
"public static function findOne($condition);",
"static public function wildcardFind($subject, $predicate, $object, $attrs=0, $limit=0, $haystack=false) {\r\n $subject=SimpleRdf::regExpFindPrepareInput($subject, 2);\r\n $predicate=SimpleRdf::regExpFindPrepareInput($predicate, 2);\r\n $object=SimpleRdf::regExpFindPrepareInput($object, 2); \r\n\r\n // die(\"wildcardFind($subject, $predicate, $object, $attrs=0, $limit=0);\");\r\n return SimpleRdf::regExpFind($subject, $predicate, $object, $attrs, $limit, $haystack);\r\n }",
"public function getItemsCriteria() {}",
"public function getItemsCriteria() {}",
"public function testQuarantineFindOne()\n {\n\n }",
"public function testProfilePrototypeFindByIdQuarantines()\n {\n\n }",
"function testPartialSearch(): void\n {\n // Serpico\n // https://imdb.com/find?s=all&q=serpico\n\n $data = engineSearch('Serpico', 'imdb');\n // $this->printData($data);\n\n foreach ($data as $item) {\n $t = strip_tags($item['title']);\n $this->assertEquals($item['title'], $t);\n }\n }",
"public abstract function getCriteriaFrom($criteria);",
"static public function regExpFindFirst($subject, $predicate, $object, $attrs=0, $haystack=false) {\r\n $found=array_shift(SimpleRdf::regExpFind($subject, $predicate, $object, $attrs, 1, $haystack));\r\n return $found;\r\n }",
"public function testFind()\n {\n $data = array('id' => 1, 'username' => 'root', 'password' => 'password');\n $mockPDO = $this->getMock('\\\\PDOMock', array('fetchOne'));\n $mockPDO\n ->expects($this->once())\n ->method('fetchOne')\n ->will($this->returnCallback(function($arg1, $arg2) use ($data) {\n $sql = 'SELECT\n *\nFROM\n `users`\nWHERE\n id = :id\nORDER BY\n id ASC';\n\n if($arg1 == $sql && $arg2 == array('id' => 1)) {\n return $data;\n } else {\n return array();\n }\n }))\n ;\n $storage = new AuraExtendedPdo($mockPDO, new QueryFactory('mysql'));\n $result = $storage->find(array('id' => 1), 'users');\n\n $this->assertEquals($data['id'], $result['id']);\n $this->assertEquals($data['username'], $result['username']);\n $this->assertEquals($data['password'], $result['password']);\n }",
"function get_criterion($ad_group_id, $criterion_id) {\n\n $selector = $this->__criteria_selector_ids(\n array(array('ad_group_id' => $ad_group_id,\n 'criterion_id' => $criterion_id)));\n\n $result = $this->__do_get('AdGroupCriterionService', $selector);\n\n if (!isset($result['entries']))\n return false;\n\n return $result['entries'][0];\n\n}",
"function findFirstMatchingStatement($subject, $predicate, $object, $offset = 0) \r\n\t{\r\n\t\t//Call the _infFind method, but let it stop, if it finds the \r\n\t\t//first match.\t\r\n\t \t$res= $this->_infFind($subject,$predicate,$object,array(),true,$offset);\r\n\t \t\t\r\n\t\tif (isset($res[$offset]))\r\n\t\t{\r\n\t\t\treturn $res[$offset];\r\n\t\t} else \r\n\t\t{\r\n\t\t\treturn NULL;\r\n\t\t};\r\n\t}",
"public function findBy($criteria);",
"public function findBy($criteria);",
"abstract protected function getWhereForRow($data);",
"public function testCanGetDatasetByTitleAndOptionallyByAccountAndProject() {\n AuthenticationHelper::login(\"[email protected]\", \"password\");\n\n $topLevel = new DatasetInstanceSummary(\"Top Level Dataset\", \"test-json\");\n $topLevelId = $this->datasetService->saveDataSetInstance($topLevel, null, null);\n\n $account1 = new DatasetInstanceSummary(\"Account Dataset 1\", \"test-json\");\n $account1Id = $this->datasetService->saveDataSetInstance($account1, null, 1);\n\n $account2 = new DatasetInstanceSummary(\"Account Dataset 2\", \"test-json\");\n $account2Id = $this->datasetService->saveDataSetInstance($account2, null, 2);\n\n $project1 = new DatasetInstanceSummary(\"Project Dataset 1\", \"test-json\");\n $project1Id = $this->datasetService->saveDataSetInstance($project1, \"soapSuds\", 2);\n\n $project2 = new DatasetInstanceSummary(\"Project Dataset 2\", \"test-json\");\n $project2Id = $this->datasetService->saveDataSetInstance($project2, \"wiperBlades\", 2);\n\n $this->assertEquals($this->datasetService->getDataSetInstance($topLevelId), $this->datasetService->getDataSetInstanceByTitle(\"Top Level Dataset\", null, null));\n $this->assertEquals($this->datasetService->getDataSetInstance($account1Id), $this->datasetService->getDataSetInstanceByTitle(\"Account Dataset 1\", null, 1));\n $this->assertEquals($this->datasetService->getDataSetInstance($account2Id), $this->datasetService->getDataSetInstanceByTitle(\"Account Dataset 2\", null, 2));\n $this->assertEquals($this->datasetService->getDataSetInstance($project1Id), $this->datasetService->getDataSetInstanceByTitle(\"Project Dataset 1\", \"soapSuds\", 2));\n $this->assertEquals($this->datasetService->getDataSetInstance($project2Id), $this->datasetService->getDataSetInstanceByTitle(\"Project Dataset 2\", \"wiperBlades\", 2));\n\n\n }",
"public function find($object) {\r\n $oReflectionClass = new ReflectionClass($object);\r\n //$properties = $oReflectionClass->getProperties(ReflectionProperty::IS_PUBLIC);\r\n $properties = $oReflectionClass->getProperties();\r\n $this->className = $class = $oReflectionClass->getName();\r\n\r\n foreach ($properties as $key => $reflectionProperty)\r\n $datos_where[$reflectionProperty->getName()] = $reflectionProperty->getValue($object);\r\n $this->setList(null);\r\n $this->setObject(null);\r\n $table = $this->table = CriteriaEntityMgr::instance()->findTable($this->className);\r\n $this->SQL = MySQL_DB::instance()->DBSQLSelect($table, null, $datos_where, $this->array_order, $this->type_order);\r\n $this->execute();\r\n $list = array();\r\n if($this->getNumRows() == 1) {\r\n $row = MySQL_DB::instance()->DBFetchArray($this->result);\r\n $object = $this->iterateProperty($class, $object, $row, $properties);\r\n $this->setObject($object);\r\n $list[] = $object;\r\n }\r\n if($this->getNumRows() > 1) {\r\n while ($row = MySQL_DB::instance()->DBFetchArray($this->result)) {\r\n $object_new = $oReflectionClass->newInstance($oReflectionClass);\r\n $object_new = $this->iterateProperty($class, $object_new, $row, $properties);\r\n $list[] = $object_new;\r\n }\r\n }\r\n $this->setList($list);\r\n return $this;\r\n }",
"public function testCanGetFilteredDatasetsForAccountsOptionallyFilteredByProjectAndTagAndCategories() {\n AuthenticationHelper::login(\"[email protected]\", \"password\");\n\n\n $categories = [\n new CategorySummary(\"Account1\", \"An account wide category available to account 1\", \"account1\")\n ];\n $this->metaDataService->returnValue(\"getObjectCategoriesFromSummaries\", [\n new ObjectCategory(new Category(new CategorySummary(\"Account 1\", \"Account 1\", \"account1\"), 1)),\n ], [\n $categories, 1, null\n ]);\n\n\n $accountDataSet = new DatasetInstanceSummary(\"Account Dataset\", \"test-json\", null, [], [], [], null, null, $categories);\n $this->datasetService->saveDataSetInstance($accountDataSet, null, 1);\n\n $accountDataSet = new DatasetInstanceSummary(\"Second Account Dataset\", \"test-json\");\n $this->datasetService->saveDataSetInstance($accountDataSet, null, 1);\n\n\n $datasetProject = new Project(\"Dataset Project\", 1, \"datasetProject\");\n $datasetProject->save();\n\n $this->metaDataService->returnValue(\"getObjectTagsFromSummaries\", [\n new ObjectTag(new Tag(new TagSummary(\"Special\", \"Special Tag\", \"special\"), 1, \"datasetProject\")),\n new ObjectTag(new Tag(new TagSummary(\"General\", \"General Tag\", \"general\"), 1, \"datasetProject\"))\n ], [\n [\n new TagSummary(\"Special\", \"\", \"special\"),\n new TagSummary(\"General\", \"\", \"general\")\n ], 1, \"datasetProject\"\n ]);\n\n $this->metaDataService->returnValue(\"getObjectTagsFromSummaries\", [\n new ObjectTag(new Tag(new TagSummary(\"General\", \"General Tag\", \"general\"), 1, \"datasetProject\"))\n ], [\n [\n new TagSummary(\"General\", \"\", \"general\")\n ], 1, \"datasetProject\"\n ]);\n\n\n $projectDataSet = new DatasetInstanceSummary(\"Project Dataset\", \"test-json\");\n $projectDataSet->setTags([\n new TagSummary(\"Special\", \"\", \"special\"),\n new TagSummary(\"General\", \"\", \"general\")\n ]);\n $this->datasetService->saveDataSetInstance($projectDataSet, \"datasetProject\", 1);\n\n $projectDataSet = new DatasetInstanceSummary(\"Second Project Dataset\", \"test-json\");\n $projectDataSet->setTags([\n new TagSummary(\"General\", \"\", \"general\")\n ]);\n $this->datasetService->saveDataSetInstance($projectDataSet, \"datasetProject\", 1);\n\n\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [], null, 0, 10, 1);\n $this->assertEquals(4, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Account Dataset\", $filtered[0]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[1]);\n $this->assertEquals(\"Project Dataset\", $filtered[1]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[2]);\n $this->assertEquals(\"Second Account Dataset\", $filtered[2]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[3]);\n $this->assertEquals(\"Second Project Dataset\", $filtered[3]->getTitle());\n\n\n // Filter on title\n $filtered = $this->datasetService->filterDataSetInstances(\"econd\", [], [], null, 0, 10, 1);\n $this->assertEquals(2, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Second Account Dataset\", $filtered[0]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[1]);\n $this->assertEquals(\"Second Project Dataset\", $filtered[1]->getTitle());\n\n\n // Filter on categories\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [\"account1\"], [], null, 0, 10, 1);\n $this->assertEquals(1, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Account Dataset\", $filtered[0]->getTitle());\n\n // Filter on project key\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [], \"datasetProject\", 0, 10, 1);\n $this->assertEquals(2, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Project Dataset\", $filtered[0]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[1]);\n $this->assertEquals(\"Second Project Dataset\", $filtered[1]->getTitle());\n\n // Filter on tags\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [\"general\"], \"datasetProject\", 0, 10, 1);\n $this->assertEquals(2, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Project Dataset\", $filtered[0]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[1]);\n $this->assertEquals(\"Second Project Dataset\", $filtered[1]->getTitle());\n\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [\"special\"], \"datasetProject\", 0, 10, 1);\n $this->assertEquals(1, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Project Dataset\", $filtered[0]->getTitle());\n\n // Filter on special NONE tags\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [\"NONE\"], null, 0, 10, 1);\n $this->assertEquals(2, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Account Dataset\", $filtered[0]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[1]);\n $this->assertEquals(\"Second Account Dataset\", $filtered[1]->getTitle());\n\n // Offsets and limits\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [\"general\"], \"datasetProject\", 0, 1, 1);\n $this->assertEquals(1, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Project Dataset\", $filtered[0]->getTitle());\n\n\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [\"general\"], \"datasetProject\", 1, 10, 1);\n $this->assertEquals(1, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Second Project Dataset\", $filtered[0]->getTitle());\n\n\n }",
"public function findOneBy($criteria);",
"public function testDatabaseSearch()\n {\n \t//finding Bowen in database (first seeded user)\n $this->seeInDatabase('users',['firstName'=>'Bowen','email'=>'[email protected]','admin'=>1]);\n\n //finding Hiroko in database (last seeded user)\n $this->seeInDatabase('users',['firstName'=>'Hiroko','email'=>'[email protected]','admin'=>1]);\n\n //check that dummy user is NOT in database\n $this->notSeeInDatabase('users',['firstName'=>'Jon Bon Jovi']);\n\n\t\t//find first Category in the database\n\t\t$this->seeInDatabase('Category',['name'=>'Physics']);\n\t\t\n //find last Category in the database\n $this->seeInDatabase('Category',['name'=>'Other']);\n\n }",
"public function test_findConfidential() {\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(0, count($data));\n $this->SampleSet->username = 'sub2';\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(1, count($data));\n $this->assertEquals(2, $data[0]['SampleSet']['id']);\n $this->SampleSet->username = 'chem2';\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(1, count($data));\n $this->assertEquals(2, $data[0]['SampleSet']['id']);\n }",
"public abstract function getCriteriaWhere($criteria);",
"public function planFindByField($field,$condition,$value,$orderBy= 'asc');",
"public function _testConstructorConditions($di)\n\t{\n\t\t// ------------- test for setters(classic) way ----------------\n\n\t\t$standardSelectBuilder = new SelectBuilder();\n\t\t$standardSelectBuilder->from('Robots')\n\t\t\t->where(\n\t\t\t\t\"year > :min: AND year < :max:\",\n\t\t\t\tarray(\"min\" => '2013-01-01', 'max' => '2100-01-01'),\n\t\t\t\tarray(\"min\" => PDO::PARAM_STR, 'max' => PDO::PARAM_STR)\n\t\t\t);\n\n\t\t$standardResult = $standardSelectBuilder->getQuery()->execute();\n\n\t\t// --------------- test for single condition ------------------\n\t\t$params = array(\n\t\t\t'models' => 'Robots',\n\t\t\t'conditions' => array(\n\t\t\t\tarray(\n\t\t\t\t\t\"year > :min: AND year < :max:\",\n\t\t\t\t\tarray(\"min\" => '2013-01-01', 'max' => '2100-01-01'),\n\t\t\t\t\tarray(\"min\" => PDO::PARAM_STR, 'max' => PDO::PARAM_STR),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$builderWithSingleCondition = new SelectBuilder($params);\n\t\t$singleConditionResult = $builderWithSingleCondition->getQuery()->execute();\n\n\t\t// ------------- test for multiple conditions ----------------\n\n\t\t$params = array(\n\t\t\t'models' => 'Robots',\n\t\t\t'conditions' => array(\n\t\t\t\tarray(\n\t\t\t\t\t\"year > :min:\",\n\t\t\t\t\tarray(\"min\" => '2000-01-01'),\n\t\t\t\t\tarray(\"min\" => PDO::PARAM_STR),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t\"year < :max:\",\n\t\t\t\t\tarray('max' => '2100-01-01'),\n\t\t\t\t\tarray(\"max\" => PDO::PARAM_STR),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t// conditions are merged!\n\t\t$builderMultipleConditions = new SelectBuilder($params);\n\t\t$multipleConditionResult = $builderMultipleConditions->getQuery()->execute();\n\n\t\t$expectedPhql = \"SELECT [Robots].* FROM [Robots] \"\n\t\t\t. \"WHERE year > :min: AND year < :max:\";\n\n\t\t/* ------------ ASSERTING --------- */\n\n\t\t$this->assertEquals($expectedPhql, $standardSelectBuilder->getPhql());\n\t\t$this->assertInstanceOf(\"Phalcon\\Mvc\\Model\\Resultset\\Simple\", $standardResult);\n\n\t\t$this->assertEquals($expectedPhql, $builderWithSingleCondition->getPhql());\n\t\t$this->assertInstanceOf(\"Phalcon\\Mvc\\Model\\Resultset\\Simple\", $singleConditionResult);\n\n\t\t$this->assertEquals($expectedPhql, $builderMultipleConditions->getPhql());\n\t\t$this->assertInstanceOf(\"Phalcon\\Mvc\\Model\\Resultset\\Simple\", $multipleConditionResult);\n }",
"public function testSearch() {\n\t\t$temaBusqueda = new Tema;\n\t\t$temaBusqueda->nombre = 'Queja';\n\t\t$temas = $temaBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $temas ), 1 );\n\t}",
"abstract protected function _doContains($id);",
"public function testFindByQWithLimit()\n {\n $dataLoader = $this->getDataLoader();\n $all = $dataLoader->getAll();\n $filters = ['q' => $all[0]['name'], 'limit' => 1];\n $this->filterTest($filters, [$all[0]]);\n $filters = ['q' => 'desc', 'limit' => 2];\n $this->filterTest($filters, [$all[0], $all[1]]);\n }",
"public function testFindByIdIsSuccess()\n {\n $tblGateMock = $this->getMockBuilder(TableGateway::class)\n ->setConstructorArgs(array($this->getDbal()))\n ->setMethodsExcept(['findById', 'setTable'])\n ->getMock();\n $tblGateMock->setTable('Person');\n\n //exercise SUT\n $row = $tblGateMock->findById($this->person['id']);\n\n //assert return value\n $this->assertTrue(is_array($row), 'result not array');\n $this->assertNotEmpty($row, 'result set is empty');\n\n foreach(array_keys($this->person) as $key) {\n $this->assertArrayHasKey($key, $row[0]);\n $this->assertEquals($this->person[$key], $row[0][$key]);\n }\n }",
"public function findBy($value);",
"public function getCriteria()\n {\n $equalValidator = new stubEqualValidator(5);\n $this->assertEquals(array('expected' => 5), $equalValidator->getCriteria());\n \n $equalValidator = new stubEqualValidator('foo');\n $this->assertEquals(array('expected' => 'foo'), $equalValidator->getCriteria());\n \n $equalValidator = new stubEqualValidator(true);\n $this->assertEquals(array('expected' => true), $equalValidator->getCriteria());\n \n $equalValidator = new stubEqualValidator(false);\n $this->assertEquals(array('expected' => false), $equalValidator->getCriteria());\n \n $equalValidator = new stubEqualValidator(null);\n $this->assertEquals(array('expected' => null), $equalValidator->getCriteria());\n }"
] | [
"0.6125974",
"0.57594967",
"0.5737834",
"0.5663683",
"0.5638742",
"0.5592787",
"0.5589237",
"0.55706584",
"0.5555321",
"0.55334795",
"0.55194634",
"0.5481652",
"0.5456586",
"0.5441099",
"0.5437106",
"0.5410632",
"0.5400165",
"0.539853",
"0.5375005",
"0.53451425",
"0.5343051",
"0.53414845",
"0.52842605",
"0.5275962",
"0.52753294",
"0.52688646",
"0.52677244",
"0.52652586",
"0.52596354",
"0.5240909",
"0.5229312",
"0.5206772",
"0.5206017",
"0.51957744",
"0.5194825",
"0.5193988",
"0.5173014",
"0.5165956",
"0.5148616",
"0.514133",
"0.51282346",
"0.5106399",
"0.51030034",
"0.50922763",
"0.50852704",
"0.5085065",
"0.50749725",
"0.5074675",
"0.5068257",
"0.5048102",
"0.50411695",
"0.5036357",
"0.5018377",
"0.5005264",
"0.5001765",
"0.49954933",
"0.49904585",
"0.49855968",
"0.498532",
"0.49657005",
"0.4962077",
"0.49605912",
"0.495592",
"0.49433947",
"0.49376595",
"0.4935846",
"0.4935238",
"0.49334687",
"0.49307537",
"0.4923002",
"0.49159855",
"0.490904",
"0.49087363",
"0.49074328",
"0.49034548",
"0.4901448",
"0.48987794",
"0.48920485",
"0.48904753",
"0.4889349",
"0.48867267",
"0.48816335",
"0.48741814",
"0.48741814",
"0.48692095",
"0.48667175",
"0.48660648",
"0.4864508",
"0.48612514",
"0.48587662",
"0.48542202",
"0.48498255",
"0.48479542",
"0.4847169",
"0.48463038",
"0.48450822",
"0.48443204",
"0.48409063",
"0.48359853",
"0.48304197"
] | 0.62691027 | 0 |
test that finding data of an object with a criterion works as expected | public function byCriterionOverruleOrderBy()
{
$mockCriterion = $this->getMock('stubCriterion');
$mockCriterion->expects($this->any())->method('toSQL')->will($this->returnValue('example'));
$mockResult = $this->getMock('stubDatabaseResult');
$this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));
$mockResult->expects($this->once())
->method('fetchAll')
->will($this->returnValue(array(array('bar' => 'Here is bar.', 'default' => 'And this is default.'))));
$finderResult = $this->dbFinder->findByCriterion($this->mockConnection, $mockCriterion, new stubReflectionClass('MockSinglePrimaryKeyEntity'), 'blub DESC');
$this->assertEquals(1, $finderResult->count());
$data = $finderResult->current();
$this->assertEquals('Here is bar.', $data->withAnnotation());
$this->assertEquals('And this is default.', $data->withDefaultValue());
$select = $this->mockQueryBuilder->getSelect();
$this->assertEquals('foo', $select->getBaseTableName());
$this->assertEquals('blub DESC', $select->getOrderedBy());
$this->assertFalse($select->hasLimit());
$this->assertNull($select->getOffset());
$this->assertNull($select->getAmount());
$this->assertTrue($select->hasCriterion());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function byCriterion()\n {\n $mockCriterion = $this->getMock('stubCriterion');\n $mockCriterion->expects($this->any())->method('toSQL')->will($this->returnValue('example'));\n $mockResult = $this->getMock('stubDatabaseResult');\n $this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));\n $mockResult->expects($this->exactly(2))\n ->method('fetchAll')\n ->will($this->onConsecutiveCalls(false, array(array('bar' => 'Here is bar.', 'default' => 'And this is default.'))));\n $finderResult = $this->dbFinder->findByCriterion($this->mockConnection, $mockCriterion, new stubReflectionClass('MockSinglePrimaryKeyEntity'));\n $this->assertEquals(0, $finderResult->count());\n $finderResult = $this->dbFinder->findByCriterion($this->mockConnection, $mockCriterion, new stubReflectionClass('MockSinglePrimaryKeyEntity'));\n $this->assertEquals(1, $finderResult->count());\n $data = $finderResult->current();\n $this->assertEquals('Here is bar.', $data->withAnnotation());\n $this->assertEquals('And this is default.', $data->withDefaultValue());\n $select = $this->mockQueryBuilder->getSelect();\n $this->assertEquals('foo', $select->getBaseTableName());\n $this->assertEquals('bar ASC', $select->getOrderedBy());\n $this->assertTrue($select->hasCriterion());\n }",
"public function testFind()\n {\n $this->assertEquals(1, $this->object->find(function ($item) {\n return $item === 2;\n })->count());\n $this->assertEquals(2, $this->object->find(function ($item) {\n return $item % 2;\n })->count());\n }",
"public function testFindFirst()\n {\n $this->assertEquals(2, $this->object->findFirst(function ($item) {\n return $item === 2;\n }));\n $this->assertEquals(1, $this->object->findFirst(function ($item) {\n return $item % 2;\n }));\n }",
"public function matching(Criteria $criteria);",
"public function testFindWhere() {\n\t\t$array = array(\n\t\t\tarray('a' => 1, 'b' => 'testing'),\n\t\t\tarray('a' => 2, 'b' => 'testing'),\n\t\t\tarray('a' => 3, 'b' => 'one'),\n\t\t\tarray('a' => 2, 'b' => 'two'),\n\t\t\tarray('a' => 4, 'b' => 'three'),\n\t\t);\n\t\t$result = _::findWhere($array, array('b' => 'testing'), true);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(2, $result);\n\t\t$this->assertEquals(1, $result['a']);\n\t\t$this->assertEquals('testing', $result['b']);\n\t}",
"public function testSearchForProductByAttribute()\n {\n // full results flag returns the full data set for the product\n }",
"public function matching(Criteria $criteria)\n {\n }",
"public function find($data);",
"public function testObjectResult()\n {\n $result = $this->searchResult->objectResult();\n\n $this->assertObjectHasAttribute('results', $result);\n $this->assertObjectHasAttribute('status', $result);\n }",
"public function testQuery(\\Jazzee\\Entity\\Answer $answer, \\stdClass $obj);",
"public function find($obj){\n\t}",
"public abstract function findOperationBy(array $criteria);",
"public function getCriteria();",
"public function testQuarantineFind()\n {\n\n }",
"public function testSearch() {\n\t\t$operacionBusqueda = new Operacion;\n\t\t$operacionBusqueda->nombre = 'Radicado';\n\t\t$operacions = $operacionBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $operacions ), 1 );\n\t}",
"public function testPredicate()\n {\n $this->persistToursLambert93(false);\n $pointO = $this->persistPointO();\n $this->persistPointA();\n $this->persistPointB();\n\n $query = $this->getEntityManager()->createQuery(\n // phpcs:disable Generic.Files.LineLength.MaxExceeded\n 'SELECT p FROM LongitudeOne\\Spatial\\Tests\\Fixtures\\PointEntity p WHERE ST_EQUALS(p.point, ST_Point(:x, :y)) = true'\n // phpcs:enable\n );\n $query->setParameter('x', 0, 'integer');\n $query->setParameter('y', 0, 'integer');\n\n $result = $query->getResult();\n\n static::assertCount(1, $result);\n static::assertEquals($pointO, $result[0]);\n }",
"public abstract function findHolderBy(array $criteria);",
"static public function findFirst($subject, $predicate, $object, $attrs=0) {\r\n $found=array_shift(SimpleRdf::find($subject, $predicate, $object, $attrs, 1));\r\n return $found;\r\n }",
"public function testFindBy() {\n\t\t\tforeach($this->users as $user) {\n\t\t\t\t$_user = User::find_by(array('conditions' => \"name = '\" . $user . \"'\"));\n\t\t\t\t$lamda = call_user_func(strtolower($user));\n\t\t\t\t//lots of redudent checking here to make sure the lamda function is also returning the right data\n\t\t\t\t$this->assertEquals($lamda->name, $_user->name);\n\t\t\t\t$this->assertEquals($user, $lamda->name);\n\t\t\t\t$this->assertEquals($user, $_user->name);\n\t\t\t\t$this->assertEquals($lamda, $_user);\n\t\t\t}\n\t\t}",
"abstract protected function findOneBy(array $criteria);",
"public function test_findAggregation() {\n $data = $this->SampleSet->find('all', ['conditions' => ['set_code LIKE' => 'tn%']]);\n // One confidential and one old version have being filtered\n $this->assertEquals(1, count($data));\n $this->SampleSet->username = 'sub2';\n $data = $this->SampleSet->find('all', ['conditions' => ['set_code LIKE' => 'tn%']]);\n // The confidential one has nolonger being filtered\n $this->assertEquals(2, count($data));\n }",
"public function hasCriteria();",
"public abstract function find();",
"public function testDoCount() {\n\n $c = new Criteria();\n\n try\n {\n $this->assertEquals(2, $this->object->doCount($c));\n }catch (Exception $e)\n {\n throw $e;\n }\n\n }",
"public function byCriterion()\n {\n $mockCriterion = $this->getMock('stubCriterion');\n $mockCriterion->expects($this->any())->method('toSQL')->will($this->returnValue('example'));\n $mockResult = $this->getMock('stubDatabaseResult');\n $this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));\n $mockResult->expects($this->exactly(2))->method('count')->will($this->onConsecutiveCalls(0, 1));\n $data = $this->dbEraser->deleteByCriterion($this->mockConnection, $mockCriterion, new stubReflectionClass('MockNoTableAnnotationEntity'));\n $this->assertEquals(0, $data);\n $data = $this->dbEraser->deleteByCriterion($this->mockConnection, $mockCriterion, new stubReflectionClass('MockNoTableAnnotationEntity'));\n $this->assertEquals(1, $data);\n $this->assertEquals('MockNoTableAnnotationEntitys', $this->mockQueryBuilder->getDeleteTable());\n $this->assertEquals('example', $this->mockQueryBuilder->getDeleteCriterion()->toSQL());\n }",
"function testGetCriteria()\n {\n $criteria1 = $this->RubricsCriteria->getCriteria(1);\n // Compare result to fixture data\n $this->assertTrue(!empty($criteria1));\n $this->assertNotNull($criteria1);\n $this->assertEqual($criteria1[0]['RubricsCriteria']['criteria'],\n 'Participated in Team Meetings');\n $this->assertEqual($criteria1[1]['RubricsCriteria']['criteria'],\n 'Was Helpful and Co-operative');\n $this->assertEqual($criteria1[2]['RubricsCriteria']['criteria'],\n 'Submitted Work on Time');\n\n }",
"public function testProfilePrototypeFindByIdLikes()\n {\n\n }",
"public function match( $data );",
"public function testWhere() {\n\t\t$array = array(\n\t\t\tarray('a' => 1, 'b' => 'testing'),\n\t\t\tarray('a' => 2, 'b' => 'testing'),\n\t\t\tarray('a' => 3, 'b' => 'one'),\n\t\t\tarray('a' => 2, 'b' => 'two'),\n\t\t\tarray('a' => 4, 'b' => 'three'),\n\t\t);\n\t\t$result = _::where($array);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(0, $result);\n\n\t\t// test matching a single field in an array\n\t\t$result = _::where($array, array('b' => 'testing'));\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(2, $result);\n\t\t$this->assertEquals(1, $result[0]['a']);\n\t\t$this->assertEquals('testing', $result[0]['b']);\n\t\t$this->assertEquals(2, $result[1]['a']);\n\t\t$this->assertEquals('testing', $result[1]['b']);\n\n\t\t// test finding the first element by a single field in an array\n\t\t$result = _::where($array, array('b' => 'testing'), true);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(2, $result);\n\t\t$this->assertEquals(1, $result['a']);\n\t\t$this->assertEquals('testing', $result['b']);\n\n\t\t// test matching objects in an array\n\t\tforeach ($array as $i => $item) {\n\t\t\t$array[$i] = (object)$item;\n\t\t}\n\t\t$result = _::where($array, array('a' => 2));\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(2, $result);\n\t\t$this->assertEquals(2, $result[1]->a);\n\t\t$this->assertEquals('testing', $result[1]->b);\n\t\t$this->assertEquals(2, $result[3]->a);\n\t\t$this->assertEquals('two', $result[3]->b);\n\t}",
"abstract public function findBy($criteria);",
"public function testFind() {\n\t\t$array = array(1, 2, 3);\n\t\t$result = _::find($array, function($value) {\n\t\t\treturn (4 == $value);\n\t\t});\n\t\t$this->assertEquals(null, $result);\n\n\t\t// test finding an element\n\t\t$result = _::find($array, function($value) {\n\t\t\treturn (2 == $value);\n\t\t});\n\t\t$this->assertEquals(2, $result);\n\n\t\t// test finding the first element\n\t\t$result = _::find($array, function($value) {\n\t\t\treturn ($value % 2);\n\t\t});\n\t\t$this->assertEquals(1, $result);\n\t}",
"public function testOk() {\n\t\t$a = new Finder('bannane', ['KIWI', \"banane\"]);\n\n // on verifie que le test entree est égale à la variable\n $this->assertEquals('banane', $a->First());\n }",
"public function testSearchForProductByAttributeType()\n {\n // full results flag returns the full data set for the product\n }",
"public function GCheck (\\stdClass $param);",
"function testPersonSearchByBoolean() {\n\t\t$this->setUrl('/search/advanced?r=per&q[per_can_call][value]=FALSE');\n\t\t$this->app->go();\n\t\t$this->assertPattern('/id=\"qb_per_can_call\"/', $this->view->output);\n\t\t$this->assertPattern('/<th>Can Call<\\/th>/', $this->view->output);\n\t\t$this->assertPattern('/<td><img src=\"\\/graphics\\/tactile\\/false.png\" alt=\"f\" \\/><\\/td>/', $this->view->output);\n\t\t$collection = $this->view->get('collection');\n\t\t$this->assertIsA($collection, 'Omelette_PersonCollection');\n\t\t$names = $collection->pluck('name');\n\t\t$this->assertEqual($names, array('Greg Jones', 'Simon Kamina'));\n\t}",
"public function find(array $criteria);",
"function findPropertyBy(array $criteria);",
"public function byCriterionNonEntity()\n {\n $this->dbFinder->findByCriterion($this->mockConnection, $this->getMock('stubCriterion'), new stubReflectionClass('MockNoEntityAnnotationEntity'));\n }",
"static public function regExpFind($subject, $predicate, $object, $attrs=0, $limit=0, $haystack=false, $_recursion=0) {\r\n \r\n $subject=SimpleRdf::regExpFindPrepareInput($subject);\r\n $predicate=SimpleRdf::regExpFindPrepareInput($predicate);\r\n $object=SimpleRdf::regExpFindPrepareInput($object); \r\n\r\n // If RDF_RESOLVE_CONTAINER then it must match objects of container type even if the object pattern does not match...\r\n if ($attrs & RDF_RESOLVE_CONTAINER) {\r\n $object[]=NS_RDF.'Bag';\r\n $object[]=NS_RDF.'Seq'; \r\n $object[]=NS_RDF.'Alt';\r\n }\r\n \r\n // Find\r\n $return=array();\r\n $haystack=(is_array($haystack) ? $haystack : SimpleRdf::$statements);\r\n foreach($haystack as $id=>$statement) {\r\n if ($limit && count($return) >= $limit) {\r\n\tbreak;\r\n }\r\n \r\n // @todo Use === operator\r\n if (\r\n\t SimpleRdf::regExpFindMatch($subject, $statement->getSubject()->getValue()) &&\r\n\t SimpleRdf::regExpFindMatch($predicate, $statement->getPredicate()->getValue()) &&\r\n\t SimpleRdf::regExpFindMatch($object, $statement->getObject()->getValue())\t \r\n\t ) {\r\n\t$return[$id]=$statement;\r\n }\r\n }\r\n // echo \" [ found: \".count($return).\" ]\\n \";\r\n return SimpleRdf::findResolveAttributes($subject, $predicate, $object, $attrs, $limit, $return, $haystack, $_recursion);\r\n }",
"public function find();",
"abstract public function matches($object) : bool;",
"public function getResultAgainstMetric();",
"public function getInfo($criteria)\n {\n }",
"public function byCriterionOverruleLimitClause()\n {\n $mockCriterion = $this->getMock('stubCriterion');\n $mockCriterion->expects($this->any())->method('toSQL')->will($this->returnValue('example'));\n $mockResult = $this->getMock('stubDatabaseResult');\n $this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));\n $mockResult->expects($this->once())\n ->method('fetchAll')\n ->will($this->returnValue(array(array('bar' => 'Here is bar.', 'default' => 'And this is default.'))));\n $finderResult = $this->dbFinder->findByCriterion($this->mockConnection, $mockCriterion, new stubReflectionClass('MockSinglePrimaryKeyEntity'), null, 50, 10);\n $this->assertEquals(1, $finderResult->count());\n $data = $finderResult->current();\n $this->assertEquals('Here is bar.', $data->withAnnotation());\n $this->assertEquals('And this is default.', $data->withDefaultValue());\n $select = $this->mockQueryBuilder->getSelect();\n $this->assertEquals('foo', $select->getBaseTableName());\n $this->assertEquals('bar ASC', $select->getOrderedBy());\n $this->assertTrue($select->hasLimit());\n $this->assertEquals(50, $select->getOffset());\n $this->assertEquals(10, $select->getAmount());\n $this->assertTrue($select->hasCriterion());\n }",
"public function Search($objeto);",
"public function testResult() {\n\t\t$object = (object)array(\n\t\t\t'one' => 1,\n\t\t\t'two' => 2,\n\t\t\t'three' => function() {\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t);\n\t\t$result = _::result($object, 'one');\n\t\t$this->assertEquals(1, $result);\n\n\t\t// test getting the result a method on an object\n\t\t$result = _::result($object, 'three');\n\t\t$this->assertEquals(3, $result);\n\t}",
"function findPropertiesBy(array $criteria);",
"public function testQueryFetchObject() {\n $records = [];\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25], ['fetch' => \\PDO::FETCH_OBJ]);\n foreach ($result as $record) {\n $records[] = $record;\n $this->assertIsObject($record);\n $this->assertSame('John', $record->name);\n }\n\n $this->assertCount(1, $records, 'There is only one record.');\n }",
"function testFindSearchcontentSco() {\n\t}",
"public function canHandle($criterion): bool;",
"public function testFind()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}",
"public function find(callable $predicate): Maybe;",
"public function testHasInCacheSearch()\n {\n // save to cache\n $saveSearchCriteria = $this->searchCriteriaBuilder\n ->setContextName('cloud')\n ->setEntityName('customer')\n ->setFieldList(['id', 'name'])\n ->setIdName('id')\n ->build();\n\n $data = [['id' => 20, 'name' => 'Sergii']];\n\n $actualSave = $this->cacheManager->save($saveSearchCriteria, $data);\n $this->assertTrue($actualSave);\n\n // search\n $searchCriteria = $this->searchCriteriaBuilder\n ->setContextName('cloud')\n ->setEntityName('customer')\n ->setIdList([20, 21, 22])\n ->setFieldList(['id', 'name'])\n ->setIdName('id')\n ->build();\n\n $searchResult = $this->cacheManager->search($searchCriteria);\n $this->assertTrue($searchResult->hasData());\n $this->assertEquals(1, $searchResult->count());\n $this->assertCount(2, $searchResult->getMissedData());\n\n // validate result\n $resultData = $searchResult->getData();\n $iteratorResultData = new \\ArrayIterator($resultData);\n $iteratorData = new \\ArrayIterator($data);\n\n $multipleIterator = new \\MultipleIterator(\\MultipleIterator::MIT_NEED_ALL|\\MultipleIterator::MIT_KEYS_ASSOC);\n $multipleIterator->attachIterator($iteratorResultData, 'actual');\n $multipleIterator->attachIterator($iteratorData, 'expected');\n\n foreach($multipleIterator as $item) {\n $this->assertEquals($item['expected'], $item['actual']->get());\n }\n }",
"public function testProfilePrototypeFindByIdReviews()\n {\n\n }",
"public function getCriteria()\n {\n $this->assertEquals(array(), $this->denyValidator->getCriteria());\n }",
"public function find(array $conditions = []);",
"public function Search($criteria);",
"public function getPredicate();",
"public function testProfileFind()\n {\n\n }",
"public function testPDONewWhere()\n {\n $mod = Read::Factory($this->_table, $this->_db, \"MysqlPDO\");\n\n $where = [\n \"(\",\n\n \"(\",\n ['fend_test.`db`.user_id', 14],\n ['users.user_name', 'oak'],\n ['`users`.user_id', \">=\", 0],\n \")\",\n\n \"OR\",\n\n \"(\",\n ['`user_id`', \"<=\", 10000],\n ['user_id', \"like\", '57%'],\n \")\",\n\n \")\",\n\n \"OR\",\n\n ['user_id', \"in\", [1, 2, 3, 4, 5, 6]],\n\n \"OR\",\n\n \"(\",\n ['user_id', \"not in\", ['a', 'c', 'd', 'f']],\n \" `user_name` = 'yes' \",\n \")\",\n\n ];\n $mod->where($where);\n $sql = $mod->getSql();\n self::assertEquals('SELECT * FROM users WHERE ( ( `fend_test`.`db`.`user_id` = \\'14\\' AND `users`.`user_name` = \\'oak\\' AND `users`.`user_id` >= \\'0\\' ) OR ( `user_id` <= \\'10000\\' AND `user_id` like \\'57%\\' ) ) OR `user_id` in (\\'1\\',\\'2\\',\\'3\\',\\'4\\',\\'5\\',\\'6\\') OR ( `user_id` not in (\\'a\\',\\'c\\',\\'d\\',\\'f\\') AND `user_name` = \\'yes\\' ) ', $sql);\n\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n $make = Cars::where(\"make\"|\"id\",10);\n if ($make == \"ford\") {\n return true;\n }\n elseif ($make == \"honda\") {\n return true;\n }\n elseif ($make == \"toyota\") {\n return true;\n } else {\n return false;\n }\n }",
"public function testFindSum()\n {\n\n $json = Scraper::start();\n $array = json_decode($json, true);\n //print_r($array['total']);\n $input = $array['results'];\n $total = $array['total'];\n\n $sumFinder = new SumFinderClass($input);\n $this->assertEquals($total, $sumFinder->findSum());\n }",
"public function testConvertCriteria()\n {\n $api = $this->getApi();\n\n $result = $api->convertSimpleCriteria(array());\n $this->assertEquals(array(), $result);\n\n $result = $api->convertSimpleCriteria(array(array('field' => 'apiReference', 'value' => 'd')));\n $this->assertEquals(array(array('field' => 'apiReference', 'value' => 'd')), $result);\n\n $result = $api->convertSimpleCriteria(array('apiReference' => 'd'));\n $this->assertEquals(array(array('field' => 'api_reference', 'value' => 'd', 'criteria' => '=')), $result);\n\n $result = $api->convertSimpleCriteria(array('apiReference' => 'd'), 'like');\n $this->assertEquals(array(array('field' => 'api_reference', 'value' => 'd', 'criteria' => 'like')), $result);\n }",
"public function hasPredicateMatched(){\n return $this->_has(1);\n }",
"static public function wildcardFindFirst($subject, $predicate, $object, $attrs=0) {\r\n $found=array_shift(SimpleRdf::wildcardFind($subject, $predicate, $object, $attrs, 1));\r\n return $found;\r\n }",
"abstract public function findBy($attributes, $value);",
"function searchObject($object){\r\n\t\tif($this->getElem($object->value)!=null) return true;\r\n\t\t\telse false;\r\n\t}",
"public function testProfilePrototypeFindByIdGroups()\n {\n\n }",
"public function testCopyFindData() {\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyFindData(1),\n\t\t\t$this->expectedFromFixtures[0]\n\t\t);\n\t}",
"public function testGetLowStockByFilter()\n {\n }",
"public function testSearchBy(): void\n {\n// $model::query();\n }",
"public static function findOne($condition);",
"public function getItemsCriteria() {}",
"static public function wildcardFind($subject, $predicate, $object, $attrs=0, $limit=0, $haystack=false) {\r\n $subject=SimpleRdf::regExpFindPrepareInput($subject, 2);\r\n $predicate=SimpleRdf::regExpFindPrepareInput($predicate, 2);\r\n $object=SimpleRdf::regExpFindPrepareInput($object, 2); \r\n\r\n // die(\"wildcardFind($subject, $predicate, $object, $attrs=0, $limit=0);\");\r\n return SimpleRdf::regExpFind($subject, $predicate, $object, $attrs, $limit, $haystack);\r\n }",
"public function getItemsCriteria() {}",
"public function testQuarantineFindOne()\n {\n\n }",
"public function testProfilePrototypeFindByIdQuarantines()\n {\n\n }",
"function testPartialSearch(): void\n {\n // Serpico\n // https://imdb.com/find?s=all&q=serpico\n\n $data = engineSearch('Serpico', 'imdb');\n // $this->printData($data);\n\n foreach ($data as $item) {\n $t = strip_tags($item['title']);\n $this->assertEquals($item['title'], $t);\n }\n }",
"public abstract function getCriteriaFrom($criteria);",
"static public function regExpFindFirst($subject, $predicate, $object, $attrs=0, $haystack=false) {\r\n $found=array_shift(SimpleRdf::regExpFind($subject, $predicate, $object, $attrs, 1, $haystack));\r\n return $found;\r\n }",
"public function testFind()\n {\n $data = array('id' => 1, 'username' => 'root', 'password' => 'password');\n $mockPDO = $this->getMock('\\\\PDOMock', array('fetchOne'));\n $mockPDO\n ->expects($this->once())\n ->method('fetchOne')\n ->will($this->returnCallback(function($arg1, $arg2) use ($data) {\n $sql = 'SELECT\n *\nFROM\n `users`\nWHERE\n id = :id\nORDER BY\n id ASC';\n\n if($arg1 == $sql && $arg2 == array('id' => 1)) {\n return $data;\n } else {\n return array();\n }\n }))\n ;\n $storage = new AuraExtendedPdo($mockPDO, new QueryFactory('mysql'));\n $result = $storage->find(array('id' => 1), 'users');\n\n $this->assertEquals($data['id'], $result['id']);\n $this->assertEquals($data['username'], $result['username']);\n $this->assertEquals($data['password'], $result['password']);\n }",
"function get_criterion($ad_group_id, $criterion_id) {\n\n $selector = $this->__criteria_selector_ids(\n array(array('ad_group_id' => $ad_group_id,\n 'criterion_id' => $criterion_id)));\n\n $result = $this->__do_get('AdGroupCriterionService', $selector);\n\n if (!isset($result['entries']))\n return false;\n\n return $result['entries'][0];\n\n}",
"function findFirstMatchingStatement($subject, $predicate, $object, $offset = 0) \r\n\t{\r\n\t\t//Call the _infFind method, but let it stop, if it finds the \r\n\t\t//first match.\t\r\n\t \t$res= $this->_infFind($subject,$predicate,$object,array(),true,$offset);\r\n\t \t\t\r\n\t\tif (isset($res[$offset]))\r\n\t\t{\r\n\t\t\treturn $res[$offset];\r\n\t\t} else \r\n\t\t{\r\n\t\t\treturn NULL;\r\n\t\t};\r\n\t}",
"public function findBy($criteria);",
"public function findBy($criteria);",
"abstract protected function getWhereForRow($data);",
"public function testCanGetDatasetByTitleAndOptionallyByAccountAndProject() {\n AuthenticationHelper::login(\"[email protected]\", \"password\");\n\n $topLevel = new DatasetInstanceSummary(\"Top Level Dataset\", \"test-json\");\n $topLevelId = $this->datasetService->saveDataSetInstance($topLevel, null, null);\n\n $account1 = new DatasetInstanceSummary(\"Account Dataset 1\", \"test-json\");\n $account1Id = $this->datasetService->saveDataSetInstance($account1, null, 1);\n\n $account2 = new DatasetInstanceSummary(\"Account Dataset 2\", \"test-json\");\n $account2Id = $this->datasetService->saveDataSetInstance($account2, null, 2);\n\n $project1 = new DatasetInstanceSummary(\"Project Dataset 1\", \"test-json\");\n $project1Id = $this->datasetService->saveDataSetInstance($project1, \"soapSuds\", 2);\n\n $project2 = new DatasetInstanceSummary(\"Project Dataset 2\", \"test-json\");\n $project2Id = $this->datasetService->saveDataSetInstance($project2, \"wiperBlades\", 2);\n\n $this->assertEquals($this->datasetService->getDataSetInstance($topLevelId), $this->datasetService->getDataSetInstanceByTitle(\"Top Level Dataset\", null, null));\n $this->assertEquals($this->datasetService->getDataSetInstance($account1Id), $this->datasetService->getDataSetInstanceByTitle(\"Account Dataset 1\", null, 1));\n $this->assertEquals($this->datasetService->getDataSetInstance($account2Id), $this->datasetService->getDataSetInstanceByTitle(\"Account Dataset 2\", null, 2));\n $this->assertEquals($this->datasetService->getDataSetInstance($project1Id), $this->datasetService->getDataSetInstanceByTitle(\"Project Dataset 1\", \"soapSuds\", 2));\n $this->assertEquals($this->datasetService->getDataSetInstance($project2Id), $this->datasetService->getDataSetInstanceByTitle(\"Project Dataset 2\", \"wiperBlades\", 2));\n\n\n }",
"public function find($object) {\r\n $oReflectionClass = new ReflectionClass($object);\r\n //$properties = $oReflectionClass->getProperties(ReflectionProperty::IS_PUBLIC);\r\n $properties = $oReflectionClass->getProperties();\r\n $this->className = $class = $oReflectionClass->getName();\r\n\r\n foreach ($properties as $key => $reflectionProperty)\r\n $datos_where[$reflectionProperty->getName()] = $reflectionProperty->getValue($object);\r\n $this->setList(null);\r\n $this->setObject(null);\r\n $table = $this->table = CriteriaEntityMgr::instance()->findTable($this->className);\r\n $this->SQL = MySQL_DB::instance()->DBSQLSelect($table, null, $datos_where, $this->array_order, $this->type_order);\r\n $this->execute();\r\n $list = array();\r\n if($this->getNumRows() == 1) {\r\n $row = MySQL_DB::instance()->DBFetchArray($this->result);\r\n $object = $this->iterateProperty($class, $object, $row, $properties);\r\n $this->setObject($object);\r\n $list[] = $object;\r\n }\r\n if($this->getNumRows() > 1) {\r\n while ($row = MySQL_DB::instance()->DBFetchArray($this->result)) {\r\n $object_new = $oReflectionClass->newInstance($oReflectionClass);\r\n $object_new = $this->iterateProperty($class, $object_new, $row, $properties);\r\n $list[] = $object_new;\r\n }\r\n }\r\n $this->setList($list);\r\n return $this;\r\n }",
"public function testCanGetFilteredDatasetsForAccountsOptionallyFilteredByProjectAndTagAndCategories() {\n AuthenticationHelper::login(\"[email protected]\", \"password\");\n\n\n $categories = [\n new CategorySummary(\"Account1\", \"An account wide category available to account 1\", \"account1\")\n ];\n $this->metaDataService->returnValue(\"getObjectCategoriesFromSummaries\", [\n new ObjectCategory(new Category(new CategorySummary(\"Account 1\", \"Account 1\", \"account1\"), 1)),\n ], [\n $categories, 1, null\n ]);\n\n\n $accountDataSet = new DatasetInstanceSummary(\"Account Dataset\", \"test-json\", null, [], [], [], null, null, $categories);\n $this->datasetService->saveDataSetInstance($accountDataSet, null, 1);\n\n $accountDataSet = new DatasetInstanceSummary(\"Second Account Dataset\", \"test-json\");\n $this->datasetService->saveDataSetInstance($accountDataSet, null, 1);\n\n\n $datasetProject = new Project(\"Dataset Project\", 1, \"datasetProject\");\n $datasetProject->save();\n\n $this->metaDataService->returnValue(\"getObjectTagsFromSummaries\", [\n new ObjectTag(new Tag(new TagSummary(\"Special\", \"Special Tag\", \"special\"), 1, \"datasetProject\")),\n new ObjectTag(new Tag(new TagSummary(\"General\", \"General Tag\", \"general\"), 1, \"datasetProject\"))\n ], [\n [\n new TagSummary(\"Special\", \"\", \"special\"),\n new TagSummary(\"General\", \"\", \"general\")\n ], 1, \"datasetProject\"\n ]);\n\n $this->metaDataService->returnValue(\"getObjectTagsFromSummaries\", [\n new ObjectTag(new Tag(new TagSummary(\"General\", \"General Tag\", \"general\"), 1, \"datasetProject\"))\n ], [\n [\n new TagSummary(\"General\", \"\", \"general\")\n ], 1, \"datasetProject\"\n ]);\n\n\n $projectDataSet = new DatasetInstanceSummary(\"Project Dataset\", \"test-json\");\n $projectDataSet->setTags([\n new TagSummary(\"Special\", \"\", \"special\"),\n new TagSummary(\"General\", \"\", \"general\")\n ]);\n $this->datasetService->saveDataSetInstance($projectDataSet, \"datasetProject\", 1);\n\n $projectDataSet = new DatasetInstanceSummary(\"Second Project Dataset\", \"test-json\");\n $projectDataSet->setTags([\n new TagSummary(\"General\", \"\", \"general\")\n ]);\n $this->datasetService->saveDataSetInstance($projectDataSet, \"datasetProject\", 1);\n\n\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [], null, 0, 10, 1);\n $this->assertEquals(4, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Account Dataset\", $filtered[0]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[1]);\n $this->assertEquals(\"Project Dataset\", $filtered[1]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[2]);\n $this->assertEquals(\"Second Account Dataset\", $filtered[2]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[3]);\n $this->assertEquals(\"Second Project Dataset\", $filtered[3]->getTitle());\n\n\n // Filter on title\n $filtered = $this->datasetService->filterDataSetInstances(\"econd\", [], [], null, 0, 10, 1);\n $this->assertEquals(2, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Second Account Dataset\", $filtered[0]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[1]);\n $this->assertEquals(\"Second Project Dataset\", $filtered[1]->getTitle());\n\n\n // Filter on categories\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [\"account1\"], [], null, 0, 10, 1);\n $this->assertEquals(1, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Account Dataset\", $filtered[0]->getTitle());\n\n // Filter on project key\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [], \"datasetProject\", 0, 10, 1);\n $this->assertEquals(2, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Project Dataset\", $filtered[0]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[1]);\n $this->assertEquals(\"Second Project Dataset\", $filtered[1]->getTitle());\n\n // Filter on tags\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [\"general\"], \"datasetProject\", 0, 10, 1);\n $this->assertEquals(2, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Project Dataset\", $filtered[0]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[1]);\n $this->assertEquals(\"Second Project Dataset\", $filtered[1]->getTitle());\n\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [\"special\"], \"datasetProject\", 0, 10, 1);\n $this->assertEquals(1, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Project Dataset\", $filtered[0]->getTitle());\n\n // Filter on special NONE tags\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [\"NONE\"], null, 0, 10, 1);\n $this->assertEquals(2, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Account Dataset\", $filtered[0]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[1]);\n $this->assertEquals(\"Second Account Dataset\", $filtered[1]->getTitle());\n\n // Offsets and limits\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [\"general\"], \"datasetProject\", 0, 1, 1);\n $this->assertEquals(1, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Project Dataset\", $filtered[0]->getTitle());\n\n\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [\"general\"], \"datasetProject\", 1, 10, 1);\n $this->assertEquals(1, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Second Project Dataset\", $filtered[0]->getTitle());\n\n\n }",
"public function findOneBy($criteria);",
"public function testDatabaseSearch()\n {\n \t//finding Bowen in database (first seeded user)\n $this->seeInDatabase('users',['firstName'=>'Bowen','email'=>'[email protected]','admin'=>1]);\n\n //finding Hiroko in database (last seeded user)\n $this->seeInDatabase('users',['firstName'=>'Hiroko','email'=>'[email protected]','admin'=>1]);\n\n //check that dummy user is NOT in database\n $this->notSeeInDatabase('users',['firstName'=>'Jon Bon Jovi']);\n\n\t\t//find first Category in the database\n\t\t$this->seeInDatabase('Category',['name'=>'Physics']);\n\t\t\n //find last Category in the database\n $this->seeInDatabase('Category',['name'=>'Other']);\n\n }",
"public function test_findConfidential() {\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(0, count($data));\n $this->SampleSet->username = 'sub2';\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(1, count($data));\n $this->assertEquals(2, $data[0]['SampleSet']['id']);\n $this->SampleSet->username = 'chem2';\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(1, count($data));\n $this->assertEquals(2, $data[0]['SampleSet']['id']);\n }",
"public abstract function getCriteriaWhere($criteria);",
"public function _testConstructorConditions($di)\n\t{\n\t\t// ------------- test for setters(classic) way ----------------\n\n\t\t$standardSelectBuilder = new SelectBuilder();\n\t\t$standardSelectBuilder->from('Robots')\n\t\t\t->where(\n\t\t\t\t\"year > :min: AND year < :max:\",\n\t\t\t\tarray(\"min\" => '2013-01-01', 'max' => '2100-01-01'),\n\t\t\t\tarray(\"min\" => PDO::PARAM_STR, 'max' => PDO::PARAM_STR)\n\t\t\t);\n\n\t\t$standardResult = $standardSelectBuilder->getQuery()->execute();\n\n\t\t// --------------- test for single condition ------------------\n\t\t$params = array(\n\t\t\t'models' => 'Robots',\n\t\t\t'conditions' => array(\n\t\t\t\tarray(\n\t\t\t\t\t\"year > :min: AND year < :max:\",\n\t\t\t\t\tarray(\"min\" => '2013-01-01', 'max' => '2100-01-01'),\n\t\t\t\t\tarray(\"min\" => PDO::PARAM_STR, 'max' => PDO::PARAM_STR),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$builderWithSingleCondition = new SelectBuilder($params);\n\t\t$singleConditionResult = $builderWithSingleCondition->getQuery()->execute();\n\n\t\t// ------------- test for multiple conditions ----------------\n\n\t\t$params = array(\n\t\t\t'models' => 'Robots',\n\t\t\t'conditions' => array(\n\t\t\t\tarray(\n\t\t\t\t\t\"year > :min:\",\n\t\t\t\t\tarray(\"min\" => '2000-01-01'),\n\t\t\t\t\tarray(\"min\" => PDO::PARAM_STR),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t\"year < :max:\",\n\t\t\t\t\tarray('max' => '2100-01-01'),\n\t\t\t\t\tarray(\"max\" => PDO::PARAM_STR),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t// conditions are merged!\n\t\t$builderMultipleConditions = new SelectBuilder($params);\n\t\t$multipleConditionResult = $builderMultipleConditions->getQuery()->execute();\n\n\t\t$expectedPhql = \"SELECT [Robots].* FROM [Robots] \"\n\t\t\t. \"WHERE year > :min: AND year < :max:\";\n\n\t\t/* ------------ ASSERTING --------- */\n\n\t\t$this->assertEquals($expectedPhql, $standardSelectBuilder->getPhql());\n\t\t$this->assertInstanceOf(\"Phalcon\\Mvc\\Model\\Resultset\\Simple\", $standardResult);\n\n\t\t$this->assertEquals($expectedPhql, $builderWithSingleCondition->getPhql());\n\t\t$this->assertInstanceOf(\"Phalcon\\Mvc\\Model\\Resultset\\Simple\", $singleConditionResult);\n\n\t\t$this->assertEquals($expectedPhql, $builderMultipleConditions->getPhql());\n\t\t$this->assertInstanceOf(\"Phalcon\\Mvc\\Model\\Resultset\\Simple\", $multipleConditionResult);\n }",
"public function planFindByField($field,$condition,$value,$orderBy= 'asc');",
"public function testSearch() {\n\t\t$temaBusqueda = new Tema;\n\t\t$temaBusqueda->nombre = 'Queja';\n\t\t$temas = $temaBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $temas ), 1 );\n\t}",
"abstract protected function _doContains($id);",
"public function testFindByQWithLimit()\n {\n $dataLoader = $this->getDataLoader();\n $all = $dataLoader->getAll();\n $filters = ['q' => $all[0]['name'], 'limit' => 1];\n $this->filterTest($filters, [$all[0]]);\n $filters = ['q' => 'desc', 'limit' => 2];\n $this->filterTest($filters, [$all[0], $all[1]]);\n }",
"public function testFindByIdIsSuccess()\n {\n $tblGateMock = $this->getMockBuilder(TableGateway::class)\n ->setConstructorArgs(array($this->getDbal()))\n ->setMethodsExcept(['findById', 'setTable'])\n ->getMock();\n $tblGateMock->setTable('Person');\n\n //exercise SUT\n $row = $tblGateMock->findById($this->person['id']);\n\n //assert return value\n $this->assertTrue(is_array($row), 'result not array');\n $this->assertNotEmpty($row, 'result set is empty');\n\n foreach(array_keys($this->person) as $key) {\n $this->assertArrayHasKey($key, $row[0]);\n $this->assertEquals($this->person[$key], $row[0][$key]);\n }\n }",
"public function findBy($value);",
"public function getCriteria()\n {\n $equalValidator = new stubEqualValidator(5);\n $this->assertEquals(array('expected' => 5), $equalValidator->getCriteria());\n \n $equalValidator = new stubEqualValidator('foo');\n $this->assertEquals(array('expected' => 'foo'), $equalValidator->getCriteria());\n \n $equalValidator = new stubEqualValidator(true);\n $this->assertEquals(array('expected' => true), $equalValidator->getCriteria());\n \n $equalValidator = new stubEqualValidator(false);\n $this->assertEquals(array('expected' => false), $equalValidator->getCriteria());\n \n $equalValidator = new stubEqualValidator(null);\n $this->assertEquals(array('expected' => null), $equalValidator->getCriteria());\n }"
] | [
"0.6269118",
"0.61252964",
"0.575876",
"0.573781",
"0.5663292",
"0.5639873",
"0.5592383",
"0.5588243",
"0.55720884",
"0.5555656",
"0.55322057",
"0.5518297",
"0.54817885",
"0.5456308",
"0.5441144",
"0.5438106",
"0.5408955",
"0.5399032",
"0.5398775",
"0.53735834",
"0.5345841",
"0.53420717",
"0.5341746",
"0.52845067",
"0.5276066",
"0.5275613",
"0.52687544",
"0.52684546",
"0.5265885",
"0.525816",
"0.5240134",
"0.5229621",
"0.5207458",
"0.5205884",
"0.5194986",
"0.5194382",
"0.51937395",
"0.51723266",
"0.516535",
"0.5147245",
"0.51423717",
"0.51295006",
"0.5104953",
"0.51024675",
"0.5091114",
"0.50866765",
"0.50838846",
"0.5075159",
"0.5074113",
"0.5067033",
"0.50469697",
"0.50389516",
"0.5037592",
"0.5019256",
"0.50066745",
"0.49995148",
"0.49946728",
"0.49911675",
"0.4985959",
"0.49858072",
"0.4965978",
"0.49626386",
"0.49614885",
"0.49573696",
"0.49423918",
"0.49367243",
"0.49352726",
"0.49351925",
"0.4932975",
"0.4931143",
"0.49240947",
"0.49132323",
"0.4908618",
"0.4908065",
"0.49073094",
"0.49032983",
"0.4901401",
"0.4899089",
"0.48911536",
"0.48899323",
"0.48886132",
"0.48846248",
"0.48807827",
"0.4872926",
"0.4872926",
"0.4868781",
"0.48674485",
"0.48658738",
"0.48655522",
"0.48599118",
"0.48595566",
"0.48543492",
"0.484876",
"0.4847868",
"0.4847009",
"0.48464906",
"0.48446715",
"0.48441216",
"0.48405188",
"0.48352283",
"0.48318025"
] | 0.0 | -1 |
test that finding data of an object with a criterion works as expected | public function byCriterionOverruleLimitClause()
{
$mockCriterion = $this->getMock('stubCriterion');
$mockCriterion->expects($this->any())->method('toSQL')->will($this->returnValue('example'));
$mockResult = $this->getMock('stubDatabaseResult');
$this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));
$mockResult->expects($this->once())
->method('fetchAll')
->will($this->returnValue(array(array('bar' => 'Here is bar.', 'default' => 'And this is default.'))));
$finderResult = $this->dbFinder->findByCriterion($this->mockConnection, $mockCriterion, new stubReflectionClass('MockSinglePrimaryKeyEntity'), null, 50, 10);
$this->assertEquals(1, $finderResult->count());
$data = $finderResult->current();
$this->assertEquals('Here is bar.', $data->withAnnotation());
$this->assertEquals('And this is default.', $data->withDefaultValue());
$select = $this->mockQueryBuilder->getSelect();
$this->assertEquals('foo', $select->getBaseTableName());
$this->assertEquals('bar ASC', $select->getOrderedBy());
$this->assertTrue($select->hasLimit());
$this->assertEquals(50, $select->getOffset());
$this->assertEquals(10, $select->getAmount());
$this->assertTrue($select->hasCriterion());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function byCriterion()\n {\n $mockCriterion = $this->getMock('stubCriterion');\n $mockCriterion->expects($this->any())->method('toSQL')->will($this->returnValue('example'));\n $mockResult = $this->getMock('stubDatabaseResult');\n $this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));\n $mockResult->expects($this->exactly(2))\n ->method('fetchAll')\n ->will($this->onConsecutiveCalls(false, array(array('bar' => 'Here is bar.', 'default' => 'And this is default.'))));\n $finderResult = $this->dbFinder->findByCriterion($this->mockConnection, $mockCriterion, new stubReflectionClass('MockSinglePrimaryKeyEntity'));\n $this->assertEquals(0, $finderResult->count());\n $finderResult = $this->dbFinder->findByCriterion($this->mockConnection, $mockCriterion, new stubReflectionClass('MockSinglePrimaryKeyEntity'));\n $this->assertEquals(1, $finderResult->count());\n $data = $finderResult->current();\n $this->assertEquals('Here is bar.', $data->withAnnotation());\n $this->assertEquals('And this is default.', $data->withDefaultValue());\n $select = $this->mockQueryBuilder->getSelect();\n $this->assertEquals('foo', $select->getBaseTableName());\n $this->assertEquals('bar ASC', $select->getOrderedBy());\n $this->assertTrue($select->hasCriterion());\n }",
"public function testFind()\n {\n $this->assertEquals(1, $this->object->find(function ($item) {\n return $item === 2;\n })->count());\n $this->assertEquals(2, $this->object->find(function ($item) {\n return $item % 2;\n })->count());\n }",
"public function testFindFirst()\n {\n $this->assertEquals(2, $this->object->findFirst(function ($item) {\n return $item === 2;\n }));\n $this->assertEquals(1, $this->object->findFirst(function ($item) {\n return $item % 2;\n }));\n }",
"public function matching(Criteria $criteria);",
"public function testFindWhere() {\n\t\t$array = array(\n\t\t\tarray('a' => 1, 'b' => 'testing'),\n\t\t\tarray('a' => 2, 'b' => 'testing'),\n\t\t\tarray('a' => 3, 'b' => 'one'),\n\t\t\tarray('a' => 2, 'b' => 'two'),\n\t\t\tarray('a' => 4, 'b' => 'three'),\n\t\t);\n\t\t$result = _::findWhere($array, array('b' => 'testing'), true);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(2, $result);\n\t\t$this->assertEquals(1, $result['a']);\n\t\t$this->assertEquals('testing', $result['b']);\n\t}",
"public function testSearchForProductByAttribute()\n {\n // full results flag returns the full data set for the product\n }",
"public function matching(Criteria $criteria)\n {\n }",
"public function find($data);",
"public function testObjectResult()\n {\n $result = $this->searchResult->objectResult();\n\n $this->assertObjectHasAttribute('results', $result);\n $this->assertObjectHasAttribute('status', $result);\n }",
"public function testQuery(\\Jazzee\\Entity\\Answer $answer, \\stdClass $obj);",
"public function find($obj){\n\t}",
"public abstract function findOperationBy(array $criteria);",
"public function getCriteria();",
"public function testQuarantineFind()\n {\n\n }",
"public function testSearch() {\n\t\t$operacionBusqueda = new Operacion;\n\t\t$operacionBusqueda->nombre = 'Radicado';\n\t\t$operacions = $operacionBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $operacions ), 1 );\n\t}",
"public function testPredicate()\n {\n $this->persistToursLambert93(false);\n $pointO = $this->persistPointO();\n $this->persistPointA();\n $this->persistPointB();\n\n $query = $this->getEntityManager()->createQuery(\n // phpcs:disable Generic.Files.LineLength.MaxExceeded\n 'SELECT p FROM LongitudeOne\\Spatial\\Tests\\Fixtures\\PointEntity p WHERE ST_EQUALS(p.point, ST_Point(:x, :y)) = true'\n // phpcs:enable\n );\n $query->setParameter('x', 0, 'integer');\n $query->setParameter('y', 0, 'integer');\n\n $result = $query->getResult();\n\n static::assertCount(1, $result);\n static::assertEquals($pointO, $result[0]);\n }",
"public abstract function findHolderBy(array $criteria);",
"static public function findFirst($subject, $predicate, $object, $attrs=0) {\r\n $found=array_shift(SimpleRdf::find($subject, $predicate, $object, $attrs, 1));\r\n return $found;\r\n }",
"public function testFindBy() {\n\t\t\tforeach($this->users as $user) {\n\t\t\t\t$_user = User::find_by(array('conditions' => \"name = '\" . $user . \"'\"));\n\t\t\t\t$lamda = call_user_func(strtolower($user));\n\t\t\t\t//lots of redudent checking here to make sure the lamda function is also returning the right data\n\t\t\t\t$this->assertEquals($lamda->name, $_user->name);\n\t\t\t\t$this->assertEquals($user, $lamda->name);\n\t\t\t\t$this->assertEquals($user, $_user->name);\n\t\t\t\t$this->assertEquals($lamda, $_user);\n\t\t\t}\n\t\t}",
"abstract protected function findOneBy(array $criteria);",
"public function test_findAggregation() {\n $data = $this->SampleSet->find('all', ['conditions' => ['set_code LIKE' => 'tn%']]);\n // One confidential and one old version have being filtered\n $this->assertEquals(1, count($data));\n $this->SampleSet->username = 'sub2';\n $data = $this->SampleSet->find('all', ['conditions' => ['set_code LIKE' => 'tn%']]);\n // The confidential one has nolonger being filtered\n $this->assertEquals(2, count($data));\n }",
"public abstract function find();",
"public function hasCriteria();",
"public function testDoCount() {\n\n $c = new Criteria();\n\n try\n {\n $this->assertEquals(2, $this->object->doCount($c));\n }catch (Exception $e)\n {\n throw $e;\n }\n\n }",
"public function byCriterion()\n {\n $mockCriterion = $this->getMock('stubCriterion');\n $mockCriterion->expects($this->any())->method('toSQL')->will($this->returnValue('example'));\n $mockResult = $this->getMock('stubDatabaseResult');\n $this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));\n $mockResult->expects($this->exactly(2))->method('count')->will($this->onConsecutiveCalls(0, 1));\n $data = $this->dbEraser->deleteByCriterion($this->mockConnection, $mockCriterion, new stubReflectionClass('MockNoTableAnnotationEntity'));\n $this->assertEquals(0, $data);\n $data = $this->dbEraser->deleteByCriterion($this->mockConnection, $mockCriterion, new stubReflectionClass('MockNoTableAnnotationEntity'));\n $this->assertEquals(1, $data);\n $this->assertEquals('MockNoTableAnnotationEntitys', $this->mockQueryBuilder->getDeleteTable());\n $this->assertEquals('example', $this->mockQueryBuilder->getDeleteCriterion()->toSQL());\n }",
"function testGetCriteria()\n {\n $criteria1 = $this->RubricsCriteria->getCriteria(1);\n // Compare result to fixture data\n $this->assertTrue(!empty($criteria1));\n $this->assertNotNull($criteria1);\n $this->assertEqual($criteria1[0]['RubricsCriteria']['criteria'],\n 'Participated in Team Meetings');\n $this->assertEqual($criteria1[1]['RubricsCriteria']['criteria'],\n 'Was Helpful and Co-operative');\n $this->assertEqual($criteria1[2]['RubricsCriteria']['criteria'],\n 'Submitted Work on Time');\n\n }",
"public function testProfilePrototypeFindByIdLikes()\n {\n\n }",
"public function match( $data );",
"public function testWhere() {\n\t\t$array = array(\n\t\t\tarray('a' => 1, 'b' => 'testing'),\n\t\t\tarray('a' => 2, 'b' => 'testing'),\n\t\t\tarray('a' => 3, 'b' => 'one'),\n\t\t\tarray('a' => 2, 'b' => 'two'),\n\t\t\tarray('a' => 4, 'b' => 'three'),\n\t\t);\n\t\t$result = _::where($array);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(0, $result);\n\n\t\t// test matching a single field in an array\n\t\t$result = _::where($array, array('b' => 'testing'));\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(2, $result);\n\t\t$this->assertEquals(1, $result[0]['a']);\n\t\t$this->assertEquals('testing', $result[0]['b']);\n\t\t$this->assertEquals(2, $result[1]['a']);\n\t\t$this->assertEquals('testing', $result[1]['b']);\n\n\t\t// test finding the first element by a single field in an array\n\t\t$result = _::where($array, array('b' => 'testing'), true);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(2, $result);\n\t\t$this->assertEquals(1, $result['a']);\n\t\t$this->assertEquals('testing', $result['b']);\n\n\t\t// test matching objects in an array\n\t\tforeach ($array as $i => $item) {\n\t\t\t$array[$i] = (object)$item;\n\t\t}\n\t\t$result = _::where($array, array('a' => 2));\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(2, $result);\n\t\t$this->assertEquals(2, $result[1]->a);\n\t\t$this->assertEquals('testing', $result[1]->b);\n\t\t$this->assertEquals(2, $result[3]->a);\n\t\t$this->assertEquals('two', $result[3]->b);\n\t}",
"abstract public function findBy($criteria);",
"public function testFind() {\n\t\t$array = array(1, 2, 3);\n\t\t$result = _::find($array, function($value) {\n\t\t\treturn (4 == $value);\n\t\t});\n\t\t$this->assertEquals(null, $result);\n\n\t\t// test finding an element\n\t\t$result = _::find($array, function($value) {\n\t\t\treturn (2 == $value);\n\t\t});\n\t\t$this->assertEquals(2, $result);\n\n\t\t// test finding the first element\n\t\t$result = _::find($array, function($value) {\n\t\t\treturn ($value % 2);\n\t\t});\n\t\t$this->assertEquals(1, $result);\n\t}",
"public function testOk() {\n\t\t$a = new Finder('bannane', ['KIWI', \"banane\"]);\n\n // on verifie que le test entree est égale à la variable\n $this->assertEquals('banane', $a->First());\n }",
"public function testSearchForProductByAttributeType()\n {\n // full results flag returns the full data set for the product\n }",
"public function GCheck (\\stdClass $param);",
"function testPersonSearchByBoolean() {\n\t\t$this->setUrl('/search/advanced?r=per&q[per_can_call][value]=FALSE');\n\t\t$this->app->go();\n\t\t$this->assertPattern('/id=\"qb_per_can_call\"/', $this->view->output);\n\t\t$this->assertPattern('/<th>Can Call<\\/th>/', $this->view->output);\n\t\t$this->assertPattern('/<td><img src=\"\\/graphics\\/tactile\\/false.png\" alt=\"f\" \\/><\\/td>/', $this->view->output);\n\t\t$collection = $this->view->get('collection');\n\t\t$this->assertIsA($collection, 'Omelette_PersonCollection');\n\t\t$names = $collection->pluck('name');\n\t\t$this->assertEqual($names, array('Greg Jones', 'Simon Kamina'));\n\t}",
"function findPropertyBy(array $criteria);",
"public function find(array $criteria);",
"public function byCriterionNonEntity()\n {\n $this->dbFinder->findByCriterion($this->mockConnection, $this->getMock('stubCriterion'), new stubReflectionClass('MockNoEntityAnnotationEntity'));\n }",
"static public function regExpFind($subject, $predicate, $object, $attrs=0, $limit=0, $haystack=false, $_recursion=0) {\r\n \r\n $subject=SimpleRdf::regExpFindPrepareInput($subject);\r\n $predicate=SimpleRdf::regExpFindPrepareInput($predicate);\r\n $object=SimpleRdf::regExpFindPrepareInput($object); \r\n\r\n // If RDF_RESOLVE_CONTAINER then it must match objects of container type even if the object pattern does not match...\r\n if ($attrs & RDF_RESOLVE_CONTAINER) {\r\n $object[]=NS_RDF.'Bag';\r\n $object[]=NS_RDF.'Seq'; \r\n $object[]=NS_RDF.'Alt';\r\n }\r\n \r\n // Find\r\n $return=array();\r\n $haystack=(is_array($haystack) ? $haystack : SimpleRdf::$statements);\r\n foreach($haystack as $id=>$statement) {\r\n if ($limit && count($return) >= $limit) {\r\n\tbreak;\r\n }\r\n \r\n // @todo Use === operator\r\n if (\r\n\t SimpleRdf::regExpFindMatch($subject, $statement->getSubject()->getValue()) &&\r\n\t SimpleRdf::regExpFindMatch($predicate, $statement->getPredicate()->getValue()) &&\r\n\t SimpleRdf::regExpFindMatch($object, $statement->getObject()->getValue())\t \r\n\t ) {\r\n\t$return[$id]=$statement;\r\n }\r\n }\r\n // echo \" [ found: \".count($return).\" ]\\n \";\r\n return SimpleRdf::findResolveAttributes($subject, $predicate, $object, $attrs, $limit, $return, $haystack, $_recursion);\r\n }",
"public function find();",
"abstract public function matches($object) : bool;",
"public function getResultAgainstMetric();",
"public function getInfo($criteria)\n {\n }",
"public function Search($objeto);",
"public function testResult() {\n\t\t$object = (object)array(\n\t\t\t'one' => 1,\n\t\t\t'two' => 2,\n\t\t\t'three' => function() {\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t);\n\t\t$result = _::result($object, 'one');\n\t\t$this->assertEquals(1, $result);\n\n\t\t// test getting the result a method on an object\n\t\t$result = _::result($object, 'three');\n\t\t$this->assertEquals(3, $result);\n\t}",
"function findPropertiesBy(array $criteria);",
"function testFindSearchcontentSco() {\n\t}",
"public function testQueryFetchObject() {\n $records = [];\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25], ['fetch' => \\PDO::FETCH_OBJ]);\n foreach ($result as $record) {\n $records[] = $record;\n $this->assertIsObject($record);\n $this->assertSame('John', $record->name);\n }\n\n $this->assertCount(1, $records, 'There is only one record.');\n }",
"public function canHandle($criterion): bool;",
"public function testFind()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}",
"public function find(callable $predicate): Maybe;",
"public function testHasInCacheSearch()\n {\n // save to cache\n $saveSearchCriteria = $this->searchCriteriaBuilder\n ->setContextName('cloud')\n ->setEntityName('customer')\n ->setFieldList(['id', 'name'])\n ->setIdName('id')\n ->build();\n\n $data = [['id' => 20, 'name' => 'Sergii']];\n\n $actualSave = $this->cacheManager->save($saveSearchCriteria, $data);\n $this->assertTrue($actualSave);\n\n // search\n $searchCriteria = $this->searchCriteriaBuilder\n ->setContextName('cloud')\n ->setEntityName('customer')\n ->setIdList([20, 21, 22])\n ->setFieldList(['id', 'name'])\n ->setIdName('id')\n ->build();\n\n $searchResult = $this->cacheManager->search($searchCriteria);\n $this->assertTrue($searchResult->hasData());\n $this->assertEquals(1, $searchResult->count());\n $this->assertCount(2, $searchResult->getMissedData());\n\n // validate result\n $resultData = $searchResult->getData();\n $iteratorResultData = new \\ArrayIterator($resultData);\n $iteratorData = new \\ArrayIterator($data);\n\n $multipleIterator = new \\MultipleIterator(\\MultipleIterator::MIT_NEED_ALL|\\MultipleIterator::MIT_KEYS_ASSOC);\n $multipleIterator->attachIterator($iteratorResultData, 'actual');\n $multipleIterator->attachIterator($iteratorData, 'expected');\n\n foreach($multipleIterator as $item) {\n $this->assertEquals($item['expected'], $item['actual']->get());\n }\n }",
"public function testProfilePrototypeFindByIdReviews()\n {\n\n }",
"public function getCriteria()\n {\n $this->assertEquals(array(), $this->denyValidator->getCriteria());\n }",
"public function find(array $conditions = []);",
"public function Search($criteria);",
"public function getPredicate();",
"public function testProfileFind()\n {\n\n }",
"public function testPDONewWhere()\n {\n $mod = Read::Factory($this->_table, $this->_db, \"MysqlPDO\");\n\n $where = [\n \"(\",\n\n \"(\",\n ['fend_test.`db`.user_id', 14],\n ['users.user_name', 'oak'],\n ['`users`.user_id', \">=\", 0],\n \")\",\n\n \"OR\",\n\n \"(\",\n ['`user_id`', \"<=\", 10000],\n ['user_id', \"like\", '57%'],\n \")\",\n\n \")\",\n\n \"OR\",\n\n ['user_id', \"in\", [1, 2, 3, 4, 5, 6]],\n\n \"OR\",\n\n \"(\",\n ['user_id', \"not in\", ['a', 'c', 'd', 'f']],\n \" `user_name` = 'yes' \",\n \")\",\n\n ];\n $mod->where($where);\n $sql = $mod->getSql();\n self::assertEquals('SELECT * FROM users WHERE ( ( `fend_test`.`db`.`user_id` = \\'14\\' AND `users`.`user_name` = \\'oak\\' AND `users`.`user_id` >= \\'0\\' ) OR ( `user_id` <= \\'10000\\' AND `user_id` like \\'57%\\' ) ) OR `user_id` in (\\'1\\',\\'2\\',\\'3\\',\\'4\\',\\'5\\',\\'6\\') OR ( `user_id` not in (\\'a\\',\\'c\\',\\'d\\',\\'f\\') AND `user_name` = \\'yes\\' ) ', $sql);\n\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n $make = Cars::where(\"make\"|\"id\",10);\n if ($make == \"ford\") {\n return true;\n }\n elseif ($make == \"honda\") {\n return true;\n }\n elseif ($make == \"toyota\") {\n return true;\n } else {\n return false;\n }\n }",
"public function testFindSum()\n {\n\n $json = Scraper::start();\n $array = json_decode($json, true);\n //print_r($array['total']);\n $input = $array['results'];\n $total = $array['total'];\n\n $sumFinder = new SumFinderClass($input);\n $this->assertEquals($total, $sumFinder->findSum());\n }",
"public function testConvertCriteria()\n {\n $api = $this->getApi();\n\n $result = $api->convertSimpleCriteria(array());\n $this->assertEquals(array(), $result);\n\n $result = $api->convertSimpleCriteria(array(array('field' => 'apiReference', 'value' => 'd')));\n $this->assertEquals(array(array('field' => 'apiReference', 'value' => 'd')), $result);\n\n $result = $api->convertSimpleCriteria(array('apiReference' => 'd'));\n $this->assertEquals(array(array('field' => 'api_reference', 'value' => 'd', 'criteria' => '=')), $result);\n\n $result = $api->convertSimpleCriteria(array('apiReference' => 'd'), 'like');\n $this->assertEquals(array(array('field' => 'api_reference', 'value' => 'd', 'criteria' => 'like')), $result);\n }",
"public function hasPredicateMatched(){\n return $this->_has(1);\n }",
"static public function wildcardFindFirst($subject, $predicate, $object, $attrs=0) {\r\n $found=array_shift(SimpleRdf::wildcardFind($subject, $predicate, $object, $attrs, 1));\r\n return $found;\r\n }",
"abstract public function findBy($attributes, $value);",
"function searchObject($object){\r\n\t\tif($this->getElem($object->value)!=null) return true;\r\n\t\t\telse false;\r\n\t}",
"public function testProfilePrototypeFindByIdGroups()\n {\n\n }",
"public function testCopyFindData() {\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyFindData(1),\n\t\t\t$this->expectedFromFixtures[0]\n\t\t);\n\t}",
"public function testGetLowStockByFilter()\n {\n }",
"public function testSearchBy(): void\n {\n// $model::query();\n }",
"public static function findOne($condition);",
"public function getItemsCriteria() {}",
"static public function wildcardFind($subject, $predicate, $object, $attrs=0, $limit=0, $haystack=false) {\r\n $subject=SimpleRdf::regExpFindPrepareInput($subject, 2);\r\n $predicate=SimpleRdf::regExpFindPrepareInput($predicate, 2);\r\n $object=SimpleRdf::regExpFindPrepareInput($object, 2); \r\n\r\n // die(\"wildcardFind($subject, $predicate, $object, $attrs=0, $limit=0);\");\r\n return SimpleRdf::regExpFind($subject, $predicate, $object, $attrs, $limit, $haystack);\r\n }",
"public function getItemsCriteria() {}",
"public function testQuarantineFindOne()\n {\n\n }",
"public function testProfilePrototypeFindByIdQuarantines()\n {\n\n }",
"function testPartialSearch(): void\n {\n // Serpico\n // https://imdb.com/find?s=all&q=serpico\n\n $data = engineSearch('Serpico', 'imdb');\n // $this->printData($data);\n\n foreach ($data as $item) {\n $t = strip_tags($item['title']);\n $this->assertEquals($item['title'], $t);\n }\n }",
"public abstract function getCriteriaFrom($criteria);",
"static public function regExpFindFirst($subject, $predicate, $object, $attrs=0, $haystack=false) {\r\n $found=array_shift(SimpleRdf::regExpFind($subject, $predicate, $object, $attrs, 1, $haystack));\r\n return $found;\r\n }",
"public function testFind()\n {\n $data = array('id' => 1, 'username' => 'root', 'password' => 'password');\n $mockPDO = $this->getMock('\\\\PDOMock', array('fetchOne'));\n $mockPDO\n ->expects($this->once())\n ->method('fetchOne')\n ->will($this->returnCallback(function($arg1, $arg2) use ($data) {\n $sql = 'SELECT\n *\nFROM\n `users`\nWHERE\n id = :id\nORDER BY\n id ASC';\n\n if($arg1 == $sql && $arg2 == array('id' => 1)) {\n return $data;\n } else {\n return array();\n }\n }))\n ;\n $storage = new AuraExtendedPdo($mockPDO, new QueryFactory('mysql'));\n $result = $storage->find(array('id' => 1), 'users');\n\n $this->assertEquals($data['id'], $result['id']);\n $this->assertEquals($data['username'], $result['username']);\n $this->assertEquals($data['password'], $result['password']);\n }",
"function get_criterion($ad_group_id, $criterion_id) {\n\n $selector = $this->__criteria_selector_ids(\n array(array('ad_group_id' => $ad_group_id,\n 'criterion_id' => $criterion_id)));\n\n $result = $this->__do_get('AdGroupCriterionService', $selector);\n\n if (!isset($result['entries']))\n return false;\n\n return $result['entries'][0];\n\n}",
"function findFirstMatchingStatement($subject, $predicate, $object, $offset = 0) \r\n\t{\r\n\t\t//Call the _infFind method, but let it stop, if it finds the \r\n\t\t//first match.\t\r\n\t \t$res= $this->_infFind($subject,$predicate,$object,array(),true,$offset);\r\n\t \t\t\r\n\t\tif (isset($res[$offset]))\r\n\t\t{\r\n\t\t\treturn $res[$offset];\r\n\t\t} else \r\n\t\t{\r\n\t\t\treturn NULL;\r\n\t\t};\r\n\t}",
"public function findBy($criteria);",
"public function findBy($criteria);",
"abstract protected function getWhereForRow($data);",
"public function testCanGetDatasetByTitleAndOptionallyByAccountAndProject() {\n AuthenticationHelper::login(\"[email protected]\", \"password\");\n\n $topLevel = new DatasetInstanceSummary(\"Top Level Dataset\", \"test-json\");\n $topLevelId = $this->datasetService->saveDataSetInstance($topLevel, null, null);\n\n $account1 = new DatasetInstanceSummary(\"Account Dataset 1\", \"test-json\");\n $account1Id = $this->datasetService->saveDataSetInstance($account1, null, 1);\n\n $account2 = new DatasetInstanceSummary(\"Account Dataset 2\", \"test-json\");\n $account2Id = $this->datasetService->saveDataSetInstance($account2, null, 2);\n\n $project1 = new DatasetInstanceSummary(\"Project Dataset 1\", \"test-json\");\n $project1Id = $this->datasetService->saveDataSetInstance($project1, \"soapSuds\", 2);\n\n $project2 = new DatasetInstanceSummary(\"Project Dataset 2\", \"test-json\");\n $project2Id = $this->datasetService->saveDataSetInstance($project2, \"wiperBlades\", 2);\n\n $this->assertEquals($this->datasetService->getDataSetInstance($topLevelId), $this->datasetService->getDataSetInstanceByTitle(\"Top Level Dataset\", null, null));\n $this->assertEquals($this->datasetService->getDataSetInstance($account1Id), $this->datasetService->getDataSetInstanceByTitle(\"Account Dataset 1\", null, 1));\n $this->assertEquals($this->datasetService->getDataSetInstance($account2Id), $this->datasetService->getDataSetInstanceByTitle(\"Account Dataset 2\", null, 2));\n $this->assertEquals($this->datasetService->getDataSetInstance($project1Id), $this->datasetService->getDataSetInstanceByTitle(\"Project Dataset 1\", \"soapSuds\", 2));\n $this->assertEquals($this->datasetService->getDataSetInstance($project2Id), $this->datasetService->getDataSetInstanceByTitle(\"Project Dataset 2\", \"wiperBlades\", 2));\n\n\n }",
"public function find($object) {\r\n $oReflectionClass = new ReflectionClass($object);\r\n //$properties = $oReflectionClass->getProperties(ReflectionProperty::IS_PUBLIC);\r\n $properties = $oReflectionClass->getProperties();\r\n $this->className = $class = $oReflectionClass->getName();\r\n\r\n foreach ($properties as $key => $reflectionProperty)\r\n $datos_where[$reflectionProperty->getName()] = $reflectionProperty->getValue($object);\r\n $this->setList(null);\r\n $this->setObject(null);\r\n $table = $this->table = CriteriaEntityMgr::instance()->findTable($this->className);\r\n $this->SQL = MySQL_DB::instance()->DBSQLSelect($table, null, $datos_where, $this->array_order, $this->type_order);\r\n $this->execute();\r\n $list = array();\r\n if($this->getNumRows() == 1) {\r\n $row = MySQL_DB::instance()->DBFetchArray($this->result);\r\n $object = $this->iterateProperty($class, $object, $row, $properties);\r\n $this->setObject($object);\r\n $list[] = $object;\r\n }\r\n if($this->getNumRows() > 1) {\r\n while ($row = MySQL_DB::instance()->DBFetchArray($this->result)) {\r\n $object_new = $oReflectionClass->newInstance($oReflectionClass);\r\n $object_new = $this->iterateProperty($class, $object_new, $row, $properties);\r\n $list[] = $object_new;\r\n }\r\n }\r\n $this->setList($list);\r\n return $this;\r\n }",
"public function testCanGetFilteredDatasetsForAccountsOptionallyFilteredByProjectAndTagAndCategories() {\n AuthenticationHelper::login(\"[email protected]\", \"password\");\n\n\n $categories = [\n new CategorySummary(\"Account1\", \"An account wide category available to account 1\", \"account1\")\n ];\n $this->metaDataService->returnValue(\"getObjectCategoriesFromSummaries\", [\n new ObjectCategory(new Category(new CategorySummary(\"Account 1\", \"Account 1\", \"account1\"), 1)),\n ], [\n $categories, 1, null\n ]);\n\n\n $accountDataSet = new DatasetInstanceSummary(\"Account Dataset\", \"test-json\", null, [], [], [], null, null, $categories);\n $this->datasetService->saveDataSetInstance($accountDataSet, null, 1);\n\n $accountDataSet = new DatasetInstanceSummary(\"Second Account Dataset\", \"test-json\");\n $this->datasetService->saveDataSetInstance($accountDataSet, null, 1);\n\n\n $datasetProject = new Project(\"Dataset Project\", 1, \"datasetProject\");\n $datasetProject->save();\n\n $this->metaDataService->returnValue(\"getObjectTagsFromSummaries\", [\n new ObjectTag(new Tag(new TagSummary(\"Special\", \"Special Tag\", \"special\"), 1, \"datasetProject\")),\n new ObjectTag(new Tag(new TagSummary(\"General\", \"General Tag\", \"general\"), 1, \"datasetProject\"))\n ], [\n [\n new TagSummary(\"Special\", \"\", \"special\"),\n new TagSummary(\"General\", \"\", \"general\")\n ], 1, \"datasetProject\"\n ]);\n\n $this->metaDataService->returnValue(\"getObjectTagsFromSummaries\", [\n new ObjectTag(new Tag(new TagSummary(\"General\", \"General Tag\", \"general\"), 1, \"datasetProject\"))\n ], [\n [\n new TagSummary(\"General\", \"\", \"general\")\n ], 1, \"datasetProject\"\n ]);\n\n\n $projectDataSet = new DatasetInstanceSummary(\"Project Dataset\", \"test-json\");\n $projectDataSet->setTags([\n new TagSummary(\"Special\", \"\", \"special\"),\n new TagSummary(\"General\", \"\", \"general\")\n ]);\n $this->datasetService->saveDataSetInstance($projectDataSet, \"datasetProject\", 1);\n\n $projectDataSet = new DatasetInstanceSummary(\"Second Project Dataset\", \"test-json\");\n $projectDataSet->setTags([\n new TagSummary(\"General\", \"\", \"general\")\n ]);\n $this->datasetService->saveDataSetInstance($projectDataSet, \"datasetProject\", 1);\n\n\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [], null, 0, 10, 1);\n $this->assertEquals(4, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Account Dataset\", $filtered[0]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[1]);\n $this->assertEquals(\"Project Dataset\", $filtered[1]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[2]);\n $this->assertEquals(\"Second Account Dataset\", $filtered[2]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[3]);\n $this->assertEquals(\"Second Project Dataset\", $filtered[3]->getTitle());\n\n\n // Filter on title\n $filtered = $this->datasetService->filterDataSetInstances(\"econd\", [], [], null, 0, 10, 1);\n $this->assertEquals(2, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Second Account Dataset\", $filtered[0]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[1]);\n $this->assertEquals(\"Second Project Dataset\", $filtered[1]->getTitle());\n\n\n // Filter on categories\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [\"account1\"], [], null, 0, 10, 1);\n $this->assertEquals(1, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Account Dataset\", $filtered[0]->getTitle());\n\n // Filter on project key\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [], \"datasetProject\", 0, 10, 1);\n $this->assertEquals(2, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Project Dataset\", $filtered[0]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[1]);\n $this->assertEquals(\"Second Project Dataset\", $filtered[1]->getTitle());\n\n // Filter on tags\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [\"general\"], \"datasetProject\", 0, 10, 1);\n $this->assertEquals(2, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Project Dataset\", $filtered[0]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[1]);\n $this->assertEquals(\"Second Project Dataset\", $filtered[1]->getTitle());\n\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [\"special\"], \"datasetProject\", 0, 10, 1);\n $this->assertEquals(1, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Project Dataset\", $filtered[0]->getTitle());\n\n // Filter on special NONE tags\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [\"NONE\"], null, 0, 10, 1);\n $this->assertEquals(2, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Account Dataset\", $filtered[0]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[1]);\n $this->assertEquals(\"Second Account Dataset\", $filtered[1]->getTitle());\n\n // Offsets and limits\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [\"general\"], \"datasetProject\", 0, 1, 1);\n $this->assertEquals(1, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Project Dataset\", $filtered[0]->getTitle());\n\n\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [\"general\"], \"datasetProject\", 1, 10, 1);\n $this->assertEquals(1, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Second Project Dataset\", $filtered[0]->getTitle());\n\n\n }",
"public function findOneBy($criteria);",
"public function testDatabaseSearch()\n {\n \t//finding Bowen in database (first seeded user)\n $this->seeInDatabase('users',['firstName'=>'Bowen','email'=>'[email protected]','admin'=>1]);\n\n //finding Hiroko in database (last seeded user)\n $this->seeInDatabase('users',['firstName'=>'Hiroko','email'=>'[email protected]','admin'=>1]);\n\n //check that dummy user is NOT in database\n $this->notSeeInDatabase('users',['firstName'=>'Jon Bon Jovi']);\n\n\t\t//find first Category in the database\n\t\t$this->seeInDatabase('Category',['name'=>'Physics']);\n\t\t\n //find last Category in the database\n $this->seeInDatabase('Category',['name'=>'Other']);\n\n }",
"public function test_findConfidential() {\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(0, count($data));\n $this->SampleSet->username = 'sub2';\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(1, count($data));\n $this->assertEquals(2, $data[0]['SampleSet']['id']);\n $this->SampleSet->username = 'chem2';\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(1, count($data));\n $this->assertEquals(2, $data[0]['SampleSet']['id']);\n }",
"public abstract function getCriteriaWhere($criteria);",
"public function _testConstructorConditions($di)\n\t{\n\t\t// ------------- test for setters(classic) way ----------------\n\n\t\t$standardSelectBuilder = new SelectBuilder();\n\t\t$standardSelectBuilder->from('Robots')\n\t\t\t->where(\n\t\t\t\t\"year > :min: AND year < :max:\",\n\t\t\t\tarray(\"min\" => '2013-01-01', 'max' => '2100-01-01'),\n\t\t\t\tarray(\"min\" => PDO::PARAM_STR, 'max' => PDO::PARAM_STR)\n\t\t\t);\n\n\t\t$standardResult = $standardSelectBuilder->getQuery()->execute();\n\n\t\t// --------------- test for single condition ------------------\n\t\t$params = array(\n\t\t\t'models' => 'Robots',\n\t\t\t'conditions' => array(\n\t\t\t\tarray(\n\t\t\t\t\t\"year > :min: AND year < :max:\",\n\t\t\t\t\tarray(\"min\" => '2013-01-01', 'max' => '2100-01-01'),\n\t\t\t\t\tarray(\"min\" => PDO::PARAM_STR, 'max' => PDO::PARAM_STR),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$builderWithSingleCondition = new SelectBuilder($params);\n\t\t$singleConditionResult = $builderWithSingleCondition->getQuery()->execute();\n\n\t\t// ------------- test for multiple conditions ----------------\n\n\t\t$params = array(\n\t\t\t'models' => 'Robots',\n\t\t\t'conditions' => array(\n\t\t\t\tarray(\n\t\t\t\t\t\"year > :min:\",\n\t\t\t\t\tarray(\"min\" => '2000-01-01'),\n\t\t\t\t\tarray(\"min\" => PDO::PARAM_STR),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t\"year < :max:\",\n\t\t\t\t\tarray('max' => '2100-01-01'),\n\t\t\t\t\tarray(\"max\" => PDO::PARAM_STR),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t// conditions are merged!\n\t\t$builderMultipleConditions = new SelectBuilder($params);\n\t\t$multipleConditionResult = $builderMultipleConditions->getQuery()->execute();\n\n\t\t$expectedPhql = \"SELECT [Robots].* FROM [Robots] \"\n\t\t\t. \"WHERE year > :min: AND year < :max:\";\n\n\t\t/* ------------ ASSERTING --------- */\n\n\t\t$this->assertEquals($expectedPhql, $standardSelectBuilder->getPhql());\n\t\t$this->assertInstanceOf(\"Phalcon\\Mvc\\Model\\Resultset\\Simple\", $standardResult);\n\n\t\t$this->assertEquals($expectedPhql, $builderWithSingleCondition->getPhql());\n\t\t$this->assertInstanceOf(\"Phalcon\\Mvc\\Model\\Resultset\\Simple\", $singleConditionResult);\n\n\t\t$this->assertEquals($expectedPhql, $builderMultipleConditions->getPhql());\n\t\t$this->assertInstanceOf(\"Phalcon\\Mvc\\Model\\Resultset\\Simple\", $multipleConditionResult);\n }",
"public function testSearch() {\n\t\t$temaBusqueda = new Tema;\n\t\t$temaBusqueda->nombre = 'Queja';\n\t\t$temas = $temaBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $temas ), 1 );\n\t}",
"public function planFindByField($field,$condition,$value,$orderBy= 'asc');",
"abstract protected function _doContains($id);",
"public function testFindByQWithLimit()\n {\n $dataLoader = $this->getDataLoader();\n $all = $dataLoader->getAll();\n $filters = ['q' => $all[0]['name'], 'limit' => 1];\n $this->filterTest($filters, [$all[0]]);\n $filters = ['q' => 'desc', 'limit' => 2];\n $this->filterTest($filters, [$all[0], $all[1]]);\n }",
"public function testFindByIdIsSuccess()\n {\n $tblGateMock = $this->getMockBuilder(TableGateway::class)\n ->setConstructorArgs(array($this->getDbal()))\n ->setMethodsExcept(['findById', 'setTable'])\n ->getMock();\n $tblGateMock->setTable('Person');\n\n //exercise SUT\n $row = $tblGateMock->findById($this->person['id']);\n\n //assert return value\n $this->assertTrue(is_array($row), 'result not array');\n $this->assertNotEmpty($row, 'result set is empty');\n\n foreach(array_keys($this->person) as $key) {\n $this->assertArrayHasKey($key, $row[0]);\n $this->assertEquals($this->person[$key], $row[0][$key]);\n }\n }",
"public function findBy($value);",
"public function getCriteria()\n {\n $equalValidator = new stubEqualValidator(5);\n $this->assertEquals(array('expected' => 5), $equalValidator->getCriteria());\n \n $equalValidator = new stubEqualValidator('foo');\n $this->assertEquals(array('expected' => 'foo'), $equalValidator->getCriteria());\n \n $equalValidator = new stubEqualValidator(true);\n $this->assertEquals(array('expected' => true), $equalValidator->getCriteria());\n \n $equalValidator = new stubEqualValidator(false);\n $this->assertEquals(array('expected' => false), $equalValidator->getCriteria());\n \n $equalValidator = new stubEqualValidator(null);\n $this->assertEquals(array('expected' => null), $equalValidator->getCriteria());\n }"
] | [
"0.626939",
"0.6125999",
"0.5759837",
"0.5737003",
"0.5663713",
"0.56393975",
"0.5592357",
"0.5587061",
"0.55729854",
"0.55565304",
"0.5532544",
"0.5518858",
"0.54810244",
"0.54578674",
"0.5442362",
"0.5437673",
"0.54090464",
"0.5399768",
"0.53989625",
"0.53737915",
"0.5344584",
"0.5341451",
"0.5341201",
"0.5285355",
"0.5277248",
"0.52762055",
"0.5269128",
"0.52666855",
"0.5265788",
"0.52581203",
"0.5240592",
"0.5230841",
"0.5206968",
"0.52062494",
"0.51944506",
"0.51943785",
"0.5193967",
"0.5173207",
"0.5165369",
"0.5146967",
"0.51416814",
"0.5128805",
"0.51049596",
"0.509177",
"0.5087075",
"0.5084158",
"0.5075654",
"0.50752145",
"0.506811",
"0.5047633",
"0.50391674",
"0.50373083",
"0.50192446",
"0.5006362",
"0.49996445",
"0.49947697",
"0.4990278",
"0.4986259",
"0.4985646",
"0.49669775",
"0.49630266",
"0.4961516",
"0.49564698",
"0.4943102",
"0.4936304",
"0.49356085",
"0.4935174",
"0.4934214",
"0.4931786",
"0.4924944",
"0.491427",
"0.49085498",
"0.490836",
"0.49072438",
"0.49049973",
"0.4901883",
"0.48993647",
"0.4891118",
"0.48905817",
"0.48889276",
"0.48859727",
"0.48810184",
"0.48726895",
"0.48726895",
"0.4867435",
"0.48660633",
"0.48653775",
"0.48642915",
"0.48604372",
"0.4859448",
"0.48541266",
"0.4848625",
"0.4848094",
"0.48475274",
"0.4846726",
"0.4844126",
"0.48433268",
"0.48413372",
"0.4834936",
"0.48316166"
] | 0.5102976 | 43 |
test that finding data for all instances of an object works as expected | public function findAll()
{
$mockResult = $this->getMock('stubDatabaseResult');
$this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));
$mockResult->expects($this->exactly(2))
->method('fetchAll')
->will($this->onConsecutiveCalls(false, array(array('bar' => 'Here is bar.', 'default' => 'And this is default.'))));
$finderResult = $this->dbFinder->findAll($this->mockConnection, new stubReflectionClass('MockSinglePrimaryKeyEntity'));
$this->assertEquals(0, $finderResult->count());
$finderResult = $this->dbFinder->findAll($this->mockConnection, new stubReflectionClass('MockSinglePrimaryKeyEntity'));
$this->assertEquals(1, $finderResult->count());
$data = $finderResult->current();
$this->assertEquals('Here is bar.', $data->withAnnotation());
$this->assertEquals('And this is default.', $data->withDefaultValue());
$select = $this->mockQueryBuilder->getSelect();
$this->assertEquals('foo', $select->getBaseTableName());
$this->assertEquals('bar ASC', $select->getOrderedBy());
$this->assertFalse($select->hasLimit());
$this->assertNull($select->getOffset());
$this->assertNull($select->getAmount());
$this->assertFalse($select->hasCriterion());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testFind()\n {\n $this->assertEquals(1, $this->object->find(function ($item) {\n return $item === 2;\n })->count());\n $this->assertEquals(2, $this->object->find(function ($item) {\n return $item % 2;\n })->count());\n }",
"public function testFindAll()\n {\n $this->createDummyRecord();\n\n $results = $this->generic->findAll();\n\n $list = $this->getPhysicalNumberOrRecords();\n\n $this->assertEquals(get_class($results), 'Ds\\Deque');\n $this->assertEquals(count($list), $results->count());\n }",
"public function testQueryFetchObject() {\n $records = [];\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25], ['fetch' => \\PDO::FETCH_OBJ]);\n foreach ($result as $record) {\n $records[] = $record;\n $this->assertIsObject($record);\n $this->assertSame('John', $record->name);\n }\n\n $this->assertCount(1, $records, 'There is only one record.');\n }",
"public function find($data);",
"public function find($obj){\n\t}",
"protected function testObjects() {\n }",
"public function testFind() {\n\t\t\tforeach($this->user_ids as $id) {\n\t\t\t\t$_user = User::_find($id);\n\t\t\t\t$this->assertTrue((isset($_user) && !empty($_user)));\n\t\t\t}\n\t\t\t//test finding by ids with cache\n\t\t\tforeach($this->user_ids as $id) {\n\t\t\t\t$_user = User::find($id);\n\t\t\t\t$this->assertTrue((isset($_user) && !empty($_user)));\n\t\t\t}\n\t\t}",
"public function testGetAll() {\n\t\t$class = get_class($this->entity);\n\t\t$array = $this->entity->toArray(true);\n\t\t$filled = $this->fillArray($array);\n\t\t$entity = new $class($filled);\n\t\t\n\t\t$result = array();\n\t\tforeach ($filled as $attr => $val){\n\t\t\t$entity->{'set' . $attr}($val);\n\t\t\t$result[$attr] = $entity->{'get' . $attr}();\n\t\t}\n\t\t\n\t\t$this->assertEquals($filled, $result);\n\t}",
"public abstract function find();",
"public function testFindAll()\n {\n $this->assertCount(4, $this->appService->findAll());\n }",
"public function testFind() {\n\t\t$this->Post->entity(false);\n\t\t$result = $this->Post->find('first');\n\t\t$this->assertTrue(is_array($result));\n\t\t$this->assertEqual($result['Post']['title'], 'Hello');\n\n\t\t// 2. OK, let's roll.\n\t\t$s1 = $this->Post->find('first', ['entity' => true]);\n\t\t$this->assertTrue(is_a($s1, 'PostEntity'));\n\n\t\t// 3. find all.\n\t\t$result = $this->Post->find('all', ['entity' => true]);\n\t\t$this->assertTrue(is_array($result));\n\t\t$this->assertEqual(count($result), 3);\n\t\t$this->assertTrue(is_a($result[0], 'PostEntity'));\n\t\t$this->assertEqual($result[2]->title, 'again');\n\n\t\t// 4. find all with empty result.\n\t\t$result = $this->Post->find('all', [\n\t\t\t'entity' => true,\n\t\t\t'result' => [],\n\t\t]);\n\t\t$this->assertTrue(is_array($result));\n\t\t$this->assertEqual(count($result), 0);\n\t}",
"public function testForeach()\n {\n $this->instance->{$this->name};\n $i = 0;\n foreach ($this->instance as $key => $value) {\n $i++;\n self::assertTrue(\n is_string($key),\n 'Element key is not a string'\n );\n self::assertInstanceOf(\n Chameleon::class,\n $this->instance,\n 'Element value is not an instance of Chameleon'\n );\n }\n self::assertGreaterThan(\n 0,\n $i,\n 'Instance is not iterated'\n );\n }",
"public function testExample()\n{\n $temporada = new Temporada();\n $episodio1 = new Episodio();\n $episodio1->assistido = true;\n $episodio2 = new Episodio();\n $episodio2->assistido = false;\n $episodio3 = new Episodio();\n $episodio3->assistido = true;\n $temporada->episodios->add($episodio1);\n $temporada->episodios->add($episodio2);\n $temporada->episodios->add($episodio3);\n\n\n $episodiosAssistidos = $temporada->getEpisodiosAssistidos();\n $this->assertCount(2, $episodiosAssistidos);\n}",
"public function find();",
"public function testFind()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}",
"public function testObjectResult()\n {\n $result = $this->searchResult->objectResult();\n\n $this->assertObjectHasAttribute('results', $result);\n $this->assertObjectHasAttribute('status', $result);\n }",
"public function test_concrete()\n {\n foreach ($this->concrete as $data) {\n //echo \"Testing: $data[0]\\n\";\n $this->setTable($data[0]);\n $this->model = new $data[0];\n $this->assertInternalType('object', $this->model, $message = 'Collection: model creation did not return an object');\n $this->collection = $this->model->finder()->findAll();\n $this->assertInternalType('object', $this->collection, $message = 'Collection::collection creation did not return an object');\n $this->tst_notifyAccess();\n $this->tst_add();\n $this->tst_delete($data[0]);\n $this->tst_count();\n $this->tst_rewind();\n $this->tst_current();\n $this->tst_key();\n $this->tst_next();\n /*\n $this->tst_valid();\n */\n }\n }",
"public function testChainedFinders()\n {\n $index = new Index();\n $query = new Query($index);\n\n $finder = $query->find()->find();\n $this->assertInstanceOf(\\Cake\\ElasticSearch\\Query::class, $finder);\n }",
"public function find() {\r\n\t\t\t$class = new ReflectionObject($this);\r\n\t\t\t$properties = $class->getProperties(ReflectionProperty::IS_PUBLIC);\r\n\r\n\t\t\t// Loop through the properties to set them from the current row\r\n\t\t\t$select = $this->db->select();\r\n\t\t\tforeach ($properties as $property) {\r\n\t\t\t\t$name = $property->getName();\r\n\t\t\t\t// Set only DO field names of subclass\r\n\t\t\t\tif ($property->class == $class->name) {\r\n\t\t\t\t\tif (!is_null($this->$name)) {\r\n\t\t\t\t\t\t$columnName = $this->map($name);\r\n\t\t\t\t\t\t$select->where(\"$columnName = ?\", $this->$name);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$select->from($this->table);\r\n\t\t\t$stmt = $this->db->query($select);\r\n\t\t\t$rs = $stmt->fetchAll();\r\n\r\n\t\t\t$dataobjects = array();\r\n\t\t\tforeach ($rs as $row) {\r\n\t\t\t\t$dataobject = new $class->name($this->app);\r\n\t\t\t\treset($properties);\r\n\t\t\t\tforeach ($properties as $property) {\r\n\t\t\t\t\t$name = $property->getName();\r\n\t\t\t\t\t$dataobject->$name = $row[$this->map($name)];\r\n\t\t\t\t}\r\n\t\t\t\t$dataobjects[] = $dataobject;\r\n\t\t\t}\r\n\t\t\treturn $dataobjects;\r\n\t\t}",
"public function testSearchForProductByAttribute()\n {\n // full results flag returns the full data set for the product\n }",
"function testObjectRecord()\n {\n $pear = new DataSourceArrayTestStore('pear');\n $doctrine = new DataSourceArrayTestStore('doctrine');\n $propel = new DataSourceArrayTestStore('propel');\n $this->datasource->bind(array(&$pear, &$doctrine, &$propel));\n\n $this->assertEquals(3, $this->datasource->count());\n\n $records = $this->datasource->fetch();\n $this->assertEquals('pear', $records[0]->name);\n $this->assertEquals('pear(tm)', $records[0]->getBrand());\n $this->assertEquals('doctrine', $records[1]->name);\n $this->assertEquals('doctrine(tm)', $records[1]->getBrand());\n $this->assertEquals('propel', $records[2]->name);\n $this->assertEquals('propel(tm)', $records[2]->getBrand());\n\n $this->datasource->sort('name');\n $records = $this->datasource->fetch(1, 1);\n $this->assertEquals('pear', $records[0]->name);\n $this->assertEquals('pear(tm)', $records[0]->getBrand());\n\n $records[0]->name = 'pear2';\n $this->assertEquals('pear2', $pear->name);\n }",
"public function testQueryFetchObjectClass() {\n $records = 0;\n $query = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25]);\n while ($result = $query->fetchObject(FakeRecord::class, [1])) {\n $records += 1;\n $this->assertInstanceOf(FakeRecord::class, $result);\n $this->assertSame('John', $result->name, '25 year old is John.');\n $this->assertSame(1, $result->fakeArg, 'The record has received an argument through its constructor.');\n }\n $this->assertSame(1, $records, 'There is only one record.');\n }",
"public function test_findId() {\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 1]]);\n $this->assertNotNull($data);\n $this->assertEquals(1, $data[0]['SampleSet']['id']);\n $this->assertEquals(1, count($data));\n }",
"public function testProfilePrototypeFindByIdLikes()\n {\n\n }",
"public function testFindAll() : void\n {\n /** @var EntityManager $em */\n $em = $this->getApplicationServiceLocator()->get(EntityManager::class);\n $postRepository = $em->getRepository(Post::class);\n static::assertNotEmpty($postRepository->findAll());\n }",
"public function Find()\n {\n //TODO Suche mit den werten machen\n }",
"public function Find()\n {\n //TODO Suche mit den werten machen\n }",
"public function Find()\n {\n //TODO Suche mit den werten machen\n }",
"public function testResultGetAll_Object()\n {\n \t$result = $this->conn->query(\"SELECT * FROM test WHERE status='ACTIVE'\");\n \t$this->assertEquals(array((object)array('id'=>1, 'key'=>'one', 'title'=>'first row', 'status'=>'ACTIVE'), (object)array('id'=>2, 'key'=>'two', 'title'=>'next row', 'status'=>'ACTIVE')), $result->getAll(DB::FETCH_OBJECT));\n }",
"function test_find()\n {\n // Arrange\n $brand_name = \"Nike\";\n $test_brand = new Brand($brand_name);\n $test_brand->save();\n $id = $test_brand->getId();\n\n $brand_name2 = \"Adidas\";\n $test_brand2 = new Brand($brand_name2);\n $test_brand2->save();\n\n //Act\n $result = Brand::find($id);\n\n //Assert\n $this->assertEquals($test_brand, $result);\n }",
"public function canIterateOverProperties()\n {\n $object0 = $this->getMock('ATM_Config_Abstract', array('getName'));\n $object1 = $this->getMock('ATM_Config_Comment', array(), array('comment'));\n $this->object->append($object0);\n $this->object->append($object1);\n $this->object->append($object0);\n $this->object->iterateOn('objIds');\n $expect = $this->object->getArrayCopy();\n foreach ($this->object as $position=>$objectId) {\n $this->assertInternalType('string', $objectId);\n $this->assertEquals($expect[$position], $objectId);\n }\n $this->assertEquals(2, $position);\n }",
"public function testProfilePrototypeFindByIdGroups()\n {\n\n }",
"public function test_findAggregation() {\n $data = $this->SampleSet->find('all', ['conditions' => ['set_code LIKE' => 'tn%']]);\n // One confidential and one old version have being filtered\n $this->assertEquals(1, count($data));\n $this->SampleSet->username = 'sub2';\n $data = $this->SampleSet->find('all', ['conditions' => ['set_code LIKE' => 'tn%']]);\n // The confidential one has nolonger being filtered\n $this->assertEquals(2, count($data));\n }",
"public function testCopyFindData() {\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyFindData(1),\n\t\t\t$this->expectedFromFixtures[0]\n\t\t);\n\t}",
"public function testSearchForProductByAttributeType()\n {\n // full results flag returns the full data set for the product\n }",
"public function testQuarantineFind()\n {\n\n }",
"public abstract function getObjects();",
"public function testGetAllNoPersistentObject() {\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testReadMultipleRecords 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => 'testReadMultipleRecords 2'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testReadMultipleRecords 3']\r\n ];\r\n // Write data to the database\r\n foreach ($records as $record) {\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$record['UUID'].'\\','.($record['bool'] ? 1:0).','.$record['int'].', \\''.$record['string'].'\\')');\r\n }\r\n // Read data out and cast it to persistent object with incomplete metadata\r\n $this->setExpectedException('Exception', 'The given class is not derived from avorium_core_persistence_PersistentObject. But this is needed to extract the table name!');\r\n $this->getPersistenceAdapter()->getAll('test_persistence_AbstractPersistenceAdapterTestNoPersistentObject');\r\n }",
"public function testDataSet()\n {\n $data = ['name' => 'Guy', 'color' => 'Green', 'food' => 'Pizza'];\n $model = new MyModel($data);\n\n $this->assertTrue($model->name === 'Guy');\n $this->assertTrue($model->color === 'Green');\n\n // this could throw an exception instead of null\n $this->assertTrue($model->food === null);\n\n\n $model->name = 'Jane';\n\n $this->assertTrue($model->name === 'Jane');\n\n $this->assertTrue(MyModel::getName() == 'MyModel');\n\n $properties = MyModel::getProperties();\n $this->assertTrue(in_array('name', $properties));\n\n $this->assertTrue(in_array('color', $properties));\n\n $this->assertFalse(in_array('food', $properties));\n\n\n }",
"public function testGetUser()\n {\n $user = factory(User::class)->create();\n $userRepo = new UserRepository(new User);\n $found = $userRepo->get($user->id);\n\n $this->assertInstanceOf(User::class, $found);\n foreach ($this->data as $key => $value) {\n \t$this->assertEquals($found->$key, $user->$key);\n }\n }",
"public function getInstances() {}",
"public function testCount()\n\t{\n\t\t$this->assertEquals(3, count($this->instance));\n\t}",
"public function getInstances() {\n\t\t$instances = array();\n\t\tforeach ($this->objects as $objectName => $information) {\n\t\t\tif (isset($information['i'])) {\n\t\t\t\t$instances[$objectName] = $information['i'];\n\t\t\t}\n\t\t}\n\t\treturn $instances;\n\t}",
"function testFindById() {\r\n $this->User = new User();\r\n \r\n $this->User->contain();\r\n $result = $this->User->findById(1, 'email');\r\n \r\n $expected = array('User' => array( 'email' => '[email protected]' ) );\r\n \r\n $this->assertEqual($result, $expected);\r\n }",
"public function it_can_be_instantiated(): void\n {\n $results = [\n Meta::make('name', 'Hello world'),\n new Meta('name', 'Hello world'),\n ];\n $expectations = [\n \\Arcanedev\\SeoHelper\\Contracts\\Renderable::class,\n \\Arcanedev\\SeoHelper\\Contracts\\Helpers\\Meta::class,\n \\Arcanedev\\SeoHelper\\Helpers\\Meta::class,\n ];\n\n foreach ($results as $actual) {\n /** @var Meta $actual */\n foreach ($expectations as $expected) {\n static::assertInstanceOf($expected, $actual);\n }\n\n static::assertSame('name', $actual->key());\n static::assertTrue($actual->isValid());\n }\n }",
"public function testFetchObjectWithMultipleCallsAndNoInstance() {\n $fixture = array(\n \"c1\" => \"r1v1\",\n \"c2\" => \"r1v2\"\n );\n \n $stub = $this->getMockBuilder(\"\\Examples\\ThriftServices\\Hive\\HivePDOStatement\")\n ->disableOriginalConstructor()\n ->setMethods(array(\"fetch\"))\n ->getMock();\n \n $stub->expects($this->exactly(2))\n ->method(\"fetch\")\n ->will($this->onConsecutiveCalls($fixture, array()));\n \n $obj = $stub->fetchObject(\"\\stdClass\");\n $this->assertInstanceOf(\"\\stdClass\", $obj);\n \n foreach($fixture as $col => $value) {\n $this->assertEquals($obj->{$col}, $value);\n }\n \n $this->assertFalse($stub->fetchObject(\"\\stdClass\"));\n }",
"public function test2()\n\t\t{\n\t\t\treturn get_object_vars($this);\n\t\t}",
"public function testFindFirst()\n {\n $this->assertEquals(2, $this->object->findFirst(function ($item) {\n return $item === 2;\n }));\n $this->assertEquals(1, $this->object->findFirst(function ($item) {\n return $item % 2;\n }));\n }",
"public function testFetchObjectWithMultipleCallsWithInstance() {\n $fixture = array(\n \"c1\" => \"r1v1\",\n \"c2\" => \"r1v2\"\n );\n \n $wrapper = new \\stdClass();\n \n $stub = $this->getMockBuilder(\"\\Examples\\ThriftServices\\Hive\\HivePDOStatement\")\n ->disableOriginalConstructor()\n ->setMethods(array(\"fetch\"))\n ->getMock();\n \n $stub->expects($this->exactly(2))\n ->method(\"fetch\")\n ->will($this->onConsecutiveCalls($fixture, array()));\n \n $obj = $stub->fetchObject($wrapper);\n $this->assertInstanceOf(get_class($wrapper), $obj);\n $this->assertSame($obj, $wrapper);\n \n foreach($fixture as $col => $value) {\n $this->assertEquals($obj->{$col}, $value);\n }\n \n $this->assertFalse($stub->fetchObject(clone $wrapper));\n }",
"public function testWithObjectMap() : void {\n $bob = Record::fromName(\"bob\");\n $result = Result::fromResponse(\n Response::fromQueriedRecords(null, $bob),\n [Example::TYPE => Example::class]\n );\n\n $first = $result->first();\n $this->assertInstanceOf(Example::class, $first);\n $this->assertEquals($bob[\"Id\"], $first->Id);\n $this->assertEquals($bob[\"Name\"], $first->Name);\n }",
"public function testMatchRetrieval()\n {\n // Given a match has been created in the database\n $insertedmatch = factory(Match::class)->create($this->data());\n \n // When I fetch the matches\n $retrievedmatch = Match::get();\n $this->assertTrue(true);\n }",
"public function testFindAllByName()\n {\n $this->assertCount(2, $this->appService->findAllByName('api'));\n }",
"public function find(){\n\n $params = $this->_where;\n $selects = $this->preparedSelects();\n $order = $this->preparedOrderBy();\n $range = $this->_range;\n $depth = $this->_depth;\n $objects = array();\n\n $found = $this->_find($params,$selects,$order,$range,$depth);\n\n if($this->_rest->statusCode() == 200){\n $this->_count = $this->_rest->count();\n $indexKey = $this->indexKey;\n\n // if the result is a single object (for example, in the case of listapi\n // query), it's converted to an array before being processed\n if(!is_array($found)) {\n $found = array($found);\n }\n foreach($found as $attributes){\n if($indexKey){\n $index = isset($attributes->$indexKey) ? $attributes->$indexKey : count($objects);\n }else{\n $index = count($objects);\n }\n\n if($this->objectClass == Object::USER_OBJECT_CLASS){\n $objects[$index] = new User($attributes);\n }else{\n $objects[$index] = new Object($this->objectClass,$attributes);\n }\n }\n }\n\n return $objects;\n }",
"public function testProfilePrototypeFindByIdQuarantines()\n {\n\n }",
"public function testFindPersistedEntities() {\n\t\t$table = TableRegistry::get('users');\n\t\t$table->entity = true;\n\t\t$results = $table->find('all');\n\t\t$this->assertCount(4, $results);\n\t\tforeach ($results as $article) {\n\t\t\t$this->assertFalse($article->isNew());\n\t\t}\n\t}",
"public function get_test_persistent_object_cache()\n {\n }",
"public function testFindBy() {\n\t\t\tforeach($this->users as $user) {\n\t\t\t\t$_user = User::find_by(array('conditions' => \"name = '\" . $user . \"'\"));\n\t\t\t\t$lamda = call_user_func(strtolower($user));\n\t\t\t\t//lots of redudent checking here to make sure the lamda function is also returning the right data\n\t\t\t\t$this->assertEquals($lamda->name, $_user->name);\n\t\t\t\t$this->assertEquals($user, $lamda->name);\n\t\t\t\t$this->assertEquals($user, $_user->name);\n\t\t\t\t$this->assertEquals($lamda, $_user);\n\t\t\t}\n\t\t}",
"public function findAllLoaded() {}",
"function test_getAll()\n {\n // Arrange\n $brand_name = \"Nike\";\n $test_brand = new Brand($brand_name);\n $test_brand->save();\n\n\n $brand_name2 = \"Adidas\";\n $test_brand2 = new Brand($brand_name2);\n $test_brand2->save();\n\n //Act\n $result = Brand::getAll();\n\n //Assert\n $this->assertEquals([$test_brand, $test_brand2], $result);\n }",
"public function testGetMeta()\n {\n $meta1 = Person::getMeta();\n $meta2 = Person::objects()->getMeta();\n\n $this->assertSame($meta1, $meta2);\n }",
"public function testFetching()\n {\n $this->assertType('Horde_Kolab_Server_Object', $this->koward->getObject('cn=Gunnar Wrobel,dc=example,dc=org'));\n }",
"public function testFetchObject()\n {\n $this->todo('stub');\n }",
"public function testBean()\n\t{\n\t\tR::nuke();\n\t\t$book = R::dispense( 'book' );\n\t\t$pages = R::dispense( 'page', 2 );\n\t\t$ads = R::dispense('ad', 3 );\n\t\t$tags = R::dispense( 'tag', 2 );\n\t\t$author = R::dispense( 'author' );\n\t\t$coauthor = R::dispense( 'author' );\n\t\t$book->alias( 'magazine' )->ownAd = $ads;\n\t\t$book->ownPage = $pages;\n\t\t$book->sharedTag = $tags;\n\t\t$book->via( 'connection' )->sharedUser = array( R::dispense( 'user' ) );\n\t\t$book->author = $author;\n\t\t$book->coauthor = $coauthor;\n\t\tR::store( $book );\n\t\t$book = $book->fresh();\n\t\tasrt( count($book->ownPage), 2 );\n\t\tasrt( count($book->alias('magazine')->ownAd), 3 );\n\t\t$book->ownAd = array();\n\t\tarray_pop( $book->ownPage );\n\t\tR::store( $book );\n\t\t$book = $book->fresh();\n\t\tasrt( count($book->ownPage), 1 );\n\t\tasrt( count($book->alias('magazine')->ownAd), 0 );\n\t}",
"public function testFixtureRecord()\n {\n \n $data = $this->EmergencyContacts->find()->where(['etype' => '1']);\n $this->assertEquals(2, $data->count());\n\n }",
"public function testQueryFetchClass() {\n $records = [];\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25], ['fetch' => FakeRecord::class]);\n foreach ($result as $record) {\n $records[] = $record;\n $this->assertInstanceOf(FakeRecord::class, $record);\n $this->assertSame('John', $record->name);\n }\n\n $this->assertCount(1, $records, 'There is only one record.');\n }",
"public function testFindServiceData()\n {\n\n }",
"public function test_find() : void\n {\n $journalMetadata1 = $this->prophesize(Metadata\\Comment::class);\n $journalMetadata2 = $this->prophesize(Metadata\\Comment::class);\n $this->compiler_prophecy\n ->compile(Argument::any())\n ->willReturn([\n $journalMetadata1->reveal(),\n $journalMetadata2->reveal(),\n ]);\n\n // create a new repository\n $repo = new FilesystemAnnotationRepository($this->file_source_prophecy->reveal(), $this->compiler_prophecy->reveal());\n\n // check the repository\n $entries = $repo->find();\n\n // check that the right number and content of entries is found\n $this->assertCount(2, $entries);\n $this->assertContains($journalMetadata1->reveal(), $entries);\n $this->assertContains($journalMetadata2->reveal(), $entries);\n }",
"public function testShow()\n\t{\n\t\t$response = $this->call('GET', '/'.self::$endpoint.'/'.$this->obj->id);\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t\t$result = $response->getOriginalContent()->toArray();\n\n\t\t// tes apakah hasil return adalah yang sesuai\n\t\tforeach ($this->obj->attributesToArray() as $attr => $attr_val)\n\t\t\t$this->assertArrayHasKey($attr, $result);\n\n\t\t// tes tak ada yang dicari\n\t\t$response = $this->call('GET', '/'.self::$endpoint.'/696969');\n\t\t$this->assertEquals(500, $response->getStatusCode());\n\t}",
"public function find($object) {\r\n $oReflectionClass = new ReflectionClass($object);\r\n //$properties = $oReflectionClass->getProperties(ReflectionProperty::IS_PUBLIC);\r\n $properties = $oReflectionClass->getProperties();\r\n $this->className = $class = $oReflectionClass->getName();\r\n\r\n foreach ($properties as $key => $reflectionProperty)\r\n $datos_where[$reflectionProperty->getName()] = $reflectionProperty->getValue($object);\r\n $this->setList(null);\r\n $this->setObject(null);\r\n $table = $this->table = CriteriaEntityMgr::instance()->findTable($this->className);\r\n $this->SQL = MySQL_DB::instance()->DBSQLSelect($table, null, $datos_where, $this->array_order, $this->type_order);\r\n $this->execute();\r\n $list = array();\r\n if($this->getNumRows() == 1) {\r\n $row = MySQL_DB::instance()->DBFetchArray($this->result);\r\n $object = $this->iterateProperty($class, $object, $row, $properties);\r\n $this->setObject($object);\r\n $list[] = $object;\r\n }\r\n if($this->getNumRows() > 1) {\r\n while ($row = MySQL_DB::instance()->DBFetchArray($this->result)) {\r\n $object_new = $oReflectionClass->newInstance($oReflectionClass);\r\n $object_new = $this->iterateProperty($class, $object_new, $row, $properties);\r\n $list[] = $object_new;\r\n }\r\n }\r\n $this->setList($list);\r\n return $this;\r\n }",
"public function testGetAllAssociated()\n {\n $this->setUp();\n $users = new Users(self::$config);\n $admin = $users->get(1);\n $student = $users->get(3);\n $injuries = new Injuries(self::$config);\n\n $reports = $injuries->getAllAssociated($admin);\n\n $this->assertNotNull($reports);\n $this->assertEquals(5, count($reports));\n\n // There are 3 where this student is involved\n $reports = $injuries->getAllAssociated($student);\n\n $this->assertNotNull($reports);\n $this->assertEquals(3, count($reports));\n }",
"public function testProfilePrototypeFindByIdPosts()\n {\n\n }",
"function test_getStores()\n {\n $brand_name = 'Nike';\n $test_brand = new Brand($brand_name);\n $test_brand->save();\n\n $store_name = \"Nordstorm\";\n $test_store = new Store($store_name);\n $test_store->save();\n\n $store_name2 = 'Macys';\n $test_store2 = new Store($store_name2);\n $test_store2->save();\n\n $test_brand->addStore($test_store);\n $test_brand->addStore($test_store2);\n $result = $test_brand->getStores();\n\n $this->assertEquals([$test_store, $test_store2], $result);\n }",
"public function findAll() {\n\t\t$registrations = $this->registrationRepository->findAll();\n\t\t$this->assertEquals(10, $registrations->count());\n\t}",
"private function extractObjects(&$data){\n\t\tif(!preg_match_all($this->patObject, $data, $matches)){\n\t\t\tthrow new Exception(\"No objects found\"); \n\t\t} else {\n\t\t\t// Trim the results, because \\R in regex assertion (lookback) causes problems.\n\t\t\tforeach($matches[0] as $key => $match){\n\t\t\t\t$newObject = new pdfObject(trim($match));\n\t\t\t\t$this->objects[$newObject->objectNumber] = $newObject;\n\t\t\t}\n\t\t\treturn $this->objects;\n\t\t}\n\t}",
"public function testIfReturnsAllElements()\n {\n $factory = new FileSystemMapFactory();\n $result = $factory->create($this->data);\n\n $this->assertEquals(count($this->data), count($result));\n }",
"public function test_findConfidential() {\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(0, count($data));\n $this->SampleSet->username = 'sub2';\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(1, count($data));\n $this->assertEquals(2, $data[0]['SampleSet']['id']);\n $this->SampleSet->username = 'chem2';\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(1, count($data));\n $this->assertEquals(2, $data[0]['SampleSet']['id']);\n }",
"public function testGetAllPistas()\n {\n $fakePista = factory(Pista::class,1)->create([\n 'id' => 4545\n ]);\n $pistas = Pista::getAllPistas();\n foreach ($pistas as $pista) {\n if($pista->id == 4545){\n $this->assertTrue($pista->id == $fakePista[0]->id);\n }\n }\n\n }",
"public function testQuarantineFindOne()\n {\n\n }",
"public function testProfilePrototypeFindByIdOwnedGroups()\n {\n\n }",
"public function canReturnABindedCollectionForAGivenName()\n {\n $object0 = $this->getMock('ATM_Config_Abstract', array('getName'));\n $object1 = clone $object0;\n $object0->expects($this->any())\n ->method('getName')\n ->will($this->returnValue('object0'));\n $object1->expects($this->any())\n ->method('getName')\n ->will($this->returnValue('object1'));\n $this->object->append($object0);\n $this->object->append($object1);\n $this->object->append($object0);\n $collection = $this->object->filterNames('object0');\n $this->assertSame($object0, $collection[0]);\n $this->assertSame($object0, $collection[1]);\n $this->assertFalse(isset($collection[2]));\n // set all $object0 to $object1 in this object\n $collection[0]=$object1;\n $this->assertSame($object1, $collection[0]);\n $this->assertSame($object1, $this->object[0]);\n $this->assertSame($object1, $this->object[1]);\n $this->assertSame($object0, $this->object[2]);\n $this->object[0]=$object0;\n $this->assertSame($object1, $collection[0]);\n }",
"public function objectIdentifierExposureTestData() {}",
"protected function testObject() {\n }",
"static function findAll() {$finder = self::getFinder( __CLASS__ ); return $finder->findAll();}",
"static function findAll() {$finder = self::getFinder( __CLASS__ ); return $finder->findAll();}",
"static function findAll() {$finder = self::getFinder( __CLASS__ ); return $finder->findAll();}",
"public function findAll() {}",
"public function findAll() {}",
"public function findAll() {}",
"public function testFindByIdIsSuccess()\n {\n $tblGateMock = $this->getMockBuilder(TableGateway::class)\n ->setConstructorArgs(array($this->getDbal()))\n ->setMethodsExcept(['findById', 'setTable'])\n ->getMock();\n $tblGateMock->setTable('Person');\n\n //exercise SUT\n $row = $tblGateMock->findById($this->person['id']);\n\n //assert return value\n $this->assertTrue(is_array($row), 'result not array');\n $this->assertNotEmpty($row, 'result set is empty');\n\n foreach(array_keys($this->person) as $key) {\n $this->assertArrayHasKey($key, $row[0]);\n $this->assertEquals($this->person[$key], $row[0][$key]);\n }\n }",
"public function find($class);",
"public function testInvoke()\n {\n $this->instance->{$this->name};\n // Copy the instance to a local variable as we can't invoke it directly.\n $instance = $this->instance;\n $instance = $instance();\n self::assertInstanceOf(\n Chameleon::class,\n $instance,\n 'Instance invocation does not return an instance of Chameleon'\n );\n self::assertTrue(\n array_key_exists($this->name, $instance),\n 'Instance element cannot be tested with array_key_exists'\n );\n }",
"public function testQueryFetchDefault() {\n $records = [];\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25]);\n $this->assertInstanceOf(StatementInterface::class, $result);\n foreach ($result as $record) {\n $records[] = $record;\n $this->assertIsObject($record);\n $this->assertSame('John', $record->name);\n }\n\n $this->assertCount(1, $records, 'There is only one record.');\n }",
"public function testCreateInstancesFromQuery()\n {\n $entityData = array(\n \"name\" => 'my recurring event',\n \"ts_start\" => strtotime(\"2016-01-01 08:00:00 PST\"),\n \"ts_end\" => strtotime(\"2016-01-01 09:00:00 PST\"),\n \"recurrence_pattern\" => array(\n \"recur_type\" => Recurrence\\RecurrencePattern::RECUR_DAILY,\n \"interval\" => 1,\n \"date_start\" => \"2016-01-01\",\n \"date_end\" => \"2016-01-05\",\n )\n );\n $event = $this->entityLoader->create(\"calendar_event\");\n $event->fromArray($entityData);\n $this->entityDataMapper->save($event);\n $recurId = $event->getRecurrencePattern()->getId();\n\n // Create a query that gets events from January 1 to January 5\n $dateTo = new \\DateTime(\"2016-01-05\");\n $query = new EntityQuery(\"calendar_event\");\n $query->where(\"ts_start\")->isLessThan($dateTo->format(\"Y-m-d\"));\n\n // Have the manager create instances using the query\n $this->recurSeriesManager->createInstancesFromQuery($query);\n\n // Open the recurrence pattern and make sure to date processed to was moved out\n $recurrencePattern = $this->recurIndentityMapper->getById($recurId);\n $dateProcessedTo = $recurrencePattern->getDateProcessedTo();\n $this->assertEquals($dateProcessedTo->format(\"Y-m-d\"), $dateTo->format(\"Y-m-d\"));\n\n // Cleanup\n $this->entityDataMapper->delete($event, true);\n\n }",
"public function testFind()\n {\n $data = array('id' => 1, 'username' => 'root', 'password' => 'password');\n $mockPDO = $this->getMock('\\\\PDOMock', array('fetchOne'));\n $mockPDO\n ->expects($this->once())\n ->method('fetchOne')\n ->will($this->returnCallback(function($arg1, $arg2) use ($data) {\n $sql = 'SELECT\n *\nFROM\n `users`\nWHERE\n id = :id\nORDER BY\n id ASC';\n\n if($arg1 == $sql && $arg2 == array('id' => 1)) {\n return $data;\n } else {\n return array();\n }\n }))\n ;\n $storage = new AuraExtendedPdo($mockPDO, new QueryFactory('mysql'));\n $result = $storage->find(array('id' => 1), 'users');\n\n $this->assertEquals($data['id'], $result['id']);\n $this->assertEquals($data['username'], $result['username']);\n $this->assertEquals($data['password'], $result['password']);\n }",
"public function testGetOneClass()\n {\n $result = $this->getQueryBuilderConnection()\n ->select()\n ->from('querybuilder_tests')\n ->where('id', '=', 1)\n ->getOneClass(SampleObject::class);\n\n $object = SampleObject::create('1', '1', 'bbbb');\n\n $this->assertEquals($object, $result);\n }",
"public function canReturnABindedCollectionForAGivenClass()\n {\n $object0 = $this->getMock('ATM_Config_Abstract', array('getName'));\n $object1 = $this->getMock('ATM_Config_Comment', array(), array('comment'));\n $this->assertNotEquals(get_class($object0), get_class($object1));\n $this->object->append($object0);\n $this->object->append($object1);\n $this->object->append($object0);\n $collection = $this->object->filterClasses(get_class($object0));\n $this->assertSame($object0, $collection[0]);\n $this->assertSame($object0, $collection[1]);\n $this->assertFalse(isset($collection[2]));\n // set all $object0 to $object1 in this object\n $collection[0]=$object1;\n $this->assertSame($object1, $collection[0]);\n $this->assertSame($object1, $this->object[0]);\n $this->assertSame($object1, $this->object[1]);\n $this->assertSame($object0, $this->object[2]);\n $this->object[0]=$object0;\n $this->assertSame($object1, $collection[0]);\n }",
"public function testFindUser()\n {\n $user = factory(User::class)->create();\n $found = User::query()->find($user->id);\n $this->assertNotEmpty($found);\n $this->assertEquals($user->id, $found->id);\n }",
"public function testSelectAll() {\n $testUser = [];\n $testUser[0] = new User();\n $testUser[0]->setUsername('testUser');\n $testUser[0]->create();\n\n $testUser[1] = new User();\n $testUser[1]->setUsername('testUser2');\n $testUser[1]->create();\n\n // Create a test rank\n $testRank = [];\n $testRank[0] = new Rank();\n $testRank[0]->setName('testRank');\n $testRank[0]->create();\n\n $testRank[1] = new Rank();\n $testRank[1]->setName('testRank2');\n $testRank[1]->create();\n\n // Create a test user rank\n $testUserRank = [];\n $testUserRank[0] = new UserRank();\n $testUserRank[0]->setUserID($testUser[0]->getID());\n $testUserRank[0]->setRankID($testRank[0]->getID());\n $testUserRank[0]->create();\n\n $testUserRank[1] = new UserRank();\n $testUserRank[1]->setUserID($testUser[1]->getID());\n $testUserRank[1]->setRankID($testRank[1]->getID());\n $testUserRank[1]->create();\n\n // Select and check\n $selectedMultiple = UserRank::select(array());\n\n $this->assertTrue(\\is_array($selectedMultiple));\n $this->assertEquals(2, \\count($selectedMultiple));\n $this->assertInstanceOf(UserRank::class, $selectedMultiple[0]);\n $this->assertInstanceOf(UserRank::class, $selectedMultiple[1]);\n\n if($testUserRank[0]->getID() == $selectedMultiple[0]->getID()) {\n $i = 0;\n $j = 1;\n }\n else {\n $i = 1;\n $j = 0;\n }\n\n $this->assertEquals($testUserRank[0]->getID(), $selectedMultiple[$i]->getID());\n $this->assertEquals($testUserRank[0]->getUserID(), $selectedMultiple[$i]->getUserID());\n $this->assertEquals($testUserRank[0]->getRankID(), $selectedMultiple[$i]->getRankID());\n\n $this->assertEquals($testUserRank[1]->getID(), $selectedMultiple[$j]->getID());\n $this->assertEquals($testUserRank[1]->getUserID(), $selectedMultiple[$j]->getUserID());\n $this->assertEquals($testUserRank[1]->getRankID(), $selectedMultiple[$j]->getRankID());\n\n // Clean up\n foreach($testUserRank as $userRank) {\n $userRank->delete();\n }\n foreach($testUser as $user) {\n $user->delete();\n }\n foreach($testRank as $rank) {\n $rank->delete();\n }\n }",
"public function testIterator()\n {\n foreach ($this->pool as $code => $class) {\n $this->assertEquals($this->pool[$code], $class);\n }\n }",
"public function testGetInstancesByTag(){\n $result = $this->aws->getInstancesByTag('environment', $this->environment);\n $this->assertNotEmpty($result);\n $this->assertArrayHasKey('Instances', $result[0]);\n $this->assertNotEmpty($result[0]['Instances']);\n $this->assertContains(array('Value' => $this->environment, 'Key' => 'environment'), $result[0]['Instances'][0]['Tags']);\n return $result;\n }"
] | [
"0.6500596",
"0.6382698",
"0.6254118",
"0.61995196",
"0.6116045",
"0.60977817",
"0.60735625",
"0.60392785",
"0.59966874",
"0.5939199",
"0.59016114",
"0.5868411",
"0.5861083",
"0.5854662",
"0.5830841",
"0.5803349",
"0.57565933",
"0.57491475",
"0.57268125",
"0.5712245",
"0.57120025",
"0.5701832",
"0.561564",
"0.56083226",
"0.5605488",
"0.55890507",
"0.55890507",
"0.55890507",
"0.5588016",
"0.5585849",
"0.5552091",
"0.5543811",
"0.55126697",
"0.55126077",
"0.5503075",
"0.55020523",
"0.5497551",
"0.5465317",
"0.5464237",
"0.5461178",
"0.5454973",
"0.5450444",
"0.5437326",
"0.5436721",
"0.5429941",
"0.54294086",
"0.54261714",
"0.54208297",
"0.5420058",
"0.5416701",
"0.5414058",
"0.5412639",
"0.5412437",
"0.54077077",
"0.54057884",
"0.5396712",
"0.5394696",
"0.5390282",
"0.5376039",
"0.53720134",
"0.536949",
"0.536603",
"0.53659654",
"0.5362627",
"0.5358762",
"0.5358499",
"0.53540117",
"0.5347318",
"0.5339198",
"0.53319615",
"0.5330954",
"0.5323407",
"0.5323405",
"0.53203696",
"0.531905",
"0.5312303",
"0.5299812",
"0.52970475",
"0.52935517",
"0.52871424",
"0.5284901",
"0.52743244",
"0.52733445",
"0.52733445",
"0.52733445",
"0.5270251",
"0.5270251",
"0.526865",
"0.52681935",
"0.52675164",
"0.52517205",
"0.5248705",
"0.52417123",
"0.52352524",
"0.52334833",
"0.52322376",
"0.5228204",
"0.521661",
"0.52124166",
"0.52112854"
] | 0.54536504 | 41 |
test that finding data for all instances of an object works as expected | public function findAllOverruleOrderBy()
{
$mockResult = $this->getMock('stubDatabaseResult');
$this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));
$mockResult->expects($this->once())
->method('fetchAll')
->will($this->returnValue(array(array('bar' => 'Here is bar.', 'default' => 'And this is default.'))));
$finderResult = $this->dbFinder->findAll($this->mockConnection, new stubReflectionClass('MockSinglePrimaryKeyEntity'), 'blub DESC');
$this->assertEquals(1, $finderResult->count());
$data = $finderResult->current();
$this->assertEquals('Here is bar.', $data->withAnnotation());
$this->assertEquals('And this is default.', $data->withDefaultValue());
$select = $this->mockQueryBuilder->getSelect();
$this->assertEquals('foo', $select->getBaseTableName());
$this->assertEquals('blub DESC', $select->getOrderedBy());
$this->assertFalse($select->hasLimit());
$this->assertNull($select->getOffset());
$this->assertNull($select->getAmount());
$this->assertFalse($select->hasCriterion());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testFind()\n {\n $this->assertEquals(1, $this->object->find(function ($item) {\n return $item === 2;\n })->count());\n $this->assertEquals(2, $this->object->find(function ($item) {\n return $item % 2;\n })->count());\n }",
"public function testFindAll()\n {\n $this->createDummyRecord();\n\n $results = $this->generic->findAll();\n\n $list = $this->getPhysicalNumberOrRecords();\n\n $this->assertEquals(get_class($results), 'Ds\\Deque');\n $this->assertEquals(count($list), $results->count());\n }",
"public function testQueryFetchObject() {\n $records = [];\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25], ['fetch' => \\PDO::FETCH_OBJ]);\n foreach ($result as $record) {\n $records[] = $record;\n $this->assertIsObject($record);\n $this->assertSame('John', $record->name);\n }\n\n $this->assertCount(1, $records, 'There is only one record.');\n }",
"public function find($data);",
"public function find($obj){\n\t}",
"protected function testObjects() {\n }",
"public function testFind() {\n\t\t\tforeach($this->user_ids as $id) {\n\t\t\t\t$_user = User::_find($id);\n\t\t\t\t$this->assertTrue((isset($_user) && !empty($_user)));\n\t\t\t}\n\t\t\t//test finding by ids with cache\n\t\t\tforeach($this->user_ids as $id) {\n\t\t\t\t$_user = User::find($id);\n\t\t\t\t$this->assertTrue((isset($_user) && !empty($_user)));\n\t\t\t}\n\t\t}",
"public function testGetAll() {\n\t\t$class = get_class($this->entity);\n\t\t$array = $this->entity->toArray(true);\n\t\t$filled = $this->fillArray($array);\n\t\t$entity = new $class($filled);\n\t\t\n\t\t$result = array();\n\t\tforeach ($filled as $attr => $val){\n\t\t\t$entity->{'set' . $attr}($val);\n\t\t\t$result[$attr] = $entity->{'get' . $attr}();\n\t\t}\n\t\t\n\t\t$this->assertEquals($filled, $result);\n\t}",
"public abstract function find();",
"public function testFindAll()\n {\n $this->assertCount(4, $this->appService->findAll());\n }",
"public function testFind() {\n\t\t$this->Post->entity(false);\n\t\t$result = $this->Post->find('first');\n\t\t$this->assertTrue(is_array($result));\n\t\t$this->assertEqual($result['Post']['title'], 'Hello');\n\n\t\t// 2. OK, let's roll.\n\t\t$s1 = $this->Post->find('first', ['entity' => true]);\n\t\t$this->assertTrue(is_a($s1, 'PostEntity'));\n\n\t\t// 3. find all.\n\t\t$result = $this->Post->find('all', ['entity' => true]);\n\t\t$this->assertTrue(is_array($result));\n\t\t$this->assertEqual(count($result), 3);\n\t\t$this->assertTrue(is_a($result[0], 'PostEntity'));\n\t\t$this->assertEqual($result[2]->title, 'again');\n\n\t\t// 4. find all with empty result.\n\t\t$result = $this->Post->find('all', [\n\t\t\t'entity' => true,\n\t\t\t'result' => [],\n\t\t]);\n\t\t$this->assertTrue(is_array($result));\n\t\t$this->assertEqual(count($result), 0);\n\t}",
"public function testForeach()\n {\n $this->instance->{$this->name};\n $i = 0;\n foreach ($this->instance as $key => $value) {\n $i++;\n self::assertTrue(\n is_string($key),\n 'Element key is not a string'\n );\n self::assertInstanceOf(\n Chameleon::class,\n $this->instance,\n 'Element value is not an instance of Chameleon'\n );\n }\n self::assertGreaterThan(\n 0,\n $i,\n 'Instance is not iterated'\n );\n }",
"public function testExample()\n{\n $temporada = new Temporada();\n $episodio1 = new Episodio();\n $episodio1->assistido = true;\n $episodio2 = new Episodio();\n $episodio2->assistido = false;\n $episodio3 = new Episodio();\n $episodio3->assistido = true;\n $temporada->episodios->add($episodio1);\n $temporada->episodios->add($episodio2);\n $temporada->episodios->add($episodio3);\n\n\n $episodiosAssistidos = $temporada->getEpisodiosAssistidos();\n $this->assertCount(2, $episodiosAssistidos);\n}",
"public function find();",
"public function testFind()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}",
"public function testObjectResult()\n {\n $result = $this->searchResult->objectResult();\n\n $this->assertObjectHasAttribute('results', $result);\n $this->assertObjectHasAttribute('status', $result);\n }",
"public function test_concrete()\n {\n foreach ($this->concrete as $data) {\n //echo \"Testing: $data[0]\\n\";\n $this->setTable($data[0]);\n $this->model = new $data[0];\n $this->assertInternalType('object', $this->model, $message = 'Collection: model creation did not return an object');\n $this->collection = $this->model->finder()->findAll();\n $this->assertInternalType('object', $this->collection, $message = 'Collection::collection creation did not return an object');\n $this->tst_notifyAccess();\n $this->tst_add();\n $this->tst_delete($data[0]);\n $this->tst_count();\n $this->tst_rewind();\n $this->tst_current();\n $this->tst_key();\n $this->tst_next();\n /*\n $this->tst_valid();\n */\n }\n }",
"public function testChainedFinders()\n {\n $index = new Index();\n $query = new Query($index);\n\n $finder = $query->find()->find();\n $this->assertInstanceOf(\\Cake\\ElasticSearch\\Query::class, $finder);\n }",
"public function find() {\r\n\t\t\t$class = new ReflectionObject($this);\r\n\t\t\t$properties = $class->getProperties(ReflectionProperty::IS_PUBLIC);\r\n\r\n\t\t\t// Loop through the properties to set them from the current row\r\n\t\t\t$select = $this->db->select();\r\n\t\t\tforeach ($properties as $property) {\r\n\t\t\t\t$name = $property->getName();\r\n\t\t\t\t// Set only DO field names of subclass\r\n\t\t\t\tif ($property->class == $class->name) {\r\n\t\t\t\t\tif (!is_null($this->$name)) {\r\n\t\t\t\t\t\t$columnName = $this->map($name);\r\n\t\t\t\t\t\t$select->where(\"$columnName = ?\", $this->$name);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$select->from($this->table);\r\n\t\t\t$stmt = $this->db->query($select);\r\n\t\t\t$rs = $stmt->fetchAll();\r\n\r\n\t\t\t$dataobjects = array();\r\n\t\t\tforeach ($rs as $row) {\r\n\t\t\t\t$dataobject = new $class->name($this->app);\r\n\t\t\t\treset($properties);\r\n\t\t\t\tforeach ($properties as $property) {\r\n\t\t\t\t\t$name = $property->getName();\r\n\t\t\t\t\t$dataobject->$name = $row[$this->map($name)];\r\n\t\t\t\t}\r\n\t\t\t\t$dataobjects[] = $dataobject;\r\n\t\t\t}\r\n\t\t\treturn $dataobjects;\r\n\t\t}",
"function testObjectRecord()\n {\n $pear = new DataSourceArrayTestStore('pear');\n $doctrine = new DataSourceArrayTestStore('doctrine');\n $propel = new DataSourceArrayTestStore('propel');\n $this->datasource->bind(array(&$pear, &$doctrine, &$propel));\n\n $this->assertEquals(3, $this->datasource->count());\n\n $records = $this->datasource->fetch();\n $this->assertEquals('pear', $records[0]->name);\n $this->assertEquals('pear(tm)', $records[0]->getBrand());\n $this->assertEquals('doctrine', $records[1]->name);\n $this->assertEquals('doctrine(tm)', $records[1]->getBrand());\n $this->assertEquals('propel', $records[2]->name);\n $this->assertEquals('propel(tm)', $records[2]->getBrand());\n\n $this->datasource->sort('name');\n $records = $this->datasource->fetch(1, 1);\n $this->assertEquals('pear', $records[0]->name);\n $this->assertEquals('pear(tm)', $records[0]->getBrand());\n\n $records[0]->name = 'pear2';\n $this->assertEquals('pear2', $pear->name);\n }",
"public function testSearchForProductByAttribute()\n {\n // full results flag returns the full data set for the product\n }",
"public function testQueryFetchObjectClass() {\n $records = 0;\n $query = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25]);\n while ($result = $query->fetchObject(FakeRecord::class, [1])) {\n $records += 1;\n $this->assertInstanceOf(FakeRecord::class, $result);\n $this->assertSame('John', $result->name, '25 year old is John.');\n $this->assertSame(1, $result->fakeArg, 'The record has received an argument through its constructor.');\n }\n $this->assertSame(1, $records, 'There is only one record.');\n }",
"public function test_findId() {\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 1]]);\n $this->assertNotNull($data);\n $this->assertEquals(1, $data[0]['SampleSet']['id']);\n $this->assertEquals(1, count($data));\n }",
"public function testProfilePrototypeFindByIdLikes()\n {\n\n }",
"public function testFindAll() : void\n {\n /** @var EntityManager $em */\n $em = $this->getApplicationServiceLocator()->get(EntityManager::class);\n $postRepository = $em->getRepository(Post::class);\n static::assertNotEmpty($postRepository->findAll());\n }",
"public function Find()\n {\n //TODO Suche mit den werten machen\n }",
"public function Find()\n {\n //TODO Suche mit den werten machen\n }",
"public function Find()\n {\n //TODO Suche mit den werten machen\n }",
"public function testResultGetAll_Object()\n {\n \t$result = $this->conn->query(\"SELECT * FROM test WHERE status='ACTIVE'\");\n \t$this->assertEquals(array((object)array('id'=>1, 'key'=>'one', 'title'=>'first row', 'status'=>'ACTIVE'), (object)array('id'=>2, 'key'=>'two', 'title'=>'next row', 'status'=>'ACTIVE')), $result->getAll(DB::FETCH_OBJECT));\n }",
"function test_find()\n {\n // Arrange\n $brand_name = \"Nike\";\n $test_brand = new Brand($brand_name);\n $test_brand->save();\n $id = $test_brand->getId();\n\n $brand_name2 = \"Adidas\";\n $test_brand2 = new Brand($brand_name2);\n $test_brand2->save();\n\n //Act\n $result = Brand::find($id);\n\n //Assert\n $this->assertEquals($test_brand, $result);\n }",
"public function canIterateOverProperties()\n {\n $object0 = $this->getMock('ATM_Config_Abstract', array('getName'));\n $object1 = $this->getMock('ATM_Config_Comment', array(), array('comment'));\n $this->object->append($object0);\n $this->object->append($object1);\n $this->object->append($object0);\n $this->object->iterateOn('objIds');\n $expect = $this->object->getArrayCopy();\n foreach ($this->object as $position=>$objectId) {\n $this->assertInternalType('string', $objectId);\n $this->assertEquals($expect[$position], $objectId);\n }\n $this->assertEquals(2, $position);\n }",
"public function testProfilePrototypeFindByIdGroups()\n {\n\n }",
"public function test_findAggregation() {\n $data = $this->SampleSet->find('all', ['conditions' => ['set_code LIKE' => 'tn%']]);\n // One confidential and one old version have being filtered\n $this->assertEquals(1, count($data));\n $this->SampleSet->username = 'sub2';\n $data = $this->SampleSet->find('all', ['conditions' => ['set_code LIKE' => 'tn%']]);\n // The confidential one has nolonger being filtered\n $this->assertEquals(2, count($data));\n }",
"public function testCopyFindData() {\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyFindData(1),\n\t\t\t$this->expectedFromFixtures[0]\n\t\t);\n\t}",
"public function testSearchForProductByAttributeType()\n {\n // full results flag returns the full data set for the product\n }",
"public function testQuarantineFind()\n {\n\n }",
"public abstract function getObjects();",
"public function testGetAllNoPersistentObject() {\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testReadMultipleRecords 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => 'testReadMultipleRecords 2'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testReadMultipleRecords 3']\r\n ];\r\n // Write data to the database\r\n foreach ($records as $record) {\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$record['UUID'].'\\','.($record['bool'] ? 1:0).','.$record['int'].', \\''.$record['string'].'\\')');\r\n }\r\n // Read data out and cast it to persistent object with incomplete metadata\r\n $this->setExpectedException('Exception', 'The given class is not derived from avorium_core_persistence_PersistentObject. But this is needed to extract the table name!');\r\n $this->getPersistenceAdapter()->getAll('test_persistence_AbstractPersistenceAdapterTestNoPersistentObject');\r\n }",
"public function testDataSet()\n {\n $data = ['name' => 'Guy', 'color' => 'Green', 'food' => 'Pizza'];\n $model = new MyModel($data);\n\n $this->assertTrue($model->name === 'Guy');\n $this->assertTrue($model->color === 'Green');\n\n // this could throw an exception instead of null\n $this->assertTrue($model->food === null);\n\n\n $model->name = 'Jane';\n\n $this->assertTrue($model->name === 'Jane');\n\n $this->assertTrue(MyModel::getName() == 'MyModel');\n\n $properties = MyModel::getProperties();\n $this->assertTrue(in_array('name', $properties));\n\n $this->assertTrue(in_array('color', $properties));\n\n $this->assertFalse(in_array('food', $properties));\n\n\n }",
"public function testGetUser()\n {\n $user = factory(User::class)->create();\n $userRepo = new UserRepository(new User);\n $found = $userRepo->get($user->id);\n\n $this->assertInstanceOf(User::class, $found);\n foreach ($this->data as $key => $value) {\n \t$this->assertEquals($found->$key, $user->$key);\n }\n }",
"public function getInstances() {}",
"public function findAll()\n {\n $mockResult = $this->getMock('stubDatabaseResult');\n $this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));\n $mockResult->expects($this->exactly(2))\n ->method('fetchAll')\n ->will($this->onConsecutiveCalls(false, array(array('bar' => 'Here is bar.', 'default' => 'And this is default.'))));\n $finderResult = $this->dbFinder->findAll($this->mockConnection, new stubReflectionClass('MockSinglePrimaryKeyEntity'));\n $this->assertEquals(0, $finderResult->count());\n $finderResult = $this->dbFinder->findAll($this->mockConnection, new stubReflectionClass('MockSinglePrimaryKeyEntity'));\n $this->assertEquals(1, $finderResult->count());\n $data = $finderResult->current();\n $this->assertEquals('Here is bar.', $data->withAnnotation());\n $this->assertEquals('And this is default.', $data->withDefaultValue());\n $select = $this->mockQueryBuilder->getSelect();\n $this->assertEquals('foo', $select->getBaseTableName());\n $this->assertEquals('bar ASC', $select->getOrderedBy());\n $this->assertFalse($select->hasLimit());\n $this->assertNull($select->getOffset());\n $this->assertNull($select->getAmount());\n $this->assertFalse($select->hasCriterion());\n }",
"public function testCount()\n\t{\n\t\t$this->assertEquals(3, count($this->instance));\n\t}",
"function testFindById() {\r\n $this->User = new User();\r\n \r\n $this->User->contain();\r\n $result = $this->User->findById(1, 'email');\r\n \r\n $expected = array('User' => array( 'email' => '[email protected]' ) );\r\n \r\n $this->assertEqual($result, $expected);\r\n }",
"public function getInstances() {\n\t\t$instances = array();\n\t\tforeach ($this->objects as $objectName => $information) {\n\t\t\tif (isset($information['i'])) {\n\t\t\t\t$instances[$objectName] = $information['i'];\n\t\t\t}\n\t\t}\n\t\treturn $instances;\n\t}",
"public function testFetchObjectWithMultipleCallsAndNoInstance() {\n $fixture = array(\n \"c1\" => \"r1v1\",\n \"c2\" => \"r1v2\"\n );\n \n $stub = $this->getMockBuilder(\"\\Examples\\ThriftServices\\Hive\\HivePDOStatement\")\n ->disableOriginalConstructor()\n ->setMethods(array(\"fetch\"))\n ->getMock();\n \n $stub->expects($this->exactly(2))\n ->method(\"fetch\")\n ->will($this->onConsecutiveCalls($fixture, array()));\n \n $obj = $stub->fetchObject(\"\\stdClass\");\n $this->assertInstanceOf(\"\\stdClass\", $obj);\n \n foreach($fixture as $col => $value) {\n $this->assertEquals($obj->{$col}, $value);\n }\n \n $this->assertFalse($stub->fetchObject(\"\\stdClass\"));\n }",
"public function it_can_be_instantiated(): void\n {\n $results = [\n Meta::make('name', 'Hello world'),\n new Meta('name', 'Hello world'),\n ];\n $expectations = [\n \\Arcanedev\\SeoHelper\\Contracts\\Renderable::class,\n \\Arcanedev\\SeoHelper\\Contracts\\Helpers\\Meta::class,\n \\Arcanedev\\SeoHelper\\Helpers\\Meta::class,\n ];\n\n foreach ($results as $actual) {\n /** @var Meta $actual */\n foreach ($expectations as $expected) {\n static::assertInstanceOf($expected, $actual);\n }\n\n static::assertSame('name', $actual->key());\n static::assertTrue($actual->isValid());\n }\n }",
"public function test2()\n\t\t{\n\t\t\treturn get_object_vars($this);\n\t\t}",
"public function testFindFirst()\n {\n $this->assertEquals(2, $this->object->findFirst(function ($item) {\n return $item === 2;\n }));\n $this->assertEquals(1, $this->object->findFirst(function ($item) {\n return $item % 2;\n }));\n }",
"public function testFetchObjectWithMultipleCallsWithInstance() {\n $fixture = array(\n \"c1\" => \"r1v1\",\n \"c2\" => \"r1v2\"\n );\n \n $wrapper = new \\stdClass();\n \n $stub = $this->getMockBuilder(\"\\Examples\\ThriftServices\\Hive\\HivePDOStatement\")\n ->disableOriginalConstructor()\n ->setMethods(array(\"fetch\"))\n ->getMock();\n \n $stub->expects($this->exactly(2))\n ->method(\"fetch\")\n ->will($this->onConsecutiveCalls($fixture, array()));\n \n $obj = $stub->fetchObject($wrapper);\n $this->assertInstanceOf(get_class($wrapper), $obj);\n $this->assertSame($obj, $wrapper);\n \n foreach($fixture as $col => $value) {\n $this->assertEquals($obj->{$col}, $value);\n }\n \n $this->assertFalse($stub->fetchObject(clone $wrapper));\n }",
"public function testWithObjectMap() : void {\n $bob = Record::fromName(\"bob\");\n $result = Result::fromResponse(\n Response::fromQueriedRecords(null, $bob),\n [Example::TYPE => Example::class]\n );\n\n $first = $result->first();\n $this->assertInstanceOf(Example::class, $first);\n $this->assertEquals($bob[\"Id\"], $first->Id);\n $this->assertEquals($bob[\"Name\"], $first->Name);\n }",
"public function testMatchRetrieval()\n {\n // Given a match has been created in the database\n $insertedmatch = factory(Match::class)->create($this->data());\n \n // When I fetch the matches\n $retrievedmatch = Match::get();\n $this->assertTrue(true);\n }",
"public function find(){\n\n $params = $this->_where;\n $selects = $this->preparedSelects();\n $order = $this->preparedOrderBy();\n $range = $this->_range;\n $depth = $this->_depth;\n $objects = array();\n\n $found = $this->_find($params,$selects,$order,$range,$depth);\n\n if($this->_rest->statusCode() == 200){\n $this->_count = $this->_rest->count();\n $indexKey = $this->indexKey;\n\n // if the result is a single object (for example, in the case of listapi\n // query), it's converted to an array before being processed\n if(!is_array($found)) {\n $found = array($found);\n }\n foreach($found as $attributes){\n if($indexKey){\n $index = isset($attributes->$indexKey) ? $attributes->$indexKey : count($objects);\n }else{\n $index = count($objects);\n }\n\n if($this->objectClass == Object::USER_OBJECT_CLASS){\n $objects[$index] = new User($attributes);\n }else{\n $objects[$index] = new Object($this->objectClass,$attributes);\n }\n }\n }\n\n return $objects;\n }",
"public function testFindAllByName()\n {\n $this->assertCount(2, $this->appService->findAllByName('api'));\n }",
"public function testProfilePrototypeFindByIdQuarantines()\n {\n\n }",
"public function testFindPersistedEntities() {\n\t\t$table = TableRegistry::get('users');\n\t\t$table->entity = true;\n\t\t$results = $table->find('all');\n\t\t$this->assertCount(4, $results);\n\t\tforeach ($results as $article) {\n\t\t\t$this->assertFalse($article->isNew());\n\t\t}\n\t}",
"public function get_test_persistent_object_cache()\n {\n }",
"public function testFindBy() {\n\t\t\tforeach($this->users as $user) {\n\t\t\t\t$_user = User::find_by(array('conditions' => \"name = '\" . $user . \"'\"));\n\t\t\t\t$lamda = call_user_func(strtolower($user));\n\t\t\t\t//lots of redudent checking here to make sure the lamda function is also returning the right data\n\t\t\t\t$this->assertEquals($lamda->name, $_user->name);\n\t\t\t\t$this->assertEquals($user, $lamda->name);\n\t\t\t\t$this->assertEquals($user, $_user->name);\n\t\t\t\t$this->assertEquals($lamda, $_user);\n\t\t\t}\n\t\t}",
"public function findAllLoaded() {}",
"function test_getAll()\n {\n // Arrange\n $brand_name = \"Nike\";\n $test_brand = new Brand($brand_name);\n $test_brand->save();\n\n\n $brand_name2 = \"Adidas\";\n $test_brand2 = new Brand($brand_name2);\n $test_brand2->save();\n\n //Act\n $result = Brand::getAll();\n\n //Assert\n $this->assertEquals([$test_brand, $test_brand2], $result);\n }",
"public function testGetMeta()\n {\n $meta1 = Person::getMeta();\n $meta2 = Person::objects()->getMeta();\n\n $this->assertSame($meta1, $meta2);\n }",
"public function testFetching()\n {\n $this->assertType('Horde_Kolab_Server_Object', $this->koward->getObject('cn=Gunnar Wrobel,dc=example,dc=org'));\n }",
"public function testBean()\n\t{\n\t\tR::nuke();\n\t\t$book = R::dispense( 'book' );\n\t\t$pages = R::dispense( 'page', 2 );\n\t\t$ads = R::dispense('ad', 3 );\n\t\t$tags = R::dispense( 'tag', 2 );\n\t\t$author = R::dispense( 'author' );\n\t\t$coauthor = R::dispense( 'author' );\n\t\t$book->alias( 'magazine' )->ownAd = $ads;\n\t\t$book->ownPage = $pages;\n\t\t$book->sharedTag = $tags;\n\t\t$book->via( 'connection' )->sharedUser = array( R::dispense( 'user' ) );\n\t\t$book->author = $author;\n\t\t$book->coauthor = $coauthor;\n\t\tR::store( $book );\n\t\t$book = $book->fresh();\n\t\tasrt( count($book->ownPage), 2 );\n\t\tasrt( count($book->alias('magazine')->ownAd), 3 );\n\t\t$book->ownAd = array();\n\t\tarray_pop( $book->ownPage );\n\t\tR::store( $book );\n\t\t$book = $book->fresh();\n\t\tasrt( count($book->ownPage), 1 );\n\t\tasrt( count($book->alias('magazine')->ownAd), 0 );\n\t}",
"public function testFetchObject()\n {\n $this->todo('stub');\n }",
"public function testFixtureRecord()\n {\n \n $data = $this->EmergencyContacts->find()->where(['etype' => '1']);\n $this->assertEquals(2, $data->count());\n\n }",
"public function testQueryFetchClass() {\n $records = [];\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25], ['fetch' => FakeRecord::class]);\n foreach ($result as $record) {\n $records[] = $record;\n $this->assertInstanceOf(FakeRecord::class, $record);\n $this->assertSame('John', $record->name);\n }\n\n $this->assertCount(1, $records, 'There is only one record.');\n }",
"public function testFindServiceData()\n {\n\n }",
"public function test_find() : void\n {\n $journalMetadata1 = $this->prophesize(Metadata\\Comment::class);\n $journalMetadata2 = $this->prophesize(Metadata\\Comment::class);\n $this->compiler_prophecy\n ->compile(Argument::any())\n ->willReturn([\n $journalMetadata1->reveal(),\n $journalMetadata2->reveal(),\n ]);\n\n // create a new repository\n $repo = new FilesystemAnnotationRepository($this->file_source_prophecy->reveal(), $this->compiler_prophecy->reveal());\n\n // check the repository\n $entries = $repo->find();\n\n // check that the right number and content of entries is found\n $this->assertCount(2, $entries);\n $this->assertContains($journalMetadata1->reveal(), $entries);\n $this->assertContains($journalMetadata2->reveal(), $entries);\n }",
"public function testShow()\n\t{\n\t\t$response = $this->call('GET', '/'.self::$endpoint.'/'.$this->obj->id);\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t\t$result = $response->getOriginalContent()->toArray();\n\n\t\t// tes apakah hasil return adalah yang sesuai\n\t\tforeach ($this->obj->attributesToArray() as $attr => $attr_val)\n\t\t\t$this->assertArrayHasKey($attr, $result);\n\n\t\t// tes tak ada yang dicari\n\t\t$response = $this->call('GET', '/'.self::$endpoint.'/696969');\n\t\t$this->assertEquals(500, $response->getStatusCode());\n\t}",
"public function find($object) {\r\n $oReflectionClass = new ReflectionClass($object);\r\n //$properties = $oReflectionClass->getProperties(ReflectionProperty::IS_PUBLIC);\r\n $properties = $oReflectionClass->getProperties();\r\n $this->className = $class = $oReflectionClass->getName();\r\n\r\n foreach ($properties as $key => $reflectionProperty)\r\n $datos_where[$reflectionProperty->getName()] = $reflectionProperty->getValue($object);\r\n $this->setList(null);\r\n $this->setObject(null);\r\n $table = $this->table = CriteriaEntityMgr::instance()->findTable($this->className);\r\n $this->SQL = MySQL_DB::instance()->DBSQLSelect($table, null, $datos_where, $this->array_order, $this->type_order);\r\n $this->execute();\r\n $list = array();\r\n if($this->getNumRows() == 1) {\r\n $row = MySQL_DB::instance()->DBFetchArray($this->result);\r\n $object = $this->iterateProperty($class, $object, $row, $properties);\r\n $this->setObject($object);\r\n $list[] = $object;\r\n }\r\n if($this->getNumRows() > 1) {\r\n while ($row = MySQL_DB::instance()->DBFetchArray($this->result)) {\r\n $object_new = $oReflectionClass->newInstance($oReflectionClass);\r\n $object_new = $this->iterateProperty($class, $object_new, $row, $properties);\r\n $list[] = $object_new;\r\n }\r\n }\r\n $this->setList($list);\r\n return $this;\r\n }",
"public function testProfilePrototypeFindByIdPosts()\n {\n\n }",
"public function testGetAllAssociated()\n {\n $this->setUp();\n $users = new Users(self::$config);\n $admin = $users->get(1);\n $student = $users->get(3);\n $injuries = new Injuries(self::$config);\n\n $reports = $injuries->getAllAssociated($admin);\n\n $this->assertNotNull($reports);\n $this->assertEquals(5, count($reports));\n\n // There are 3 where this student is involved\n $reports = $injuries->getAllAssociated($student);\n\n $this->assertNotNull($reports);\n $this->assertEquals(3, count($reports));\n }",
"function test_getStores()\n {\n $brand_name = 'Nike';\n $test_brand = new Brand($brand_name);\n $test_brand->save();\n\n $store_name = \"Nordstorm\";\n $test_store = new Store($store_name);\n $test_store->save();\n\n $store_name2 = 'Macys';\n $test_store2 = new Store($store_name2);\n $test_store2->save();\n\n $test_brand->addStore($test_store);\n $test_brand->addStore($test_store2);\n $result = $test_brand->getStores();\n\n $this->assertEquals([$test_store, $test_store2], $result);\n }",
"public function findAll() {\n\t\t$registrations = $this->registrationRepository->findAll();\n\t\t$this->assertEquals(10, $registrations->count());\n\t}",
"private function extractObjects(&$data){\n\t\tif(!preg_match_all($this->patObject, $data, $matches)){\n\t\t\tthrow new Exception(\"No objects found\"); \n\t\t} else {\n\t\t\t// Trim the results, because \\R in regex assertion (lookback) causes problems.\n\t\t\tforeach($matches[0] as $key => $match){\n\t\t\t\t$newObject = new pdfObject(trim($match));\n\t\t\t\t$this->objects[$newObject->objectNumber] = $newObject;\n\t\t\t}\n\t\t\treturn $this->objects;\n\t\t}\n\t}",
"public function testIfReturnsAllElements()\n {\n $factory = new FileSystemMapFactory();\n $result = $factory->create($this->data);\n\n $this->assertEquals(count($this->data), count($result));\n }",
"public function test_findConfidential() {\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(0, count($data));\n $this->SampleSet->username = 'sub2';\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(1, count($data));\n $this->assertEquals(2, $data[0]['SampleSet']['id']);\n $this->SampleSet->username = 'chem2';\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(1, count($data));\n $this->assertEquals(2, $data[0]['SampleSet']['id']);\n }",
"public function testGetAllPistas()\n {\n $fakePista = factory(Pista::class,1)->create([\n 'id' => 4545\n ]);\n $pistas = Pista::getAllPistas();\n foreach ($pistas as $pista) {\n if($pista->id == 4545){\n $this->assertTrue($pista->id == $fakePista[0]->id);\n }\n }\n\n }",
"public function testQuarantineFindOne()\n {\n\n }",
"public function testProfilePrototypeFindByIdOwnedGroups()\n {\n\n }",
"public function canReturnABindedCollectionForAGivenName()\n {\n $object0 = $this->getMock('ATM_Config_Abstract', array('getName'));\n $object1 = clone $object0;\n $object0->expects($this->any())\n ->method('getName')\n ->will($this->returnValue('object0'));\n $object1->expects($this->any())\n ->method('getName')\n ->will($this->returnValue('object1'));\n $this->object->append($object0);\n $this->object->append($object1);\n $this->object->append($object0);\n $collection = $this->object->filterNames('object0');\n $this->assertSame($object0, $collection[0]);\n $this->assertSame($object0, $collection[1]);\n $this->assertFalse(isset($collection[2]));\n // set all $object0 to $object1 in this object\n $collection[0]=$object1;\n $this->assertSame($object1, $collection[0]);\n $this->assertSame($object1, $this->object[0]);\n $this->assertSame($object1, $this->object[1]);\n $this->assertSame($object0, $this->object[2]);\n $this->object[0]=$object0;\n $this->assertSame($object1, $collection[0]);\n }",
"public function objectIdentifierExposureTestData() {}",
"protected function testObject() {\n }",
"static function findAll() {$finder = self::getFinder( __CLASS__ ); return $finder->findAll();}",
"static function findAll() {$finder = self::getFinder( __CLASS__ ); return $finder->findAll();}",
"static function findAll() {$finder = self::getFinder( __CLASS__ ); return $finder->findAll();}",
"public function findAll() {}",
"public function findAll() {}",
"public function testFindByIdIsSuccess()\n {\n $tblGateMock = $this->getMockBuilder(TableGateway::class)\n ->setConstructorArgs(array($this->getDbal()))\n ->setMethodsExcept(['findById', 'setTable'])\n ->getMock();\n $tblGateMock->setTable('Person');\n\n //exercise SUT\n $row = $tblGateMock->findById($this->person['id']);\n\n //assert return value\n $this->assertTrue(is_array($row), 'result not array');\n $this->assertNotEmpty($row, 'result set is empty');\n\n foreach(array_keys($this->person) as $key) {\n $this->assertArrayHasKey($key, $row[0]);\n $this->assertEquals($this->person[$key], $row[0][$key]);\n }\n }",
"public function findAll() {}",
"public function find($class);",
"public function testInvoke()\n {\n $this->instance->{$this->name};\n // Copy the instance to a local variable as we can't invoke it directly.\n $instance = $this->instance;\n $instance = $instance();\n self::assertInstanceOf(\n Chameleon::class,\n $instance,\n 'Instance invocation does not return an instance of Chameleon'\n );\n self::assertTrue(\n array_key_exists($this->name, $instance),\n 'Instance element cannot be tested with array_key_exists'\n );\n }",
"public function testQueryFetchDefault() {\n $records = [];\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25]);\n $this->assertInstanceOf(StatementInterface::class, $result);\n foreach ($result as $record) {\n $records[] = $record;\n $this->assertIsObject($record);\n $this->assertSame('John', $record->name);\n }\n\n $this->assertCount(1, $records, 'There is only one record.');\n }",
"public function testCreateInstancesFromQuery()\n {\n $entityData = array(\n \"name\" => 'my recurring event',\n \"ts_start\" => strtotime(\"2016-01-01 08:00:00 PST\"),\n \"ts_end\" => strtotime(\"2016-01-01 09:00:00 PST\"),\n \"recurrence_pattern\" => array(\n \"recur_type\" => Recurrence\\RecurrencePattern::RECUR_DAILY,\n \"interval\" => 1,\n \"date_start\" => \"2016-01-01\",\n \"date_end\" => \"2016-01-05\",\n )\n );\n $event = $this->entityLoader->create(\"calendar_event\");\n $event->fromArray($entityData);\n $this->entityDataMapper->save($event);\n $recurId = $event->getRecurrencePattern()->getId();\n\n // Create a query that gets events from January 1 to January 5\n $dateTo = new \\DateTime(\"2016-01-05\");\n $query = new EntityQuery(\"calendar_event\");\n $query->where(\"ts_start\")->isLessThan($dateTo->format(\"Y-m-d\"));\n\n // Have the manager create instances using the query\n $this->recurSeriesManager->createInstancesFromQuery($query);\n\n // Open the recurrence pattern and make sure to date processed to was moved out\n $recurrencePattern = $this->recurIndentityMapper->getById($recurId);\n $dateProcessedTo = $recurrencePattern->getDateProcessedTo();\n $this->assertEquals($dateProcessedTo->format(\"Y-m-d\"), $dateTo->format(\"Y-m-d\"));\n\n // Cleanup\n $this->entityDataMapper->delete($event, true);\n\n }",
"public function testFind()\n {\n $data = array('id' => 1, 'username' => 'root', 'password' => 'password');\n $mockPDO = $this->getMock('\\\\PDOMock', array('fetchOne'));\n $mockPDO\n ->expects($this->once())\n ->method('fetchOne')\n ->will($this->returnCallback(function($arg1, $arg2) use ($data) {\n $sql = 'SELECT\n *\nFROM\n `users`\nWHERE\n id = :id\nORDER BY\n id ASC';\n\n if($arg1 == $sql && $arg2 == array('id' => 1)) {\n return $data;\n } else {\n return array();\n }\n }))\n ;\n $storage = new AuraExtendedPdo($mockPDO, new QueryFactory('mysql'));\n $result = $storage->find(array('id' => 1), 'users');\n\n $this->assertEquals($data['id'], $result['id']);\n $this->assertEquals($data['username'], $result['username']);\n $this->assertEquals($data['password'], $result['password']);\n }",
"public function testGetOneClass()\n {\n $result = $this->getQueryBuilderConnection()\n ->select()\n ->from('querybuilder_tests')\n ->where('id', '=', 1)\n ->getOneClass(SampleObject::class);\n\n $object = SampleObject::create('1', '1', 'bbbb');\n\n $this->assertEquals($object, $result);\n }",
"public function canReturnABindedCollectionForAGivenClass()\n {\n $object0 = $this->getMock('ATM_Config_Abstract', array('getName'));\n $object1 = $this->getMock('ATM_Config_Comment', array(), array('comment'));\n $this->assertNotEquals(get_class($object0), get_class($object1));\n $this->object->append($object0);\n $this->object->append($object1);\n $this->object->append($object0);\n $collection = $this->object->filterClasses(get_class($object0));\n $this->assertSame($object0, $collection[0]);\n $this->assertSame($object0, $collection[1]);\n $this->assertFalse(isset($collection[2]));\n // set all $object0 to $object1 in this object\n $collection[0]=$object1;\n $this->assertSame($object1, $collection[0]);\n $this->assertSame($object1, $this->object[0]);\n $this->assertSame($object1, $this->object[1]);\n $this->assertSame($object0, $this->object[2]);\n $this->object[0]=$object0;\n $this->assertSame($object1, $collection[0]);\n }",
"public function testFindUser()\n {\n $user = factory(User::class)->create();\n $found = User::query()->find($user->id);\n $this->assertNotEmpty($found);\n $this->assertEquals($user->id, $found->id);\n }",
"public function testSelectAll() {\n $testUser = [];\n $testUser[0] = new User();\n $testUser[0]->setUsername('testUser');\n $testUser[0]->create();\n\n $testUser[1] = new User();\n $testUser[1]->setUsername('testUser2');\n $testUser[1]->create();\n\n // Create a test rank\n $testRank = [];\n $testRank[0] = new Rank();\n $testRank[0]->setName('testRank');\n $testRank[0]->create();\n\n $testRank[1] = new Rank();\n $testRank[1]->setName('testRank2');\n $testRank[1]->create();\n\n // Create a test user rank\n $testUserRank = [];\n $testUserRank[0] = new UserRank();\n $testUserRank[0]->setUserID($testUser[0]->getID());\n $testUserRank[0]->setRankID($testRank[0]->getID());\n $testUserRank[0]->create();\n\n $testUserRank[1] = new UserRank();\n $testUserRank[1]->setUserID($testUser[1]->getID());\n $testUserRank[1]->setRankID($testRank[1]->getID());\n $testUserRank[1]->create();\n\n // Select and check\n $selectedMultiple = UserRank::select(array());\n\n $this->assertTrue(\\is_array($selectedMultiple));\n $this->assertEquals(2, \\count($selectedMultiple));\n $this->assertInstanceOf(UserRank::class, $selectedMultiple[0]);\n $this->assertInstanceOf(UserRank::class, $selectedMultiple[1]);\n\n if($testUserRank[0]->getID() == $selectedMultiple[0]->getID()) {\n $i = 0;\n $j = 1;\n }\n else {\n $i = 1;\n $j = 0;\n }\n\n $this->assertEquals($testUserRank[0]->getID(), $selectedMultiple[$i]->getID());\n $this->assertEquals($testUserRank[0]->getUserID(), $selectedMultiple[$i]->getUserID());\n $this->assertEquals($testUserRank[0]->getRankID(), $selectedMultiple[$i]->getRankID());\n\n $this->assertEquals($testUserRank[1]->getID(), $selectedMultiple[$j]->getID());\n $this->assertEquals($testUserRank[1]->getUserID(), $selectedMultiple[$j]->getUserID());\n $this->assertEquals($testUserRank[1]->getRankID(), $selectedMultiple[$j]->getRankID());\n\n // Clean up\n foreach($testUserRank as $userRank) {\n $userRank->delete();\n }\n foreach($testUser as $user) {\n $user->delete();\n }\n foreach($testRank as $rank) {\n $rank->delete();\n }\n }",
"public function testIterator()\n {\n foreach ($this->pool as $code => $class) {\n $this->assertEquals($this->pool[$code], $class);\n }\n }",
"public function testGetInstancesByTag(){\n $result = $this->aws->getInstancesByTag('environment', $this->environment);\n $this->assertNotEmpty($result);\n $this->assertArrayHasKey('Instances', $result[0]);\n $this->assertNotEmpty($result[0]['Instances']);\n $this->assertContains(array('Value' => $this->environment, 'Key' => 'environment'), $result[0]['Instances'][0]['Tags']);\n return $result;\n }"
] | [
"0.65012705",
"0.6381913",
"0.625526",
"0.6200126",
"0.6117206",
"0.60985893",
"0.6073501",
"0.603796",
"0.5996785",
"0.5937547",
"0.59029263",
"0.58676267",
"0.5860701",
"0.5854859",
"0.5831004",
"0.5804406",
"0.5757",
"0.5749655",
"0.5728703",
"0.57137245",
"0.57110256",
"0.57024884",
"0.56165016",
"0.5608046",
"0.5604318",
"0.55894935",
"0.55894935",
"0.55894935",
"0.55885714",
"0.558666",
"0.55532014",
"0.55429137",
"0.5513185",
"0.5512872",
"0.55022013",
"0.5501085",
"0.54983723",
"0.5465497",
"0.5465003",
"0.5461754",
"0.5453927",
"0.54533213",
"0.54496443",
"0.54382545",
"0.54374784",
"0.54296064",
"0.54295737",
"0.5427097",
"0.54214954",
"0.54203135",
"0.5417779",
"0.54147685",
"0.5413872",
"0.54114187",
"0.540763",
"0.54058015",
"0.5397709",
"0.5395109",
"0.5388798",
"0.5375359",
"0.5372508",
"0.53706145",
"0.5367142",
"0.5366849",
"0.5362154",
"0.5358374",
"0.53571826",
"0.5354337",
"0.53479546",
"0.53409666",
"0.533071",
"0.53299016",
"0.53227955",
"0.53217185",
"0.5321697",
"0.5316837",
"0.5313039",
"0.52987075",
"0.5296849",
"0.5292883",
"0.5287728",
"0.52848595",
"0.5275573",
"0.5272981",
"0.5272981",
"0.5272981",
"0.52694416",
"0.52694416",
"0.52688175",
"0.5267849",
"0.5266746",
"0.52518415",
"0.52483326",
"0.52421075",
"0.52357644",
"0.5234045",
"0.5232331",
"0.5229",
"0.5215268",
"0.5210782",
"0.5210619"
] | 0.0 | -1 |
test that finding data for all instances of an object works as expected | public function findAllOverruleLimitClause()
{
$mockResult = $this->getMock('stubDatabaseResult');
$this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));
$mockResult->expects($this->once())
->method('fetchAll')
->will($this->returnValue(array(array('bar' => 'Here is bar.', 'default' => 'And this is default.'))));
$finderResult = $this->dbFinder->findAll($this->mockConnection, new stubReflectionClass('MockSinglePrimaryKeyEntity'), null, 50, 10);
$this->assertEquals(1, $finderResult->count());
$data = $finderResult->current();
$this->assertEquals('Here is bar.', $data->withAnnotation());
$this->assertEquals('And this is default.', $data->withDefaultValue());
$select = $this->mockQueryBuilder->getSelect();
$this->assertEquals('foo', $select->getBaseTableName());
$this->assertEquals('bar ASC', $select->getOrderedBy());
$this->assertTrue($select->hasLimit());
$this->assertEquals(50, $select->getOffset());
$this->assertEquals(10, $select->getAmount());
$this->assertFalse($select->hasCriterion());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testFind()\n {\n $this->assertEquals(1, $this->object->find(function ($item) {\n return $item === 2;\n })->count());\n $this->assertEquals(2, $this->object->find(function ($item) {\n return $item % 2;\n })->count());\n }",
"public function testFindAll()\n {\n $this->createDummyRecord();\n\n $results = $this->generic->findAll();\n\n $list = $this->getPhysicalNumberOrRecords();\n\n $this->assertEquals(get_class($results), 'Ds\\Deque');\n $this->assertEquals(count($list), $results->count());\n }",
"public function testQueryFetchObject() {\n $records = [];\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25], ['fetch' => \\PDO::FETCH_OBJ]);\n foreach ($result as $record) {\n $records[] = $record;\n $this->assertIsObject($record);\n $this->assertSame('John', $record->name);\n }\n\n $this->assertCount(1, $records, 'There is only one record.');\n }",
"public function find($data);",
"public function find($obj){\n\t}",
"protected function testObjects() {\n }",
"public function testFind() {\n\t\t\tforeach($this->user_ids as $id) {\n\t\t\t\t$_user = User::_find($id);\n\t\t\t\t$this->assertTrue((isset($_user) && !empty($_user)));\n\t\t\t}\n\t\t\t//test finding by ids with cache\n\t\t\tforeach($this->user_ids as $id) {\n\t\t\t\t$_user = User::find($id);\n\t\t\t\t$this->assertTrue((isset($_user) && !empty($_user)));\n\t\t\t}\n\t\t}",
"public function testGetAll() {\n\t\t$class = get_class($this->entity);\n\t\t$array = $this->entity->toArray(true);\n\t\t$filled = $this->fillArray($array);\n\t\t$entity = new $class($filled);\n\t\t\n\t\t$result = array();\n\t\tforeach ($filled as $attr => $val){\n\t\t\t$entity->{'set' . $attr}($val);\n\t\t\t$result[$attr] = $entity->{'get' . $attr}();\n\t\t}\n\t\t\n\t\t$this->assertEquals($filled, $result);\n\t}",
"public abstract function find();",
"public function testFindAll()\n {\n $this->assertCount(4, $this->appService->findAll());\n }",
"public function testFind() {\n\t\t$this->Post->entity(false);\n\t\t$result = $this->Post->find('first');\n\t\t$this->assertTrue(is_array($result));\n\t\t$this->assertEqual($result['Post']['title'], 'Hello');\n\n\t\t// 2. OK, let's roll.\n\t\t$s1 = $this->Post->find('first', ['entity' => true]);\n\t\t$this->assertTrue(is_a($s1, 'PostEntity'));\n\n\t\t// 3. find all.\n\t\t$result = $this->Post->find('all', ['entity' => true]);\n\t\t$this->assertTrue(is_array($result));\n\t\t$this->assertEqual(count($result), 3);\n\t\t$this->assertTrue(is_a($result[0], 'PostEntity'));\n\t\t$this->assertEqual($result[2]->title, 'again');\n\n\t\t// 4. find all with empty result.\n\t\t$result = $this->Post->find('all', [\n\t\t\t'entity' => true,\n\t\t\t'result' => [],\n\t\t]);\n\t\t$this->assertTrue(is_array($result));\n\t\t$this->assertEqual(count($result), 0);\n\t}",
"public function testForeach()\n {\n $this->instance->{$this->name};\n $i = 0;\n foreach ($this->instance as $key => $value) {\n $i++;\n self::assertTrue(\n is_string($key),\n 'Element key is not a string'\n );\n self::assertInstanceOf(\n Chameleon::class,\n $this->instance,\n 'Element value is not an instance of Chameleon'\n );\n }\n self::assertGreaterThan(\n 0,\n $i,\n 'Instance is not iterated'\n );\n }",
"public function testExample()\n{\n $temporada = new Temporada();\n $episodio1 = new Episodio();\n $episodio1->assistido = true;\n $episodio2 = new Episodio();\n $episodio2->assistido = false;\n $episodio3 = new Episodio();\n $episodio3->assistido = true;\n $temporada->episodios->add($episodio1);\n $temporada->episodios->add($episodio2);\n $temporada->episodios->add($episodio3);\n\n\n $episodiosAssistidos = $temporada->getEpisodiosAssistidos();\n $this->assertCount(2, $episodiosAssistidos);\n}",
"public function find();",
"public function testFind()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}",
"public function testObjectResult()\n {\n $result = $this->searchResult->objectResult();\n\n $this->assertObjectHasAttribute('results', $result);\n $this->assertObjectHasAttribute('status', $result);\n }",
"public function test_concrete()\n {\n foreach ($this->concrete as $data) {\n //echo \"Testing: $data[0]\\n\";\n $this->setTable($data[0]);\n $this->model = new $data[0];\n $this->assertInternalType('object', $this->model, $message = 'Collection: model creation did not return an object');\n $this->collection = $this->model->finder()->findAll();\n $this->assertInternalType('object', $this->collection, $message = 'Collection::collection creation did not return an object');\n $this->tst_notifyAccess();\n $this->tst_add();\n $this->tst_delete($data[0]);\n $this->tst_count();\n $this->tst_rewind();\n $this->tst_current();\n $this->tst_key();\n $this->tst_next();\n /*\n $this->tst_valid();\n */\n }\n }",
"public function testChainedFinders()\n {\n $index = new Index();\n $query = new Query($index);\n\n $finder = $query->find()->find();\n $this->assertInstanceOf(\\Cake\\ElasticSearch\\Query::class, $finder);\n }",
"public function find() {\r\n\t\t\t$class = new ReflectionObject($this);\r\n\t\t\t$properties = $class->getProperties(ReflectionProperty::IS_PUBLIC);\r\n\r\n\t\t\t// Loop through the properties to set them from the current row\r\n\t\t\t$select = $this->db->select();\r\n\t\t\tforeach ($properties as $property) {\r\n\t\t\t\t$name = $property->getName();\r\n\t\t\t\t// Set only DO field names of subclass\r\n\t\t\t\tif ($property->class == $class->name) {\r\n\t\t\t\t\tif (!is_null($this->$name)) {\r\n\t\t\t\t\t\t$columnName = $this->map($name);\r\n\t\t\t\t\t\t$select->where(\"$columnName = ?\", $this->$name);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$select->from($this->table);\r\n\t\t\t$stmt = $this->db->query($select);\r\n\t\t\t$rs = $stmt->fetchAll();\r\n\r\n\t\t\t$dataobjects = array();\r\n\t\t\tforeach ($rs as $row) {\r\n\t\t\t\t$dataobject = new $class->name($this->app);\r\n\t\t\t\treset($properties);\r\n\t\t\t\tforeach ($properties as $property) {\r\n\t\t\t\t\t$name = $property->getName();\r\n\t\t\t\t\t$dataobject->$name = $row[$this->map($name)];\r\n\t\t\t\t}\r\n\t\t\t\t$dataobjects[] = $dataobject;\r\n\t\t\t}\r\n\t\t\treturn $dataobjects;\r\n\t\t}",
"function testObjectRecord()\n {\n $pear = new DataSourceArrayTestStore('pear');\n $doctrine = new DataSourceArrayTestStore('doctrine');\n $propel = new DataSourceArrayTestStore('propel');\n $this->datasource->bind(array(&$pear, &$doctrine, &$propel));\n\n $this->assertEquals(3, $this->datasource->count());\n\n $records = $this->datasource->fetch();\n $this->assertEquals('pear', $records[0]->name);\n $this->assertEquals('pear(tm)', $records[0]->getBrand());\n $this->assertEquals('doctrine', $records[1]->name);\n $this->assertEquals('doctrine(tm)', $records[1]->getBrand());\n $this->assertEquals('propel', $records[2]->name);\n $this->assertEquals('propel(tm)', $records[2]->getBrand());\n\n $this->datasource->sort('name');\n $records = $this->datasource->fetch(1, 1);\n $this->assertEquals('pear', $records[0]->name);\n $this->assertEquals('pear(tm)', $records[0]->getBrand());\n\n $records[0]->name = 'pear2';\n $this->assertEquals('pear2', $pear->name);\n }",
"public function testSearchForProductByAttribute()\n {\n // full results flag returns the full data set for the product\n }",
"public function testQueryFetchObjectClass() {\n $records = 0;\n $query = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25]);\n while ($result = $query->fetchObject(FakeRecord::class, [1])) {\n $records += 1;\n $this->assertInstanceOf(FakeRecord::class, $result);\n $this->assertSame('John', $result->name, '25 year old is John.');\n $this->assertSame(1, $result->fakeArg, 'The record has received an argument through its constructor.');\n }\n $this->assertSame(1, $records, 'There is only one record.');\n }",
"public function test_findId() {\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 1]]);\n $this->assertNotNull($data);\n $this->assertEquals(1, $data[0]['SampleSet']['id']);\n $this->assertEquals(1, count($data));\n }",
"public function testProfilePrototypeFindByIdLikes()\n {\n\n }",
"public function testFindAll() : void\n {\n /** @var EntityManager $em */\n $em = $this->getApplicationServiceLocator()->get(EntityManager::class);\n $postRepository = $em->getRepository(Post::class);\n static::assertNotEmpty($postRepository->findAll());\n }",
"public function Find()\n {\n //TODO Suche mit den werten machen\n }",
"public function Find()\n {\n //TODO Suche mit den werten machen\n }",
"public function Find()\n {\n //TODO Suche mit den werten machen\n }",
"public function testResultGetAll_Object()\n {\n \t$result = $this->conn->query(\"SELECT * FROM test WHERE status='ACTIVE'\");\n \t$this->assertEquals(array((object)array('id'=>1, 'key'=>'one', 'title'=>'first row', 'status'=>'ACTIVE'), (object)array('id'=>2, 'key'=>'two', 'title'=>'next row', 'status'=>'ACTIVE')), $result->getAll(DB::FETCH_OBJECT));\n }",
"function test_find()\n {\n // Arrange\n $brand_name = \"Nike\";\n $test_brand = new Brand($brand_name);\n $test_brand->save();\n $id = $test_brand->getId();\n\n $brand_name2 = \"Adidas\";\n $test_brand2 = new Brand($brand_name2);\n $test_brand2->save();\n\n //Act\n $result = Brand::find($id);\n\n //Assert\n $this->assertEquals($test_brand, $result);\n }",
"public function canIterateOverProperties()\n {\n $object0 = $this->getMock('ATM_Config_Abstract', array('getName'));\n $object1 = $this->getMock('ATM_Config_Comment', array(), array('comment'));\n $this->object->append($object0);\n $this->object->append($object1);\n $this->object->append($object0);\n $this->object->iterateOn('objIds');\n $expect = $this->object->getArrayCopy();\n foreach ($this->object as $position=>$objectId) {\n $this->assertInternalType('string', $objectId);\n $this->assertEquals($expect[$position], $objectId);\n }\n $this->assertEquals(2, $position);\n }",
"public function testProfilePrototypeFindByIdGroups()\n {\n\n }",
"public function test_findAggregation() {\n $data = $this->SampleSet->find('all', ['conditions' => ['set_code LIKE' => 'tn%']]);\n // One confidential and one old version have being filtered\n $this->assertEquals(1, count($data));\n $this->SampleSet->username = 'sub2';\n $data = $this->SampleSet->find('all', ['conditions' => ['set_code LIKE' => 'tn%']]);\n // The confidential one has nolonger being filtered\n $this->assertEquals(2, count($data));\n }",
"public function testCopyFindData() {\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyFindData(1),\n\t\t\t$this->expectedFromFixtures[0]\n\t\t);\n\t}",
"public function testSearchForProductByAttributeType()\n {\n // full results flag returns the full data set for the product\n }",
"public function testQuarantineFind()\n {\n\n }",
"public abstract function getObjects();",
"public function testGetAllNoPersistentObject() {\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testReadMultipleRecords 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => 'testReadMultipleRecords 2'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testReadMultipleRecords 3']\r\n ];\r\n // Write data to the database\r\n foreach ($records as $record) {\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$record['UUID'].'\\','.($record['bool'] ? 1:0).','.$record['int'].', \\''.$record['string'].'\\')');\r\n }\r\n // Read data out and cast it to persistent object with incomplete metadata\r\n $this->setExpectedException('Exception', 'The given class is not derived from avorium_core_persistence_PersistentObject. But this is needed to extract the table name!');\r\n $this->getPersistenceAdapter()->getAll('test_persistence_AbstractPersistenceAdapterTestNoPersistentObject');\r\n }",
"public function testDataSet()\n {\n $data = ['name' => 'Guy', 'color' => 'Green', 'food' => 'Pizza'];\n $model = new MyModel($data);\n\n $this->assertTrue($model->name === 'Guy');\n $this->assertTrue($model->color === 'Green');\n\n // this could throw an exception instead of null\n $this->assertTrue($model->food === null);\n\n\n $model->name = 'Jane';\n\n $this->assertTrue($model->name === 'Jane');\n\n $this->assertTrue(MyModel::getName() == 'MyModel');\n\n $properties = MyModel::getProperties();\n $this->assertTrue(in_array('name', $properties));\n\n $this->assertTrue(in_array('color', $properties));\n\n $this->assertFalse(in_array('food', $properties));\n\n\n }",
"public function testGetUser()\n {\n $user = factory(User::class)->create();\n $userRepo = new UserRepository(new User);\n $found = $userRepo->get($user->id);\n\n $this->assertInstanceOf(User::class, $found);\n foreach ($this->data as $key => $value) {\n \t$this->assertEquals($found->$key, $user->$key);\n }\n }",
"public function getInstances() {}",
"public function findAll()\n {\n $mockResult = $this->getMock('stubDatabaseResult');\n $this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));\n $mockResult->expects($this->exactly(2))\n ->method('fetchAll')\n ->will($this->onConsecutiveCalls(false, array(array('bar' => 'Here is bar.', 'default' => 'And this is default.'))));\n $finderResult = $this->dbFinder->findAll($this->mockConnection, new stubReflectionClass('MockSinglePrimaryKeyEntity'));\n $this->assertEquals(0, $finderResult->count());\n $finderResult = $this->dbFinder->findAll($this->mockConnection, new stubReflectionClass('MockSinglePrimaryKeyEntity'));\n $this->assertEquals(1, $finderResult->count());\n $data = $finderResult->current();\n $this->assertEquals('Here is bar.', $data->withAnnotation());\n $this->assertEquals('And this is default.', $data->withDefaultValue());\n $select = $this->mockQueryBuilder->getSelect();\n $this->assertEquals('foo', $select->getBaseTableName());\n $this->assertEquals('bar ASC', $select->getOrderedBy());\n $this->assertFalse($select->hasLimit());\n $this->assertNull($select->getOffset());\n $this->assertNull($select->getAmount());\n $this->assertFalse($select->hasCriterion());\n }",
"public function testCount()\n\t{\n\t\t$this->assertEquals(3, count($this->instance));\n\t}",
"public function getInstances() {\n\t\t$instances = array();\n\t\tforeach ($this->objects as $objectName => $information) {\n\t\t\tif (isset($information['i'])) {\n\t\t\t\t$instances[$objectName] = $information['i'];\n\t\t\t}\n\t\t}\n\t\treturn $instances;\n\t}",
"function testFindById() {\r\n $this->User = new User();\r\n \r\n $this->User->contain();\r\n $result = $this->User->findById(1, 'email');\r\n \r\n $expected = array('User' => array( 'email' => '[email protected]' ) );\r\n \r\n $this->assertEqual($result, $expected);\r\n }",
"public function it_can_be_instantiated(): void\n {\n $results = [\n Meta::make('name', 'Hello world'),\n new Meta('name', 'Hello world'),\n ];\n $expectations = [\n \\Arcanedev\\SeoHelper\\Contracts\\Renderable::class,\n \\Arcanedev\\SeoHelper\\Contracts\\Helpers\\Meta::class,\n \\Arcanedev\\SeoHelper\\Helpers\\Meta::class,\n ];\n\n foreach ($results as $actual) {\n /** @var Meta $actual */\n foreach ($expectations as $expected) {\n static::assertInstanceOf($expected, $actual);\n }\n\n static::assertSame('name', $actual->key());\n static::assertTrue($actual->isValid());\n }\n }",
"public function testFetchObjectWithMultipleCallsAndNoInstance() {\n $fixture = array(\n \"c1\" => \"r1v1\",\n \"c2\" => \"r1v2\"\n );\n \n $stub = $this->getMockBuilder(\"\\Examples\\ThriftServices\\Hive\\HivePDOStatement\")\n ->disableOriginalConstructor()\n ->setMethods(array(\"fetch\"))\n ->getMock();\n \n $stub->expects($this->exactly(2))\n ->method(\"fetch\")\n ->will($this->onConsecutiveCalls($fixture, array()));\n \n $obj = $stub->fetchObject(\"\\stdClass\");\n $this->assertInstanceOf(\"\\stdClass\", $obj);\n \n foreach($fixture as $col => $value) {\n $this->assertEquals($obj->{$col}, $value);\n }\n \n $this->assertFalse($stub->fetchObject(\"\\stdClass\"));\n }",
"public function test2()\n\t\t{\n\t\t\treturn get_object_vars($this);\n\t\t}",
"public function testFetchObjectWithMultipleCallsWithInstance() {\n $fixture = array(\n \"c1\" => \"r1v1\",\n \"c2\" => \"r1v2\"\n );\n \n $wrapper = new \\stdClass();\n \n $stub = $this->getMockBuilder(\"\\Examples\\ThriftServices\\Hive\\HivePDOStatement\")\n ->disableOriginalConstructor()\n ->setMethods(array(\"fetch\"))\n ->getMock();\n \n $stub->expects($this->exactly(2))\n ->method(\"fetch\")\n ->will($this->onConsecutiveCalls($fixture, array()));\n \n $obj = $stub->fetchObject($wrapper);\n $this->assertInstanceOf(get_class($wrapper), $obj);\n $this->assertSame($obj, $wrapper);\n \n foreach($fixture as $col => $value) {\n $this->assertEquals($obj->{$col}, $value);\n }\n \n $this->assertFalse($stub->fetchObject(clone $wrapper));\n }",
"public function testFindFirst()\n {\n $this->assertEquals(2, $this->object->findFirst(function ($item) {\n return $item === 2;\n }));\n $this->assertEquals(1, $this->object->findFirst(function ($item) {\n return $item % 2;\n }));\n }",
"public function testWithObjectMap() : void {\n $bob = Record::fromName(\"bob\");\n $result = Result::fromResponse(\n Response::fromQueriedRecords(null, $bob),\n [Example::TYPE => Example::class]\n );\n\n $first = $result->first();\n $this->assertInstanceOf(Example::class, $first);\n $this->assertEquals($bob[\"Id\"], $first->Id);\n $this->assertEquals($bob[\"Name\"], $first->Name);\n }",
"public function testMatchRetrieval()\n {\n // Given a match has been created in the database\n $insertedmatch = factory(Match::class)->create($this->data());\n \n // When I fetch the matches\n $retrievedmatch = Match::get();\n $this->assertTrue(true);\n }",
"public function find(){\n\n $params = $this->_where;\n $selects = $this->preparedSelects();\n $order = $this->preparedOrderBy();\n $range = $this->_range;\n $depth = $this->_depth;\n $objects = array();\n\n $found = $this->_find($params,$selects,$order,$range,$depth);\n\n if($this->_rest->statusCode() == 200){\n $this->_count = $this->_rest->count();\n $indexKey = $this->indexKey;\n\n // if the result is a single object (for example, in the case of listapi\n // query), it's converted to an array before being processed\n if(!is_array($found)) {\n $found = array($found);\n }\n foreach($found as $attributes){\n if($indexKey){\n $index = isset($attributes->$indexKey) ? $attributes->$indexKey : count($objects);\n }else{\n $index = count($objects);\n }\n\n if($this->objectClass == Object::USER_OBJECT_CLASS){\n $objects[$index] = new User($attributes);\n }else{\n $objects[$index] = new Object($this->objectClass,$attributes);\n }\n }\n }\n\n return $objects;\n }",
"public function testFindAllByName()\n {\n $this->assertCount(2, $this->appService->findAllByName('api'));\n }",
"public function testProfilePrototypeFindByIdQuarantines()\n {\n\n }",
"public function testFindPersistedEntities() {\n\t\t$table = TableRegistry::get('users');\n\t\t$table->entity = true;\n\t\t$results = $table->find('all');\n\t\t$this->assertCount(4, $results);\n\t\tforeach ($results as $article) {\n\t\t\t$this->assertFalse($article->isNew());\n\t\t}\n\t}",
"public function get_test_persistent_object_cache()\n {\n }",
"public function testFindBy() {\n\t\t\tforeach($this->users as $user) {\n\t\t\t\t$_user = User::find_by(array('conditions' => \"name = '\" . $user . \"'\"));\n\t\t\t\t$lamda = call_user_func(strtolower($user));\n\t\t\t\t//lots of redudent checking here to make sure the lamda function is also returning the right data\n\t\t\t\t$this->assertEquals($lamda->name, $_user->name);\n\t\t\t\t$this->assertEquals($user, $lamda->name);\n\t\t\t\t$this->assertEquals($user, $_user->name);\n\t\t\t\t$this->assertEquals($lamda, $_user);\n\t\t\t}\n\t\t}",
"public function findAllLoaded() {}",
"function test_getAll()\n {\n // Arrange\n $brand_name = \"Nike\";\n $test_brand = new Brand($brand_name);\n $test_brand->save();\n\n\n $brand_name2 = \"Adidas\";\n $test_brand2 = new Brand($brand_name2);\n $test_brand2->save();\n\n //Act\n $result = Brand::getAll();\n\n //Assert\n $this->assertEquals([$test_brand, $test_brand2], $result);\n }",
"public function testGetMeta()\n {\n $meta1 = Person::getMeta();\n $meta2 = Person::objects()->getMeta();\n\n $this->assertSame($meta1, $meta2);\n }",
"public function testFetching()\n {\n $this->assertType('Horde_Kolab_Server_Object', $this->koward->getObject('cn=Gunnar Wrobel,dc=example,dc=org'));\n }",
"public function testBean()\n\t{\n\t\tR::nuke();\n\t\t$book = R::dispense( 'book' );\n\t\t$pages = R::dispense( 'page', 2 );\n\t\t$ads = R::dispense('ad', 3 );\n\t\t$tags = R::dispense( 'tag', 2 );\n\t\t$author = R::dispense( 'author' );\n\t\t$coauthor = R::dispense( 'author' );\n\t\t$book->alias( 'magazine' )->ownAd = $ads;\n\t\t$book->ownPage = $pages;\n\t\t$book->sharedTag = $tags;\n\t\t$book->via( 'connection' )->sharedUser = array( R::dispense( 'user' ) );\n\t\t$book->author = $author;\n\t\t$book->coauthor = $coauthor;\n\t\tR::store( $book );\n\t\t$book = $book->fresh();\n\t\tasrt( count($book->ownPage), 2 );\n\t\tasrt( count($book->alias('magazine')->ownAd), 3 );\n\t\t$book->ownAd = array();\n\t\tarray_pop( $book->ownPage );\n\t\tR::store( $book );\n\t\t$book = $book->fresh();\n\t\tasrt( count($book->ownPage), 1 );\n\t\tasrt( count($book->alias('magazine')->ownAd), 0 );\n\t}",
"public function testFetchObject()\n {\n $this->todo('stub');\n }",
"public function testFixtureRecord()\n {\n \n $data = $this->EmergencyContacts->find()->where(['etype' => '1']);\n $this->assertEquals(2, $data->count());\n\n }",
"public function testQueryFetchClass() {\n $records = [];\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25], ['fetch' => FakeRecord::class]);\n foreach ($result as $record) {\n $records[] = $record;\n $this->assertInstanceOf(FakeRecord::class, $record);\n $this->assertSame('John', $record->name);\n }\n\n $this->assertCount(1, $records, 'There is only one record.');\n }",
"public function testFindServiceData()\n {\n\n }",
"public function test_find() : void\n {\n $journalMetadata1 = $this->prophesize(Metadata\\Comment::class);\n $journalMetadata2 = $this->prophesize(Metadata\\Comment::class);\n $this->compiler_prophecy\n ->compile(Argument::any())\n ->willReturn([\n $journalMetadata1->reveal(),\n $journalMetadata2->reveal(),\n ]);\n\n // create a new repository\n $repo = new FilesystemAnnotationRepository($this->file_source_prophecy->reveal(), $this->compiler_prophecy->reveal());\n\n // check the repository\n $entries = $repo->find();\n\n // check that the right number and content of entries is found\n $this->assertCount(2, $entries);\n $this->assertContains($journalMetadata1->reveal(), $entries);\n $this->assertContains($journalMetadata2->reveal(), $entries);\n }",
"public function testShow()\n\t{\n\t\t$response = $this->call('GET', '/'.self::$endpoint.'/'.$this->obj->id);\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t\t$result = $response->getOriginalContent()->toArray();\n\n\t\t// tes apakah hasil return adalah yang sesuai\n\t\tforeach ($this->obj->attributesToArray() as $attr => $attr_val)\n\t\t\t$this->assertArrayHasKey($attr, $result);\n\n\t\t// tes tak ada yang dicari\n\t\t$response = $this->call('GET', '/'.self::$endpoint.'/696969');\n\t\t$this->assertEquals(500, $response->getStatusCode());\n\t}",
"public function find($object) {\r\n $oReflectionClass = new ReflectionClass($object);\r\n //$properties = $oReflectionClass->getProperties(ReflectionProperty::IS_PUBLIC);\r\n $properties = $oReflectionClass->getProperties();\r\n $this->className = $class = $oReflectionClass->getName();\r\n\r\n foreach ($properties as $key => $reflectionProperty)\r\n $datos_where[$reflectionProperty->getName()] = $reflectionProperty->getValue($object);\r\n $this->setList(null);\r\n $this->setObject(null);\r\n $table = $this->table = CriteriaEntityMgr::instance()->findTable($this->className);\r\n $this->SQL = MySQL_DB::instance()->DBSQLSelect($table, null, $datos_where, $this->array_order, $this->type_order);\r\n $this->execute();\r\n $list = array();\r\n if($this->getNumRows() == 1) {\r\n $row = MySQL_DB::instance()->DBFetchArray($this->result);\r\n $object = $this->iterateProperty($class, $object, $row, $properties);\r\n $this->setObject($object);\r\n $list[] = $object;\r\n }\r\n if($this->getNumRows() > 1) {\r\n while ($row = MySQL_DB::instance()->DBFetchArray($this->result)) {\r\n $object_new = $oReflectionClass->newInstance($oReflectionClass);\r\n $object_new = $this->iterateProperty($class, $object_new, $row, $properties);\r\n $list[] = $object_new;\r\n }\r\n }\r\n $this->setList($list);\r\n return $this;\r\n }",
"public function testProfilePrototypeFindByIdPosts()\n {\n\n }",
"public function testGetAllAssociated()\n {\n $this->setUp();\n $users = new Users(self::$config);\n $admin = $users->get(1);\n $student = $users->get(3);\n $injuries = new Injuries(self::$config);\n\n $reports = $injuries->getAllAssociated($admin);\n\n $this->assertNotNull($reports);\n $this->assertEquals(5, count($reports));\n\n // There are 3 where this student is involved\n $reports = $injuries->getAllAssociated($student);\n\n $this->assertNotNull($reports);\n $this->assertEquals(3, count($reports));\n }",
"function test_getStores()\n {\n $brand_name = 'Nike';\n $test_brand = new Brand($brand_name);\n $test_brand->save();\n\n $store_name = \"Nordstorm\";\n $test_store = new Store($store_name);\n $test_store->save();\n\n $store_name2 = 'Macys';\n $test_store2 = new Store($store_name2);\n $test_store2->save();\n\n $test_brand->addStore($test_store);\n $test_brand->addStore($test_store2);\n $result = $test_brand->getStores();\n\n $this->assertEquals([$test_store, $test_store2], $result);\n }",
"public function findAll() {\n\t\t$registrations = $this->registrationRepository->findAll();\n\t\t$this->assertEquals(10, $registrations->count());\n\t}",
"private function extractObjects(&$data){\n\t\tif(!preg_match_all($this->patObject, $data, $matches)){\n\t\t\tthrow new Exception(\"No objects found\"); \n\t\t} else {\n\t\t\t// Trim the results, because \\R in regex assertion (lookback) causes problems.\n\t\t\tforeach($matches[0] as $key => $match){\n\t\t\t\t$newObject = new pdfObject(trim($match));\n\t\t\t\t$this->objects[$newObject->objectNumber] = $newObject;\n\t\t\t}\n\t\t\treturn $this->objects;\n\t\t}\n\t}",
"public function testIfReturnsAllElements()\n {\n $factory = new FileSystemMapFactory();\n $result = $factory->create($this->data);\n\n $this->assertEquals(count($this->data), count($result));\n }",
"public function test_findConfidential() {\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(0, count($data));\n $this->SampleSet->username = 'sub2';\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(1, count($data));\n $this->assertEquals(2, $data[0]['SampleSet']['id']);\n $this->SampleSet->username = 'chem2';\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 2]]);\n $this->assertEquals(1, count($data));\n $this->assertEquals(2, $data[0]['SampleSet']['id']);\n }",
"public function testGetAllPistas()\n {\n $fakePista = factory(Pista::class,1)->create([\n 'id' => 4545\n ]);\n $pistas = Pista::getAllPistas();\n foreach ($pistas as $pista) {\n if($pista->id == 4545){\n $this->assertTrue($pista->id == $fakePista[0]->id);\n }\n }\n\n }",
"public function testQuarantineFindOne()\n {\n\n }",
"public function testProfilePrototypeFindByIdOwnedGroups()\n {\n\n }",
"public function canReturnABindedCollectionForAGivenName()\n {\n $object0 = $this->getMock('ATM_Config_Abstract', array('getName'));\n $object1 = clone $object0;\n $object0->expects($this->any())\n ->method('getName')\n ->will($this->returnValue('object0'));\n $object1->expects($this->any())\n ->method('getName')\n ->will($this->returnValue('object1'));\n $this->object->append($object0);\n $this->object->append($object1);\n $this->object->append($object0);\n $collection = $this->object->filterNames('object0');\n $this->assertSame($object0, $collection[0]);\n $this->assertSame($object0, $collection[1]);\n $this->assertFalse(isset($collection[2]));\n // set all $object0 to $object1 in this object\n $collection[0]=$object1;\n $this->assertSame($object1, $collection[0]);\n $this->assertSame($object1, $this->object[0]);\n $this->assertSame($object1, $this->object[1]);\n $this->assertSame($object0, $this->object[2]);\n $this->object[0]=$object0;\n $this->assertSame($object1, $collection[0]);\n }",
"public function objectIdentifierExposureTestData() {}",
"protected function testObject() {\n }",
"static function findAll() {$finder = self::getFinder( __CLASS__ ); return $finder->findAll();}",
"static function findAll() {$finder = self::getFinder( __CLASS__ ); return $finder->findAll();}",
"static function findAll() {$finder = self::getFinder( __CLASS__ ); return $finder->findAll();}",
"public function findAll() {}",
"public function findAll() {}",
"public function testFindByIdIsSuccess()\n {\n $tblGateMock = $this->getMockBuilder(TableGateway::class)\n ->setConstructorArgs(array($this->getDbal()))\n ->setMethodsExcept(['findById', 'setTable'])\n ->getMock();\n $tblGateMock->setTable('Person');\n\n //exercise SUT\n $row = $tblGateMock->findById($this->person['id']);\n\n //assert return value\n $this->assertTrue(is_array($row), 'result not array');\n $this->assertNotEmpty($row, 'result set is empty');\n\n foreach(array_keys($this->person) as $key) {\n $this->assertArrayHasKey($key, $row[0]);\n $this->assertEquals($this->person[$key], $row[0][$key]);\n }\n }",
"public function find($class);",
"public function findAll() {}",
"public function testInvoke()\n {\n $this->instance->{$this->name};\n // Copy the instance to a local variable as we can't invoke it directly.\n $instance = $this->instance;\n $instance = $instance();\n self::assertInstanceOf(\n Chameleon::class,\n $instance,\n 'Instance invocation does not return an instance of Chameleon'\n );\n self::assertTrue(\n array_key_exists($this->name, $instance),\n 'Instance element cannot be tested with array_key_exists'\n );\n }",
"public function testQueryFetchDefault() {\n $records = [];\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25]);\n $this->assertInstanceOf(StatementInterface::class, $result);\n foreach ($result as $record) {\n $records[] = $record;\n $this->assertIsObject($record);\n $this->assertSame('John', $record->name);\n }\n\n $this->assertCount(1, $records, 'There is only one record.');\n }",
"public function testCreateInstancesFromQuery()\n {\n $entityData = array(\n \"name\" => 'my recurring event',\n \"ts_start\" => strtotime(\"2016-01-01 08:00:00 PST\"),\n \"ts_end\" => strtotime(\"2016-01-01 09:00:00 PST\"),\n \"recurrence_pattern\" => array(\n \"recur_type\" => Recurrence\\RecurrencePattern::RECUR_DAILY,\n \"interval\" => 1,\n \"date_start\" => \"2016-01-01\",\n \"date_end\" => \"2016-01-05\",\n )\n );\n $event = $this->entityLoader->create(\"calendar_event\");\n $event->fromArray($entityData);\n $this->entityDataMapper->save($event);\n $recurId = $event->getRecurrencePattern()->getId();\n\n // Create a query that gets events from January 1 to January 5\n $dateTo = new \\DateTime(\"2016-01-05\");\n $query = new EntityQuery(\"calendar_event\");\n $query->where(\"ts_start\")->isLessThan($dateTo->format(\"Y-m-d\"));\n\n // Have the manager create instances using the query\n $this->recurSeriesManager->createInstancesFromQuery($query);\n\n // Open the recurrence pattern and make sure to date processed to was moved out\n $recurrencePattern = $this->recurIndentityMapper->getById($recurId);\n $dateProcessedTo = $recurrencePattern->getDateProcessedTo();\n $this->assertEquals($dateProcessedTo->format(\"Y-m-d\"), $dateTo->format(\"Y-m-d\"));\n\n // Cleanup\n $this->entityDataMapper->delete($event, true);\n\n }",
"public function testFind()\n {\n $data = array('id' => 1, 'username' => 'root', 'password' => 'password');\n $mockPDO = $this->getMock('\\\\PDOMock', array('fetchOne'));\n $mockPDO\n ->expects($this->once())\n ->method('fetchOne')\n ->will($this->returnCallback(function($arg1, $arg2) use ($data) {\n $sql = 'SELECT\n *\nFROM\n `users`\nWHERE\n id = :id\nORDER BY\n id ASC';\n\n if($arg1 == $sql && $arg2 == array('id' => 1)) {\n return $data;\n } else {\n return array();\n }\n }))\n ;\n $storage = new AuraExtendedPdo($mockPDO, new QueryFactory('mysql'));\n $result = $storage->find(array('id' => 1), 'users');\n\n $this->assertEquals($data['id'], $result['id']);\n $this->assertEquals($data['username'], $result['username']);\n $this->assertEquals($data['password'], $result['password']);\n }",
"public function testGetOneClass()\n {\n $result = $this->getQueryBuilderConnection()\n ->select()\n ->from('querybuilder_tests')\n ->where('id', '=', 1)\n ->getOneClass(SampleObject::class);\n\n $object = SampleObject::create('1', '1', 'bbbb');\n\n $this->assertEquals($object, $result);\n }",
"public function canReturnABindedCollectionForAGivenClass()\n {\n $object0 = $this->getMock('ATM_Config_Abstract', array('getName'));\n $object1 = $this->getMock('ATM_Config_Comment', array(), array('comment'));\n $this->assertNotEquals(get_class($object0), get_class($object1));\n $this->object->append($object0);\n $this->object->append($object1);\n $this->object->append($object0);\n $collection = $this->object->filterClasses(get_class($object0));\n $this->assertSame($object0, $collection[0]);\n $this->assertSame($object0, $collection[1]);\n $this->assertFalse(isset($collection[2]));\n // set all $object0 to $object1 in this object\n $collection[0]=$object1;\n $this->assertSame($object1, $collection[0]);\n $this->assertSame($object1, $this->object[0]);\n $this->assertSame($object1, $this->object[1]);\n $this->assertSame($object0, $this->object[2]);\n $this->object[0]=$object0;\n $this->assertSame($object1, $collection[0]);\n }",
"public function testFindUser()\n {\n $user = factory(User::class)->create();\n $found = User::query()->find($user->id);\n $this->assertNotEmpty($found);\n $this->assertEquals($user->id, $found->id);\n }",
"public function testSelectAll() {\n $testUser = [];\n $testUser[0] = new User();\n $testUser[0]->setUsername('testUser');\n $testUser[0]->create();\n\n $testUser[1] = new User();\n $testUser[1]->setUsername('testUser2');\n $testUser[1]->create();\n\n // Create a test rank\n $testRank = [];\n $testRank[0] = new Rank();\n $testRank[0]->setName('testRank');\n $testRank[0]->create();\n\n $testRank[1] = new Rank();\n $testRank[1]->setName('testRank2');\n $testRank[1]->create();\n\n // Create a test user rank\n $testUserRank = [];\n $testUserRank[0] = new UserRank();\n $testUserRank[0]->setUserID($testUser[0]->getID());\n $testUserRank[0]->setRankID($testRank[0]->getID());\n $testUserRank[0]->create();\n\n $testUserRank[1] = new UserRank();\n $testUserRank[1]->setUserID($testUser[1]->getID());\n $testUserRank[1]->setRankID($testRank[1]->getID());\n $testUserRank[1]->create();\n\n // Select and check\n $selectedMultiple = UserRank::select(array());\n\n $this->assertTrue(\\is_array($selectedMultiple));\n $this->assertEquals(2, \\count($selectedMultiple));\n $this->assertInstanceOf(UserRank::class, $selectedMultiple[0]);\n $this->assertInstanceOf(UserRank::class, $selectedMultiple[1]);\n\n if($testUserRank[0]->getID() == $selectedMultiple[0]->getID()) {\n $i = 0;\n $j = 1;\n }\n else {\n $i = 1;\n $j = 0;\n }\n\n $this->assertEquals($testUserRank[0]->getID(), $selectedMultiple[$i]->getID());\n $this->assertEquals($testUserRank[0]->getUserID(), $selectedMultiple[$i]->getUserID());\n $this->assertEquals($testUserRank[0]->getRankID(), $selectedMultiple[$i]->getRankID());\n\n $this->assertEquals($testUserRank[1]->getID(), $selectedMultiple[$j]->getID());\n $this->assertEquals($testUserRank[1]->getUserID(), $selectedMultiple[$j]->getUserID());\n $this->assertEquals($testUserRank[1]->getRankID(), $selectedMultiple[$j]->getRankID());\n\n // Clean up\n foreach($testUserRank as $userRank) {\n $userRank->delete();\n }\n foreach($testUser as $user) {\n $user->delete();\n }\n foreach($testRank as $rank) {\n $rank->delete();\n }\n }",
"public function testIterator()\n {\n foreach ($this->pool as $code => $class) {\n $this->assertEquals($this->pool[$code], $class);\n }\n }",
"public function testGetInstancesByTag(){\n $result = $this->aws->getInstancesByTag('environment', $this->environment);\n $this->assertNotEmpty($result);\n $this->assertArrayHasKey('Instances', $result[0]);\n $this->assertNotEmpty($result[0]['Instances']);\n $this->assertContains(array('Value' => $this->environment, 'Key' => 'environment'), $result[0]['Instances'][0]['Tags']);\n return $result;\n }"
] | [
"0.650067",
"0.6381611",
"0.6254883",
"0.61996305",
"0.6117527",
"0.6097989",
"0.6072997",
"0.6038859",
"0.5997902",
"0.59367657",
"0.5901609",
"0.58685756",
"0.58615386",
"0.5855224",
"0.5829968",
"0.5803692",
"0.57572615",
"0.57503814",
"0.57283956",
"0.5712582",
"0.57118434",
"0.57027024",
"0.5615134",
"0.5608786",
"0.56027985",
"0.5589249",
"0.5589249",
"0.5589249",
"0.55881387",
"0.55856323",
"0.5552911",
"0.5543628",
"0.5512902",
"0.5511626",
"0.55027133",
"0.550069",
"0.5498506",
"0.54647225",
"0.5463637",
"0.54607534",
"0.5454731",
"0.5453152",
"0.54490817",
"0.5437403",
"0.5436864",
"0.5430709",
"0.543021",
"0.542644",
"0.5421375",
"0.54212916",
"0.5417943",
"0.54138476",
"0.5413674",
"0.5411318",
"0.540773",
"0.54050416",
"0.5396593",
"0.5395466",
"0.538894",
"0.53752923",
"0.53714466",
"0.5369772",
"0.53665346",
"0.5366073",
"0.5361512",
"0.5359335",
"0.53565043",
"0.53535885",
"0.53479034",
"0.5340723",
"0.5331094",
"0.5331001",
"0.53232247",
"0.5320742",
"0.5320425",
"0.5317471",
"0.53122026",
"0.5298906",
"0.5296474",
"0.5293049",
"0.52887845",
"0.52842265",
"0.52746296",
"0.5271774",
"0.5271774",
"0.5271774",
"0.5269055",
"0.5269055",
"0.52687794",
"0.52680355",
"0.5267462",
"0.5252667",
"0.5248783",
"0.5242414",
"0.52348876",
"0.5234035",
"0.52337873",
"0.5227198",
"0.5216172",
"0.5211947",
"0.5210993"
] | 0.0 | -1 |
Get the minimum age for this event. | public function getAgeFrom() {
return $this->ageFrom;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getMinimumAge()\n {\n return $this->minimumAge;\n }",
"public function getMinimumAge()\n {\n return $this->minimumAge;\n }",
"public function getMinAge()\n {\n return $this->minAge;\n }",
"public function getMinAge()\n {\n return $this->minAge;\n }",
"public function getGroupMinAge() {\n\t\treturn $this->_group_min_age;\n\t}",
"public function setMinAge($var)\n {\n GPBUtil::checkInt32($var);\n $this->minAge = $var;\n\n return $this;\n }",
"public function getAge()\n {\n // future dates have no age\n return max(0, $this->difference(self::now())->getYears());\n }",
"public function getMin() {\n return $this->min;\n }",
"public function getAge()\n {\n if ($this->age) {\n return $this->age;\n }\n\n $this->age = $this->getBirthDate()->diff(new \\DateTime())->y;\n\n return $this->age;\n }",
"function getMinYears()\n {\n return 0;\n }",
"public function getMin()\n {\n return $this->_minValue;\n }",
"public function age()\r\n {\r\n\r\n // Note that A DOB object is based on a date-range and the exact date is\r\n // usually unknown so for age calculation the the middle of the range is\r\n // assumed to be the real date-of-birth.\r\n\r\n if (!empty($this->date_range))\r\n {\r\n $dob = $this->date_range->middle();\r\n $today = new DateTime('now', new DateTimeZone('GMT'));\r\n\r\n $diff = $today->format('Y') - $dob->format('Y');\r\n\r\n if ($dob->format('z') > $today->format('z'))\r\n {\r\n $diff -= 1;\r\n }\r\n\r\n return $diff;\r\n }\r\n return;\r\n }",
"public function getMinFreshAge(): ?int\n {\n return $this->min_fresh;\n }",
"function getMinAgeInScore($player_id) {\n return self::getMinOrMaxAgeInLocation($player_id, 'score', 'MIN');\n }",
"function getMin() { return $this->readMinValue(); }",
"public function hasAgeMin() {\n return $this->_has(2);\n }",
"public function getMinValue()\n {\n return $this->get('MinValue');\n }",
"public function getMin()\n {\n return $this->_fMin;\n }",
"public function getage()\n {\n return $this->age;\n }",
"public function getAge() {\n return $this->age;\n }",
"function getMinAgeInHand($player_id) {\n return self::getMinOrMaxAgeInLocation($player_id, 'hand', 'MIN');\n }",
"public function getMinimum()\n {\n return $this->minimum;\n }",
"public function determineAge() {\n $timeInOneYear = 365.256 * 24 * 60 * 60;\n $yearsofAge = floor((strtotime(date('Y')) - strtotime($this->year.'-12-31'))/ $timeInOneYear);\n\n $this->age = $yearsofAge;\n\n return (int) $yearsofAge;\n }",
"public function getAge()\n {\n return $this->age;\n }",
"public function getAge()\n {\n return $this->age;\n }",
"public function getAge()\n {\n return $this->age;\n }",
"public function getAge()\n {\n return $this->age;\n }",
"public function getAge()\n {\n return $this->age;\n }",
"public function getAge()\n {\n return $this->age;\n }",
"function min() { return $this->min; }",
"public function getAge()\n {\n $this->checkJMBG();\n\n $timestamp = $this->getBirthdayTimeStamp();\n $now = time();\n $diff = $now - $timestamp;\n return date('Y', $diff) - 1970;\n }",
"public function setMinAge($age)\n\t {\n\t \t $this->json['params'][$this->account]['minage'] = $age;\n\t \t \n\t \t return $this;\n\t }",
"public function getMinimum() {\r\n return $this->minimumvalue;\r\n }",
"public function getMaxAge()\n\t{\n\t\treturn $this->maxage;\n\t}",
"public function getAge() {\n date_default_timezone_set('America/New_York');\n list($year,$month,$day) = explode(\"-\",$this->birthDate);\n $year_diff = date(\"Y\") - $year;\n $month_diff = date(\"m\") - $month;\n $day_diff = date(\"d\") - $day;\n if ($month_diff < 0 || ($month_diff == 0 && $day_diff < 0)) {\n $year_diff--;\n }\n return $year_diff;\n }",
"public function age() {\n $years = ((integer) date('Y')) - $this->year;\n\n if (((integer) date('n')) < $this->month) {\n $years -= 1;\n }\n else if (((integer) date('n')) == $this->month) {\n if (((integer) date('j')) < $this->day) {\n $years -= 1;\n }\n }\n\n return $years;\n }",
"public function getAgeAttribute()\n\t{\n\t\treturn now()->diffInYears($this->birthdate);\n\t}",
"public function getMinDateRange()\n {\n $dob = $this->_getAttribute('dob');\n if ($dob !== null) {\n $rules = $this->_getAttribute('dob')->getValidationRules();\n $minDateValue = ArrayObjectSearch::getArrayElementByName(\n $rules,\n self::MIN_DATE_RANGE_KEY\n );\n if ($minDateValue !== null) {\n return date(\"Y/m/d\", $minDateValue);\n }\n }\n\n return null;\n }",
"public function getAge()\n\t{\n\t\t$date_birthday = $this->getAnswer('birthday');\n\t\t$date_birthday = convert_date_to_age($date_birthday);\n\t\treturn $date_birthday;\n\n\t}",
"public static function get_default_min()\n\t{\n\t\treturn self::get_value('1970-01');\n\t}",
"private function getAge()\n {\n return $this->getAge($this->dob);\n }",
"function getMinValue() { return $this->readMinValue(); }",
"public function getAge() {\n\t\tif ($this->birthday) {\n\t\t\t// split date\n\t\t\t$year = $month = $day = 0;\n\t\t\t$optionValue = explode('-', $this->birthday);\n\t\t\tif (isset($optionValue[0])) $year = intval($optionValue[0]);\n\t\t\tif (isset($optionValue[1])) $month = intval($optionValue[1]);\n\t\t\tif (isset($optionValue[2])) $day = intval($optionValue[2]);\n\t\t\t\n\t\t\t// calc\n\t\t\tif ($year) {\n\t\t\t\t$age = DateUtil::formatDate('%Y', null, false, true) - $year;\n\t\t\t\tif (intval(DateUtil::formatDate('%m', null, false, true)) < intval($month)) $age--;\n\t\t\t\telse if (intval(DateUtil::formatDate('%m', null, false, true)) == intval($month) && DateUtil::formatDate('%e', null, false, true) < intval($day)) $age--;\n\t\t\t\treturn $age;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn 0;\n\t}",
"public function getMaxAgeInDays() {\n\t\treturn $this->maxAgeInDays;\n\t}",
"public function getAge()\n {\n if ($dob = $this->getDob()) {\n $now = new \\Datetime('now');\n $today['month'] = $now->format('m');\n $today['day'] = $now->format('d');\n $today['year'] = $now->format('Y');\n\n $years = $today['year'] - $dob->format('Y');\n\n if ($today['month'] <= $dob->format('m')) {\n if ($dob->format('m') == $today['month']) {\n if ($dob->format('d') > $today['day'])\n $years--;\n } else\n $years--;\n }\n\n return $years;\n }\n\n return null;\n }",
"public function getAge()\n {\n\n return $this->age;\n \n }",
"public function getMaxAge(): int {\n return $this->configuration['max_age'];\n }",
"function getMinValue() { return $this->readMinValue(); }",
"public function getMin();",
"public function getMaxAge()\n {\n return $this->maxAge;\n }",
"public function getMaxAge()\n {\n return $this->maxAge;\n }",
"function getAge() {\n return $this->age;\n }",
"public function getAgeAttribute ()\n\t{\n\t\treturn \\Carbon\\Carbon::parse($this->birthdate)->age;\n\t}",
"public function getageEc()\n {\n return $this->age_ec;\n }",
"public function getMinNumber()\n {\n return $this->minNumber;\n }",
"public function getMaxAge(): ?int\n {\n return $this->max_age;\n }",
"public static function get_min_value() {\n return self::MIN_VALUE;\n }",
"public function getMaxAge()\n {\n return $this->expiry;\n }",
"public function setMinAge($minAge)\n {\n $this->minAge = $minAge;\n return $this;\n }",
"public function setGroupMinAge($value) {\n\t\t$this->_group_min_age = $value;\n\t}",
"protected function getMin() {\n\n\t\t$min = 1;\n\n\t\tif (!empty($this->tagsArray)) {\n\n\t\t\t$preAmount = 999999;\n\n\t\t\tforeach ($this->tagsArray as $key => $value) {\n\t\t\t\t$currentAmount = $value['amount'];\n\t\t\t\tif ($currentAmount < $preAmount) {\n\t\t\t\t\t$min = $currentAmount;\n\t\t\t\t\t$preAmount = $currentAmount;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $min;\n\t}",
"public function getAge()\n {\n //function qui calcule l'age de leleve \n $now = new \\DateTime('now');\n $age = $this->getDateNaissance();\n $difference = $now->diff($age);\n\n return $difference->format('%y Ans');\n }",
"public function getMinValue();",
"public function getMinValue();",
"public function age(){\n return $this->dob->age;\n }",
"public function getMinimum(): float\n {\n return $this->min;\n }",
"public function getEarliest(): int\n {\n return $this->earliest;\n }",
"public function getAge() { return $this->age; }",
"public function getMin(): int;",
"public function getAgeAttribute() {\n return Carbon::createFromDate($this->attributes['DOB'])->age;\n }",
"function getAppropriateAges(){\n\t\treturn $this->appropriateAges;\n\t}",
"public function getPassengerAge(){\n\t\t\n\t\treturn $this->passengerAge;\n\t}",
"public function getWholeAge()\n\t{\n\t\tif($this->age < 2){\n\t\t\treturn $this->age . ' rok';\n\t\t}else if($this->age < 5){\n\t\t\treturn $this->age . ' roky';\n\t\t}else{\n\t\t\treturn $this->age . ' let';\n\t\t}\n\t}",
"public function min()\n {\n $minimum = round($this->centre - $this->centre * $this->deviation);\n\n return $this->unsigned ? max($minimum, 0) : $minimum;\n }",
"public function getMaxAge()\n {\n\n }",
"public function getAge()\n {\n return 14;\n }",
"public function getAge()\n {\n return 14;\n }",
"public function getAge() {\n // Age of oldest entry.\n $old = $this->database->select('watchdog', 'w')\n ->fields('w', ['timestamp'])\n ->orderBy('wid', 'ASC')\n ->range(0, 1)\n ->execute()\n ->fetchField();\n\n // Age of newest entry.\n $new = $this->database->select('watchdog', 'w')\n ->fields('w', ['timestamp'])\n ->orderBy('wid', 'DESC')\n ->range(0, 1)\n ->execute()\n ->fetchField();\n\n // If two different days...\n if (date('Y-m-d', $old) != date('Y-m-d', $new)) {\n return $this->t(\"Age of messages: From @from to @to (@days days)\", [\n '@from' => date('Y-m-d', $old),\n '@to' => date('Y-m-d', $new),\n '@days' => round(($new - $old) / 86400, 2),\n ]);\n }\n // Same day; don't calculate number of days.\n return $this->t(\"Age of messages: From @from to @to\", [\n '@from' => date('Y-m-d', $old),\n '@to' => date('Y-m-d', $new),\n ]);\n }",
"public function getProfileAge() {\n\t\treturn (TIME_NOW - $this->registrationDate) / 86400;\n\t}",
"function exibeAtualMin(){\n return $nmin= (($this->atual * $this->numpage) - $this->numpage)+1;\n }",
"public static function get_default_min()\n\t{\n\t\treturn self::get_value('1970-W01');\n\t}",
"public function get_age($dob){\n\t\treturn floor((time() - strtotime($dob))/31556926);\n\t}",
"private function min()\n {\n return Carbon::create(1, 1, 1, 0, 0, 0);\n }",
"public static function min($attribute = null);",
"public function getGroupMaxAge() {\n\t\treturn $this->_group_max_age;\n\t}",
"protected function getLowerBoundDate() {\n return $this->roundToNearestDay(time() - 15552000); //180 days in secs\n }",
"public function getMinimum() : int\n {\n return $this->getValue('nb_domain_zone_minimum');\n }",
"public function getMinimumOffset() {\r\n return $this->minimumOffset;\r\n }",
"public function get_score_min()\n\t{\n\t\treturn $this->score_min;\n\t}",
"function get_min_range($p, $age_days, $age_years)\n {\n if (!empty($p->ref_ranges)) {\n if (get_gender_range($p)) {\n $range = get_gender_range($p);\n return $range->lower;\n } else {\n $r = get_first_ranges($p->id);\n if (!empty($r)) {\n return $r->lower;\n }\n }\n } else {\n if ($age_days < 4) {\n return $p->this_test->_0_3d_minrange;\n } elseif ($age_days >= 4 && $age_days <= 30) {\n return $p->this_test->_4_30d_minrange;\n } elseif ($age_days > 30 && $age_days <= 730) {\n return $p->this_test->_1_24m_minrange;\n } elseif ($age_days > 730 && $age_days <= 1825) {\n return $p->this_test->_25_60m_minrange;\n } else {\n if ($age_years > 4 && $age_years <= 19) {\n return $p->this_test->_5_19y_minrange;\n } else {\n return $p->this_test->adult_minrange;\n }\n }\n }\n }",
"public function getAge();",
"public function getAge();",
"public function getMinLat() {\n return $this->minLat;\n }",
"public function getMinSpellBonusDamage(){\r\n\t $result = min($this->getSpellBonusDamageArcane(),\r\n \t\t\t\t\t$this->getSpellBonusDamageFire(),\r\n \t\t\t\t\t$this->getSpellBonusDamageFrost(),\r\n\t\t\t\t\t$this->getSpellBonusDamageHoly(),\r\n \t\t\t\t\t$this->getSpellBonusDamageNature(),\r\n \t\t\t\t\t$this->getSpellBonusDamageShadow());\r\n\t return $result;\r\n\t}",
"public function getMinXValue() {\r\n return $this->chart->getMinXValue($this);\r\n }",
"public function getMin(): float;",
"public function getMinLikelihood()\n {\n return $this->min_likelihood;\n }",
"public function getMinLikelihood()\n {\n return $this->min_likelihood;\n }",
"public function getMinPriceInt()\n {\n $stats = $this->_getFieldStats();\n $min = $stats['min'];\n if (!is_numeric($min)) {\n $min = 0;\n }\n return $min;\n }",
"public function getMinDateRange()\n {\n return $this->_getBorderDateRange(self::MIN_DATE_RANGE_KEY);\n }"
] | [
"0.8404982",
"0.8404982",
"0.82016313",
"0.82016313",
"0.7740125",
"0.68456215",
"0.68371844",
"0.66355467",
"0.66262823",
"0.660445",
"0.6498166",
"0.6472624",
"0.64619476",
"0.64606583",
"0.64388615",
"0.64190954",
"0.6412454",
"0.63906807",
"0.6382508",
"0.6380305",
"0.63613695",
"0.6355479",
"0.6300938",
"0.6296264",
"0.6296264",
"0.6296264",
"0.6296264",
"0.6296264",
"0.6296264",
"0.6286919",
"0.62787724",
"0.6278391",
"0.62569094",
"0.62557495",
"0.6233047",
"0.62248546",
"0.62229425",
"0.621917",
"0.62186027",
"0.6206104",
"0.6195977",
"0.6194068",
"0.6188574",
"0.61373377",
"0.6135107",
"0.61171234",
"0.6093524",
"0.60934854",
"0.60839534",
"0.6076939",
"0.6076939",
"0.6052474",
"0.60503364",
"0.6008549",
"0.60073817",
"0.59855986",
"0.59767467",
"0.5961777",
"0.5958067",
"0.59553903",
"0.5953422",
"0.5951977",
"0.5947114",
"0.5947114",
"0.59390426",
"0.5938629",
"0.5921216",
"0.5917841",
"0.58535844",
"0.5848813",
"0.5845779",
"0.5845117",
"0.5821729",
"0.5810642",
"0.58053374",
"0.57987833",
"0.57987833",
"0.5786189",
"0.57610273",
"0.5758335",
"0.57540643",
"0.5742088",
"0.57364726",
"0.56897044",
"0.5678113",
"0.5674243",
"0.5638953",
"0.5610909",
"0.55853194",
"0.55678326",
"0.5565908",
"0.5565908",
"0.5565089",
"0.5558855",
"0.555334",
"0.5548799",
"0.5518259",
"0.5518259",
"0.5512587",
"0.5506473"
] | 0.65696985 | 10 |
Get the calendar from this event. | public function getCalendar() {
return $this->calendar;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCalendar()\r\n {\r\n if (!$this->_calendar && $this->getCalendarId()) {\r\n $this->_calendar = Mage::getModel('google/calendar')->load($this->getCalendarId());\r\n }\r\n\r\n return $this->_calendar;\r\n }",
"public function getCalendar()\n {\n return IntlCalendar::fromDateTime($this);\n }",
"protected function get_calendar()\n\t{\n\t\treturn $this->calendars['gregorian'];\n\t}",
"public function getCalendar()\n {\n $result = new stdClass;\n $all_calendars = $GLOBALS['calendar_manager']->get(Kronolith::ALL_CALENDARS);\n if (!isset($all_calendars[$this->vars->cal]) && !$GLOBALS['conf']['share']['hidden']) {\n $GLOBALS['notification']->push(_(\"You are not allowed to view this calendar.\"), 'horde.error');\n return $result;\n } elseif (!isset($all_calendars[$this->vars->cal])) {\n // Subscribing to a \"hidden\" share, check perms.\n $kronolith_shares = $GLOBALS['injector']->getInstance('Kronolith_Shares');\n $share = $kronolith_shares->getShare($this->vars->cal);\n if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {\n $GLOBALS['notification']->push(_(\"You are not allowed to view this calendar.\"), 'horde.error');\n return $result;\n }\n $calendar = new Kronolith_Calendar_Internal(array('share' => $share));\n } else {\n $calendar = $all_calendars[$this->vars->cal];\n }\n\n $result->calendar = $calendar->toHash();\n return $result;\n }",
"public function calendar(): Calendar\n {\n return new Calendar($this);\n }",
"public static function Get(){\n static $inst = NULL;\n if( $inst == NULL )\n $inst = new Calendar();\n return( $inst );\n }",
"public function getCalendarId()\n {\n return $this->get('CalendarId');\n }",
"public function get_calender_data()\n\t{\n\treturn $this->cal['VCALENDAR'];\n\t}",
"public function getServiceCalendar()\n {\n $scopes = array('https://www.googleapis.com/auth/calendar');\n $credential = new Google_Auth_AssertionCredentials($this->auth_email, $scopes, $this->p12_key);\n\n $client = new Google_Client();\n $client->setAssertionCredentials($credential);\n if ($client->getAuth()->isAccessTokenExpired()) {\n $client->getAuth()->refreshTokenWithAssertion($credential);\n }\n\n return new Google_Service_Calendar($client);\n }",
"public function get_calendar_id() {\n return $this->get_option( 'calendar-id', '' );\n }",
"protected function _getRecurEvent()\n {\n return new Calendar_Model_Event(array(\n 'summary' => 'Breakfast',\n 'dtstart' => '2010-05-20 06:00:00',\n 'dtend' => '2010-05-20 06:15:00',\n 'description' => 'Breakfast',\n 'rrule' => 'FREQ=DAILY;INTERVAL=1', \n 'container_id' => $this->_testCalendar->getId(),\n Tinebase_Model_Grants::GRANT_EDIT => true,\n ));\n }",
"protected function _getRecurEvent()\n {\n return new Calendar_Model_Event(array(\n 'summary' => 'Breakfast',\n 'dtstart' => '2010-05-20 06:00:00',\n 'dtend' => '2010-05-20 06:15:00',\n 'description' => 'Breakfast',\n 'rrule' => 'FREQ=DAILY;INTERVAL=1', \n 'container_id' => $this->_testCalendar->getId(),\n Tinebase_Model_Grants::GRANT_EDIT => true,\n ));\n }",
"public function getCalendarSync()\n {\n return $this->calendarSync;\n }",
"public function getCalendarFor($name);",
"public function getCalendarId()\r\n {\r\n if (!$this->getData('calendar_id') && $this->_calendar instanceof Mymodules_Google_Model_Calendar) {\r\n return $this->getCalendar()->getId();\r\n }\r\n\r\n return $this->getData('calendar_id');\r\n }",
"public static function getCalendarApplication();",
"public function getCalendarManager() {\n \tthrow new osid_OperationFailedException('getCalendarManager() is not yet implemented.');\n \t\n \tif (!isset($this->calendarManager)) {\n \t\t$this->calendarManager = $this->impl_getRuntimeManager()->getManager(osid_OSID::CALENDAR(), 'banner_calendar_CalendarManager', '3.0.0');\n \t}\n \t\n \treturn $this->calendarManager;\n }",
"private function getCalendarBagFromStore()\n {\n $bag = $this->calendarBag;\n\n return $bag;\n }",
"public function getCalle()\n {\n return $this->calle;\n }",
"private function getOrCreateCalendarBag()\n {\n $bag = $this->getCalendarBagFromStore();\n if (null === $bag) {\n $newBag = new CalendarBag();\n $nodename = strtolower($newBag->getSemanticNodeType());\n $newBag->setNodename($nodename);\n $this->setCalendarNodes($newBag);\n $bag = $this->getCalendarBagFromStore();\n }\n\n return $bag;\n }",
"public function getDiaCalendario(){\n return $this->diaCalendario;\n }",
"protected function getCalendarRoot() {\n $request = $this->getRequest();\n $session = $request->getSession();\n if (!$session->has('calendar_id')) {\n $session->set('calendar_id', '1');\n }\n $id_cal = $session->get('calendar_id');\n return $id_cal;\n }",
"public static function getInstance() {\n if (!isset(self::$instance)) {\n self::$instance = new CalendarDayManager();\n }\n return self::$instance;\n }",
"public function getCalendarPage();",
"public function getCalendarUid ()\n {\n return $this->calendar_uid;\n }",
"public function getCalendarDescription()\n {\n return $this->get('CalendarDescription');\n }",
"public function setCalendarId($id)\n {\n if ($id) {\n $this->calendarId = $id;\n }\n\n return $this;\n }",
"public function calendars()\n {\n return $this->hasMany('App\\Models\\Calendar');\n }",
"public function getEvent()\n {\n $result = new stdClass;\n\n if (!($kronolith_driver = $this->_getDriver($this->vars->cal)) ||\n !isset($this->vars->id)) {\n return $result;\n }\n\n try {\n $event = $kronolith_driver->getEvent($this->vars->id, $this->vars->date);\n $event->setTimezone(true);\n $result->event = $event->toJson(null, true, $GLOBALS['prefs']->getValue('twentyFour') ? 'H:i' : 'h:i A');\n // If recurring, we need to format the dates of this instance, since\n // Kronolith_Driver#getEvent will return the start/end dates of the\n // original event in the series.\n if ($event->recurs() && $this->vars->rsd) {\n $rs = new Horde_Date($this->vars->rsd);\n $result->event->rsd = $rs->strftime('%x');\n $re = new Horde_Date($this->vars->red);\n $result->event->red = $re->strftime('%x');\n }\n } catch (Horde_Exception_NotFound $e) {\n $GLOBALS['notification']->push(_(\"The requested event was not found.\"), 'horde.error');\n } catch (Exception $e) {\n $GLOBALS['notification']->push($e, 'horde.error');\n }\n\n return $result;\n }",
"public function setCalendar(Mymodules_Google_Model_Calendar $calendar)\r\n {\r\n $this->_calendar = $calendar;\r\n\r\n return $this;\r\n }",
"public function getCalificacion() {\n return $this->calificacion;\n }",
"public function getCalendarSummary()\n {\n return $this->get('CalendarSummary');\n }",
"public function getAnioCalendario(){\n return $this->anioCalendario;\n }",
"private function createCalendar($method)\n {\n // Create calender.\n $calendar = $this->ics->createCalendar(null, true);\n\n // Set request method.\n $calendar->setMethod(strtoupper($method));\n\n return $calendar;\n }",
"private function getCalendar($calendar_obj_list, $cal_id){\n\t\t$main_cal_obj = false;\n\t\tforeach($calendar_obj_list as $cal){\n\t\t\tif($cal->getId() == $cal_id){\n\t\t\t\t$main_cal_obj = $cal;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(!is_object($main_cal_obj) && is_object($calendar_obj_list[0])){\n\t\t\t// they specified an incorrect calendar id\n\t\t\t// just use the first calendar\n\t\t\t$main_cal_obj = $calendar_obj_list[0];\n\t\t}\n\t\treturn $main_cal_obj;\n\t}",
"function getHomeCalendar()\n {\n $intYear = (isset($_GET['yearID'])) ? intval($_GET['yearID']) : date('Y', time());\n $intMonth = (isset($_GET['monthID'])) ? intval($_GET['monthID']) : date('m', time());\n $intDay = (isset($_GET['dayID'])) ? intval($_GET['dayID']) : 0;\n return $this->getCalendar($intYear,$intMonth,$intDay);\n }",
"public static function initialize_calendar(){\n \n $event_array[] = array();\n $schedules = \\App\\Event::get();\n if(!empty($schedules)){\n foreach($schedules as $schedule){\n $event_array[] = array(\n 'id' => uniqid(),\n 'title' => $schedule->description,\n 'start' => date('Y-m-d', strtotime($schedule->event_date)),\n 'end' => date('Y-m-d', strtotime($schedule->event_date)),\n 'color' => \"lightblue\",\n \"textEscape\"=> 'false' ,\n 'textColor' => 'black',\n );\n }\n return $get_schedule = json_encode($event_array);\n }\n }",
"public static function icalendar() {\r\n $ical = \"BEGIN:VCALENDAR\".PHP_EOL;\r\n $ical .= \"VERSION:2.0\".PHP_EOL;\r\n\r\n $show_personal_bak = Calendar_Events::$calsettings->show_personal;\r\n $show_course_bak = Calendar_Events::$calsettings->show_course;\r\n $show_deadline_bak = Calendar_Events::$calsettings->show_deadline;\r\n $show_admin_bak = Calendar_Events::$calsettings->show_admin;\r\n Calendar_Events::set_calendar_settings(1,1,1,1);\r\n Calendar_Events::get_calendar_settings();\r\n $eventlist = Calendar_Events::get_calendar_events();\r\n Calendar_Events::set_calendar_settings($show_personal_bak,$show_course_bak,$show_deadline_bak,$show_admin_bak);\r\n Calendar_Events::get_calendar_settings();\r\n\r\n $events = array();\r\n foreach ($eventlist as $event) {\r\n $ical .= \"BEGIN:VEVENT\".PHP_EOL;\r\n $startdatetime = new DateTime($event->start);\r\n $ical .= \"DTSTART:\".$startdatetime->format(\"Ymd\\THis\").PHP_EOL;\r\n $duration = new DateTime($event->duration);\r\n $ical .= \"DURATION:\".$duration->format(\"\\P\\TH\\Hi\\Ms\\S\").PHP_EOL;\r\n $ical .= \"SUMMARY:[\".strtoupper($event->event_group).\"] \".$event->title.PHP_EOL;\r\n $ical .= \"DESCRIPTION:\".canonicalize_whitespace(strip_tags($event->content)).PHP_EOL;\r\n if ($event->event_group == 'deadline')\r\n {\r\n $ical .= \"BEGIN:VALARM\".PHP_EOL;\r\n $ical .= \"TRIGGER:-PT24H\".PHP_EOL;\r\n $ical .= \"DURATION:PT10H\".PHP_EOL;\r\n $ical .= \"ACTION:DISPLAY\".PHP_EOL;\r\n $ical .= \"DESCRIPTION:DEADLINE REMINDER for \".canonicalize_whitespace(strip_tags($event->title)).PHP_EOL;\r\n $ical .= \"END:VALARM\".PHP_EOL;\r\n }\r\n $ical .= \"END:VEVENT\".PHP_EOL;\r\n }\r\n $ical .= \"END:VCALENDAR\".PHP_EOL;\r\n return $ical;\r\n }",
"public static function event() {\n return self::service()->get('events');\n }",
"public function getCalendarInCalendarHome(string $principalUri, string $calendarUri): ?ExternalCalendar;",
"public function events()\n {\n return $this->hasMany(CalendarEvent::class);\n }",
"public function getIdCalendario(){\n return $this->idCalendario;\n }",
"function get_calendars() {\n\n\t\t// Get the attached calendars\n\t\t$calendars = wp_get_post_terms( $this->post_id , 'calendar' );\n\t\t$this->calendars = $calendars;\n\t\t\n\t\t// Loop through calendars, checking permissions\n\t\tforeach ( $calendars as $calendar ) {\n\t\t\t\n\t\t\t// Is it a group calendar?\n\t\t\tif ( is_group_calendar( $calendar->term_id ) ) :\n\t\t\t\t$group_id\t= groups_get_id( $calendar->slug );\n\t\t\t\t$can_view \t= groups_is_user_member( get_current_user_id() , $group_id ) ? true : false;\n\t\t\telse :\n\t\t\t\t$can_view = true;\n\t\t\tendif;\n\t\t\t\n\t\t\t// If we find a calendar for which the user is authorized, go ahead and display it\n\t\t\tif( $can_view ) :\n\t\t\t\t$this->calendar = $calendar;\n\t\t\t\t$this->can_view = true;\n\t\t\t\tbreak;\n\t\t\tendif;\n\t\t}\n\n\t\t// If the user is not allowed to view any calendar, redirect them to the group\n\t\tif ( !$can_view ) {\n\t\t\t$redirect = SITEURL . '/groups/' . $this->calendar->slug;\n\t\t\tbp_core_add_message( 'You cannot access events on this calendar.' , 'error' );\n\t\t\tbp_core_redirect( $redirect );\n\t\t}\n\t}",
"public function getEvent()\n {\n return $this->getProperty(\"Event\",\n new Event($this->getContext(), new ResourcePath(\"Event\", $this->getResourcePath())));\n }",
"public function getCalendarInfo()\n\t{\n\t\t\n\t\t//get URL to calendar page\n\t\t$url = $this->calendarLink;\n\t\t//Get the sourcecode\t\t\t\n\t\t$data = $this->curl->curlGetReq($url);\n\t\t//find all links to each person\n\t\t$query = \"//a\";\n\t\t$aTagNodes = $this->curl-> getDOMData($data,$query);\n\t\t\n\t\t$calendarDates = new CalendarDateRepository();\n\t\t//loop through each link, representing a person\n\t\tforeach ($aTagNodes as $at)\n\t\t{\n\t\t\t//get the href to that persons calendar\n\t\t\t$calURL =$at->getAttribute(\"href\");\n\t\t\t//get the sourcecode of that page\n\t\t\t$data = $this->curl->curlGetReq($url.$calURL);\n\t\t\t//get the table header containing name of the days\n\t\t\t$query = \"//th\";\n\t\t\t$days = $this->curl->getDOMData($data,$query);\n\t\t\t//get the table data containing availability\n\t\t\t$query = \"//td\";\n\t\t\t$availibility = $this->curl->getDOMData($data,$query);\t\t\t\n\n\t\t\t$dates = array();\n\t\t\t/*\n\t\t\t* loop table data, if the availability of that day is ok\n\t\t\t* save that data.\n\t\t\t*/\n\t\t\tfor ($i=0; $i < $days->length ; $i++)\n\t\t\t{ \n\t\t\t\t$availibilityStr =$availibility[$i]->nodeValue;\n\t\n\t\t\t\tif(strtolower($availibilityStr) === \"ok\")\n\t\t\t\t{\t\n\t\t\t\t\t//$calendarDates->add($days[$i]->nodeValue);\n\t\t\t\t\t$dates[] = new Day($days[$i]->nodeValue);\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t$calendarDates->add($dates);\n\t\t\t\n\t\t }\n\t\t\n\t\treturn $calendarDates; \n\t}",
"public function getCalendar() {\n\t\t$this->setDate();\n\t\t$this->getLinks();\n\t\t $this->di->logger->stamp(__CLASS__, __METHOD__, '');\n\n\n\t\t// Get new date array\n\t\t$newDate = getdate(mktime(0,0,0,$this->newMonth, 1, $this->newYear));\n\t\t// Calculate rest days in previous and next month\n\t\t$firstDay = $newDate['wday'];\n\t\t$firstDay = ($firstDay == 0) ? 7: $firstDay;\n\t\t$daysInMonth = cal_days_in_month ( CAL_GREGORIAN , $this->newMonth , $this->newYear );\n\t\tif($this->newMonth != 1){\n\t\t\t$daysInPrevMonth = cal_days_in_month ( CAL_GREGORIAN , $this->newMonth-1 , $this->newYear );\n\t\t}\n\t\telse if($this->newMonth == 1) {\n\t\t\t$daysInPrevMonth = cal_days_in_month ( CAL_GREGORIAN , 12 , $this->newYear-1 );\n\t\t}\n\n\t\t$lastDates = $daysInPrevMonth - $firstDay +1;\n\n\t\t// Start building table\n\t\t$table =\"<section class='calendar'><header>\" . $this->prevLink . \"<h3>\" . $newDate['month'] . \" - \" . $newDate['year'] . \"</h3>\" . $this->nextLink;\n\t\t$table .= \"</header><table><thead>\\n\";\n\t\t$table .= \"<th>Mon</th><th>Tue</th><th>Wed</th><th>Thu</th><th>Fri</th><th>Sat</th><th>Sun</th>\\n\";\n\t\t$table .= \"</thead>\\n\";\n\t\t$table .= \"<tr>\";\n\t\t\n\t\tfor ($a=1; $a < $firstDay ; $a++) { \n\t\t\t$lastDates++;\n\t\t\t$table .= \"<td class='lighter'>\" . $lastDates . \"</td>\";\n\t\t}\n\n\t\t$d = 0;\n\t\tfor ($b=0; $b < $daysInMonth ; $b++) { \n\t\t\t\n\t\t\t$d++;\n\t\t\t$DATE = date('N',mktime(0,0,0, $this->newMonth, $d, $this->newYear));\n\t\t\t\n\t\t\tif ($DATE == 1) {\n\t\t\t\t$table .= \"</tr>\\n<tr>\";\n\t\t\t}\n\n\t\t\tif (($this->newMonth == $this->currentMonth && $d == $this->currentDate && $this->newYear == $this->currentYear)) {\n\t\t\t\t$table .= \"<td><strong>\" . $d . \"</strong></td>\";\n\t\t\t}\n\t\t\telse if ($DATE == 7) {\n\t\t\t\t$table .= \"<td class='red'>\" . $d . \"</td>\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$table .= \"<td>\" . $d . \"</td>\";\n\t\t\t}\n\t\t}\n\t\t\tif ($DATE != 7) {\n\t\t\t\t$nextMonthDays = 7 - $DATE;\n\t\t\t\tfor ($c=1; $c <= $nextMonthDays ; $c++) { \n\t\t\t\t\t$table .= \"<td class='lighter'>\" . $c . \"</td>\";\n\t\t\t}\n\t}\n\t\t$table .= \"</tr></table></section>\";\n\n\t\treturn $table;\n\t}",
"public function calendars()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name' => 'category',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'site_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'not' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'not' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'status',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => 'open'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_end',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t)\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Convert calendar_name to calendar_id\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('calendar_id') == '' AND\n\t\t\t$this->P->value('calendar_name') != '')\n\t\t{\n\t\t\t$ids = $this->data->get_calendar_id_from_name(\n\t\t\t\t$this->P->value('calendar_name'),\n\t\t\t\tNULL,\n\t\t\t\t$this->P->params['calendar_name']['details']['not']\n\t\t\t);\n\n\t\t\tif ( empty( $ids ) )\n\t\t\t{\n\t\t\t\t//ee()->TMPL->log_item('Calendar: No results for\n\t\t\t\t//calendar name provided, bailing');\n\t\t\t\treturn $this->no_results();\n\t\t\t}\n\n\t\t\t$this->P->set('calendar_id', implode('|', $ids));\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Determine which calendars this user has permission to view\n\t\t// and modify the parameters accordingly.\n\t\t// -------------------------------------\n\n\t\t// TODO\n\n\t\t// -------------------------------------\n\t\t// Fetch the basics\n\t\t// -------------------------------------\n\n\t\t$data = $this->data->fetch_calendars_basics(\n\t\t\t$this->P->value('site_id'),\n\t\t\t$this->P->value('calendar_id'),\n\t\t\t$this->P->params['calendar_id']['details']['not']\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// If no data, then give 'em no_results\n\t\t// -------------------------------------\n\n\t\tif (($total_results = count($data)) == 0)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: No results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Ensure date_range_start <= date_range_end\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('date_range_start') !== FALSE AND\n\t\t\t$this->P->value('date_range_end') !== FALSE)\n\t\t{\n\t\t\tif ($this->P->value('date_range_start', 'ymd') > $this->P->value('date_range_end', 'ymd'))\n\t\t\t{\n\t\t\t\t$temp = $this->P->params['date_range_start']['value'];\n\t\t\t\t$this->P->set('date_range_start', $this->P->params['date_range_end']['value']);\n\t\t\t\t$this->P->set('date_range_end', $temp);\n\t\t\t\tunset($temp);\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// This will come in handy later\n\t\t// -------------------------------------\n\n\t\t$calendar_array = array();\n\t\tforeach ($data as $k => $arr)\n\t\t{\n\t\t\t$calendar_array[] = $arr['calendar_id'];\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Date range params? Then we need to do a lot more work.\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('date_range_start') !== FALSE OR\n\t\t\t$this->P->value('date_range_end') !== FALSE)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: Calculating date ranges');\n\t\t\t$min = ($this->P->value('date_range_start') !== FALSE) ?\n\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') :\n\t\t\t\t\t\t0;\n\n\t\t\t$max = ($this->P->value('date_range_end') !== FALSE) ?\n\t\t\t\t$this->P->value('date_range_end', 'ymd') :\n\t\t\t\t0;\n\n\t\t\t$calendar_array = $this->data->fetch_calendars_with_events_in_date_range(\n\t\t\t\t$min,\n\t\t\t\t$max,\n\t\t\t\t$calendar_array,\n\t\t\t\t$this->P->value('status')\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// No calendars? No results.\n\t\t// -------------------------------------\n\n\t\tif (empty($calendar_array))\n\t\t{\n//ee()->TMPL->log_item('Calendar: No calendars, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tInvoke Channel class\n\t\t//\t----------------------------------------\n\n\t\tif ( ! class_exists('Channel') )\n\t\t{\n\t\t\trequire PATH_MOD.'/channel/mod.channel.php';\n\t\t}\n\n\t\t$channel = new Channel();\n\n\t\t//need to remove limit here so huge amounts of events work\n\t\t$channel->limit = 1000000;\n\n\t\t// --------------------------------------------\n\t\t// Invoke Pagination for EE 2.4 and Above\n\t\t// --------------------------------------------\n\n\t\t$channel = $this->add_pag_to_channel($channel);\n\n\t\t// -------------------------------------\n\t\t// Prepare parameters\n\t\t// -------------------------------------\n\n\t\tee()->TMPL->tagparams['entry_id'] = implode('|', $calendar_array);\n\t\tee()->TMPL->tagparams['channel'] = CALENDAR_CALENDARS_CHANNEL_NAME;\n\n\t\t// -------------------------------------\n\t\t// Pre-process related data\n\t\t// -------------------------------------\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\n\t\t\tee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data(\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t\tee()->TMPL->var_single = array_merge(\n\t\t\t\tee()->TMPL->var_single,\n\t\t\t\tee()->TMPL->related_markers\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Execute needed methods\n\t\t// -------------------------------------\n\n\t\t$channel->fetch_custom_channel_fields();\n\n\t\t$channel->fetch_custom_member_fields();\n\n\t\t// --------------------------------------------\n\t\t// Pagination Tags Parsed Out\n\t\t// --------------------------------------------\n\n\t\t$this->fetch_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Querification\n\t\t// -------------------------------------\n\n\t\t$channel->build_sql_query();\n\n\t\tif ($channel->sql == '')\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query = ee()->db->query($channel->sql);\n\n\t\tif ($channel->query->num_rows() == 0)\n\t\t{\n//ee()->TMPL->log_item('Calendar: Channel module says no results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query->result\t= $channel->query->result_array();\n\n\t\t// -------------------------------------------\n\t\t// 'calendar_calendars_channel_query' hook.\n\t\t// - Do something with the channel query\n\n\t\tif (ee()->extensions->active_hook('calendar_calendars_channel_query') === TRUE)\n\t\t{\n\t\t\t$channel->query = ee()->extensions->call('calendar_calendars_channel_query', $channel->query, $calendar_array);\n\t\t\tif (ee()->extensions->end_script === TRUE) return;\n\t\t}\n\t\t//\n\t\t// -------------------------------------------\n\n\t\t// -------------------------------------\n\t\t// Inject Calendar-specific variables\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Adding Calendar variables');\n\n\t\t$aliases = array(\n\t\t\t'title'\t\t\t=> 'calendar_title',\n\t\t\t'url_title'\t\t=> 'calendar_url_title',\n\t\t\t'entry_id'\t\t=> 'calendar_id',\n\t\t\t'author_id'\t\t=> 'calendar_author_id',\n\t\t\t'author'\t\t=> 'calendar_author',\n\t\t\t'status'\t\t=> 'calendar_status'\n\t\t);\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$aliases['url_title'] = 'calendar_borked_title';\n\n\t\t\tee()->TMPL->var_single['calendar_borked_title'] = 'calendar_borked_title';\n\n\t\t\tunset(ee()->TMPL->var_single['calendar_url_title']);\n\n\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_url_title' . RD,\n\t\t\t\t\t'\"calendar_url_title\"',\n\t\t\t\t\t\"'calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_borked_title' . RD,\n\t\t\t\t\t'\"calendar_borked_title\"',\n\t\t\t\t\t\"'calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t}\n\n\t\tforeach ($channel->query->result as $k => $row)\n\t\t{\n\t\t\t$channel->query->result[$k]['author'] = ($row['screen_name'] != '') ?\n\t\t\t\t\t\t\t\t\t\t$row['screen_name'] : $row['username'];\n\n\t\t\tforeach ($aliases as $old => $new)\n\t\t\t{\n\t\t\t\t$channel->query->result[$k][$new] = $channel->query->result[$k][$old];\n\t\t\t}\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tRedeclare\n\t\t//\t----------------------------------------\n\t\t//\tWe will reassign the $channel->query->result with our\n\t\t//\treordered array of values.\n\t\t//\t----------------------------------------\n\n\t\t$channel->query->result_array = $channel->query->result;\n\n\t\t// --------------------------------------------\n\t\t// Typography\n\t\t// --------------------------------------------\n\n\t\tee()->load->library('typography');\n\t\tee()->typography->initialize();\n\t\tee()->typography->convert_curly = FALSE;\n\n\t\t$channel->fetch_categories();\n\n\t\t// -------------------------------------\n\t\t// Parse\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing, via channel module');\n\n\n\n\t\t$channel->parse_channel_entries();\n\n\t\t// -------------------------------------\n\t\t// Paginate\n\t\t// -------------------------------------\n\n\t\t$channel = $this->add_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Related entries\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing related entries, via Weblog module');\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\t\t\tif (count(ee()->TMPL->related_data) > 0 AND\n\t\t\t\tcount($channel->related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_related_entries();\n\t\t\t}\n\n\t\t\tif (count(ee()->TMPL->reverse_related_data) > 0 AND\n\t\t\t\tcount($channel->reverse_related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_reverse_related_entries();\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Send 'em home\n\t\t// -------------------------------------\n\n\t\t$tagdata = $channel->return_data;\n\n\t\t//ee()->TMPL->log_item('Calendar: Done!');\n\n\t\t//on the off chance someone just wrote the word\n\t\t//'calendar_url_title', we should fix that before\n\t\t//output. (See above calendar_url_title fix)\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_borked_title' . RD,\n\t\t\t\t\t'\"calendar_borked_title\"',\n\t\t\t\t\t\"'calendar_borked_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_url_title' . RD,\n\t\t\t\t\t'\"calendar_url_title\"',\n\t\t\t\t\t\"'calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\t\t}\n\n\t\treturn $tagdata;\n\n\t}",
"public static function get($type) {\n switch ($type) {\n case 'Fundraiser':\n return new Application_Model_CalendarEntryFundraiser();\n break;\n\n case 'Newsletter':\n return new Application_Model_CalendarEntryNewsletter();\n break;\n\n default:\n throw new Zend_Exception('Calendar entry ' . $type . 'does not exists');\n break;\n }\n }",
"public function calendar()\n {\n return view('pages.calendar');\n }",
"public function calendar()\n {\n return view('calendar');\n }",
"public static function get_event($eventid) {\r\n global $uid;\r\n return Database::get()->querySingle(\"SELECT * FROM personal_calendar WHERE id = ?d AND user_id = ?d\", $eventid, $uid);\r\n }",
"public function get_calendar_list() {\n $calendars = array();\n $uri = 'https://www.googleapis.com/calendar/v3/users/me/calendarList';\n $params = array(\n 'sslverify' => false,\n 'timeout' => 60,\n 'headers' => array(\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->get_access_token(),\n ),\n );\n\n $response = wp_remote_get( $uri, $params );\n\n if ( !is_wp_error( $response ) && 200 == $response[ 'response' ][ 'code' ] && 'OK' == $response[ 'response' ][ 'message' ] ) {\n $body = json_decode( $response[ 'body' ] );\n $calendars = $body->items;\n\n $this->debug( 'Calendar List retrieved successfully', $body );\n } else {\n $this->error( 'Error while retrieving Calendar List: ', $response );\n }\n\n return $calendars;\n }",
"public function getEvent()\n {\n return isset($this->event) ? $this->event : null;\n }",
"public function getCalendarTimezone()\n {\n return $this->get('CalendarTimezone');\n }",
"public function getEvent()\n {\n return $this->event;\n }",
"public function getEvent()\n {\n return $this->event;\n }",
"public function getEvent()\n {\n return $this->event;\n }",
"private function get_current_agenda(): AgendaInterface\n {\n return array_key_exists($this->agenda_index, $this->agendas)\n ? $this->agendas[$this->agenda_index]\n : $this->agendas[] = new Weekly();\n }",
"public function getEvent()\n {\n return $this->getData('event');\n }",
"public function getEventsCreatedHere()\n {\n $options = array(\n 'calendar' => $this->shortname,\n 'created_only' => true\n );\n\n # create new events class. On constructor it will get the stuff\n $events = new Events($options);\n return $events;\n }",
"protected function getEvent()\n {\n if (null === $this->event) {\n $this->event = $event = new EntityEvent;\n\n $event->setTarget($this);\n }\n\n return $this->event;\n }",
"public function getEvent()\n {\n $event = array(\n \"eid\" => $this->eid,\n \"name\" => $this->name,\n \"venue\" => $this->venue,\n \"date\" => $this->date,\n \"time\" => $this->time,\n \"type\" => $this->type,\n \"status\" => $this->status\n );\n return $event;\n }",
"public function get_all_data()\n\t{\n\treturn $this->cal;\n\t}",
"private function _get_calendar_array()\n\t{\n\t $this->all_events = $this->result->xpath(\".//event\");\n\t \n\t foreach($this->all_events as $an_event):\n\t $start_at = $an_event->xpath(\"./start-at\");\n \t $start_at = $start_at[0];\n \t $end_at = $an_event->xpath(\"./end-at\");\n \t $end_at = $end_at[0];\n \t \n \t $start_at = new DateTime($start_at);\n \t $start_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $start_at->setTime(0, 0, 0);\n \t $end_at = new DateTime($end_at);\n \t $end_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $end_at->setTime(0, 0, 0);\n \t \n \t $start_timestamp = strtotime($start_at->format('Y-m-d'));\n $end_timestamp = strtotime($end_at->format('Y-m-d'));\n \n $start_year = date(\"Y\", $start_timestamp);\n $end_year = date(\"Y\", $end_timestamp);\n $start_month = date(\"m\", $start_timestamp);\n $end_month = date(\"m\", $end_timestamp);\n $start_day = date(\"d\", $start_timestamp);\n $start_day = $start_day + 1;\n $end_day = date(\"d\", $end_timestamp);\n $end_day = $end_day + 1;\n \n if(($start_year == $this->year && $start_month == $this->month) || ($end_year == $this->year && $end_month == $this->month)):\n if($start_year == $end_year):\n if($start_month == $end_month):\n $this->_calendar_array_one($start_day, $end_day);\n else:\n if($end_month != $this->month):\n $this->_calendar_array_two($start_day);\n else:\n $this->_calendar_array_three($end_day);\n endif;\n endif;\n endif;\n endif;\n endforeach;\n \n\t foreach($this->callinks as $callinks):\n\t foreach($callinks as $key => $value):\n\t $this->combined_callinks[\"$key\"] = $value;\n\t endforeach;\n\t endforeach;\n\t}",
"public function getEvent()\r\n {\r\n return $this->Event;\r\n }",
"public function getEvent() {\n return $this->event;\n }",
"public function getEventManager()\n {\n return $this->events;\n }",
"protected function getCalendarView()\n {\n return !empty($_GET['calview']) ? $_GET['calview'] : 'fullcalendar';\n }",
"protected function get_calendar_data(){\r\n global $user;\r\n \r\n \r\n if (Go_to::is_on_page(\"edit_room\")){\r\n $this->room_name = $_GET['room'];\r\n $this->owner = $user->username();\r\n $this->facility_name = $_SESSION['active_fac'] ;\r\n// $this->room = $user->username()\";\r\n// var_dump($_SESSION);\r\n// var_dump($this);\r\n }\r\n \r\n \r\n \r\n\r\n }",
"public function getCurrentEvent(): CalendarEventsModel|null\n {\n $item = Input::get('auto_item');\n\n if (empty($item)) {\n return null;\n }\n\n return CalendarEventsModel::findByIdOrAlias($item);\n }",
"public function getCalendarPeriod()\n {\n return $this->readOneof(8);\n }",
"public function getCalendarTimerFactory()\n {\n return $this->calendarTimerFactory;\n }",
"public function icalendar()\n\t{\n\t\t$s = 'EJURI3ia8aj#912IKa';\n\t\t$r = '#';\n\t\t$e = 'aAEah38a;a33';\n\n\t\t// -------------------------------------\n\t\t// Some dummy tagdata we'll hand off to events()\n\t\t// -------------------------------------\n\n\t\t$vars = array(\n\t\t\t'event_title'\t\t\t\t\t=> 'title',\n\t\t\t'event_id'\t\t\t\t\t\t=> 'id',\n\t\t\t'event_summary'\t\t\t\t\t=> 'summary',\n\t\t\t'event_location'\t\t\t\t=> 'location',\n\t\t\t'event_start_date format=\"%Y\"'\t=> 'start_year',\n\t\t\t'event_start_date format=\"%m\"'\t=> 'start_month',\n\t\t\t'event_start_date format=\"%d\"'\t=> 'start_day',\n\t\t\t'event_start_date format=\"%H\"'\t=> 'start_hour',\n\t\t\t'event_start_date format=\"%i\"'\t=> 'start_minute',\n\t\t\t'event_end_date format=\"%Y\"'\t=> 'end_year',\n\t\t\t'event_end_date format=\"%m\"'\t=> 'end_month',\n\t\t\t'event_end_date format=\"%d\"'\t=> 'end_day',\n\t\t\t'event_end_date format=\"%H\"'\t=> 'end_hour',\n\t\t\t'event_end_date format=\"%i\"'\t=> 'end_minute',\n\t\t\t'event_calendar_tz_offset'\t\t=> 'tz_offset',\n\t\t\t'event_calendar_timezone'\t\t=> 'timezone'\n\t\t);\n\n\t\t$rvars = array(\n\t\t\t'rule_type',\n\t\t\t'rule_start_date',\n\t\t\t'rule_repeat_years',\n\t\t\t'rule_repeat_months',\n\t\t\t'rule_repeat_days',\n\t\t\t'rule_repeat_weeks',\n\t\t\t'rule_days_of_week',\n\t\t\t'rule_relative_dow',\n\t\t\t'rule_days_of_month',\n\t\t\t'rule_months_of_year',\n\t\t\t'rule_stop_by',\n\t\t\t'rule_stop_after'\n\t\t);\n\n\t\t$evars = array(\n\t\t\t'exception_start_date format=\"%Y%m%dT%H%i00\"'\n\t\t);\n\n\t\t$ovars = array(\n\t\t\t'occurrence_start_date format=\"%Y%m%dT%H%i00\"',\n\t\t\t'occurrence_end_date format=\"%Y%m%dT%H%i00\"'\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Preparing tagdata');\n\n\t\t$summary_field = ee()->TMPL->fetch_param('summary_field', 'event_title');\n\n\t\tee()->TMPL->tagdata =\timplode($s, array(\n\t\t\tLD . $summary_field . RD,\n\t\t\tLD . 'event_id' . RD,\n\t\t\tLD . 'if event_summary' . RD .\n\t\t\t\tLD . 'event_summary' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\tLD . 'if event_location' . RD .\n\t\t\t\tLD . 'event_location' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\tLD . 'event_start_date format=\"%Y\"' . RD,\n\t\t\tLD . 'event_start_date format=\"%m\"' . RD,\n\t\t\tLD . 'event_start_date format=\"%d\"' . RD,\n\t\t\tLD . 'event_start_date format=\"%H\"' . RD,\n\t\t\tLD . 'event_start_date format=\"%i\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%Y\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%m\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%d\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%H\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%i\"' . RD,\n\t\t\tLD . 'event_calendar_tz_offset' . RD,\n\t\t\tLD . 'event_calendar_timezone' . RD,\n\t\t\t'RULES' .\n\t\t\t\tLD . 'if event_has_rules' . RD .\n\t\t\t\tLD . 'rules' . RD .\n\t\t\t\tLD . implode(RD . $r . LD, $rvars) . RD . '|' .\n\t\t\t\tLD . T_SLASH . 'rules' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\t'OCCURRENCES'.\n\t\t\t\tLD . 'if event_has_occurrences' . RD .\n\t\t\t\tLD . 'occurrences' . RD .\n\t\t\t\tLD . implode(RD . $r . LD, $ovars) . RD . '|' .\n\t\t\t\tLD . T_SLASH . 'occurrences' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\t'EXCEPTIONS'.\n\t\t\t\tLD . 'if event_has_exceptions' . RD .\n\t\t\t\tLD . 'exceptions' . RD .\n\t\t\t\tLD . implode(RD . $r . LD, $evars) . RD . '|' .\n\t\t\t\tLD . T_SLASH . 'exceptions' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\t$e\n\t\t));\n\n\t\t$tvars \t\t\t\t\t= ee()->functions->assign_variables(\n\t\t\tee()->TMPL->tagdata\n\t\t);\n\t\tee()->TMPL->var_single \t= $tvars['var_single'];\n\t\tee()->TMPL->var_pair \t= $tvars['var_pair'];\n\t\tee()->TMPL->tagdata \t= ee()->functions->prep_conditionals(\n\t\t\tee()->TMPL->tagdata,\n\t\t\tarray_keys($vars)\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// Fire up events()\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Firing up Events()');\n\n\t\t$tagdata = ee()->TMPL->advanced_conditionals($this->events());\n\n\t\t// -------------------------------------\n\t\t// Collect the events\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Collecting events');\n\n\t\t$events = explode($e, $tagdata);\n\n\t\t// -------------------------------------\n\t\t// Fire up iCalCreator\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Starting iCalCreator');\n\n\t\tif ( ! class_exists('vcalendar'))\n\t\t{\n\t\t\trequire_once 'libraries/icalcreator/iCalcreator.class.php';\n\t\t}\n\n\t\t$ICAL = new vcalendar();\n\n\t\t//we are setting this manually because we need individual ones for each event for this to work\n\t\t//$ICAL->setConfig('unique_id', parse_url(ee()->config->item('site_url'), PHP_URL_HOST));\n\t\t$host = parse_url(ee()->config->item('site_url'), PHP_URL_HOST);\n\n\n\t\t$vars = array_values($vars);\n\n\t\t//ee()->TMPL->log_item('Calendar: Iterating through the events');\n\n\t\tforeach ($events as $key => $event)\n\t\t{\n\t\t\tif (trim($event) == '') continue;\n\n\t\t\t$E \t\t\t\t= new vevent();\n\n\t\t\t$event \t\t\t= explode($s, $event);\n\t\t\t$rules \t\t\t= '';\n\t\t\t$occurrences \t= '';\n\t\t\t$exceptions \t= '';\n\n\t\t\tforeach ($event as $k => $v)\n\t\t\t{\n\t\t\t\tif (isset($vars[$k]))\n\t\t\t\t{\n\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t//\tMakes the local vars from above, if available:\n\t\t\t\t\t// \t$title, $summary, $location,\n\t\t\t\t\t// $start_year, $start_month, $start_day,\n\t\t\t\t\t// $start_hour, $start_minute, $end_year,\n\t\t\t\t\t// $end_month, $end_day, $end_hour,\n\t\t\t\t\t// \t$end_minute, $tz_offset, $timezone\n\t\t\t\t\t//--------------------------------------------\n\n\t\t\t\t\t$$vars[$k] = $v;\n\t\t\t\t}\n\t\t\t\telseif (substr($v, 0, 5) == 'RULES')\n\t\t\t\t{\n\t\t\t\t\t$rules = substr($v, 5);\n\t\t\t\t}\n\t\t\t\telseif (substr($v, 0, 11) == 'OCCURRENCES')\n\t\t\t\t{\n\t\t\t\t\t$occurrences = substr($v, 11);\n\t\t\t\t}\n\t\t\t\telseif (substr($v, 0, 10) == 'EXCEPTIONS')\n\t\t\t\t{\n\t\t\t\t\t$exceptions = substr($v, 10);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Set the timezone for this calendar based on the first event's info\n\t\t\t// -------------------------------------\n\n\t\t\tif ($key == 0)\n\t\t\t{\n\t\t\t\t// -------------------------------------\n\t\t\t\t// Convert calendar_name to calendar_id\n\t\t\t\t// -------------------------------------\n\n\t\t\t\tif ($this->P->value('calendar_id') == '' AND\n\t\t\t\t\t$this->P->value('calendar_name') != '')\n\t\t\t\t{\n\t\t\t\t\t$ids = $this->data->get_calendar_id_from_name(\n\t\t\t\t\t\t$this->P->value('calendar_name'),\n\t\t\t\t\t\tNULL,\n\t\t\t\t\t\t$this->P->params['calendar_name']['details']['not']\n\t\t\t\t\t);\n\n\t\t\t\t\t$this->P->set('calendar_id', implode('|', $ids));\n\t\t\t\t}\n\n\t\t\t\t//--------------------------------------------\n\t\t\t\t//\tlets try to get the timezone from the\n\t\t\t\t//\tpassed calendar ID if there is one\n\t\t\t\t//--------------------------------------------\n\n\t\t\t\t$cal_timezone \t= FALSE;\n\t\t\t\t$cal_tz_offset \t= FALSE;\n\n\t\t\t\tif ($this->P->value('calendar_id') != '')\n\t\t\t\t{\n\t\t\t\t\t$sql = \"SELECT \ttz_offset, timezone\n\t\t\t\t\t\t\tFROM\texp_calendar_calendars\n\t\t\t\t\t\t\tWHERE \tcalendar_id\n\t\t\t\t\t\t\tIN \t\t(\" . ee()->db->escape_str(\n\t\t\t\t\t\t\t\t\t\t\timplode(',',\n\t\t\t\t\t\t\t\t\t\t\t\texplode('|',\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->P->value('calendar_id')\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t) .\n\t\t\t\t\t\t\t\t\t\")\n\t\t\t\t\t\t\tLIMIT\t1\";\n\n\t\t\t\t\t$cal_tz_query = ee()->db->query($sql);\n\n\t\t\t\t\tif ($cal_tz_query->num_rows() > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$cal_timezone \t= $cal_tz_query->row('timezone');\n\t\t\t\t\t\t$cal_tz_offset \t= $cal_tz_query->row('tz_offset');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//last resort, we get it from the current event\n\n\t\t\t\t$T = new vtimezone();\n\t\t\t\t$T->setProperty('tzid', ($cal_timezone ? $cal_timezone : $timezone));\n\t\t\t\t$T->setProperty('tzoffsetfrom', '+0000');\n\n\t\t\t\t$tzoffsetto = ($cal_tz_offset ? $cal_tz_offset : $tz_offset);\n\n\t\t\t\tif ($tzoffsetto === '0000')\n\t\t\t\t{\n\t\t\t\t\t$tzoffsetto = '+0000';\n\t\t\t\t}\n\n\t\t\t\t$T->setProperty('tzoffsetto', $tzoffsetto);\n\t\t\t\t$ICAL->setComponent($T);\n\t\t\t}\n\n\t\t\t$title\t\t\t= strip_tags($title);\n\t\t\t$description\t= strip_tags(trim($summary));\n\t\t\t$location\t\t= strip_tags(trim($location));\n\n\t\t\t// -------------------------------------\n\t\t\t// Occurrences?\n\t\t\t// -------------------------------------\n\n\t\t\t$occurrences\t= explode('|', rtrim($occurrences, '|'));\n\t\t\t$odata\t\t\t= array();\n\n\t\t\tforeach ($occurrences as $k => $occ)\n\t\t\t{\n\t\t\t\t$occ = trim($occ);\n\t\t\t\tif ($occ == '') continue;\n\n\t\t\t\t$occ = explode($r, $occ);\n\t\t\t\t$odata[$k][] = $occ[0];\n\t\t\t\t$odata[$k][] = $occ[1];\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Exceptions?\n\t\t\t// -------------------------------------\n\n\t\t\t$exceptions\t= explode('|', rtrim($exceptions, '|'));\n\t\t\t$exdata\t\t= array();\n\n\t\t\tforeach ($exceptions as $k => $exc)\n\t\t\t{\n\t\t\t\t$exc = trim($exc);\n\n\t\t\t\tif ($exc == '') continue;\n\n\t\t\t\t$exdata[] = $exc;\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Rules?\n\t\t\t// -------------------------------------\n\n\t\t\t$add_rules \t= FALSE;\n\t\t\t$erules \t= array();\n\t\t\t$rules \t\t= explode('|', rtrim($rules, '|'));\n\n\t\t\tforeach ($rules as $rule)\n\t\t\t{\n\t\t\t\t$temp = explode($r, $rule);\n\t\t\t\t$rule = array();\n\n\t\t\t\tforeach ($temp as $k => $v)\n\t\t\t\t{\n\t\t\t\t\tif ($v != FALSE) $add_rules = TRUE;\n\t\t\t\t\t$rule[substr($rvars[$k], 5)] = $v;\n\t\t\t\t}\n\n\t\t\t\tif ($add_rules === TRUE)\n\t\t\t\t{\n\t\t\t\t\t$temp = array();\n\n\t\t\t\t\tif ($rule['repeat_years'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['FREQ'] = 'YEARLY';\n\n\t\t\t\t\t\tif ($rule['repeat_years'] > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['INTERVAL'] = $rule['repeat_years'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif ($rule['repeat_months'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['FREQ'] = 'MONTHLY';\n\n\t\t\t\t\t\tif ($rule['repeat_months'] > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['INTERVAL'] = $rule['repeat_months'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif ($rule['repeat_weeks'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['FREQ'] = 'WEEKLY';\n\n\t\t\t\t\t\tif ($rule['repeat_weeks'] > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['INTERVAL'] = $rule['repeat_weeks'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif ($rule['repeat_days'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['FREQ'] = 'DAILY';\n\n\t\t\t\t\t\tif ($rule['repeat_days'] > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['INTERVAL'] = $rule['repeat_days'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($rule['months_of_year'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//this flips keys to make 'c' => 12, etc\n\t\t\t\t\t\t$m = array_flip(array(\n\t\t\t\t\t\t\t1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C'\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\tif (strlen($rule['months_of_year'] > 1))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$months = str_split($rule['months_of_year']);\n\t\t\t\t\t\t\tforeach ($months as $month)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$temp['BYMONTH'][] = $m[$month] + 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['BYMONTH'] = $m[$month] + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($rule['days_of_month'] > '')\n\t\t\t\t\t{\n\t\t\t\t\t\t//this flips keys to make 'v' => 30, etc\n\t\t\t\t\t\t$d = array_flip(array(\n\t\t\t\t\t\t\t1, 2, 3, 4, 5, 6, 7, 8, 9,\n\t\t\t\t\t\t\t'A', 'B', 'C', 'D', 'E', 'F',\n\t\t\t\t\t\t\t'G', 'H', 'I', 'J', 'K', 'L',\n\t\t\t\t\t\t\t'M', 'N', 'O', 'P', 'Q', 'R',\n\t\t\t\t\t\t\t'S', 'T', 'U', 'V'\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\tif (strlen($rule['days_of_month']) > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$days = str_split($rule['days_of_month']);\n\t\t\t\t\t\t\tforeach ($days as $day)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$temp['BYMONTHDAY'][] = $d[$day] + 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['BYMONTHDAY'] = $d[$rule['days_of_month']] + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($rule['days_of_week'] != '' OR $rule['days_of_week'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$d \t\t\t= array('SU','MO','TU','WE','TH','FR','SA');\n\t\t\t\t\t\t$d_letter \t= array('U','M','T','W','R','F','S');\n\n\t\t\t\t\t\t$dows \t\t= str_split($rule['days_of_week']);\n\n\t\t\t\t\t\tif ($rule['relative_dow'] > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$rels = str_split($rule['relative_dow']);\n\t\t\t\t\t\t\tforeach ($dows as $dow)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($rels as $rel)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($rel == 6) $rel = -1;\n\t\t\t\t\t\t\t\t\t$temp['BYDAY'][] = $rel.$d[array_search($dow, $d_letter)];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($dows as $dow)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$temp['BYDAY'][] = $d[array_search($dow, $d_letter)];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($rule['stop_after'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['COUNT'] = $rule['stop_after'];\n\t\t\t\t\t}\n\t\t\t\t\telseif ($rule['stop_by'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t// TODO: Add time\n\t\t\t\t\t\t// TODO: The \"+1\" below is because the ical standard treats\n\t\t\t\t\t\t// \tUNTIL as \"less than\", not \"less than or equal to\" (which\n\t\t\t\t\t\t// \tis how Calendar treats stop_by). Double check that a simple\n\t\t\t\t\t\t// \t\"+1\" accurately addresses this difference.\n\t\t\t\t\t\t$temp['UNTIL'] = $rule['stop_by'] + 1;\n\t\t\t\t\t}\n\n\t\t\t\t\t$erules[] = $temp;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Put it together\n\t\t\t// -------------------------------------\n\n\t\t\t//if this is all day we need to add the dates as params to the dstart and end items\n\t\t\tif ($this->_is_all_day($start_hour, $start_minute, $end_hour, $end_minute))\n\t\t\t{\n\t\t\t\t$E->setProperty(\n\t\t\t\t\t\"dtstart\" ,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'year' \t=> $start_year,\n\t\t\t\t\t\t'month' => $start_month,\n\t\t\t\t\t\t'day'\t=> $start_day\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t//--------------------------------------------\n\t\t\t\t//\twe need CDT so we can add a day\n\t\t\t\t//\tgcal, and ical are ok with this being the same day\n\t\t\t\t//\tstupid damned outlook barfs, hence the +1\n\t\t\t\t//\tthe +1 doesnt affect g/ical\n\t\t\t\t//--------------------------------------------\n\n\t\t\t\tif ( ! isset($this->CDT) OR ! is_object($this->CDT) )\n\t\t\t\t{\n\t\t\t\t\t$this->load_calendar_datetime();\n\t\t\t\t}\n\n\t\t\t\t$this->CDT->change_date(\n\t\t\t\t\t$end_year,\n\t\t\t\t\t$end_month,\n\t\t\t\t\t$end_day\n\t\t\t\t);\n\n\t\t\t\t$this->CDT->add_day();\n\n\t\t\t\t$E->setProperty(\n\t\t\t\t\t\"dtend\" ,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'year' \t=> $this->CDT->year,\n\t\t\t\t\t\t'month' => $this->CDT->month,\n\t\t\t\t\t\t'day'\t=> $this->CDT->day\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$E->setProperty('dtstart', $start_year, $start_month, $start_day, $start_hour, $start_minute, 00);\n\t\t\t\t$E->setProperty('dtend', $end_year, $end_month, $end_day, $end_hour, $end_minute, 00);\n\t\t\t}\n\n\t\t\t$E->setProperty('summary', $title);\n\n\t\t\tif ( ! empty($erules))\n\t\t\t{\n\t\t\t\tforeach ($erules as $rule)\n\t\t\t\t{\n\t\t\t\t\t$E->setProperty('rrule', $rule);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$extras = array();\n\t\t\t$edits\t= array();\n\n\t\t\tif ( ! empty($odata))\n\t\t\t{\n\t\t\t\t$query = ee()->db->query(\n\t\t\t\t\t\"SELECT *\n\t\t\t\t\t FROM\texp_calendar_events_occurrences\n\t\t\t\t\t WHERE\tevent_id = \" . ee()->db->escape_str($id)\n\t\t\t\t);\n\n\t\t\t\tforeach ($query->result_array() as $row)\n\t\t\t\t{\n\t\t\t\t\t//fix blank times\n\t\t\t\t\t$row['start_time'] \t= ($row['start_time'] == 0) ? '0000' \t: $row['start_time'];\n\t\t\t\t\t$row['end_time'] \t= ($row['end_time'] == 0) ? '2400' \t\t: $row['end_time'];\n\n\t\t\t\t\t//looks like an edited occurrence\n\t\t\t\t\t//edits without rules arent really edits.\n\t\t\t\t\tif ($row['event_id'] != $row['entry_id'] AND empty($rules))\n\t\t\t\t\t{\n\t\t\t\t\t\t$edits[] = $row;\n\t\t\t\t\t}\n\t\t\t\t\t//probably entered with the date picker or something\n\t\t\t\t\t//these loose occurences\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$extras[] = $row;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! empty($exdata))\n\t\t\t{\n\t\t\t\t$E->setProperty('exdate', $exdata);\n\t\t\t}\n\n\t\t\tif ($description != '') $E->setProperty('description', $description);\n\t\t\tif ($location != '') $E->setProperty('location', $location);\n\n\n\t\t\t$E->setProperty( \"uid\", $this->make_uid() . '@' . $host);\n\t\t\t$ICAL->setComponent($E);\n\n\t\t\t//--------------------------------------------\n\t\t\t//\tremove rules for subsequent items\n\t\t\t//--------------------------------------------\n\n\t\t\twhile( $E->deleteProperty( \"RRULE\" )) continue;\n\n\t\t\t//edits must come right after\n\t\t\tif ( ! empty($edits))\n\t\t\t{\n\t\t\t\tforeach ($edits as $edit)\n\t\t\t\t{\n\t\t\t\t\t$edit_date = array(\n\t\t\t\t\t\t\"year\" \t=> $edit['start_year'],\n\t\t\t\t\t\t\"month\" => $edit['start_month'],\n\t\t\t\t\t\t\"day\" \t=> $edit['start_day'] ,\n\t\t\t\t\t\t\"hour\" \t=> substr($edit['start_time'], 0, 2) ,\n\t\t\t\t\t\t\"min\" \t=> substr($edit['start_time'], 2, 2)\n\t\t\t\t\t);\n\n\t\t\t\t\t//if this is all day we need to add the dates as params to the dstart and end items\n\t\t\t\t\tif ($this->_is_all_day(\n\t\t\t\t\t\tsubstr($edit['start_time'], 0, 2),\n\t\t\t\t\t\tsubstr($edit['start_time'], 2, 2),\n\t\t\t\t\t\tsubstr($edit['end_time'], 0, 2),\n\t\t\t\t\t\tsubstr($edit['end_time'], 2, 2)\n\t\t\t\t\t ))\n\t\t\t\t\t{\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t\"dtstart\" ,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'year' \t=> $edit['start_year'],\n\t\t\t\t\t\t\t\t'month' => $edit['start_month'],\n\t\t\t\t\t\t\t\t'day'\t=> $edit['start_day']\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t//\twe need CDT so we can add a day\n\t\t\t\t\t\t//\tgcal, and ical are ok with this being the same day\n\t\t\t\t\t\t//\tstupid damned outlook barfs, hence the +1\n\t\t\t\t\t\t//\tthe +1 doesnt affect g/ical\n\t\t\t\t\t\t//--------------------------------------------\n\n\t\t\t\t\t\tif ( ! isset($this->CDT) OR ! is_object($this->CDT) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->load_calendar_datetime();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->CDT->change_date(\n\t\t\t\t\t\t\t$edit['end_year'],\n\t\t\t\t\t\t\t$edit['end_month'],\n\t\t\t\t\t\t\t$edit['end_day']\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$this->CDT->add_day();\n\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t\"dtend\" ,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'year' \t=> $this->CDT->year,\n\t\t\t\t\t\t\t\t'month' => $this->CDT->month,\n\t\t\t\t\t\t\t\t'day'\t=> $this->CDT->day\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t'dtstart',\n\t\t\t\t\t\t\t$edit_date['year'],\n\t\t\t\t\t\t\t$edit_date['month'],\n\t\t\t\t\t\t\t$edit_date['day'],\n\t\t\t\t\t\t\t$edit_date['hour'],\n\t\t\t\t\t\t\t$edit_date['min'],\n\t\t\t\t\t\t\t00\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t'dtend',\n\t\t\t\t\t\t\t$edit['end_year'],\n\t\t\t\t\t\t\t$edit['end_month'],\n\t\t\t\t\t\t\t$edit['end_day'] ,\n\t\t\t\t\t\t\tsubstr($edit['end_time'], 0, 2),\n\t\t\t\t\t\t\tsubstr($edit['end_time'], 2, 2),\n\t\t\t\t\t\t\t00\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$E->setProperty( \"RECURRENCE-ID\", $edit_date);\n\t\t\t\t\t$E->setProperty( \"uid\", $this->make_uid() . '@' . $host);\n\n\t\t\t\t\t$ICAL->setComponent($E);\n\t\t\t\t}\n\n\t\t\t\t//cleanup\n\t\t\t\t$E->deleteProperty(\"RECURRENCE-ID\");\n\n\t\t\t\t$E->setProperty('dtstart', $start_year, $start_month, $start_day, $start_hour, $start_minute, 00);\n\t\t\t\t$E->setProperty('dtend', $end_year, $end_month, $end_day, $end_hour, $end_minute, 00);\n\t\t\t}\n\n\t\t\t// these random ass add-in dates are non-standard to most cal creation\n\t\t\t// and need to be treated seperately as lumping don't work, dog\n\t\t\tif ( ! empty($extras))\n\t\t\t{\n\t\t\t\tforeach ($extras as $extra)\n\t\t\t\t{\n\n\t\t\t\t\t//if this is all day we need to add the dates as params to the dstart and end items\n\t\t\t\t\tif ($this->_is_all_day(\n\t\t\t\t\t\tsubstr($extra['start_time'], 0, 2),\n\t\t\t\t\t\tsubstr($extra['start_time'], 2, 2),\n\t\t\t\t\t\tsubstr($extra['end_time'], 0, 2),\n\t\t\t\t\t\tsubstr($extra['end_time'], 2, 2)\n\t\t\t\t\t ))\n\t\t\t\t\t{\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t\"dtstart\" ,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'year' \t=> $extra['start_year'],\n\t\t\t\t\t\t\t\t'month' => $extra['start_month'],\n\t\t\t\t\t\t\t\t'day'\t=> $extra['start_day']\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t//\twe need CDT so we can add a day\n\t\t\t\t\t\t//\tgcal, and ical are ok with this being the same day\n\t\t\t\t\t\t//\tstupid damned outlook barfs, hence the +1\n\t\t\t\t\t\t//\tthe +1 doesnt affect g/ical\n\t\t\t\t\t\t//--------------------------------------------\n\n\t\t\t\t\t\tif ( ! isset($this->CDT) OR ! is_object($this->CDT) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->load_calendar_datetime();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->CDT->change_date(\n\t\t\t\t\t\t\t$extra['end_year'],\n\t\t\t\t\t\t\t$extra['end_month'],\n\t\t\t\t\t\t\t$extra['end_day']\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$this->CDT->add_day();\n\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t\"dtend\" ,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'year' \t=> $this->CDT->year,\n\t\t\t\t\t\t\t\t'month' => $this->CDT->month,\n\t\t\t\t\t\t\t\t'day'\t=> $this->CDT->day\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t'dtstart',\n\t\t\t\t\t\t\t$extra['start_year'],\n\t\t\t\t\t\t\t$extra['start_month'],\n\t\t\t\t\t\t\t$extra['start_day'] ,\n\t\t\t\t\t\t\tsubstr($extra['start_time'], 0, 2),\n\t\t\t\t\t\t\tsubstr($extra['start_time'], 2, 2),\n\t\t\t\t\t\t\t00\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t'dtend',\n\t\t\t\t\t\t\t$extra['end_year'],\n\t\t\t\t\t\t\t$extra['end_month'],\n\t\t\t\t\t\t\t$extra['end_day'] ,\n\t\t\t\t\t\t\tsubstr($extra['end_time'], 0, 2),\n\t\t\t\t\t\t\tsubstr($extra['end_time'], 2, 2),\n\t\t\t\t\t\t\t00\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$E->setProperty( \"uid\", $this->make_uid() . '@' . $host);\n\t\t\t\t\t$ICAL->setComponent($E);\n\t\t\t\t}\n\n\t\t\t\t//clean in case we need to add more later\n\t\t\t\t$E->setProperty('dtstart', $start_year, $start_month, $start_day, $start_hour, $start_minute, 00);\n\t\t\t\t$E->setProperty('dtend', $end_year, $end_month, $end_day, $end_hour, $end_minute, 00);\n\t\t\t}\n\t\t}\n\t\t//return $ICAL->createCalendar();\n\t\treturn $ICAL->returnCalendar();\n\t}",
"public function createCalendar(BaseCalendar $calendar): Component\n {\n $components = $this->createCalendarComponents($calendar);\n $properties = iterator_to_array($this->getProperties($calendar), false);\n\n return new Component('VCALENDAR', $properties, $components);\n }",
"public function createClient()\n {\n $scopes = implode(' ', [\\Google_Service_Calendar::CALENDAR]);\n\n $client = new \\Google_Client();\n $client->setApplicationName('P4 LMS');\n $client->setScopes($scopes);\n $client->setClientId(env('GOOGLE_API_ID'));\n $client->setClientSecret(env('GOOGLE_API_SECRET'));\n $client->setAccessType('offline');\n\n return $client;\n }",
"public function getCalendarNode(string $nodename)\n {\n $bag = $this->getOrCreateCalendarBag();\n\n return $bag->getCalendarNode($nodename);\n }",
"public function getEventObject(){\n $eventTimeID = $this->getID();\n\n $prepared = self::adhocQuery(function( \\PDO $connection ) use ($eventTimeID){\n $statement = $connection->prepare(\"\n SELECT sev.id FROM SchedulizerEvent sev\n JOIN SchedulizerEventTime sevTime ON sevTime.eventID = sev.id\n WHERE sevTime.id = :eventTimeID\n \");\n $statement->bindValue(\":eventTimeID\", $eventTimeID);\n return $statement;\n });\n\n return Event::getByID($prepared->fetch(\\PDO::FETCH_COLUMN));\n }",
"function get_event(){\n\t\tglobal $EM_Event;\n\t\tif( is_object($EM_Event) && $EM_Event->event_id == $this->event_id ){\n\t\t\treturn $EM_Event;\n\t\t}else{\n\t\t\tif( is_numeric($this->event_id) && $this->event_id > 0 ){\n\t\t\t\treturn em_get_event($this->event_id, 'event_id');\n\t\t\t}elseif( is_array($this->bookings) ){\n\t\t\t\tforeach($this->bookings as $EM_Booking){\n\t\t\t\t\t/* @var $EM_Booking EM_Booking */\n\t\t\t\t\treturn em_get_event($EM_Booking->event_id, 'event_id');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn em_get_event($this->event_id, 'event_id');\n\t}",
"public function cal()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Start up\n\t\t// -------------------------------------\n\n\t\t$this->get_first_day_of_week();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$disable = array(\n\t\t\t'categories',\n\t\t\t'category_fields',\n\t\t\t'custom_fields',\n\t\t\t'member_data',\n\t\t\t'pagination',\n\t\t\t'trackbacks'\n\t\t);\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name' => 'category',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'site_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'status',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => 'open'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_end',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date',\n\t\t\t\t//'default' => 'today'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'show_days',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'default' => 1\n\t\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'show_weeks',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'show_months',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'show_years',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'time_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'time',\n\t\t\t\t'default' => '0000'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'time_range_end',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'time',\n\t\t\t\t'default' => '2359'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'day_limit',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'default' => '10'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_limit',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'default' => '0'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'first_day_of_week',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'default' => $this->first_day_of_week\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'pad_short_weeks',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'bool',\n\t\t\t\t'default' => 'yes',\n\t\t\t\t'allowed_values' => array('yes', 'no')\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'enable',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'default' => '',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'allowed_values' => $disable\n\t\t\t)\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Do some voodoo on P\n\t\t// -------------------------------------\n\n\t\t$this->process_events_params();\n\n\t\t// -------------------------------------\n\t\t// Let's go build us a gosh darn calendar!\n\t\t// -------------------------------------\n\n\t\t$this->parent_method = __FUNCTION__;\n\n\t\treturn $this->build_calendar();\n\t}",
"public function getEvent()\n {\n if (!isset($this->event)) {\n $this->setEvent(new MvcEvent());\n $this->event->setRouteMatch(new RouteMatch($this->routeParams));\n }\n\n return $this->event;\n }",
"public function getMesCalendario(){\n return $this->mesCalendario;\n }",
"public function get_calendar() {\n $start = date('Y-m-d H:i:s', strtotime($this->input->post('start_date')));\n $end = date('Y-m-d H:i:s', strtotime($this->input->post('end_date')));\n $filter = $this->input->post('filter');\n if ($start && $end) {\n if (isset($filter) && !empty($filter) && !in_array($filter, config_item('event_types'))) {\n return $this->send_error('INVALID_FILTER');\n }\n $this->load->model('events_model');\n $where = array('start_date >=' => $start, 'end_date <=' => $end);\n if (isset($filter) && !empty($filter)) {\n $where['type'] = $filter;\n }\n if ($events = $this->events_model->get_all($where)) {\n setlocale(LC_TIME, 'nl_NL.UTF-8');\n foreach ($events as &$event) {\n $event['readable_start_date'] = strftime('%A %d %B %G', strtotime($event['start_date']));\n $event['readable_end_date'] = strftime('%A %d %B %G', strtotime($event['end_date']));\n }\n $this->event_log();\n return $this->send_response($events);\n }\n return $this->send_error('NO_RESULTS');\n } else {\n return $this->send_error('ERROR');\n }\n }",
"public function listCalendars()\n {\n Kronolith::initialize();\n $all_external_calendars = $GLOBALS['calendar_manager']->get(Kronolith::ALL_EXTERNAL_CALENDARS);\n $result = new stdClass;\n $auth_name = $GLOBALS['registry']->getAuth();\n\n // Calendars. Do some twisting to sort own calendar before shared\n // calendars.\n foreach (array(true, false) as $my) {\n foreach ($GLOBALS['calendar_manager']->get(Kronolith::ALL_CALENDARS) as $id => $calendar) {\n $owner = ($auth_name && ($calendar->owner() == $auth_name));\n if (($my && $owner) || (!$my && !$owner)) {\n $result->calendars['internal'][$id] = $calendar->toHash();\n }\n }\n\n // Tasklists\n if (Kronolith::hasApiPermission('tasks')) {\n foreach ($GLOBALS['registry']->tasks->listTasklists($my, Horde_Perms::SHOW, false) as $id => $tasklist) {\n if (isset($all_external_calendars['tasks/' . $id])) {\n $owner = ($auth_name &&\n ($tasklist->get('owner') == $auth_name));\n if (($my && $owner) || (!$my && !$owner)) {\n $result->calendars['tasklists']['tasks/' . $id] =\n $all_external_calendars['tasks/' . $id]->toHash();\n }\n }\n }\n }\n }\n\n // Resources\n if (!empty($GLOBALS['conf']['resource']['driver'])) {\n foreach (Kronolith::getDriver('Resource')->listResources() as $resource) {\n if ($resource->get('type') != Kronolith_Resource::TYPE_GROUP) {\n $rcal = new Kronolith_Calendar_Resource(array(\n 'resource' => $resource\n ));\n $result->calendars['resource'][$resource->get('calendar')] = $rcal->toHash();\n } else {\n $rcal = new Kronolith_Calendar_ResourceGroup(array(\n 'resource' => $resource\n ));\n $result->calendars['resourcegroup'][$resource->getId()] = $rcal->toHash();\n }\n }\n }\n\n // Timeobjects\n foreach ($all_external_calendars as $id => $calendar) {\n if ($calendar->api() != 'tasks' && $calendar->display()) {\n $result->calendars['external'][$id] = $calendar->toHash();\n }\n }\n\n // Remote calendars\n foreach ($GLOBALS['calendar_manager']->get(Kronolith::ALL_REMOTE_CALENDARS) as $url => $calendar) {\n $result->calendars['remote'][$url] = $calendar->toHash();\n }\n\n // Holidays\n foreach ($GLOBALS['calendar_manager']->get(Kronolith::ALL_HOLIDAYS) as $id => $calendar) {\n $result->calendars['holiday'][$id] = $calendar->toHash();\n }\n\n return $result;\n }",
"function addCalendar($calendar) {\n return $this->databaseInsertRecord(\n $this->tableCalendars,\n 'calendar_id',\n $calendar\n );\n }",
"public function calendar(){\n\n /**\n * Hago una consulta a la tabla eventos para que me traiga los eventos\n * que esten activos y le pido que me lo convierta a array\n */\n $events = Event::query()->where('state','Activo')->get()->toArray();\n\n /**\n * Creo un array vacio\n */\n $eventos = array();\n\n /**\n * Recorro cada uno de los elementos de la consulta que hice antes con un foreach\n * y los guardo en un array, en la posicion title guardo el titulo y la descripcion\n * y la fecha la guardo en la posicion start, ya que asi me la pide el fullcalendar\n */\n foreach($events as $event){\n $evento = [\n 'title' => $event['title'].\" | \".$event['description'],\n 'start' => $event['date'],\n ];\n /**\n * Guardo el array anterior en el array vacio que cree antes\n */\n array_push($eventos,$evento);\n }\n return view('calendar' , compact('eventos'));\n }",
"public static function ObtenerCalendario()\n {\n // Consulta de la meta\n $consulta = \"SELECT * FROM calendario\";\n\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n // Capturar primera fila del resultado\n //$row = $comando->fetch(PDO::FETCH_ASSOC);\n //return $row;\n\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n // Aquí puedes clasificar el error dependiendo de la excepción\n // para presentarlo en la respuesta Json\n return -1;\n }\n }",
"public function calendarioacedemico()\n {\n return $this->hasMany(CalendarioAcad::class, 'iCalAcadId');\n }",
"public function getEvent()\n {\n return $this->hasOne(Event::class, ['id' => 'event_id']);\n }",
"function __construct() {\n $this->client = new \\Google_Client();\n $this->client->setApplicationName(\"AIQ-CRM\");\n $this->client->setClientId(Config::get('google.calendar.client_id'));\n $this->client->setClientSecret(Config::get('google.calendar.client_secret'));\n $this->client->setRedirectUri(Config::get('google.calendar.redirect_uri'));\n $this->client->setAccessType('offline');\n $this->client->addScope(\"https://www.googleapis.com/auth/calendar\");\n //\n //\n $this->service = new \\Google_Service_Calendar($this->client);\n }",
"public function show(InternCalendar $internCalendar ,$id)\n {\n $calendar = InternCalendar::find($id);\n return $calendar ;\n }",
"public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }",
"public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }",
"public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }",
"public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }",
"public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }",
"public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }",
"public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }",
"public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }",
"public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }",
"public function setCalendar(CultureFeed_Cdb_Data_Calendar $calendar) {\n $this->calendar = $calendar;\n }"
] | [
"0.7920089",
"0.7573589",
"0.73638797",
"0.72971344",
"0.7145896",
"0.7012212",
"0.6862772",
"0.6771605",
"0.6688989",
"0.64592737",
"0.64512366",
"0.64512366",
"0.6415997",
"0.64020973",
"0.6395439",
"0.63549966",
"0.6231698",
"0.6060423",
"0.59474295",
"0.5864934",
"0.58567375",
"0.58348215",
"0.583184",
"0.5818935",
"0.58146787",
"0.57426673",
"0.5706372",
"0.5691334",
"0.56823736",
"0.56365085",
"0.56348205",
"0.56043464",
"0.56022346",
"0.56015503",
"0.55893826",
"0.5586007",
"0.5579772",
"0.5542012",
"0.5490432",
"0.5472506",
"0.5466528",
"0.5458818",
"0.5430044",
"0.54077846",
"0.5379824",
"0.53606665",
"0.53531694",
"0.5331099",
"0.52975845",
"0.52815014",
"0.5217712",
"0.5195203",
"0.5186464",
"0.51841134",
"0.5148782",
"0.5148782",
"0.5148782",
"0.5137866",
"0.5132297",
"0.5114835",
"0.5093528",
"0.50832057",
"0.5063034",
"0.50618607",
"0.5061105",
"0.5056139",
"0.5040082",
"0.5034195",
"0.5033879",
"0.50330776",
"0.5031796",
"0.50254786",
"0.5024706",
"0.5018856",
"0.5017388",
"0.5012955",
"0.50093925",
"0.50088847",
"0.5008333",
"0.50029707",
"0.49897933",
"0.49833578",
"0.49702746",
"0.49618798",
"0.49488905",
"0.4940268",
"0.49365032",
"0.49320388",
"0.49278837",
"0.49150974",
"0.4896923",
"0.4896923",
"0.4896038",
"0.48938727",
"0.4893506",
"0.4893506",
"0.4893506",
"0.4893506",
"0.48932967",
"0.48867145"
] | 0.80141985 | 0 |
Get the location from this event. | public function getLocation() {
return $this->location;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getEventLocation() {\n\t\treturn ($this->eventLocation);\n\t}",
"public function getLocation() {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}",
"public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}",
"public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}",
"public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}",
"public function getLocation()\r\n {\r\n return $this->location;\r\n }",
"public function getLocation() {\n\t\treturn($this->location);\n\t}",
"public function getLocation()\n {\n return isset($this->location) ? $this->location : null;\n }",
"public function getLocation() {\r\n return $this->location;\r\n }",
"public function getLocation()\n\t{\n\t\treturn $this->_location;\n\t}",
"public function get_location()\n\t{\n\t\treturn $this->location;\n\t}",
"public function getLocation() { return $this->location; }",
"public function getLocation()\n {\n return $this->get('location');\n }",
"public function getLocation()\n {\n return $this->getLocationData();\n }",
"public function location()\n {\n return $this->resolvedLocation ?: $this->location;\n }",
"public function getLocation()\n\t{\n\t\treturn null;\n\t}",
"public function getLocation() : ?string\n {\n return $this->location;\n }",
"public function getLocation();",
"public function getLocation();",
"function getLocation(){ return $this->_Location;}",
"public function getOriginLocation()\n {\n return $this->originLocation;\n }",
"public function getOriginLocation()\n {\n return $this->originLocation;\n }",
"public function getLocation()\n {\n return $this->getParameter('location');\n }",
"public function getLocation()\n {\n return $this->banner_location_id;\n }",
"function get_location() {\n\n\t\tif ( ! isset( $this->location ) ) {\n\t\t\t$this->location = new Workflow_Location( $this );\n\t\t\t$this->location = apply_filters( 'automatewoo/workflow/location', $this->location, $this );\n\t\t}\n\n\t\treturn $this->location;\n\t}",
"public function getSourceLocation()\n {\n return $this->source_location;\n }",
"public function currentLocation() {\n return $this->currentLocation;\n }",
"public function getOfficeLocation()\n {\n return $this->getProperty(\"OfficeLocation\");\n }",
"private function getLocation()\n {\n $this->location = null;\n \n if ($this->fingerprint !== null && $this->end_point !== null) {\n $this->location = $this->end_point.$this->fingerprint;\n } else {\n $info = $this->getPost();\n \n if (isset($info['Location']) === true) {\n $this->fingerprint = str_replace($this->end_point, '', $info['Location']);\n $this->location = $info['Location'];\n }\n }\n \n return $this->location;\n }",
"public function getLocation()\n {\n return $this->index;\n }",
"public function getLocationHeader()\n {\n return $this->getHeader(self::HEADER_LOCATION);\n }",
"public function getOriginLocation()\r\n {\r\n $first_location = $this->getRoutes()->getOriginLocation();\r\n\r\n return $first_location;\r\n }",
"public function getLocation()\n {\n return $this->apiLocation === 'Yahoo' ? $this->getLocationYahoo() : $this->getLocationGoogle();\n }",
"private function getLocation() {\n }",
"public function getArrivalLocation()\n {\n return $this->arrivalLocation;\n }",
"public function getStartLocation()\n {\n return $this->start_location;\n }",
"public function publicLocation()\n {\n return $this->state(function (array $attributes) {\n return [\n 'location' => 1,\n ];\n });\n }",
"public function weatherLocation() {\n\t\treturn $this->get('PLZ');\n\t}",
"public function getCoordinate()\n {\n return $this->coordinate;\n }",
"public function getCoordinate() {\n return $this->coordinate;\n }",
"public function getDeliveryLocation()\n {\n return $this->deliveryLocation;\n }",
"public function getGeolocation()\n {\n return $this->geolocation;\n }",
"public function getCoordinate() {\n\n return $this->coordinate;\n }",
"public function getLocationName()\n {\n return $this->locationName;\n }",
"public function getLocationId()\n {\n return $this->locationId;\n }",
"public function getLocationId()\n {\n return $this->locationId;\n }",
"public function location()\n {\n //\n return view('event.location');\n }",
"public function getUserLocation();",
"public function getLocationId()\n {\n return $this->location_id;\n }",
"public function getLocationId()\n {\n return $this->location_id;\n }",
"public function getLocation() {\n\t\tif(isset($this->data['mdid'])) {\n\t\t\treturn $this->data['md_folder'] . $this->data['md_filename'];\n\t\t}\n\t\treturn ;\n\t}",
"public function getLocationY()\n {\n return $this->locationY;\n }",
"function getPosition()\n\t{\n\t\treturn $this->Info['Position'];\n\t}",
"public function getLocationX()\n {\n return $this->locationX;\n }",
"public function getEventAddress() \n {\n return $this->_fields['EventAddress']['FieldValue'];\n }",
"function getLocationConfig()\n {\n return $this->_setup['locationconfig'];\n }",
"public function getLocationid()\n {\n return $this->locationId;\n }",
"public function getDestinationLocation()\n {\n return $this->destinationLocation;\n }",
"public function getLocation()\n {\n if (array_key_exists('location', $this->userInfo)) {\n return $this->userInfo['location'];\n }\n\n elseif (isset($this->response['placesLived']) && is_array($this->response['placesLived']))\n {\n foreach ($this->response['placesLived'] as $location)\n {\n if (isset($location['primary']) && $location['primary'] == 1)\n {\n if (isset($location['value']))\n {\n $loc = preg_replace('/[\\x03-\\x20]{2,}/sxSX', ' ', $location['value']);\n $glue = ',';\n\n if (strpos($location, $glue) === false) {\n $glue = ' ';\n }\n $loc = explode($glue, $loc);\n\n if(count($loc) <= 3) {\n $this->userInfo['city'] = trim($loc[0]);\n $this->userInfo['country'] = isset($loc[1]) ? isset($loc[2]) ? trim($loc[2]) : trim($loc[1]) : null;\n }\n else{\n $this->userInfo['city'] = null;\n $this->userInfo['country'] = null;\n }\n\n return $this->userInfo['location'] = $location['value'];\n }\n break;\n }\n }\n }\n\n $this->userInfo['city'] = null;\n $this->userInfo['country'] = null;\n\n return $this->userInfo['location'] = null;\n }",
"public function getLocationbase()\n {\n return $this->locationbase;\n }",
"public function location(): array\n {\n return $this->location;\n }",
"public function getCoord(){\n return $this->coord;\n }",
"public function place()\n {\n return $this->place;\n }",
"public function preferredLocation() {\n return $this->preferredLocation;\n }",
"public function getPosition()\n {\n return $this->get(self::POSITION);\n }",
"public function getServiceLocation()\n {\n if (array_key_exists(\"serviceLocation\", $this->_propDict)) {\n if (is_a($this->_propDict[\"serviceLocation\"], \"\\Beta\\Microsoft\\Graph\\Model\\Location\") || is_null($this->_propDict[\"serviceLocation\"])) {\n return $this->_propDict[\"serviceLocation\"];\n } else {\n $this->_propDict[\"serviceLocation\"] = new Location($this->_propDict[\"serviceLocation\"]);\n return $this->_propDict[\"serviceLocation\"];\n }\n }\n return null;\n }",
"public function getlongitude()\r\n {\r\n return $this->_longitude;\r\n }",
"public function getTargetingLocation()\n {\n return isset($this->targeting_location) ? $this->targeting_location : false;\n }",
"function getLocation();",
"public function get_location()\r\n\t\t{\r\n\t\t\t$retArr = $this->obj->getBasics();\r\n\r\n\t\t\treturn $retArr;\r\n\t\t}",
"public function getPosition()\n {\n return $this->getData(self::POSITION);\n }",
"public function getFileLocation()\n {\n return $this->fileLocation;\n }",
"public function getPosition() {\n return $this->getValue('position');\n }",
"public function getLongitude()\n {\n return $this->get('Longitude');\n }",
"public function getLongitude()\n {\n return $this->longitude;\n }",
"public function getPlacePosition()\n {\n return substr($this->place, 0, 1);\n }",
"public function getFinLocation()\n {\n return $this->finLocation;\n }",
"public function getLng();",
"public function getCustomerLocation()\n {\n if (array_key_exists(\"customerLocation\", $this->_propDict)) {\n if (is_a($this->_propDict[\"customerLocation\"], \"\\Beta\\Microsoft\\Graph\\Model\\Location\") || is_null($this->_propDict[\"customerLocation\"])) {\n return $this->_propDict[\"customerLocation\"];\n } else {\n $this->_propDict[\"customerLocation\"] = new Location($this->_propDict[\"customerLocation\"]);\n return $this->_propDict[\"customerLocation\"];\n }\n }\n return null;\n }",
"public function getLng()\n {\n return $this->lng;\n }",
"public function getOrigin()\n {\n if (array_key_exists(\"origin\", $this->_propDict)) {\n return $this->_propDict[\"origin\"];\n } else {\n return null;\n }\n }",
"public function getLongitude()\n {\n return $this->longitude;\n }",
"public function getLongitude()\n {\n return $this->longitude;\n }",
"public function getLongitude()\n {\n return $this->longitude;\n }",
"public function getLongitude()\n {\n return $this->longitude;\n }",
"public function getLongitude()\n {\n return $this->longitude;\n }"
] | [
"0.8567676",
"0.8015834",
"0.80007327",
"0.80007327",
"0.80007327",
"0.80007327",
"0.80007327",
"0.80007327",
"0.80007327",
"0.80007327",
"0.80007327",
"0.80007327",
"0.80007327",
"0.80007327",
"0.80007327",
"0.79756325",
"0.79756325",
"0.79756325",
"0.79756325",
"0.79661524",
"0.79636794",
"0.7959821",
"0.7943443",
"0.7926629",
"0.79241556",
"0.7842642",
"0.783954",
"0.7715899",
"0.7678855",
"0.72036344",
"0.7143248",
"0.7032448",
"0.7032448",
"0.69870716",
"0.6916373",
"0.6916373",
"0.69112885",
"0.6898097",
"0.68815684",
"0.6866182",
"0.68641895",
"0.6828951",
"0.6795077",
"0.6761861",
"0.66841936",
"0.6616444",
"0.6556504",
"0.65464115",
"0.6543755",
"0.6540548",
"0.6535947",
"0.6496981",
"0.64704686",
"0.6467204",
"0.64660865",
"0.6465323",
"0.6409315",
"0.6389884",
"0.6364821",
"0.6364821",
"0.6360234",
"0.63479924",
"0.6347537",
"0.6347537",
"0.6342823",
"0.631582",
"0.62932765",
"0.62775815",
"0.6259998",
"0.62398756",
"0.6221748",
"0.61763585",
"0.6155331",
"0.61278677",
"0.6101088",
"0.60857034",
"0.6069889",
"0.6069621",
"0.60689014",
"0.6053183",
"0.6052127",
"0.60359627",
"0.6030523",
"0.60235983",
"0.5969455",
"0.5961673",
"0.59609866",
"0.59601",
"0.59504825",
"0.5949206",
"0.5945497",
"0.59330237",
"0.5916319",
"0.5895097",
"0.5885322",
"0.58840674",
"0.58840674",
"0.58840674",
"0.58840674",
"0.58840674"
] | 0.78771144 | 25 |
Get the organiser from this event. | public function getOrganiser() {
return $this->organiser;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getOrganisation()\n {\n return $this->organisation;\n }",
"public function organizer()\n {\n return $this->belongsTo(User::class, 'organizer_id');\n }",
"public function getOrganisation()\n\t{\n\t\treturn $this->_organisation;\n\t}",
"public function getOrganization()\n {\n return $this->organization;\n }",
"public function getOrganization()\n {\n return $this->organization;\n }",
"public function getOrganization()\n {\n return $this->organization;\n }",
"public function getOrganismeAssedic() {\n return $this->organismeAssedic;\n }",
"function organiser($key = null)\n {\n if(!current_route_is('organiser.*'))\n return null;\n\n $organiser = request()->route('organiser');\n\n if ($key)\n return $organiser->$key;\n\n return $organiser;\n }",
"public function isOrganizer() {\n\t\treturn $this->organizer;\n\t}",
"public function getOrganization()\n {\n if (array_key_exists(\"organization\", $this->_propDict)) {\n return $this->_propDict[\"organization\"];\n } else {\n return null;\n }\n }",
"public function getEventPublisher()\n {\n return $this->eventPublisher;\n }",
"public function getOrganisateurSpectacle() {\n return $this->organisateurSpectacle;\n }",
"public function organization()\n {\n return Organization::i();\n }",
"public function getOrganizationUser()\n {\n return $this->organizationUser;\n }",
"public function getOrganism() {\n\t\treturn (string)$this->gpml[\"Organism\"];\n\t}",
"public function getPublisher() {\n return $this->publisher;\n }",
"public function getEnterer()\n {\n return $this->enterer;\n }",
"function getOrganisers(&$organisers, $event)\n{\n\tif( $event->has( \"event:agent\" ) )\n\t{\n\t\tforeach( $event->all( \"event:agent\" ) as $agent )\n\t\t{\n\t\t\tif(!$agent->isType(\"http://www.w3.org/ns/org#Organization\"))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$organisers[sid((string)$agent)] = $agent->label();\n\t\t\twhile($agent->has(\"-http://www.w3.org/ns/org#hasSubOrganization\"))\n\t\t\t{\n\t\t\t\t$agent = $agent->get(\"-http://www.w3.org/ns/org#hasSubOrganization\");\n\t\t\t\t$organisers[sid((string)$agent)] = $agent->label();\n\t\t\t}\n\t\t}\n\t}\n}",
"public function getCodeOrganisme(): ?string {\n return $this->codeOrganisme;\n }",
"public function getOrgName()\n {\n return $this->orgName;\n }",
"public function get_organizer_by_id( $organizer_id ) {\r\n\t\t$existing_organizer = get_posts( array(\r\n\t\t\t'posts_per_page' => 1,\r\n\t\t\t'post_type' => $this->oraganizer_posttype,\r\n\t\t\t'meta_key' => 'ime_event_organizer_id',\r\n\t\t\t'meta_value' => $organizer_id,\r\n\t\t\t'suppress_filters' => false,\r\n\t\t) );\r\n\r\n\t\tif ( is_array( $existing_organizer ) && ! empty( $existing_organizer ) ) {\r\n\t\t\treturn $existing_organizer[0]->ID;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function getOrgId()\n {\n return $this->org_id;\n }",
"public function getCurrentOrganization()\n {\n return $this->userLoader->getOrganization($this->getCurrentOrganizationId());\n }",
"public function getOwner()\n {\n if(!($domainId = $this->getData('domainId'))) {\n return null;\n }\n \n return Core_Model_DiFactory::getClientManager()->getClientByDomain($domainId);\n }",
"public function getPublisher()\n {\n if (array_key_exists(\"publisher\", $this->_propDict)) {\n return $this->_propDict[\"publisher\"];\n } else {\n return null;\n }\n }",
"public function getEmployer()\n {\n return $this->employer;\n }",
"public function getOwner()\n {\n return isset($this->owner) ? $this->owner : null;\n }",
"public function getOrganizationId()\n {\n return $this->organization_id;\n }",
"public function getOrganizationId()\n {\n return $this->organizationId;\n }",
"function getOwner() \n {\n return $this->instance->getOwner();\n }",
"public function organizers()\n {\n return $this->belongsToMany('DavideCasiraghi\\LaravelEventsCalendar\\Models\\Organizer', 'event_has_organizers', 'event_id', 'organizer_id');\n }",
"public function getOwner()\n {\n return $this->owner;\n }",
"public function getOwner()\n {\n return $this->owner;\n }",
"public function getOwner()\n {\n return $this->owner;\n }",
"public function getOrganization()\n {\n $node = $this->response->getFirst('contact:org', $this->node);\n if ($node === null) {\n return null;\n }\n\n return $node->nodeValue;\n }",
"public function getOrgId() {\n\treturn ($this->orgId);\n}",
"public function getOwner()\n {\n return $this->get(self::_OWNER);\n }",
"public function getRegistrant()\n {\n return $this->registrant;\n }",
"public function getOrganismeRetraite() {\n return $this->organismeRetraite;\n }",
"public function getOwner() {\n\t\treturn $this->owner;\n\t}",
"public function getOwner()\n {\n return $this->data['owner'];\n }",
"public function getAgency()\n {\n return isset($this->agency) ? $this->agency : null;\n }",
"public function getOrgId() {\n\t\treturn ($this->orgId);\n\t}",
"public function getOwner() {\r\n return $this->owner;\r\n }",
"public function getOrganizationEmail(): string {\n\t\treturn $this->organizationEmail;\n\t}",
"public function getOwner()\n {\n return $this->_owner;\n }",
"public function getOrganizationalUnit()\n {\n return $this->organizational_unit;\n }",
"public function getCalendar() {\n return $this->calendar;\n }",
"public function getLoggedEnterprise()\n {\n return $this->defaultEnterprise;\n }",
"public function getEnterprise()\n {\n return $this->getValue('nb_icontact_prospect_enterprise');\n }",
"public function getOrganiserData() {\n\n $domain = parse_url(Director::absoluteBaseURL(), PHP_URL_HOST);\n\n $data = array(\n \"Name\" => \"SilverStripe Event Management Module\",\n \"Email\" => \"postmaster@\" . $domain,\n \"Domain\" => $domain\n );\n\n $sitename = SiteConfig::current_site_config()->Title;\n if(!empty($sitename)) {\n $data['Name'] = trim($sitename);\n }\n\n $adminEmail = Config::inst()->get('Email', 'admin_email');\n if(!empty($adminEmail)) {\n $data['Email'] = trim($adminEmail);\n }\n\n return new ArrayData($data);\n\n }",
"public function getOwner()\n {\n if (array_key_exists(\"owner\", $this->_propDict)) {\n return $this->_propDict[\"owner\"];\n } else {\n return null;\n }\n }",
"protected function getEvent()\n {\n if (null === $this->event) {\n $this->event = $event = new EntityEvent;\n\n $event->setTarget($this);\n }\n\n return $this->event;\n }",
"public function getEventManager()\n {\n return $this->events;\n }",
"public function getOwner()\n\t{\n\t\treturn $this->getObject('owner', null, 'user');\n\t}",
"public function getOwner() {\n\t\telgg_deprecated_notice(\"ElggExtender::getOwner deprecated for ElggExtender::getOwnerGUID\", 1.8);\n\t\treturn $this->getOwnerGUID();\n\t}",
"public function getAutor()\n {\n return $this->autor;\n }",
"public function getAutor()\n {\n return $this->autor;\n }",
"public function getAutor()\n {\n return $this->autor;\n }",
"public function organization()\n {\n return $this->belongsTo('F3\\Models\\Organization', 'party_id', 'party_id');\n }",
"public function getProposerEndowment()\n {\n return $this->getAttribute(self::$PROPOSER_ENDOWMENT_KEY);\n }",
"public function getEndorserParty()\n {\n return $this->endorserParty;\n }",
"public function team()\n {\n return $this->user();\n }",
"public function getCalendar()\r\n {\r\n if (!$this->_calendar && $this->getCalendarId()) {\r\n $this->_calendar = Mage::getModel('google/calendar')->load($this->getCalendarId());\r\n }\r\n\r\n return $this->_calendar;\r\n }",
"public function getEvent()\n {\n return $this->event;\n }",
"public function getEvent()\n {\n return $this->event;\n }",
"public function getEvent()\n {\n return $this->event;\n }",
"public function getMentoringOrganisationDetails()\n {\n return $this->hasOne(MentoringOrganisation::class, 'user_id', 'id');\n }",
"public function getAttendee()\n {\n return $this->attendee;\n }",
"public function getAttendee()\n {\n return $this->attendee;\n }",
"public function getEvent()\n {\n return isset($this->event) ? $this->event : null;\n }",
"function getOwnerIdentifier()\n {\n return $this->ownerIdentifier;\n }",
"public function getEncounter()\n {\n return $this->encounter;\n }",
"public function getInvitor()\n {\n return $this->invitor;\n }",
"function getOwner() {\n \n return $this->principalInfo['uri'];\n \n }",
"public function getCreator()\n {\n return $this->creator;\n }",
"public function getCreator()\n {\n return $this->creator;\n }",
"public function getCreator()\n {\n return $this->creator;\n }",
"public function getCreator()\n {\n return $this->creator;\n }",
"public function getCreator()\n {\n return $this->creator;\n }",
"public function getCreator()\n {\n return $this->creator;\n }",
"public function getCreator()\n {\n return $this->creator;\n }",
"public function getCreator()\n {\n return $this->creator;\n }",
"public function getEvent() {\n return $this->event;\n }",
"public function transporter() {\n if(is_null($this->transporter)){\n $this->transporter = Transporter::getByIdentifier($this->transporter_id);\n }\n return $this->transporter;\n }",
"public function getOrganizationName(): string {\n\t\treturn ($this->organizationName);\n\t}",
"public function getAssignor()\n {\n $config = $this->scopeConfig->getValue(\n 'payment/az2009_cielo_bank_slip/assignor',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n\n return $config;\n }",
"public function getAudience()\n {\n return $this->audience;\n }",
"public function getAudience()\n {\n return $this->audience;\n }",
"protected function get_calendar()\n\t{\n\t\treturn $this->calendars['gregorian'];\n\t}",
"public function getEvent()\r\n {\r\n return $this->Event;\r\n }",
"public function client()\n {\n if ( ! $this->bean->fetchAs('person')->client) $this->bean->client = R::dispense('person');\n return $this->bean->fetchAs('person')->client;\n }",
"function getApprover() {\n return user_load($this->approver_uid);\n }",
"public function getOrganization()\n {\n $token = $this->securityContext->getToken();\n if ($token instanceof OrganizationContextTokenInterface) {\n return $token->getOrganizationContext();\n }\n\n return false;\n }",
"public function getAffiliation()\n {\n return $this->affiliation;\n }",
"public static function event() {\n return self::service()->get('events');\n }",
"public function getEsAConductor()\n {\n return $this->esAConductor;\n }",
"public function getOwnerEntity() {\n\t\treturn get_entity($this->owner_guid);\n\t}",
"public function getAffiliation() {\n return $this->affiliation;\n }",
"public function getEventManager()\n {\n return $this->eventManager;\n }"
] | [
"0.6697686",
"0.6507971",
"0.64969254",
"0.648617",
"0.648617",
"0.648617",
"0.6372064",
"0.61768335",
"0.6144404",
"0.6089184",
"0.60589164",
"0.60294944",
"0.5977343",
"0.59507185",
"0.5903315",
"0.5806831",
"0.5783075",
"0.5752315",
"0.57308006",
"0.57056224",
"0.56900215",
"0.5660749",
"0.5641454",
"0.5633055",
"0.5617995",
"0.5585752",
"0.5574358",
"0.5565014",
"0.5558102",
"0.55451304",
"0.5539179",
"0.55284894",
"0.55284894",
"0.55284894",
"0.552561",
"0.5523665",
"0.5501045",
"0.5501035",
"0.55005985",
"0.5494118",
"0.5489357",
"0.547965",
"0.54720736",
"0.5471639",
"0.54701513",
"0.54669875",
"0.54454017",
"0.544498",
"0.5438723",
"0.540698",
"0.538032",
"0.5378044",
"0.5367512",
"0.5351497",
"0.53457254",
"0.5343708",
"0.53417313",
"0.53417313",
"0.53417313",
"0.5335687",
"0.5316571",
"0.5316476",
"0.5312059",
"0.530707",
"0.53066766",
"0.53066766",
"0.53066766",
"0.52833337",
"0.52796894",
"0.52796894",
"0.5274856",
"0.5267118",
"0.5252473",
"0.5250432",
"0.524422",
"0.5238046",
"0.5238046",
"0.5238046",
"0.5238046",
"0.5238046",
"0.5238046",
"0.5238046",
"0.5238046",
"0.52341187",
"0.5232256",
"0.5222597",
"0.52138174",
"0.5213723",
"0.5213723",
"0.5213335",
"0.52112675",
"0.5208824",
"0.5204729",
"0.5202484",
"0.52024424",
"0.5185552",
"0.51843005",
"0.5184204",
"0.5181427",
"0.5181393"
] | 0.79483306 | 0 |
Get the contact info from this event. | public function getContactInfo() {
return $this->contactInfo;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getContact()\n\t{\n\t\treturn $this->Info['Contact'];\n\t}",
"public function getContact()\n {\n return $this->contact;\n }",
"public function getContact()\n {\n return $this->contact;\n }",
"public function getContact()\n {\n return $this->contact;\n }",
"public function getContactInfo()\n {\n return array_filter([\n 'email' => $this->getEmail(),\n 'phoneNumber' => $this->getPhoneNumber(),\n ]);\n }",
"public function getContact()\n {\n return $this->contact;\n }",
"public function getContactInfo()\n {\n $phoneNumbers = [];\n if (isset($this->properties['contact_mobile_phone'])) {\n $phoneNumbers[] = $this->properties['contact_mobile_phone']->value;\n }\n if (isset($this->properties['contact_home_phone'])) {\n $phoneNumbers[] = $this->properties['contact_home_phone']->value;\n }\n $emailAddresses = [];\n if (isset($this->properties['email'])) {\n $emailAddresses[] = $this->properties['email']->value;\n }\n if (isset($this->properties['contact_alt_email'])) {\n $emailAddresses[] = $this->properties['contact_alt_email']->value;\n }\n return new Model\\ContactInfo(\n $phoneNumbers,\n $emailAddresses\n );\n }",
"public function getContact()\n {\n return isset($this->contact) ? $this->contact : null;\n }",
"public function getContact()\n {\n $userId = Yii::$app->user->id;\n\n if ($userId == $this->author_id) {\n return $this->recipient;\n } elseif ($userId == $this->recipient_id) {\n return $this->author;\n }\n\n }",
"public function getContact(): string\n {\n return $this->_contact;\n }",
"public function getContactDetailAttribute()\n {\n return $this->contact()->first();\n }",
"public function getInfosContact() {\n $listeInfos = $this->getInfos(\"contact\");\n return $listeInfos;\n }",
"public function getContact(): ?array\n\t{\n\t\treturn $this->contact;\n\t}",
"public function get_contact(){\n $this->relative = array_shift(Relative::find_all(\" WHERE dead_no = '{$this->id}' LIMIT 1\"));\n if ($this->relative) {\n return $this->relative->contact();\n } else {\n return \"Not Specified\";\n }\n }",
"public function getReadableContact()\n {\n return Extra::getBeautifulPhone($this->contact);\n }",
"function getInfo()\n\t{\n\t\treturn array_merge($this->getDeveloperInfo(), $this->getContact()->getInfo());\n\t}",
"public function getContact(){\n return $this->getParameter('contact');\n }",
"public function getEventAddress() \n {\n return $this->_fields['EventAddress']['FieldValue'];\n }",
"public function returnContact(){\n return $this->contact->getContact(); //Chama a função getContact do objeto contact\n }",
"public function getIdContact()\n {\n return $this->id_contact;\n }",
"public function getContactID()\n {\n return $this->get('ContactID');\n }",
"public function getContactID()\n {\n return $this->get('ContactID');\n }",
"public function getContactID()\n {\n return $this->get('ContactID');\n }",
"public function getContactName()\n {\n return $this->contactName;\n }",
"public function getContact() {\n try {\n return new Yourdelivery_Model_Contact($this->getContactId());\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n return null;\n }\n }",
"public function getContactID()\n {\n return $this->ContactID;\n }",
"protected function _getContactOwner()\n {\n return $this->params['name'];\n }",
"public function getMainContact()\n {\n return $this->mainContact;\n }",
"public function getContacts()\n {\n if (array_key_exists(\"contacts\", $this->_propDict)) {\n return $this->_propDict[\"contacts\"];\n } else {\n return null;\n }\n }",
"public function getTelContact() {\n return $this->telContact;\n }",
"public function getContactId()\n\t{\n\t\treturn $this->_contactId;\n\t}",
"public function getContactEmail()\n {\n return $this->contactEmail;\n }",
"public function getAllContactMetadata()\n {\n $response = $this->get(Resources::$Contactmetadata);\n if (!$response->success()) {\n $this->throwError('MailjetService:getAllContactMetadata() failed', $response);\n }\n return $response->getData();\n }",
"public function getContactInfo()\n {\n $info = DB::table('oc_setting')->whereIn(\n 'key',\n [\n 'config_telephone',\n 'config_email',\n 'config_address',\n 'config_name'\n ]\n )->get();\n\n $data = [];\n $info->each(\n function ($item, $key) use (&$data) {\n $data[$item->key] = $item->value;\n }\n );\n\n return $data;\n\n\n }",
"public function existingContactInfo($id) \n {\n //return the result for later use\n return $this->getExistingContactInfo($id);\n }",
"function InfGetContactDetails($inf_contact_id) {\n $object_type = \"Contact\";\n $class_name = \"Infusionsoft_\" . $object_type;\n $object = new $class_name();\n $objects = Infusionsoft_DataService::query(new $class_name(), array('Id' => $inf_contact_id));\n\n $contact_array = array();\n foreach ($objects as $i => $object) {\n $contact_array[$i] = $object->toArray();\n }\n\treturn $contact_array[0];\n}",
"public function getContact(): ?string;",
"public function getContacts(): stdClass {\n\n\t\treturn $this->greenApi->request( 'GET',\n\t\t\t'{{host}}/waInstance{{idInstance}}/GetContacts/{{apiTokenInstance}}' );\n\t}",
"public function getContact()\n {\n return dd(22222);\n }",
"public function getContactPhone()\n {\n return isset($this->contactPhone) ? $this->contactPhone : null;\n }",
"public function getContact()\n {\n return view('frontend.info.contact');\n }",
"public function getContactDate() {\n return $this->date;\n }",
"public function getSellerContact()\n {\n return $this->sellerContact;\n }",
"public function contactDetails()\n {\n return $this->hasMany(ContactDetail::class);\n }",
"public function contact()\n {\n return $this->hasOne(OrderContact::class);\n }",
"public function contactInfo($id)\n\t{\n\t\t$sql = \"SELECT * FROM contact_us WHERE id = '\". $id . \"'\";\n\t\t//return $this->fetch($sql);\n $rows = $this->fetch($sql);\n $c=0;\n foreach($rows AS $row){\n $contactinfo[$c] = $row;\n $c++;\n }\n return $contactinfo;\n\t}",
"public function getContactInfo( string $chatId ): stdClass {\n\n\t\t$requestBody = [\n\t\t\t'chatId' => $chatId,\n\t\t];\n\n\t\treturn $this->greenApi->request( 'POST',\n\t\t\t'{{host}}/waInstance{{idInstance}}/GetContactInfo/{{apiTokenInstance}}', $requestBody );\n\t}",
"public function getContacts() {\n return $this->contacts;\n }",
"public function getContactDataFields();",
"public function contact()\n {\n return new Contact($this);\n }",
"public function getFieldContactID()\n\t{\n\t\treturn $this->GetDAL()->GetField(DotCoreContactMemberDAL::CONTACT_MEMBER_ID);\n\t}",
"public function getContacts()\r\n {\r\n return $this->_contacts;\r\n }",
"public function getContacts()\n\t{\n\t\treturn $this->contacts; \n\n\t}",
"protected function buildContactObject()\n {\n return new Contact();\n }",
"public function getToInfo() {\r\n\t\treturn $this->toInfo;\r\n\t}",
"public function getCorrespondentAddress() {\n\t\treturn self::$_correspondentAddress;\n\t}",
"public function getReceiverInfo(array $request)\n {\n if (isset($request['estimate_id']))\n {\n return EstimateRepository::with('contacts')->findOrFail($request['estimate_id'])->get()->pluck('contacts')->first()->toArray();\n }\n if (isset($request['lead_id']))\n {\n return Leads::with('contacts')->findOrFail($request['lead_id'])->get()->pluck('contacts')->first()->toArray();\n\n }\n if (isset($request['request_id']))\n {\n return Request::with('contacts')->findOrFail($request['request_id'])->get()->pluck('contacts')->first()->toArray();\n }\n }",
"public function getPortalContact()\n {\n return BeanFactory::getBean('Contacts', $_SESSION['contact_id']);\n }",
"public function getRecipient() {\n\t\treturn $this -> data['recipient'];\n\t}",
"public function fromContact()\n {\n return $this->hasOne(User::class, 'id', 'from');\n }",
"public function getContactsForAdding()\n {\n return $this->contactsForAdding;\n }",
"function getContactDetails($prj_id, $contact_id)\n {\n $backend =& self::_getBackend($prj_id);\n return $backend->getContactDetails($contact_id);\n }",
"public function getContact(){\n return $this->db->get('contact')->result();\n }",
"public function get() {\n\t\t$request = $this->send(\"GET\", \"contacts/\" . $this->contactId, [\n\t\t\t'headers' => [\n\t\t\t\t'Accept' => 'application/json, */*',\n\t\t\t]\n\t\t]);\n\t\treturn $request;\n\t}",
"public function getDetails()\n {\n return [\n 'phone' => $this->user->phone\n ];\n }",
"public function getEventAdditionalInfo() {\n\t\treturn ($this->eventAdditionalInfo);\n\t}",
"public function getEvent()\n {\n return $this->getData('event');\n }",
"public function getConnectorContactId()\n {\n return $this->contactId;\n }",
"public function fetchContacts()\n {\n return $this->contacts;\n }",
"public function getEvent()\n {\n $event = array(\n \"eid\" => $this->eid,\n \"name\" => $this->name,\n \"venue\" => $this->venue,\n \"date\" => $this->date,\n \"time\" => $this->time,\n \"type\" => $this->type,\n \"status\" => $this->status\n );\n return $event;\n }",
"public function getAddress()\n\t{\n\t\treturn $this->data['address'];\n\t}",
"public function getEventDetails($eventId) {\n $sql = 'SELECT cmr.*, cmroom.room_name FROM ces_meeting_requests cmr '\n . 'LEFT JOIN ces_meeting_rooms cmroom ON cmroom.id = cmr.room_id '\n . 'WHERE cmr.id = :id';\n \n $stmt = $this->conn->prepare($sql);\n $stmt->execute([':id' => $eventId]);\n \n return $stmt->fetch();\n }",
"public function getInfo()\n {\n if (!empty($this->info)) {\n return $this->info;\n }\n\n // fallback to seat information\n if (!empty($this->seat)) {\n return $this->seat->getDisplayname();\n }\n\n return null;\n }",
"function get_primary_contact_details() : array {\n\n\treturn array(\n\t\tarray(\n\t\t\t'icon' => 'map-marker-alt',\n\t\t\t'title' => 'OFFICE',\n\t\t\t'value' => get_theme_mod( 'address_primary' ),\n\t\t),\n\t\tarray(\n\t\t\t'icon' => 'phone',\n\t\t\t'title' => 'PHONE',\n\t\t\t'value' => get_theme_mod( 'phone_primary' ),\n\t\t),\n\t\tarray(\n\t\t\t'icon' => 'envelope',\n\t\t\t'title' => 'EMAIL ADDRESS',\n\t\t\t'value' => get_theme_mod( 'email_primary' ),\n\t\t),\n\t\tarray(\n\t\t\t'icon' => 'business-time',\n\t\t\t'title' => 'OPENING HOURS',\n\t\t\t'value' => get_theme_mod( 'working_hrs_primary' ),\n\t\t),\n\t);\n\n}",
"public function contact(): \\Illuminate\\Database\\Eloquent\\Relations\\HasOne\n {\n return $this->hasOne('App\\Models\\UserContactDetail');\n }",
"public function getFTOContactDetailsArr()\n\t{\n\t\t$FTOContactDetailsArr[\"FLAG\"] = $this->getFTOFlag();\n\t\t$FTOContactDetailsArr[\"INBOUND_LIMIT\"] = $this->getInBoundLimit();\n\t\t$FTOContactDetailsArr[\"OUTBOUND_LIMIT\"] = $this->getOutBoundLimit();\n\t\t$FTOContactDetailsArr[\"TOTAL_LIMIT\"] = $this->getTotalAcceptanceLimit();\n\t\t\n\t\treturn $FTOContactDetailsArr;\n\t}",
"public function getContactList()\r\n {\r\n return $this->exec('contact_list');\r\n }",
"public function getContactNotes()\n\t{\n\t\treturn $this->contact_notes;\n\t}",
"public function getContact()\n\t{\n\t\treturn view('contact');\n\t}",
"public function contact()\n {\n return $this->BelongsTo(User::class, 'parent_contact_id');\n }",
"public function getContactsList() {\n return $this->_get(7);\n }",
"function get_contact($uid) {\n //make sure the uid is set\n if (!isset($uid) || empty($uid)) {\n throw new Zim_Exception_UIDNotSet();\n }\n $q = Doctrine_Query::create()\n ->from('Zim_Model_User user')\n ->where('user.uid = ?', $uid)\n ->limit(1);\n $contact = $q->fetchOne();\n if (empty($contact)) {\n throw new Zim_Exception_ContactNotFound();\n }\n $contact = $contact->toArray();\n if (!isset($contact['uname']) || trim($contact['uname']) == ''){\n $contact['uname'] = $this->update_username(array('uid' => $contact['uid']));\n }\n\n //return the contact\n return $contact;\n }",
"public function getOneInformation(){\n\t\tuser_login_required();\n\n\t\t//Get conversation ID\n\t\t$conversationID = $this->getSafePostConversationID(\"conversationID\");\n\t\t\n\t\t//Try to get informations about the conversation\n\t\t$conversationsList = CS::get()->components->conversations->getList(userID, $conversationID);\n\n\t\t//Check for errors\n\t\tif($conversationsList === false)\n\t\t\tRest_fatal_error(500, \"An internal error occured\");\n\n\t\t//Check if a conversation was found\n\t\tif(count($conversationsList) < 1)\n\t\t\tRest_fatal_error(401, \"Users doesn't belong to the specified conversation,\".\n\t\t\t\" or the conversation doesn't exists !\");\n\n\t\t//Return conversation informations\n\t\treturn self::ConvInfoToAPI($conversationsList[0]);\n\t}",
"function buildContactDetail() {\n return url(\"thong-tin-lien-he\");\n }",
"public function hasContactInformation() {\n\t\treturn $this->hasContactEmail() || $this->hasContactUrl();\n\t}",
"public function contact()\n {\n return $this->hasMany(contact::class);\n }",
"public function getContacts(){\n $contacts = [];\n if ($this->data instanceof IPPCustomer){\n $newContact = $this->parseData($this->data);\n $contacts[] = $newContact;\n }\n else {\n foreach ($this->data as $contact) {\n $newContact = $this->parseData($contact);\n $contacts[] = $newContact;\n }\n }\n\n return $contacts;\n }",
"public function getCustomInfo() {\n\t\treturn $this->custom_info;\n\t}",
"public function getSource()\n {\n return 'contacts';\n }",
"public function getInfo ()\n {\n return $this->info;\n }",
"public function getContactsList() {\n return $this->_get(6);\n }",
"public function contacts()\n {\n return $this->hasOne(Contact::class);\n }",
"public function getContact()\n {\n return \\View::make(\"ishu.contact\");\n }",
"public function getInfo()\n {\n return $this->info;\n }",
"public function getInfo()\n {\n return $this->info;\n }",
"public function getInfo()\n {\n return $this->info;\n }",
"public function getInfo()\n {\n return $this->info;\n }",
"public function getInfo()\n {\n return $this->info;\n }",
"public function getInfo()\n {\n return $this->info;\n }",
"public function getInfo()\n {\n return $this->info;\n }"
] | [
"0.77773935",
"0.729121",
"0.729121",
"0.729121",
"0.72665775",
"0.7256344",
"0.7149975",
"0.71452886",
"0.6844479",
"0.6794244",
"0.658297",
"0.65391105",
"0.6429791",
"0.64087987",
"0.6387042",
"0.630271",
"0.62434536",
"0.62045443",
"0.6178928",
"0.6142353",
"0.61272514",
"0.61272514",
"0.61270726",
"0.6115195",
"0.61095613",
"0.60818934",
"0.60487974",
"0.6027327",
"0.6014215",
"0.60121226",
"0.5938872",
"0.58992463",
"0.58444846",
"0.57321703",
"0.57263106",
"0.5708956",
"0.57085943",
"0.56739724",
"0.5662602",
"0.5638552",
"0.56058455",
"0.5591887",
"0.55872107",
"0.55863386",
"0.5584089",
"0.5558975",
"0.55570596",
"0.55518925",
"0.5540838",
"0.55339175",
"0.5508676",
"0.55029345",
"0.5500238",
"0.54969096",
"0.5474316",
"0.54631245",
"0.54556084",
"0.5452485",
"0.54497933",
"0.5448079",
"0.544285",
"0.542502",
"0.54044455",
"0.5401957",
"0.53988236",
"0.5380373",
"0.5362757",
"0.534905",
"0.5332925",
"0.53300524",
"0.5326034",
"0.53229606",
"0.53189015",
"0.5317489",
"0.53070223",
"0.5303565",
"0.5301232",
"0.5299749",
"0.52946687",
"0.52678984",
"0.5225668",
"0.521655",
"0.52137524",
"0.5211776",
"0.52070975",
"0.5203911",
"0.5203808",
"0.5201751",
"0.51908404",
"0.51821905",
"0.5178374",
"0.5176462",
"0.51764333",
"0.51757556",
"0.51757556",
"0.51757556",
"0.51757556",
"0.51757556",
"0.51757556",
"0.51757556"
] | 0.7819706 | 0 |
Get the maximum amount of participants. | public function getMaxParticipants() {
return $this->maxParticipants;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getMaxParticipants()\n {\n return $this->max_participants;\n }",
"public function limitPerParticipant()\n {\n if ($this->acceptsGuestEntries()) {\n return;\n }\n\n $limit = $this->settings['limit-per-participant'] ?? 1;\n\n return $limit !== -1 ? $limit : null;\n }",
"public function getMaximumAttempts();",
"public function getMaxPlayers(): int;",
"public function getMaxPlayers() : int {\r\n\r\n return (int) $this->getMain()->getDatabase()->get(\"max_players\", [\"table\" => \"Games\", \"name\" => $this->getName()])->fetchArray()[0];\r\n\r\n }",
"public function getMaxChatters()\n {\n return $this->maxChatters;\n }",
"public function getNbParticipants()\n {\n return $this->nbParticipants;\n }",
"public function getMaximumAttendees()\n {\n $query = 'select count(attendeeID) from attendees';\n if ($this->connectedModel->runQuery($query)) //query\n {\n if ($row = $this->connectedModel->getResultsRow())\n return $row[0]; //count()\n }\n else\n {\n return -1;\n }\n }",
"public function getMaxcount()\n {\n return $this->maxCount;\n }",
"public function getMaxLimit()\n {\n return $this->max_limit;\n }",
"public function getCountMax(): int\n {\n return $this->countMax;\n }",
"public function getMaximumAttendeesCount()\n {\n if (array_key_exists(\"maximumAttendeesCount\", $this->_propDict)) {\n return $this->_propDict[\"maximumAttendeesCount\"];\n } else {\n return null;\n }\n }",
"public function getLimit() : int\n {\n return $this->limit;\n }",
"public function maxAttempts()\n {\n return property_exists($this, 'maxAttempts') ? $this->maxAttempts : 5;\n }",
"protected function getMaxItemsCount()\n {\n return $this->getParam(self::PARAM_MAX_ITEMS_TO_DISPLAY) ?: $this->getMaxCountInBlock();\n }",
"public function limit(): int\n {\n return $this->limit;\n }",
"public function getMaximumItemCount()\n {\n return $this->maximumItemCount;\n }",
"public function getMaxPerUserId()\n {\n return $this->maxPerUserId;\n }",
"public function get_maximum_tries() {\n $max = 1;\n foreach ($this->get_response_class_ids() as $responseclassid) {\n $max = max($max, $this->get_response_class($responseclassid)->get_maximum_tries());\n }\n return $max;\n }",
"public function getMaxResults()\n {\n return $this->max_results;\n }",
"public function getMaxNumber()\n {\n return $this->maxNumber;\n }",
"public function GetMaxCount ();",
"public function getMaxMessage()\n {\n return $this->getOption('max_message', 'Please add not more than %max% '\n .'number of objects.');\n }",
"public function getLimit();",
"public function getLimit();",
"public function getLimit();",
"public function getLimit();",
"public function getLimit();",
"public function getMaxItems()\n {\n return isset($this->max_items) ? $this->max_items : 0;\n }",
"public function getMaxItemsCount() {\n\t\t\treturn $this->maxItemsCount;\n\t\t}",
"public function getMax() {\n return $this->max;\n }",
"public function setMaxParticipants($maxParticipants) {\n $this->maxParticipants = $maxParticipants;\n }",
"public function getLimit ()\r\n\t{\r\n\t\treturn $this->limit;\r\n\t}",
"public function getMaximum()\n {\n return $this->max;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"protected function getLimit()\n {\n return (int)$this->getSettingsValue('limit');\n }",
"public function getLimit() {}",
"public function setMaxParticipants($max_participants)\n {\n $this->max_participants = $max_participants;\n }",
"public function getMaximum()\n {\n return $this->maximum;\n }",
"final public static function HpsMaximumNumberOfRetryTransactionWasBreached()\n {\n return self::get(822);\n }",
"protected function get_max_length(): int\n\t{\n\t\treturn $this->end < $this->total ? $this->length : -1;\n\t}",
"public function setMaxParticipants(int $maxParticipants): self\n {\n $this->options['maxParticipants'] = $maxParticipants;\n return $this;\n }",
"public function getLimit() {\n\t\treturn $this->limit;\n\t}",
"public function getMaxPower() {\r\n return $this->getMemberCount() * $this->factionsLevel->getSettings()->maxPowerPerUser;\r\n }",
"public function getMax()\n {\n return $this->_maxValue;\n }",
"public function getMaxFindings()\n {\n return $this->max_findings;\n }",
"public function max_connections()\n {\n $channel = ChannelRepository::getPublic($this);\n\n return $channel->max_connections;\n }",
"public function getMaxCount(): ?int\n {\n return $this->maxCount;\n }",
"public function getMaxItems() {\n\t\t$q = $this->bdd->prepare('SELECT count(1) FROM items');\n\t\t$q->execute();\n\t\treturn intval($q->fetch(PDO::FETCH_COLUMN));\n\t}",
"public function getLimit()\n {\n return $this->number_of_items_per_page;\n }",
"public static function getApproxMaxTour()\n\t{\n\t\t$playersCount = Yii::app()->db->createCommand()\n\t\t\t->select('count(*)')\n\t\t\t->from(Player::tableName())\n\t\t\t->queryScalar();\n\t\t$tourCount=ceil(log($playersCount,2)) + ceil(log(Yii::app()->params['accuracyCount'],2));\n\t\treturn (int)$tourCount;\n\t}",
"public function getItemsMax() {\n\t\treturn \\Services::get('submission')->getMax($this->_getItemsParams());\n\t}",
"public function getMaxRetries()\n {\n return $this->_maxRetries;\n }",
"public function maxTries();",
"public function maxAttempts(): int\n {\n return 5;\n }",
"public function getLimit()\n {\n return $this->_limit;\n }",
"function max() { return $this->max; }",
"public function getSlotMaxAttribute()\n {\n return ($this->trainer_slot_id ? $this->trainer_count * $this->slot_max_potential : $this->slot_max_potential);\n }",
"public function getMaxValue()\n {\n return $this->get('MaxValue');\n }",
"public function getMaximum() {\r\n return $this->maximumvalue;\r\n }",
"public function getMax(): int;",
"public function getMaxCount(): ?int\n {\n if ($this->fallback_params) {\n return null;\n }\n $prop_max_count = 0;\n foreach ($this->properties as $property) {\n if (!$property->isNever()) {\n $prop_max_count++;\n }\n }\n assert($prop_max_count !== 0);\n return $prop_max_count;\n }",
"public function getMaxValue();",
"public function getMaxValue();",
"function getMax() { return $this->readMaxValue(); }",
"public function getNotificationCounterMax()\n {\n return self::NOTIFICATIONS_COUNTER_MAX;\n }",
"public function getLimit()\n {\n return isset($this->limit) ? $this->limit : 0.0;\n }",
"public function getMaxClients()\n {\n return $this->_maxClients;\n }",
"public static function getMaxUsedNumber()\n {\n $query = new Query;\n\n $query->select('recepient_num, count(recepient_num) as quan')\n ->from('call')\n ->groupBy('recepient_num')\n ->orderBy('quan desc')\n ->limit(1);\n\n $rows = $query->all();\n\n return $rows[0]['recepient_num'];\n }",
"function getMaxValue() { return $this->readMaxValue(); }",
"public function limit(): int\n {\n return $this->per_page;\n }",
"public function getMaxNbChilds()\n {\n return $this->getOption('max', 0);\n }",
"public function getMaxConnections() {\n return @$this->attributes['max_connections'];\n }",
"public function getProgressLimit()\n {\n if ($this->progressLimit === null) {\n $this->setProgressLimit($this->config->get('concrete.i18n.community_translation.progress_limit', 90));\n }\n\n return $this->progressLimit;\n }",
"public function getMaxRounds() {\n\t\treturn $this->maxRounds;\n\t}",
"public function maxCount($var = null): int\n {\n return $this->loadHeaderProperty(\n 'max_count',\n $var,\n static function ($value) {\n return (int)($value ?? Grav::instance()['config']->get('system.pages.list.count'));\n }\n );\n }",
"function getNota_max()\n {\n if (!isset($this->inota_max) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->inota_max;\n }",
"function getNota_max()\n {\n if (!isset($this->inota_max) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->inota_max;\n }",
"public function getLimit() {\n return $this->limit;\n }",
"public function mutualFriendCount(): int\n {\n return $this->pluck('mutualFriendsCount');\n }",
"public function mutualFriendCount(): int\n {\n return $this->pluck('mutualFriendsCount');\n }",
"public function getLimit()\n {\n return $this->getParameter('limit');\n }",
"abstract public function maxMax(): int;",
"public function getMessageLimit() {\n if (isset($this->_quotausage['MESSAGE']['limit'])) {\n return $this->_quotausage['MESSAGE']['limit'];\n }\n return 0;\n }",
"public function getMaximumQuantity()\n {\n return $this->maximumQuantity;\n }",
"public function getMaximumAmount()\n\t{\n\t\treturn ['amount' => 5000.00, 'currency' => 'EUR'];\n\t}",
"public function getPlayersNbr ()\r\n {\r\n return $this->playersNbr;\r\n }",
"public function getLimit()\n {\n return self::LIMIT;\n }",
"public function getMaxSize(): int\n {\n return $this->maxSize;\n }"
] | [
"0.83796704",
"0.73337865",
"0.7174557",
"0.71393937",
"0.7088084",
"0.6965768",
"0.6949374",
"0.6934905",
"0.6926936",
"0.6925162",
"0.68878186",
"0.6872525",
"0.67364603",
"0.67028195",
"0.66730255",
"0.665985",
"0.66541666",
"0.6636262",
"0.66084987",
"0.6601371",
"0.66003674",
"0.65445954",
"0.6509324",
"0.648952",
"0.648952",
"0.648952",
"0.648952",
"0.648952",
"0.6482105",
"0.6469523",
"0.6441155",
"0.64118123",
"0.6411434",
"0.6408419",
"0.640243",
"0.640243",
"0.640243",
"0.640243",
"0.640243",
"0.640243",
"0.640243",
"0.640243",
"0.640243",
"0.640243",
"0.640243",
"0.640243",
"0.63949734",
"0.6394011",
"0.63876444",
"0.63722646",
"0.6361009",
"0.6356118",
"0.63560706",
"0.6355748",
"0.6350027",
"0.6347493",
"0.63425237",
"0.6338139",
"0.6327275",
"0.6323975",
"0.63080317",
"0.62914693",
"0.627396",
"0.6269625",
"0.6258641",
"0.6239832",
"0.6202036",
"0.6178453",
"0.6177626",
"0.6168914",
"0.61659616",
"0.61549205",
"0.6147683",
"0.61448693",
"0.61448693",
"0.6132627",
"0.6131756",
"0.6128615",
"0.612306",
"0.6119415",
"0.60971874",
"0.60862416",
"0.6080886",
"0.60790133",
"0.607101",
"0.60703874",
"0.6068117",
"0.6064642",
"0.6064642",
"0.6051118",
"0.60480094",
"0.60480094",
"0.6041882",
"0.6040869",
"0.60363",
"0.6029582",
"0.6028328",
"0.6027256",
"0.6027016",
"0.60241556"
] | 0.8278022 | 1 |
Get the booking period. | public function getBookingPeriod() {
return $this->bookingPeriod;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPeriod() {}",
"public function getPeriod();",
"public function getPeriod()\n {\n return $this->period;\n }",
"public function getPeriod()\n {\n return $this->period;\n }",
"public function getPeriod()\n {\n return $this->period;\n }",
"public function getPeriod()\n {\n return $this->period;\n }",
"public function getPeriod()\n\t{\n\t\treturn $this->period;\n\t}",
"public function period()\n {\n return $this->hasOne(Period::class, 'id', 'id');\n }",
"public function getBookingPeriodPricing(Period $period)\n {\n $bookingPeriod = $this->getBookingPeriod($period);\n\n return $bookingPeriod->purchasedAt;\n }",
"public function getActivatedPeriod()\n {\n if ($this->isDeactivatedPermanently() === false)\n throw new LogicException('The record is not deactivated permanently, and therefore has no finite, active period.');\n \n $invoker = $this->getInvoker();\n $until = $invoker->{$this->_options['until']['name']} === null?\n 'today' : $invoker->{$this->_options['until']['name']};\n \n return new DatePeriod(\n new DateTime($until),\n new DateInterval('P1D'),\n new DateTime($invoker->{$this->_options['from']['name']})\n );\n }",
"public function getTabsBooking()\n {\n\n // Get the booking object\n $bookingCheck = \\tabs\\api\\client\\ApiClient::getApi()->get(\n \"/booking/{$this->getBookingId()}/tabsbooking\"\n );\n if ($bookingCheck\n && $bookingCheck->status == 200\n && $bookingCheck->response != ''\n ) {\n return \\tabs\\api\\booking\\TabsBooking::createFromNode(\n $bookingCheck->response\n );\n } else {\n throw new \\tabs\\api\\client\\ApiException(\n $bookingCheck,\n \"Booking not found\"\n );\n }\n }",
"public function getCalendarPeriod()\n {\n return $this->readOneof(8);\n }",
"public function getReminderPeriod()\n {\n return $this->reminderPeriod;\n }",
"public function getInvoicePeriod()\n {\n return $this->invoicePeriod;\n }",
"public function getPeriodo()\n {\n return $this->periodo;\n }",
"public function getPeriod() : int\n {\n return $this->period;\n }",
"public function getDeactivatedPeriod()\n {\n if ($this->isDeactivatedTemporarily() === false)\n throw new LogicException('The record is not deactivated temporarily, and therefore has no finite, deactivated period.');\n \n $invoker = $this->getInvoker();\n \n return new DatePeriod(\n new DateTime($invoker->{$this->_options['from']['name']}),\n new DateInterval('P1D'),\n new DateTime($invoker->{$this->_options['until']['name']})\n );\n }",
"public function getEffectivePeriod()\n {\n return $this->effectivePeriod;\n }",
"public function getPeriodto()\n {\n return $this->periodto;\n }",
"public function getPeriodfrom()\n {\n return $this->periodfrom;\n }",
"public function getEntity(): Booking\n {\n return (new Booking())\n ->setBeginsAt(new \\DateTime('2050/11/20'))\n ->setEndsAt(new \\DateTime('2050/11/25'))\n ->setTotalOccupiers(3);\n }",
"public function get_recurring_period(){\n\t\treturn $this->payment['recurring_period'];\n\t}",
"public function getPeriod(){\n\t\tif($this->_year>1970&&$this->_year<2038){\n\t\t\treturn date('Ym', $this->_timestamp);\n\t\t} else {\n\t\t\t$dateParts = self::_getDateParts($this->_timestamp, false);\n\t\t\treturn $dateParts['year'].$dateParts['mon'];\n\t\t}\n\t}",
"public function getPeriodSinceActive()\n {\n return $this->calculatePeriodDifference($this->last_active);\n }",
"public function getPeriodDatesProperty()\n {\n $now = Carbon::now()->timezone(\"America/Bogota\");\n $min = $now->copy();\n $max = $now->copy();\n\n switch ($this->period) {\n case 'today':\n break;\n case 'yesterday':\n $min->subDay();\n $max->subDay();\n break;\n case 'thisWeek':\n $min->startOfWeek();\n $max->endOfWeek();\n break;\n case 'lastWeek':\n $min->subWeek()->startOfWeek();\n $max->subWeek()->endOfWeek();\n break;\n case 'thisFortnight':\n if ($min->day > 15) {\n $min->day(16);\n $max->endOfMonth();\n } else {\n $min->startOfMonth();\n $max->startOfMonth()->addDays(14);\n }\n break;\n case 'lastFortnight':\n if ($min->day > 15) {\n $min->startOfMonth();\n $max->startOfMonth()->addDays(14);\n } else {\n $min->subMonth()->day(16);\n $max->subMonth()->endOfMonth();\n }\n break;\n case 'thisMonth':\n $min->startOfMonth();\n $max->endOfMonth();\n break;\n case 'lastMonth':\n $min->subMonth()->startOfMonth();\n $max->subMonth()->endOfMonth();\n break;\n\n default:\n # code...\n break;\n }\n\n $min->startOfDay();\n $max->endOfDay();\n $format = 'd-m-y H:i:s';\n\n return [\n 'min' => $min,\n 'minView' => $min->format($format),\n 'max' => $max,\n 'maxView' => $max->format($format),\n ];\n }",
"protected function getPeriodHash()\n {\n if($this->periodTo === null && $this->periodFrom === null) {\n return false;\n }\n\n $period = array(\n 'from' => static::PERIOD_DATE_ZERO,\n 'to' => ''\n );\n\n if($this->periodFrom) {\n $period['from'] = $this->periodFrom->format(static::PERIOD_DATE_FORMAT);\n }\n\n // If no 'to' date is set, assume the current date.\n if($this->periodTo) {\n $period['to'] = $this->periodTo->format(static::PERIOD_DATE_FORMAT);\n } else {\n $period['to'] = date(static::PERIOD_DATE_FORMAT);\n }\n\n return $period;\n }",
"public function getForecastPeriod()\n {\n return $this->forecast_period;\n }",
"public function period()\n {\n return $this->belongsTo('App\\Period');\n }",
"public function definePeriod($period)\n {\n return $period;\n }",
"public function getForecastPeriod()\n {\n return $this->forecastPeriod;\n }",
"private static function get_limit_period_dates( $period ) {\n\t\tif ( empty( $period ) ) {\n\t\t\treturn array( 'start_date' => null, 'end_date' => null );\n\t\t}\n\n\t\tswitch ( $period ) {\n\t\t\tcase 'day':\n\t\t\t\treturn array(\n\t\t\t\t\t'start_date' => current_time( 'Y-m-d' ),\n\t\t\t\t\t'end_date' => current_time( 'Y-m-d 23:59:59' ),\n\t\t\t\t);\n\t\t\t\tbreak;\n\n\t\t\tcase 'week':\n\t\t\t\treturn array(\n\t\t\t\t\t'start_date' => gmdate( 'Y-m-d', strtotime( 'Monday this week' ) ),\n\t\t\t\t\t'end_date' => gmdate( 'Y-m-d 23:59:59', strtotime( 'next Sunday' ) ),\n\t\t\t\t);\n\t\t\t\tbreak;\n\n\t\t\tcase 'month':\n\t\t\t\t$month_start = gmdate( 'Y-m-1');\n\t\t\t\treturn array(\n\t\t\t\t\t'start_date' => $month_start,\n\t\t\t\t\t'end_date' => gmdate( 'Y-m-d H:i:s', strtotime( \"{$month_start} +1 month -1 second\" ) ),\n\t\t\t\t);\n\t\t\t\tbreak;\n\n\t\t\tcase 'year':\n\t\t\t\treturn array(\n\t\t\t\t\t'start_date' => gmdate( 'Y-1-1' ),\n\t\t\t\t\t'end_date' => gmdate( 'Y-12-31 23:59:59' ),\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\t}",
"private function getParamPeriodEnd()\n {\n $periodEnd = JFactory::getApplication()->input->get('periodEnd', '', 'string');\n return $periodEnd === '' ? null : new DateTime( $periodEnd );\n }",
"static function getLifetime()\n {\n return new Am_Period(self::MAX_SQL_DATE);\n }",
"public function getRatePeriod()\n {\n return $this->ratePeriod;\n }",
"function get_booking(){\r\n\t\tglobal $EM_Booking;\r\n\t\tif( is_object($this->booking) && get_class($this->booking)=='EM_Booking' && ($this->booking->id == $this->booking_id || (empty($this->id) && empty($this->booking_id))) ){\r\n\t\t\treturn $this->booking;\r\n\t\t}elseif( is_object($EM_Booking) && $EM_Booking->id == $this->booking_id ){\r\n\t\t\t$this->booking = $EM_Booking;\r\n\t\t}else{\r\n\t\t\tif(is_numeric($this->booking_id)){\r\n\t\t\t\t$this->booking = new EM_Booking($this->booking_id);\r\n\t\t\t}else{\r\n\t\t\t\t$this->booking = new EM_Booking();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn apply_filters('em_ticket_booking_get_booking', $this->booking, $this);;\r\n\t}",
"public function getActivationPeriodAttribute()\n {\n return [$this->{$this->starts_at_field}, $this->{$this->ends_at_field}];\n }",
"public function getSuspendPeriodUntil(): ?DateTime {\n return $this->suspendPeriodUntil;\n }",
"public function getEndDate();",
"public function getEndDate();",
"public function getAdvanceBookingRequirement() {\n\t\treturn $this->advanceBookingRequirement;\n\t}",
"public function periods()\n {\n return $this->hasMany(Period::class);\n }",
"public function plan_period(){\n return $this->belongsTo(config('subscriptions.models.period'), 'period_id')->withoutGlobalScope('publics');\n }",
"private function getLastPayPeriodEnd(){ $myq = getCurrentPayPeriod();\r\n $result = getQueryResult($this->config, $myq, $debug = false);\r\n $ppArray = $result->fetch_assoc();\r\n $startDate = $ppArray['PPBEG'];\r\n $this->lastPayStart = date('Y-m-d', strtotime('-14 days', strtotime($startDate)));\r\n $endDate = $ppArray['PPEND'];\r\n $this->lastPayEnd = date('Y-m-d', strtotime('-14 days', strtotime($endDate)));\r\n\r\n return $endDate;\r\n }",
"public function getBookingStatus()\n {\n return isset($this->BookingStatus) ? $this->BookingStatus : null;\n }",
"public function booking()\n {\n return $this->hasOne('App\\Booking','id_stato_prenotazione','id_stato_prenotazione');\n }",
"public function getRequestedDeliveryPeriod()\n {\n return $this->requestedDeliveryPeriod;\n }",
"public function periodoActual()\n\t{\n\t\t$sql = \"SELECT semesterId FROM course_module LEFT JOIN subject_module ON subject_module.subjectModuleId = course_module.subjectModuleId WHERE courseId = '{$this->courseId}' ORDER BY semesterId DESC LIMIT 1\"; \n\t\t$this->Util()->DB()->setQuery($sql);\n\t\t$periodo = $this->Util()->DB()->GetSingle();\n\t\treturn $periodo;\n\t}",
"private function getLastPeriod(): Period\n {\n $count = \\count($this->getPeriods());\n\n // We don't use end() to not modify the internal pointer of the array\n return $this->getPeriods()[$count - 1];\n }",
"public function getValidityPeriod()\n {\n return $this->validityPeriod;\n }",
"public function getInGracePeriodUntilDateTime()\n {\n if (array_key_exists(\"inGracePeriodUntilDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"inGracePeriodUntilDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"inGracePeriodUntilDateTime\"])) {\n return $this->_propDict[\"inGracePeriodUntilDateTime\"];\n } else {\n $this->_propDict[\"inGracePeriodUntilDateTime\"] = new \\DateTime($this->_propDict[\"inGracePeriodUntilDateTime\"]);\n return $this->_propDict[\"inGracePeriodUntilDateTime\"];\n }\n }\n return null;\n }",
"public function getSuspendPeriodFrom(): ?DateTime {\n return $this->suspendPeriodFrom;\n }",
"public static function getResourceURI()\n {\n return 'LeavePeriod';\n }",
"public function get(int $offset): Period\n {\n return $this->periods[$this->getOffset($offset)];\n }",
"public function getRelatedRecord(): IActivityPeriodRelated\n {\n return $this->card;\n }",
"public function periodRanges(): Collection\n {\n return Period::makeRanges($this->getConfig('strategy.keep-backups', []));\n }",
"public function getNotificationPeriod() {\n\t\treturn $this->notificationPeriod;\n\t}",
"function wpbs_get_booking($booking)\n{\n\n return wp_booking_system()->db['bookings']->get_object($booking);\n\n}",
"public function getCustomPeriod()\n {\n return $this->readOneof(9);\n }",
"public function getBookingsByDate(Request $request)\n {\n $booking_obj = new Booking();\n return $booking_obj->getFutureBookingsByServiceAndDate($request->sv_id, $request->start, $request->end);\n }",
"public function getMonitoringPeriod()\n {\n return $this->monitoringPeriod;\n }",
"function get_pending_bookings(){\n\t\tif( get_option('dbem_bookings_approval') == 0 ){\n\t\t\treturn new EM_Bookings();\n\t\t}\n\t\t$pending = array();\n\t\tforeach ( $this->load() as $EM_Booking ){\n\t\t\tif($EM_Booking->booking_status == 0){\n\t\t\t\t$pending[] = $EM_Booking;\n\t\t\t}\n\t\t}\n\t\t$EM_Bookings = new EM_Bookings($pending);\n\t\treturn $EM_Bookings;\t\n\t}",
"public function findLatest(): Booking\n {\n return $this->bookingRepository->getLatest();\n }",
"public function periodAction() {\n\tif($this->_getParam('id',false)){\n\t$this->view->periods = $this->_periods->getPeriodDetails($this->_getParam('id'));\n\t} else {\n\t\tthrow new Exception($this->_missingParameter);\n\t}\n\t}",
"public function index()\n {\n $p = Period::latest()->get();\n return new PeriodCollection($p);\n }",
"public function booking()\n {\n return $this->hasMany(Booking::class);\n }",
"public function getDebouncePeriod()\n {\n $payload = '';\n\n $data = $this->sendRequest(self::FUNCTION_GET_DEBOUNCE_PERIOD, $payload);\n\n $payload = unpack('V1debounce', $data);\n\n return IPConnection::fixUnpackedUInt32($payload['debounce']);\n }",
"protected function _getBookingOptions(){\n\t\t$product = $this->getProduct();\n if(!is_object($product->getCustomOption(AW_Booking_Model_Product_Type_Bookable::FROM_DATE_OPTION_NAME))){\n $source = unserialize($product->getCustomOption('info_buyRequest')->getValue());\n $from_date = $source['aw_booking_from'];\n $to_date = $source['aw_booking_to'];\n\n $data = array(\n new Zend_Date($from_date, Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT)),\n new Zend_Date($to_date, Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT))\n );\n }\n else{\n $data = array(\n //new Zend_Date($product->getCustomOption('aw_booking_from')->getValue().\" \". $product->getCustomOption('aw_booking_time_from')->getValue(), Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_FULL)),\n new Zend_Date($product->getCustomOption('aw_booking_from')->getValue().\" \". $product->getCustomOption('aw_booking_time_from')->getValue(), AW_Core_Model_Abstract::DB_DATETIME_FORMAT),\n //new Zend_Date($product->getCustomOption('aw_booking_to')->getValue().\" \". $product->getCustomOption('aw_booking_time_to')->getValue(), Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_FULL))\n new Zend_Date($product->getCustomOption('aw_booking_to')->getValue().\" \". $product->getCustomOption('aw_booking_time_to')->getValue(), AW_Core_Model_Abstract::DB_DATETIME_FORMAT),\n );\n }\n\t\t\n\t\treturn array(\n\t\t\tarray('label' => $this->__('From'), 'value' => $this->formatDate($data[0], 'short', $this->getProduct()->getAwBookingRangeType() != 'date_fromto')),\n\t\t\tarray('label' => $this->__('To'), 'value' => $this->formatDate($data[1], 'short', $this->getProduct()->getAwBookingRangeType() != 'date_fromto'))\n\t\t);\n\t}",
"public function getEndDateAndTime() {}",
"public function getPeriodoPagoActivo()\n {\n $periodo_activo = $this->em->getRepository('PlanillasNomencladorBundle:NPeriodoPago')\n ->findOneBy(array(\n 'activo' => true\n ));\n\n if (!$periodo_activo) {\n throw new \\Exception('No se existe un periodo de pago activo en el sistema, debe registrar al menos uno.');\n }\n\n return $periodo_activo;\n }",
"public function reportingPeriod()\n {\n return $this->belongsTo(ReportingPeriod::class);\n }",
"public function getAngularVelocityPeriod()\n {\n $payload = '';\n\n $data = $this->sendRequest(self::FUNCTION_GET_ANGULAR_VELOCITY_PERIOD, $payload);\n\n $payload = unpack('V1period', $data);\n\n return IPConnection::fixUnpackedUInt32($payload['period']);\n }",
"protected function getLeaveAssignDateLimit() {\n // If no leave period, don't allow apply/assign beyond next calender year\n $todayNextYear = new DateTime();\n $todayNextYear->add(new DateInterval('P1Y'));\n \n if ($this->getConfigService()->isLeavePeriodDefined()) {\n $period = $this->getLeavePeriodService()->getCurrentLeavePeriodByDate($todayNextYear->format('Y-m-d'));\n $maxDate = $period[1];\n } else {\n $nextYear = $todayNextYear->format('Y');\n $maxDate = $nextYear . '-12-31';\n } \n \n return $maxDate;\n }",
"public function store(PeriodRequest $request)\n {\n $period = new Period();\n $period->begining_date = $request->begining_date;\n $period->ending_date = $request->ending_date;\n $period->is_current = $request->is_current;\n $period->pay_month = $request->pay_month;\n $period->pay_year = $request->pay_year;\n $period->save();\n \n return new PeriodResource($period);\n }",
"public function getAvailableTill()\n {\n if ($this->AvailableTillDate) {\n return $this->dbObject('AvailableTillDate');\n } elseif ($startDate = $this->getEventStartDate()) {\n $till = strtotime(self::config()->get('sale_end_threshold'), strtotime($startDate->getValue()));\n $date = DBDatetime::create();\n $date->setValue(date('Y-m-d H:i:s', $till));\n return $date;\n }\n\n\n return null;\n }",
"public function getBillableActivityDateRange()\n {\n return isset($this->billable_activity_date_range) ? $this->billable_activity_date_range : null;\n }",
"public function getEnd()\n {\n return $this->getLatestPeriod()->getEnd();\n }",
"public static function getScheduleService($servicId, $timestamp) {\n $bookedArr = array();\n $availabilityArr = array();\n $date = date('Y-m-d',$timestamp);\n \n //get already booked spot\n $booking = Booking::select('bd.start_time','bd.end_time')\n ->join('bookings_details as bd','bookings.id','=','bd.booking_id')\n ->where('service_id',$servicId)\n ->where(DB::raw(\"date(start_time)\"),'=',$date)->get()->toArray();\n \n if($booking){\n foreach ($booking as $key => $value) {\n $bookedArr[] = date(\"H:i\", strtotime($value['start_time']));\n }\n }\n //end code\n \n $service = Service::find($servicId);\n $closeTime = $service->close_booking_before_time != \"\" ? $service->close_booking_before_time : 30;\n $int = $service->duration;\n \n if ($service->service_type != 'weekly') {\n $n = 0;\n $start_time = explode(':', $service['start_time']);\n $startMinutes = ($start_time[0]*60) + ($start_time[1]) + ($start_time[2]/60);\n\n $end_time = explode(':', $service['end_time']);\n $endMinutes = ($end_time[0]*60) + ($end_time[1]) + ($end_time[2]/60);\n\n $st = date(\"Y-m-d H:i\", strtotime($date . \" +\" . $startMinutes . \" minutes\"));\n $et = date(\"Y-m-d H:i\", strtotime($date . \" +\" . $endMinutes . \" minutes\"));\n \n $a = $st;\n $b = date(\"Y-m-d H:i\", strtotime($a . \" +\" . $int . \" minutes\")); //default value for B is start time.\n\n for ($a = $st; $b <= $et; $b = date(\"Y-m-d H:i\", strtotime($a . \" +\" . $int . \" minutes\"))) {\n //echo \"a: \".$a.\" // \".\"b: \".$b.\"<br />\";\n\n //$availabilityArr[date(\"Y-m-d\", strtotime($a))][] = date(\"H:i\", strtotime($a));\n if(strtotime($a) > strtotime('+'.$closeTime.' minutes', time())){\n $availabilityArr[] = date(\"H:i\", strtotime($a));\n }\n $a = $b;\n $n++;\n }\n }\n \n if ($service->service_type == 'weekly') {\n $dayOfWeek = date(\"w\", strtotime($date));\n $schedule = Schedule::where('service_id', $servicId)->where('week_number',$dayOfWeek)->get()->toArray();\n $n = 0;\n for ($i = 0; $i < count($schedule); $i++) {\n $start_time = explode(':', $schedule[$i]['start_time']);\n $startMinutes = ($start_time[0]*60) + ($start_time[1]) + ($start_time[2]/60);\n \n $end_time = explode(':', $schedule[$i]['end_time']);\n $endMinutes = ($end_time[0]*60) + ($end_time[1]) + ($end_time[2]/60);\n \n $st = date(\"Y-m-d H:i\", strtotime($date . \" +\" . $startMinutes . \" minutes\"));\n $et = date(\"Y-m-d H:i\", strtotime($date . \" +\" . $endMinutes . \" minutes\"));\n \n $a = $st;\n $b = date(\"Y-m-d H:i\", strtotime($a . \" +\" . $int . \" minutes\")); //default value for B is start time.\n\n for ($a = $st; $b <= $et; $b = date(\"Y-m-d H:i\", strtotime($a . \" +\" . $int . \" minutes\"))) {\n //echo \"a: \".$a.\" // \".\"b: \".$b.\"<br />\";\n \n //$availabilityArr[date(\"Y-m-d\", strtotime($a))][] = date(\"H:i\", strtotime($a));\n if(strtotime($a) > strtotime('+'.$closeTime.' minutes', time())){\n $availabilityArr[] = date(\"H:i\", strtotime($a));\n }\n $a = $b;\n $n++;\n }\n }\n }\n return array(\"availability\" => $availabilityArr, \"booked\" => $bookedArr, \"duration\" => $int,\"total_spots\" => $n);\n }",
"public function calculate_package_period($period)\n {\n // $date = strtotime(date(\"Y-m-d\", strtotime($date)) . \" +1 day\");\n // $date = strtotime(date(\"Y-m-d\", strtotime($date)) . \" +1 week\");\n // $date = strtotime(date(\"Y-m-d\", strtotime($date)) . \" +2 week\");\n // $date = strtotime(date(\"Y-m-d\", strtotime($date)) . \" +1 month\");\n // $date = strtotime(date(\"Y-m-d\", strtotime($date)) . \" +30 days\");\n $today=Date('Y-m-d');\n if($period==1){\n $date = strtotime(date(\"Y-m-d\", strtotime($today)) . \" +3 month\");\n $membership_end = date(\"Y-m-d\", $date);\n }else if($period==0){\n $membership_end='';\n }\n return array('membership_end'=>$membership_end);\n }",
"public function length(): Period|null\n {\n $period = reset($this->periods);\n if (false === $period) {\n return null;\n }\n\n return $period->merge(...$this->periods);\n }",
"public function getDateRange()\n {\n return $this->date_range;\n }",
"public function getEndDate() {\n return $this->endDate;\n }",
"public function getDatePeriod($interval, $option = 0)\n {\n return new DatePeriod($this->startDate, static::filterDateInterval($interval), $this->endDate, $option);\n }",
"public function getValidUntil()\n {\n if (is_null($this->validUntil)) {\n /** @psalm-var ?string $data */\n $data = $this->raw(self::FIELD_VALID_UNTIL);\n if (is_null($data)) {\n return null;\n }\n $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);\n if (false === $data) {\n return null;\n }\n $this->validUntil = $data;\n }\n\n return $this->validUntil;\n }",
"public function get_endDate()\n {\n return $this->_endDate;\n }",
"public function getRepeatPropertyBookerDate()\n {\n if ($this->repeatPropertyBookerDate) {\n return new \\DateTime($this->repeatPropertyBookerDate);\n } else {\n return;\n }\n }",
"public function getEndDate(){\n\t\treturn $this->endDate;\n\t}",
"protected function getTimePeriods() {\n return array(\n '604800', //7 days \n '2678400', //31 days\n '15552000' //180 dats\n );\n }",
"public function getEndDate()\n {\n return $this->endDate;\n }",
"public function getEndDate()\n {\n return $this->endDate;\n }",
"public function getEndDate()\n {\n return $this->endDate;\n }",
"public function getEndDate()\n {\n return $this->endDate;\n }",
"public function getEndDate()\n {\n return $this->endDate;\n }",
"public function getEndDate()\n {\n return $this->endDate;\n }",
"public function getBookings(): ?array\n {\n return $this->bookings;\n }",
"public function getAllDataPeriod()\n {\n $payload = '';\n\n $data = $this->sendRequest(self::FUNCTION_GET_ALL_DATA_PERIOD, $payload);\n\n $payload = unpack('V1period', $data);\n\n return IPConnection::fixUnpackedUInt32($payload['period']);\n }",
"public function booking()\n {\n return $this->hasMany('App\\Models\\Booking');\n }",
"public function getPeriod($data,$date2 = null){\n\n if($date2 != null){\n\n $firstDay = $data;\n $lastDay = $date2;\n $periodos[0] = \"$data,$date2\";\n $dataMax = strtotime($date2);\n }else{\n # Get first day of month\n $firstDay = date(\"j-n-Y\",strtotime($data));\n # Get last day of month\n $lastDay = date(\"t-n-Y\",strtotime($data));\n # First period\n $periodos[0] = $firstDay.','.$lastDay;\n #Define the last date\n $dataMax = strtotime($lastDay);\n }\n\n $z = 1;\n\n $current=0;\n # Get first month\n $month = date(\"n\",strtotime($data));\n # Get first year\n $year = date(\"Y\", strtotime($data));\n # While the current date is less than max date, then continue\n while($current <= $dataMax){\n # Get next month\n $month = $month+1;\n # First date's period\n $p1 = \"1-$month-$year\"; //2014-02-01\n # Last day of date's period\n $p2D = date(\"t\",strtotime($p1)); // 28\n # Get second date's period\n $p2 = \"$p2D-$month-$year\";\n #\n $limit1 = strtotime($p1);\n # Check if first date of this period is bigger than max date\n if( $limit1 >= $dataMax){\n break;\n }\n $periodos[$z] = \"$p1,$p2\";\n if($month >= 12)\n {\n $month = 0;\n $year = $year+1;\n }\n\n $current = strtotime($p2);\n if($current >= $dataMax)\n {\n $p2 = date(\"j-n-Y\",$dataMax);\n $periodos[$z] = \"$p1,$p2\";\n break;\n }\n ++$z;\n\n }\n\n return $periodos;\n // $x = 0;\n\n // # Get current month\n // $mon = date(\"m\",strtotime($data));\n // # Get current year\n // $year = date(\"Y\",strtotime($data));\n // # Get periods previous\n // for($i=1;$i < 7;$i++){\n // # Changes of year\n // if($mon-1 == 0){$mon = 12;$year -= 1;}\n // else{--$mon;}\n\n // # Get first day of month\n // $ini = \"1-$mon-$year\";\n // # Get last day of month\n // $end = date(\"t-n-Y\",strtotime($ini));\n // # Get Period\n // $periodos[$i] = \"$ini,$end\";\n // }\n // # Set period\n // $this->periodos = $periodos;\n // # Return period\n // return $periodos;\n }",
"private function getParamPeriodStart()\n {\n $periodStart = JFactory::getApplication()->input->get('periodStart', '', 'string');\n return $periodStart === '' ? null : new DateTime( $periodStart );\n }",
"public function getBounceRate(Period $period);",
"function getBookings($uid, $interval) {\n\n\t\t$bookingsRaw = array();\n\t\t$storagePid = $this->lConf['PIDstorage'];\n\n\t\tif (!isset($uid))\n\t\t\t$uid = $this->lConf['ProductID'];\n\n\t\tif (!isset($interval['startList']) && !isset($interval['endList'])) {\n\t\t\t$interval['startList'] = $interval['startDate'];\n\t\t\t$interval['endList'] = $interval['endDate'];\n\t\t}\n\n\t\tif ($storagePid != '' && $uid != '') {\n\t\t\t// SELECT\n\t\t\t// 1. get for bookings for these uids/pids\n\t\t\t$query = 'pid IN ('. $storagePid .') AND uid_foreign IN ('.$uid.')';\n\t\t\t$query .= ' AND deleted=0 AND hidden=0 AND uid=uid_local';\n\t\t\t$query .= ' AND ( enddate >=('.$interval['startList'].') AND startdate <=('.$interval['endList'].'))';\n\n\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('DISTINCT uid_foreign as uid, startdate, enddate, title','tx_abbooking_booking, tx_abbooking_booking_productid_mm',$query,'','startdate','');\n\n\t\t\t// one array for start and end dates. one for each pid\n\t\t\twhile (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {\n\t\t\t\t$bookingsRaw[] = $row;\n\t\t\t};\n\n\t\t}\n\n\t\t$localbookings['bookings'] = $bookingsRaw;\n\n \t\treturn $localbookings;\n\n\t}"
] | [
"0.7230923",
"0.71676385",
"0.6909265",
"0.6909265",
"0.6909265",
"0.6909265",
"0.67613584",
"0.65692484",
"0.6470812",
"0.64168024",
"0.63482606",
"0.6346187",
"0.6337608",
"0.6302562",
"0.6266849",
"0.62030804",
"0.6163268",
"0.6121682",
"0.61178577",
"0.6074483",
"0.605462",
"0.60427153",
"0.5926231",
"0.58546764",
"0.58341354",
"0.58319277",
"0.5800109",
"0.57643634",
"0.571134",
"0.5699192",
"0.5680349",
"0.5657198",
"0.56380796",
"0.55754864",
"0.55708987",
"0.5555832",
"0.55468786",
"0.5520602",
"0.5520602",
"0.5513982",
"0.5513064",
"0.54583704",
"0.54128104",
"0.54000306",
"0.5398719",
"0.5395864",
"0.5378872",
"0.5365358",
"0.5361638",
"0.5338636",
"0.5319199",
"0.53182536",
"0.5315853",
"0.5314297",
"0.52952415",
"0.52911735",
"0.527456",
"0.5269797",
"0.52695054",
"0.52499336",
"0.52464914",
"0.52198106",
"0.51821643",
"0.51814115",
"0.5173881",
"0.51627463",
"0.5154701",
"0.5151584",
"0.51368916",
"0.5136495",
"0.5127861",
"0.51238304",
"0.51229495",
"0.51087815",
"0.50981015",
"0.5092109",
"0.5077159",
"0.50693065",
"0.50586367",
"0.5054345",
"0.50469327",
"0.50268346",
"0.4995916",
"0.49921563",
"0.49804735",
"0.49734193",
"0.49726626",
"0.4970088",
"0.4970088",
"0.4970088",
"0.4970088",
"0.4970088",
"0.4970088",
"0.49676353",
"0.49670047",
"0.4965753",
"0.49632382",
"0.4952044",
"0.49491495",
"0.49475634"
] | 0.85103947 | 0 |
Set the minimum age for this event. | public function setAgeFrom($age) {
if (!is_numeric($age)) {
throw new UnexpectedValueException('Invalid age: ' . $age);
}
$this->ageFrom = $age;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setMinAge($age)\n\t {\n\t \t $this->json['params'][$this->account]['minage'] = $age;\n\t \t \n\t \t return $this;\n\t }",
"public function setGroupMinAge($value) {\n\t\t$this->_group_min_age = $value;\n\t}",
"public function setMinAge($var)\n {\n GPBUtil::checkInt32($var);\n $this->minAge = $var;\n\n return $this;\n }",
"public function getMinimumAge()\n {\n return $this->minimumAge;\n }",
"public function getMinimumAge()\n {\n return $this->minimumAge;\n }",
"public function setMinAge($minAge)\n {\n $this->minAge = $minAge;\n return $this;\n }",
"public function getMinAge()\n {\n return $this->minAge;\n }",
"public function getMinAge()\n {\n return $this->minAge;\n }",
"function setAge($newAge){\n //check if numeric\n if(is_numeric($newAge)){\n $this->age = $newAge;\n }\n //if not, set 0\n $this->age = \"0\";\n }",
"public function setMin( int $min ): void {\n\t\t\t$this->minimum = abs( $min );\n\t\t}",
"public function setChildrenMinimumAge($childrenMinimumAge) {\n\t\t$this->childrenMinimumAge = $childrenMinimumAge !== null ? ((int) $childrenMinimumAge) : null;\n\t}",
"public function setMinValue($minValue);",
"private function setFilterForAge(){\n $selfAge = $this->loggedInProfileObj->getAGE();\n $othersAge = $this->ProfileObj->getAGE();\n if($this->loggedInProfileObj->getGENDER()==self::maleProfile){\n $LAgeToSet = min($selfAge-self::AgeConstantToBeSub,$othersAge);\n $HAgeToSet = max($selfAge,$othersAge);\n }\n else{\n $LAgeToSet = min($selfAge,$othersAge);\n $HAgeToSet = max($selfAge+self::AgeConstantToBeSub,$othersAge);\n }\n $this->setLAGE($LAgeToSet);\n $this->setHAGE($HAgeToSet);\n }",
"public function getGroupMinAge() {\n\t\treturn $this->_group_min_age;\n\t}",
"public function setRandomAge()\n\t{\n\t\t$this->age = rand(self::AGE_MIN, self::AGE_MAX);\n\t\treturn $this;\n\t}",
"function setMin($min) {\n $this->field['min'] = (int) $min;\n\n return $this;\n }",
"public function hasAgeMin() {\n return $this->_has(2);\n }",
"public function setAge($age){\n\n if(is_int($age) && $age >= 1 && $age <= 120){ //condition pour empecher la modification de l'age en string\n $this->$age = $age;\n }else{\n throw new Exception(\"L'age de l'Employé devrait etre un entier supérieur à 1 et inférieur à 120\");\n }\n \n }",
"public function setMinimum($value) {\r\n $this->internalSetMinimum($value);\r\n }",
"public function setAge($age)\n {\n if (is_numeric($age)){\n\n $this->age = $age;\n }\n\n return $this;\n }",
"public function setMaxAge($var)\n {\n GPBUtil::checkInt32($var);\n $this->maxAge = $var;\n\n return $this;\n }",
"function getMinYears()\n {\n return 0;\n }",
"public function setGroupMaxAge($value) {\n\t\t$this->_group_max_age = $value;\n\t}",
"public function setMin($min) {\n\t\t$this->attributes['min'] = $min;\n\t\t$this->min = $min;\n\t\treturn $this;\n\t}",
"public function setMinimumValue(int $minimumValue): void;",
"public function setXMin($xMin) {}",
"public function setAge($age) {\n $this->age = $age;\n return $this;\n }",
"public function setAge(INT $newAge)\n\t{\n\t $this->age = $newAge;\n\t return $this;\n\t}",
"public function setMinValue($value)\n {\n $this->set('MinValue', (int) $value);\n return $this;\n }",
"public function setAge($age)\n {\n $this->age = $age;\n\n return $this;\n }",
"public function setMinValue($value)\n\t{\n\t\t$this->setViewState('MinValue',$value,'');\n\t}",
"public static function set_cache_age($age)\n {\n Deprecation::notice('5.0', 'Use HTTPCacheControlMiddleware::singleton()->setMaxAge($age) instead');\n self::$cache_age = $age;\n HTTPCacheControlMiddleware::singleton()->setMaxAge($age);\n }",
"public function setAge($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->age !== $v) {\n $this->age = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_AGE] = true;\n }\n\n return $this;\n }",
"public function setage($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (string) $v;\n }\n\n if ($this->age !== $v) {\n $this->age = $v;\n $this->modifiedColumns[] = ActionTypePeer::AGE;\n }\n\n\n return $this;\n }",
"public function ageLimit(?int $ageLimit): self\n {\n $new = clone $this;\n $new->ageLimit = $ageLimit;\n\n return $new;\n }",
"public function setMinDamage(){ $this->minDamage = 10; }",
"public function setMaxAge($maxAge)\n {\n $this->maxAge = $maxAge;\n return $this;\n }",
"static function set_cache_age($age) {\n\t\tself::$cache_age = $age;\n\t}",
"public function setMaxAge(int $maxAge): self\n {\n $this->maxAge = $maxAge;\n $this->hasData = true;\n return $this;\n }",
"public function setMaxAge($expiry)\n {\n $this->expiry = $expiry;\n }",
"public function setUseAging($value)\n {\n if ($value) {\n $this->setBaseAge(new \\DateTime());\n } else {\n $this->setBaseAge(null);\n }\n return $this;\n }",
"public function setAge(float $value, int $unit = self::AGE_SECONDS) {\n switch ($unit) {\n case self::AGE_MINUTES:\n $this->age = $value * 60;\n break;\n case self::AGE_HOURS:\n $this->age = $value * 60 * 60;\n break;\n case self::AGE_DAYS:\n $this->age = $value * 60 * 60 * 24;\n break;\n default:\n $this->age = $value;\n }\n }",
"public function setMaxAge($i)\n\t{\n\t\tif (is_null($i))\n\t\t\t$this->maxage = null;\n\t\telseif (is_numeric($i))\n\t\t\t$this->maxage = $i * 1;\n\t}",
"public function setMin($value)\n {\n $this->_minValue = $value;\n return $this;\n }",
"public function getAgeFrom() {\n return $this->ageFrom;\n }",
"public function setLengthMin($lengthMin)\n {\n $this->lengthMin = \\RandData\\Checker::int(\n $lengthMin,\n self::LENGTH_MIN_MIN,\n self::LENGTH_MIN_MAX,\n \"lengthMin\"\n );\n }",
"function min() { return $this->min; }",
"public function __construct($min)\n {\n $this->min = $min;\n }",
"public function setMin($min) {\n $this->min = $min;\n return $this;\n }",
"public function setMin($min) {\n $this->min = $min;\n return $this;\n }",
"public function setXAxisLimitedTo($Year) {\n\t\t$this->Options['xaxis']['min'] = mktime(1,0,0,1,1,$Year).'000';\n\t\t$this->Options['xaxis']['max'] = mktime(1,0,0,1,0,$Year+1).'000';\n\t}",
"public function min($value) {\n return $this->setProperty('min', $value);\n }",
"public function min($value) {\n return $this->setProperty('min', $value);\n }",
"public function setEarliest(int $earliest): void\n {\n $this->earliest = $earliest;\n }",
"public function getMaxAge()\n {\n\n }",
"public function setMinLength($minLength) {\n if (!is_integer($minLength) || $minLength < 0) {\n throw new \\InvalidArgumentException('Minimal length must be numeric and greather or equal to zero. Get: \"' . $minLength . '\"');\n }\n $this->minLength = $minLength;\n return $this;\n }",
"public function setMinimumAmount($min, bool $inclusive = false, ?string $message = null) : void\n {\n $this->minimumOptions = [\n 'min' => $min,\n 'inclusive' => $inclusive,\n 'message' => $message,\n ];\n }",
"public static function min($attribute = null);",
"function getMaxYears()\n {\n return 9999;\n }",
"public function setGroupAgeSize($value) {\n\t\t$this->_group_age_size = $value;\n\t}",
"public function setMinimumLength($length)\n {\n $this->minimumLength = $length;\n }",
"public function getAgeAttribute()\n\t{\n\t\treturn now()->diffInYears($this->birthdate);\n\t}",
"public function determineAge() {\n $timeInOneYear = 365.256 * 24 * 60 * 60;\n $yearsofAge = floor((strtotime(date('Y')) - strtotime($this->year.'-12-31'))/ $timeInOneYear);\n\n $this->age = $yearsofAge;\n\n return (int) $yearsofAge;\n }",
"public function setMinimum(int $minimum = 10800) : CNabuDataObject\n {\n if ($minimum === null) {\n throw new ENabuCoreException(\n ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,\n array(\"\\$minimum\")\n );\n }\n $this->setValue('nb_domain_zone_minimum', $minimum);\n \n return $this;\n }",
"public function checkAge()\n {\n Validator::extend('check_age', function ($attribute, $value, $parameters, $validator) {\n $request = app(\\Illuminate\\Http\\Request::class);\n $dob = $request->date_of_birth;\n $dobValue = explode('-', $dob);\n if ($dobValue[0] && $dobValue[1] && $dobValue[2]) {\n $today = new DateTime();\n $birthdate = new DateTime($dob);\n $interval = $today->diff($birthdate);\n $age = (int)$interval->format('%y');\n if ($age>=18) {\n return true;\n } else {\n return false;\n }\n }\n });\n }",
"public function setageEc($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (int) $v;\n }\n\n if ($this->age_ec !== $v) {\n $this->age_ec = $v;\n $this->modifiedColumns[] = ActionTypePeer::AGE_EC;\n }\n\n\n return $this;\n }",
"function setExperience($experience) { $experience = (int) $experience;\r\n if ($experience >= 1 && $experience <= 100) {\r\n $this->_experience = $experience;\r\n }\r\n }",
"public function getMaxAge(): int {\n return $this->configuration['max_age'];\n }",
"public function setMinimum(?Json $value): void {\n $this->getBackingStore()->set('minimum', $value);\n }",
"function set_thirty_day_min_booking($min_days){\n $min_days = 30;\n return $min_days;\n}",
"function setYear($y)\r\n {\r\n if($y < 0 || $y > 9999) {\r\n $this->ano = 0;\r\n } else {\r\n $this->ano = $y;\r\n }\r\n }",
"public function setStartAtMin(?string $startAtMin): void\n {\n $this->startAtMin = $startAtMin;\n }",
"public function getMaxAge()\n\t{\n\t\treturn $this->maxage;\n\t}",
"public static function get_default_min()\n\t{\n\t\treturn self::get_value('1970-01');\n\t}",
"public function setAge($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->age !== $v) {\n $this->age = $v;\n $this->modifiedColumns[UserTableMap::COL_AGE] = true;\n }\n\n if ($this->aUserAge !== null && $this->aUserAge->getAge() !== $v) {\n $this->aUserAge = null;\n }\n\n return $this;\n }",
"public function getAgeAttribute ()\n\t{\n\t\treturn \\Carbon\\Carbon::parse($this->birthdate)->age;\n\t}",
"public function setMin($min): bool {\n\t\tif($min instanceof DateTime) {\n\t\t\t$min = $min->format(self::OutputFormat);\n\t\t}\n\n\t\tif(is_string($min) || is_null($min)) {\n\t\t\t$this->setAttribute(\"min\", $min);\n\t\t\treturn true;\n\t\t}\n\n\t\tAppLog::error(\"invalid minimum time\", __FILE__, __LINE__, __FUNCTION__);\n\t\treturn false;\n\t}",
"private function min()\n {\n return Carbon::create(1, 1, 1, 0, 0, 0);\n }",
"public function setStartingMileageAttribute($input)\n {\n if ($input != '') {\n $this->attributes['starting_mileage'] = $input;\n } else {\n $this->attributes['starting_mileage'] = null;\n }\n }",
"protected function onParentSet() : void\n {\n $value = $this->oFG->getData()->getValue($this->strName);\n $this->iValue = $value ? intval($value) : $this->iMin;\n }",
"public function setMaxAge(int $seconds): void\n {\n $this->maxAge = $seconds;\n }",
"public function setMinPrice($minPrice);",
"public function setMin($value)\n {\n if (is_array($value)) {\n $value = array2Point($value);\n }\n\n if (!($value instanceof Point)) {\n throw new InvalidConfigException('Invalid `min` attribute value; it must be a Point object or an array that can be converted to a Point object');\n }\n\n $this->_min = $value;\n }",
"public function min($min = null)\n {\n $this->min = $min;\n\n return $this;\n }",
"public function setMinYearBuilt($minYearBuilt);",
"public function testSetMinGaranti() {\n\n $obj = new Employes();\n\n $obj->setMinGaranti(10.092018);\n $this->assertEquals(10.092018, $obj->getMinGaranti());\n }",
"function exibeAtualMin(){\n return $nmin= (($this->atual * $this->numpage) - $this->numpage)+1;\n }",
"public function setMin(int $value): CustomField\n {\n $this->min = $value;\n\n return $this;\n }",
"public function testSetIsLowerInclusive()\n { \n $interval = new Interval();\n \n $this->assertSame($interval, $interval->setIsLowerInclusive(true));\n $this->assertTrue($this->getProperty('isLowerInclusive', $interval));\n \n return;\n }",
"public function getAge() { return $this->age; }",
"public function getMinDateRange()\n {\n $dob = $this->_getAttribute('dob');\n if ($dob !== null) {\n $rules = $this->_getAttribute('dob')->getValidationRules();\n $minDateValue = ArrayObjectSearch::getArrayElementByName(\n $rules,\n self::MIN_DATE_RANGE_KEY\n );\n if ($minDateValue !== null) {\n return date(\"Y/m/d\", $minDateValue);\n }\n }\n\n return null;\n }",
"public function getAge()\n {\n\n return $this->age;\n \n }",
"public function setYMin($yMin) {}",
"public function setUserDateOfBirth ($newUserDateOfBirth = null) {\n\t\t// base case: if the date is null, ask user to enter date of birth\n\t\tif($newUserDateOfBirth === null) {\n\t\t\tthrow (new \\OutOfBoundsException(\"You must enter your date of birth\"));\n\t\t}\n\n\t\t$newUserDateOfBirth = self::validateDate($newUserDateOfBirth);\n\t\t$drinkDate = new \\DateTime();\n\t\t$drinkDate = $drinkDate->sub(new \\DateInterval('P21Y'));\n\t\tif($drinkDate < $newUserDateOfBirth) {\n\t\t\tthrow (new \\OutOfRangeException(\"You are too young.\"));\n\t\t}\n\t\t// store the userDateOfBirth date\n\t\t$this->userDateOfBirth = $newUserDateOfBirth;\n\n\t}",
"public function getAge() {\n return $this->age;\n }",
"public final function setLowerLimit($val)\n {\n $this->limit['lower'] = (int) $val;\n return $this;\n }",
"public function getMaxAge()\n {\n return $this->maxAge;\n }",
"public function getMaxAge()\n {\n return $this->maxAge;\n }",
"function getMinValue() { return $this->readMinValue(); }",
"public function getage()\n {\n return $this->age;\n }"
] | [
"0.7497076",
"0.74574995",
"0.7310172",
"0.6883263",
"0.6883263",
"0.68508893",
"0.66369855",
"0.66369855",
"0.6004696",
"0.5991757",
"0.5989631",
"0.5979681",
"0.5971634",
"0.5926428",
"0.58863324",
"0.58699036",
"0.5857535",
"0.5851972",
"0.5842608",
"0.5754469",
"0.57461804",
"0.5741191",
"0.5706496",
"0.5677453",
"0.5658985",
"0.56340045",
"0.5628069",
"0.56087446",
"0.5574716",
"0.5543797",
"0.5540199",
"0.5511606",
"0.55053705",
"0.5457086",
"0.54402816",
"0.5387176",
"0.53819275",
"0.537386",
"0.5355913",
"0.53558636",
"0.5329323",
"0.5318104",
"0.52796954",
"0.5263611",
"0.5257142",
"0.52499056",
"0.5247114",
"0.52418876",
"0.5236103",
"0.5236103",
"0.5221947",
"0.52219003",
"0.52219003",
"0.5211197",
"0.52067715",
"0.51902163",
"0.5184255",
"0.51626045",
"0.51492196",
"0.5139413",
"0.513924",
"0.51333743",
"0.5115829",
"0.5101151",
"0.5100348",
"0.50972766",
"0.50451857",
"0.5041506",
"0.50163114",
"0.5010341",
"0.50060815",
"0.5001043",
"0.49993885",
"0.49931183",
"0.4974069",
"0.49730352",
"0.49644607",
"0.49569213",
"0.4943827",
"0.49407235",
"0.49377725",
"0.49199724",
"0.49191308",
"0.49055997",
"0.49007878",
"0.49003607",
"0.48951972",
"0.48920926",
"0.48850963",
"0.4877771",
"0.48719478",
"0.48706675",
"0.48487723",
"0.4844584",
"0.4844029",
"0.4843467",
"0.48425457",
"0.48425457",
"0.4840859",
"0.48360032"
] | 0.62070346 | 8 |
Set the calendar data for the event. | public function setCalendar(CultureFeed_Cdb_Data_Calendar $calendar) {
$this->calendar = $calendar;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setData($data)\n {\n $this->date=$data;\n }",
"function setEvent($year,$month,$day,$id=false,$url=false){\n$eventTime=$this->mkActiveTime(0,0,1,$month,$day,$year);\n\tif (!$id) $id=$this->cssEvent;\n$this->calEvents[$eventTime]=$id;\n$this->calEventsUrl[$eventTime]=$url;\n}",
"public function setDates($calendarDate) {\r\n $year=substr($calendarDate,0,4);\r\n $month=substr($calendarDate,5,2);\r\n $day=substr($calendarDate,8,2);\r\n $this->calendarDate=$calendarDate;\r\n $this->day=$year . $month . $day;\r\n $this->month=$year . $month; \r\n $this->year=$year;\r\n $this->week=$year . weekNumber($calendarDate);\r\n }",
"protected function setMessage(\\Google_Service_Calendar_Event $message)\n\t{\n\t\t$this->id = $message->getId();\n\t\t$this->summary = $message->getSummary();\n\t\t$this->description = $message->getDescription();\n\t}",
"function setEventContent($year,$month,$day,$content,$url=false,$id=false){\n$eventTime=$this->mkActiveTime(0,0,1,$month,$day,$year);\n$eventContent[$eventTime]=$content;\n$this->calEventContent[]=$eventContent;\n\tif (!$id) $id=$this->cssEventContent;\n$this->calEventContentId[]=$id;\n\tif ($url) $this->calEventContentUrl[]=$url;\n\telse $this->calEventContentUrl[]=$this->calInit++;\n}",
"public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }",
"public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }",
"public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }",
"public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }",
"public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }",
"public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }",
"public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }",
"public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }",
"public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }",
"private function getData()\n {\n $data = array();\n\n $data = array_merge($data,\n $this->services->CalendarData->currentUserData(),\n $this->services->Common->subPageName( $this->timber->translator->trans('Calendar') . \" | \" ),\n $this->services->Common->runtimeScripts( 'calendar' ),\n $this->services->Common->injectScripts(array(\n 'projectsEvents' => $this->services->CalendarData->projectsEvents(),\n 'tasksEvents' => $this->services->CalendarData->tasksEvents(),\n 'projectsEventsColor' => '#ecf0f1',\n 'projectsEventsTextColor' => '#2c3e50',\n 'tasksEventsColor' => '#bdc3c7',\n 'tasksEventsTextColor' => '#2980b9',\n 'calEvent_id' => $this->timber->translator->trans('ID'),\n 'calEvent_iden' => $this->timber->translator->trans('Identifier'),\n 'calEvent_type' => $this->timber->translator->trans('Type'),\n 'calEvent_mi_id' => $this->timber->translator->trans('Milestone ID'),\n 'calEvent_mi_title' => $this->timber->translator->trans('Milestone Title'),\n 'calEvent_pr_id' => $this->timber->translator->trans('Project ID'),\n 'calEvent_owner_id' => $this->timber->translator->trans('Owner ID'),\n 'calEvent_assign_to' => $this->timber->translator->trans('Assignee ID'),\n 'calEvent_assign_to_name' => $this->timber->translator->trans('Assignee Name'),\n 'calEvent_assign_to_email' => $this->timber->translator->trans('Assignee Email'),\n 'calEvent_title' => $this->timber->translator->trans('Title'),\n 'calEvent_description' => $this->timber->translator->trans('Description'),\n 'calEvent_status' => $this->timber->translator->trans('Status'),\n 'calEvent_progress' => $this->timber->translator->trans('Progress'),\n 'calEvent_priority' => $this->timber->translator->trans('Priority'),\n 'calEvent_start_at' => $this->timber->translator->trans('Start at'),\n 'calEvent_end_at' => $this->timber->translator->trans('End at'),\n 'calEvent_created_at' => $this->timber->translator->trans('Created at'),\n 'calEvent_updated_at' => $this->timber->translator->trans('Updated at'),\n 'calEvent_currency' => $this->timber->translator->trans('Currency'),\n 'calEvent_reference' => $this->timber->translator->trans('Reference'),\n 'calEvent_ref_id' => $this->timber->translator->trans('Reference ID'),\n 'calEvent_version' => $this->timber->translator->trans('Version'),\n 'calEvent_budget' => $this->timber->translator->trans('Budget'),\n 'calEvent_tax_value' => $this->timber->translator->trans('Tax Value'),\n 'calEvent_tax_type' => $this->timber->translator->trans('Tax Type'),\n 'calEvent_discount_value' => $this->timber->translator->trans('Discount Value'),\n 'calEvent_discount_type' => $this->timber->translator->trans('Discount Type'),\n 'calEvent_attach' => $this->timber->translator->trans('Attachments'),\n 'calEvent_owners' => $this->timber->translator->trans('Owners'),\n 'calEvent_staff' => $this->timber->translator->trans('Staff'),\n 'calEvent_clients' => $this->timber->translator->trans('Clients'),\n 'calEvent_staff_ids' => $this->timber->translator->trans('Staff IDs'),\n 'calEvent_clients_ids' => $this->timber->translator->trans('Clients IDs'),\n ))\n );\n\n return $data;\n }",
"public function get_calender_data()\n\t{\n\treturn $this->cal['VCALENDAR'];\n\t}",
"public function setDocumentData($data)\n {\n $this->id = $data['_id'];\n\n if (isset($data['channel_code'])) {\n $this->data['fields']['channel_code'] = (string) $data['channel_code'];\n }\n if (isset($data['time'])) {\n $date = new \\DateTime(); $date->setTimestamp($data['time']->sec); $this->data['fields']['time'] = $date;\n }\n\n\n \n }",
"public static function initialize_calendar(){\n \n $event_array[] = array();\n $schedules = \\App\\Event::get();\n if(!empty($schedules)){\n foreach($schedules as $schedule){\n $event_array[] = array(\n 'id' => uniqid(),\n 'title' => $schedule->description,\n 'start' => date('Y-m-d', strtotime($schedule->event_date)),\n 'end' => date('Y-m-d', strtotime($schedule->event_date)),\n 'color' => \"lightblue\",\n \"textEscape\"=> 'false' ,\n 'textColor' => 'black',\n );\n }\n return $get_schedule = json_encode($event_array);\n }\n }",
"protected function saveCalendarEvent(Request $request, CalendarEvent $calendar_event): void\n {\n $calendar_event->title = $request->input(\"title\");\n $calendar_event->start = Carbon::parse($request->input(\"start\"));\n $calendar_event->end = Carbon::parse($request->input(\"start\"))->addMinutes(30);\n $calendar_event->user_id = Auth::guard('admin')->check() ? $request->input(\"user_id\") : Auth::user()->getAuthIdentifier();\n $calendar_event->admin_id = $request->input('selectAdmin');\n\n $calendar_event->save();\n }",
"public function setDataCalculo($dtDataCalculo) {\n $this->dtDataCalculo = $dtDataCalculo;\n }",
"public function initEvent()\n {\n $this->owner->{$this->createdAtField} = date($this->format);\n $this->owner->{$this->updatedAtField} = date($this->format);\n }",
"public function update() {\n $hasduedate = isset($this->mumie->duedate) && $this->mumie->duedate > 0;\n if (!$this->event && $hasduedate) {\n $this->create_calendar_event(\n self::EVENT_TYPE,\n $this->mumie->duedate\n );\n } else if ($this->event && $hasduedate) {\n $update = new \\stdClass();\n $update->name = $this->title;\n $update->timestart = $this->mumie->duedate;\n $this->event->update($update, false);\n } else if ($this->event && !$hasduedate) {\n $this->event->delete();\n }\n }",
"public function eventsSetData($data) {\r\n\t\t$this->data = $data;\r\n\t\treturn( true );\r\n\t}",
"public function setData(array $data)\n\t{\n\t\t$this->date_data = $data;\n\t\treturn $this;\n\t}",
"public function setData( ) {\r\n\t\t\tself::callEvent('response.setData', $this, func_get_args());\r\n\t\t}",
"public function set($id, CalendarEventInterface $event)\n {\n $this->events[$id] = $event;\n return $this->events;\n }",
"protected function set_up()\n {\n $eventFeedText = file_get_contents(\n 'Zend/Gdata/Calendar/_files/EventFeedCompositeSample1.xml',\n true\n );\n $this->eventFeed = new Zend_Gdata_Calendar_EventFeed($eventFeedText);\n }",
"public function add_event($data)\n {\n $datafields = array\n ('start' => array('req' => true)\n ,'end' => array('req' => true)\n ,'gid' => array('req' => true)\n ,'title' => array('req' => false, 'def' => '')\n ,'description' => array('req' => false, 'def' => '')\n ,'location' => array('req' => false, 'def' => '')\n ,'type' => array('req' => false, 'def' => 0)\n ,'status' => array('req' => false, 'def' => 0)\n ,'opaque' => array('req' => false, 'def' => 1)\n ,'uuid' => array('req' => false, 'def' => basics::uuid())\n );\n foreach ($datafields as $k => $v) {\n if (!isset($data[$k])) {\n if ($v['req'] === true) {\n return false;\n }\n $data[$k] = $v['def'];\n } else {\n $data[$k] = $this->esc($data[$k]);\n }\n }\n if (empty($data['gid'])) {\n $data['gid'] = 0;\n }\n\n // Am I the owner?\n if (!empty($data['gid']) && $this->getGroupOwner($data['gid']) != $this->uid) {\n // If not, I should have write permissions through a share\n if (!empty($GLOBALS['DB']->features['groups'])) {\n $perms = $GLOBALS['DB']->getUserSharedFolderPermissions($this->uid, 'calendar', $data['gid']);\n }\n if (empty($perms) || empty($perms['write'])) {\n // No, I haven't\n return false;\n }\n }\n\n $query = 'INSERT '.$this->Tbl['cal_event']\n .' (`uid`,`gid`,`starts`,`ends`,`title`,`description`,`location`,`type`,`status`,`opaque`,`uuid`,`lastmod`) VALUES ('\n .$this->uid.', \"'.$data['gid'].'\" ,\"'.$data['start'].'\",\"'.$data['end'].'\",\"'.$data['title'].'\",\"'.$data['description'].'\"'\n .',\"'.$data['location'].'\",'.doubleval($data['type']).','.doubleval($data['status']).',\"'.doubleval($data['opaque']).'\", \"'.$data['uuid'].'\",NOW())';\n if (!$this->query($query)) {\n return false;\n }\n $newId = $this->insertid();\n // Make sure, the end of an event is NOT before its beginning\n $this->query('UPDATE '.$this->Tbl['cal_event'].' SET `ends`=`starts` WHERE `ends`<`starts` AND id='.$newId);\n\n if (isset($data['attendees']) && !empty($data['attendees'])) {\n $query = 'INSERT INTO '.$this->Tbl['cal_attendee'].' (`eid`,`ref`,`name`,`email`,`role`,`type`,`status`,`mailhash`) VALUES ';\n $k = 0;\n foreach ($data['attendees'] as $v) {\n if ($k) {\n $query .= ',';\n }\n $query .= '('.doubleval($newId).',\"evt\",\"'.$this->esc($v['name']).'\",\"'.$this->esc($v['email']).'\"'\n .',\"'.$this->esc($v['role']).'\",\"'.$this->esc($v['type']).'\",'.doubleval($v['status'])\n .',\"'.$this->esc(basics::uuid()).'\")';\n $k++;\n }\n $this->query($query);\n }\n\n if (isset($data['reminders']) && !empty($data['reminders'])) {\n $query = 'INSERT INTO '.$this->Tbl['cal_reminder'].' (`eid`,`ref`,`uid`,`mode`,`time`,`text`,`smsto`,`mailto`) VALUES ';\n $k = 0;\n foreach ($data['reminders'] as $v) {\n if ($k) {\n $query .= ',';\n }\n if ($v['mode'] == '-') {\n continue;\n }\n $query .= '('.doubleval($newId).',\"evt\",'.$this->uid.',\"'.$this->esc($v['mode']).'\",'.doubleval($v['time'])\n .',\"'.$this->esc($v['text']).'\"'\n .',\"'.(!empty($v['smsto']) ? $this->esc($v['smsto']) : '').'\"'\n .',\"'.(!empty($v['mailto']) ? $this->esc($v['mailto']) : '').'\")';\n $k++;\n }\n if ($k > 0) {\n $this->query($query);\n }\n }\n if (isset($data['repetitions']) && !empty($data['repetitions'])) {\n $query = 'INSERT INTO '.$this->Tbl['cal_repetition'].' (`eid`,`ref`,`type`,`repeat`,`extra`,`until`) VALUES ';\n $k = 0;\n foreach ($data['repetitions'] as $v) {\n if ($k) {\n $query .= ',';\n }\n $query .= '('.doubleval($newId).',\"evt\",\"'.$this->esc($v['type']).'\",'.doubleval($v['repeat'])\n .','.(isset($v['extra']) && !is_null($v['extra']) ? '\"'.$this->esc($v['extra']).'\"' : '\"\"')\n .','.(isset($v['until']) && !is_null($v['until']) ? '\"'.$this->esc($v['until']).'\"' : 'NULL').')';\n $k++;\n }\n if ($k > 0) {\n $this->query($query);\n }\n } else {\n $query = 'INSERT INTO '.$this->Tbl['cal_repetition'].' (`eid`,`ref`,`type`,`repeat`,`extra`,`until`) VALUES '\n .'('.doubleval($newId).',\"evt\",\"-\",0,\"\",NULL)';\n $this->query($query);\n }\n return $newId;\n }",
"private function setData($data){\n\t\n\t\t$this->setIdusuario($data['idusuario']);\n\t\t$this->setDeslogin($data['deslogin']);\n\t\t$this->setDessenha($data['dessenha']);\n\t\t$this->setDtcadastro(new DateTime($data['dtcadastro']));\t\t\n\t}",
"public function setData($data)\n {\n $this->_data = $data;\n }",
"public static function setData($data) {}",
"public function __construct($data)\n {\n $this->event = $data;\n }",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n {\n $this->data = $data;\n }",
"public function setData()\n {\n $this->data=new \\DateTime('now');\n\n }",
"public function setCalendarProperties($date, $recur = false) {\n if(!empty($recur)) {\n $startField = \"InstanceStartDateTime\";\n $finishField = \"InstanceFinishDateTime\";\n } else {\n $startField = \"StartDateTime\";\n $finishField = \"FinishDateTime\";\n }\n\n if(date('Y-m-d', strtotime($this->getField($startField))) != date('Y-m-d', strtotime($this->getField($finishField)))) {\n // If this is a multi-day event\n $this->Span = 'ongoing';\n }\n\n if(date('Y-m-d', strtotime($this->getField($startField))) == $date) {\n // If the specified calendar date is the events start date\n $this->Position = 'first';\n } elseif (date('Y-m-d', strtotime($this->getField($finishField))) == $date) {\n // If the specified calendar date is the events finsh date\n $this->Position = 'last';\n }\n\n return $this;\n\n }",
"public function setData() {\n\t\t$this->import($this->get());\n\t}",
"private function _setUpEvent(\n CalendarEvent $event,\n \\SimpleXMLElement $xmlElement\n ) {\n switch ($xmlElement->getName())\n {\n case 'href':\n $event->setUrl((string) $xmlElement);\n break;\n case 'dtstart':\n $event->from((string) $xmlElement);\n break;\n case 'dtend':\n $event->to((string) $xmlElement);\n break;\n case 'location':\n $event->at((string) $xmlElement);\n break;\n case 'subject':\n $event->withSubject((string) $xmlElement);\n break;\n case 'htmldescription':\n $event->withDescription((string) $xmlElement);\n break;\n }\n\n }",
"function _getCalendarData( $year, $month, $day){\t\t\t\t\n\t\t$rows = $this->_listIcalEventsByMonth( $year, $month);\n \t\t\n\t\t$rowcount = count( $rows );\t\t\n\t\t$data = array();\n\t\t$data['year'] = $year;\n\t\t$data['month'] = $month;\n\t\t$month = intval($month);\n\t\tif( $month <= '9' ) {\n\t\t\t$month = '0' . $month;\n\t\t}\n\t\t$data['startday'] = $startday = (int) EventBookingHelper::getConfigValue('calendar_start_date');\t\t\n\t\t// get days in week\n\t\t$data[\"daynames\"] = array();\n\t\tfor( $i = 0; $i < 7; $i++ ) {\n\t\t\t$data[\"daynames\"][$i] = $this->_getDayName(($i+$startday)%7, true );\n\t\t}\t\t\n\t\t$data[\"dates\"]=array();\t\t\n\t\t//Start days\n\t\t$start = (( date( 'w', mktime( 0, 0, 0, $month, 1, $year )) - $startday + 7 ) % 7 );\t\t\n\t\t// previous month\n\t\t$priorMonth = $month-1;\n\t\t$priorYear = $year;\t\t\n\t\tif ($priorMonth <= 0) {\n\t\t\t$priorMonth += 12;\n\t\t\t$priorYear -= 1;\n\t\t}\t\t\t\n\t\t$dayCount=0;\n\t\tfor( $a = $start; $a > 0; $a-- ){\n\t\t\t$data[\"dates\"][$dayCount] = array();\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"] = \"prior\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"] = $priorMonth;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"] = $priorYear;\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay'] = 0;\n\t\t\t$dayCount++;\n\t\t}\n\t\tsort($data[\"dates\"]);\n\t\t//Current month\n\t\t$end = date( 't', mktime( 0, 0, 0,( $month + 1 ), 0, $year ));\n\t\tfor( $d = 1; $d <= $end; $d++ ){\n\t\t\t$data[\"dates\"][$dayCount]=array();\n\t\t\t// utility field used to keep track of events displayed in a day!\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay']=0;\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"]=\"current\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"]=$month;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"]=$year;\t\t\n\t\t\t\t\t\t\n\t\t\t$t_datenow = $this->_getNow();\n\t\t\t$now_adjusted = $t_datenow->toUnix(true);\n\t\t\tif( $month == strftime( '%m', $now_adjusted)\n\t\t\t&& $year == strftime( '%Y', $now_adjusted)\n\t\t\t&& $d == strftime( '%d', $now_adjusted)) {\n\t\t\t\t$data[\"dates\"][$dayCount][\"today\"]=true;\n\t\t\t}else{\n\t\t\t\t$data[\"dates\"][$dayCount][\"today\"]=false;\n\t\t\t}\n\t\t\t$data[\"dates\"][$dayCount]['d']=$d;\t\t\t\t\t\t\n\t\t\t$data[\"dates\"][$dayCount]['events'] = array();\n\t\t\tif( $rowcount > 0 ){\n\t\t\t\tforeach ($rows as $row) {\n\t\t\t\t\t\t$date_of_event = explode('-',$row->event_date);\n\t\t\t\t\t\t$date_of_event = (int)$date_of_event[2];\t\t\t\t\t\t\n\t\t\t\t\t\tif ($d == $date_of_event ){\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$i=count($data[\"dates\"][$dayCount]['events']);\n\t\t\t\t\t\t\t$data[\"dates\"][$dayCount]['events'][$i] = $row;\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t$dayCount++;\n\t\t}\t\n \t\n\t\t// followmonth\n\t\t$days \t= ( 7 - date( 'w', mktime( 0, 0, 0, $month + 1, 1, $year )) + $startday ) %7;\n\t\t$d\t\t= 1;\n\t\t$followMonth = $month+1;\n\t\t$followYear = $year;\n\t\tif ($followMonth>12) {\n\t\t\t$followMonth-=12;\n\t\t\t$followYear+=1;\n\t\t}\n\t\t$data[\"followingMonth\"]=array();\n\t\tfor( $d = 1; $d <= $days; $d++ ) {\n\t\t\t$data[\"dates\"][$dayCount]=array();\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"]=\"following\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"]=$followMonth;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"]=$followYear;\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay']=0;\n\t\t\t$dayCount++;\n\t\t}\n\t\treturn $data;\t\t\n\t}",
"public function set_all_data($data)\n\t{\n\t\t$this->_data = $data;\n\t}",
"public function set_data($data)\n {\n }",
"public function set_data($data)\n {\n }",
"final public function setData($data) {\n $this->data = $data;\n }",
"public function setData($data) {\n $this->data = $data;\n }",
"public function calendars()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name' => 'category',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'site_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'not' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'not' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'status',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => 'open'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_end',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t)\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Convert calendar_name to calendar_id\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('calendar_id') == '' AND\n\t\t\t$this->P->value('calendar_name') != '')\n\t\t{\n\t\t\t$ids = $this->data->get_calendar_id_from_name(\n\t\t\t\t$this->P->value('calendar_name'),\n\t\t\t\tNULL,\n\t\t\t\t$this->P->params['calendar_name']['details']['not']\n\t\t\t);\n\n\t\t\tif ( empty( $ids ) )\n\t\t\t{\n\t\t\t\t//ee()->TMPL->log_item('Calendar: No results for\n\t\t\t\t//calendar name provided, bailing');\n\t\t\t\treturn $this->no_results();\n\t\t\t}\n\n\t\t\t$this->P->set('calendar_id', implode('|', $ids));\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Determine which calendars this user has permission to view\n\t\t// and modify the parameters accordingly.\n\t\t// -------------------------------------\n\n\t\t// TODO\n\n\t\t// -------------------------------------\n\t\t// Fetch the basics\n\t\t// -------------------------------------\n\n\t\t$data = $this->data->fetch_calendars_basics(\n\t\t\t$this->P->value('site_id'),\n\t\t\t$this->P->value('calendar_id'),\n\t\t\t$this->P->params['calendar_id']['details']['not']\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// If no data, then give 'em no_results\n\t\t// -------------------------------------\n\n\t\tif (($total_results = count($data)) == 0)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: No results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Ensure date_range_start <= date_range_end\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('date_range_start') !== FALSE AND\n\t\t\t$this->P->value('date_range_end') !== FALSE)\n\t\t{\n\t\t\tif ($this->P->value('date_range_start', 'ymd') > $this->P->value('date_range_end', 'ymd'))\n\t\t\t{\n\t\t\t\t$temp = $this->P->params['date_range_start']['value'];\n\t\t\t\t$this->P->set('date_range_start', $this->P->params['date_range_end']['value']);\n\t\t\t\t$this->P->set('date_range_end', $temp);\n\t\t\t\tunset($temp);\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// This will come in handy later\n\t\t// -------------------------------------\n\n\t\t$calendar_array = array();\n\t\tforeach ($data as $k => $arr)\n\t\t{\n\t\t\t$calendar_array[] = $arr['calendar_id'];\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Date range params? Then we need to do a lot more work.\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('date_range_start') !== FALSE OR\n\t\t\t$this->P->value('date_range_end') !== FALSE)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: Calculating date ranges');\n\t\t\t$min = ($this->P->value('date_range_start') !== FALSE) ?\n\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') :\n\t\t\t\t\t\t0;\n\n\t\t\t$max = ($this->P->value('date_range_end') !== FALSE) ?\n\t\t\t\t$this->P->value('date_range_end', 'ymd') :\n\t\t\t\t0;\n\n\t\t\t$calendar_array = $this->data->fetch_calendars_with_events_in_date_range(\n\t\t\t\t$min,\n\t\t\t\t$max,\n\t\t\t\t$calendar_array,\n\t\t\t\t$this->P->value('status')\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// No calendars? No results.\n\t\t// -------------------------------------\n\n\t\tif (empty($calendar_array))\n\t\t{\n//ee()->TMPL->log_item('Calendar: No calendars, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tInvoke Channel class\n\t\t//\t----------------------------------------\n\n\t\tif ( ! class_exists('Channel') )\n\t\t{\n\t\t\trequire PATH_MOD.'/channel/mod.channel.php';\n\t\t}\n\n\t\t$channel = new Channel();\n\n\t\t//need to remove limit here so huge amounts of events work\n\t\t$channel->limit = 1000000;\n\n\t\t// --------------------------------------------\n\t\t// Invoke Pagination for EE 2.4 and Above\n\t\t// --------------------------------------------\n\n\t\t$channel = $this->add_pag_to_channel($channel);\n\n\t\t// -------------------------------------\n\t\t// Prepare parameters\n\t\t// -------------------------------------\n\n\t\tee()->TMPL->tagparams['entry_id'] = implode('|', $calendar_array);\n\t\tee()->TMPL->tagparams['channel'] = CALENDAR_CALENDARS_CHANNEL_NAME;\n\n\t\t// -------------------------------------\n\t\t// Pre-process related data\n\t\t// -------------------------------------\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\n\t\t\tee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data(\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t\tee()->TMPL->var_single = array_merge(\n\t\t\t\tee()->TMPL->var_single,\n\t\t\t\tee()->TMPL->related_markers\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Execute needed methods\n\t\t// -------------------------------------\n\n\t\t$channel->fetch_custom_channel_fields();\n\n\t\t$channel->fetch_custom_member_fields();\n\n\t\t// --------------------------------------------\n\t\t// Pagination Tags Parsed Out\n\t\t// --------------------------------------------\n\n\t\t$this->fetch_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Querification\n\t\t// -------------------------------------\n\n\t\t$channel->build_sql_query();\n\n\t\tif ($channel->sql == '')\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query = ee()->db->query($channel->sql);\n\n\t\tif ($channel->query->num_rows() == 0)\n\t\t{\n//ee()->TMPL->log_item('Calendar: Channel module says no results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query->result\t= $channel->query->result_array();\n\n\t\t// -------------------------------------------\n\t\t// 'calendar_calendars_channel_query' hook.\n\t\t// - Do something with the channel query\n\n\t\tif (ee()->extensions->active_hook('calendar_calendars_channel_query') === TRUE)\n\t\t{\n\t\t\t$channel->query = ee()->extensions->call('calendar_calendars_channel_query', $channel->query, $calendar_array);\n\t\t\tif (ee()->extensions->end_script === TRUE) return;\n\t\t}\n\t\t//\n\t\t// -------------------------------------------\n\n\t\t// -------------------------------------\n\t\t// Inject Calendar-specific variables\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Adding Calendar variables');\n\n\t\t$aliases = array(\n\t\t\t'title'\t\t\t=> 'calendar_title',\n\t\t\t'url_title'\t\t=> 'calendar_url_title',\n\t\t\t'entry_id'\t\t=> 'calendar_id',\n\t\t\t'author_id'\t\t=> 'calendar_author_id',\n\t\t\t'author'\t\t=> 'calendar_author',\n\t\t\t'status'\t\t=> 'calendar_status'\n\t\t);\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$aliases['url_title'] = 'calendar_borked_title';\n\n\t\t\tee()->TMPL->var_single['calendar_borked_title'] = 'calendar_borked_title';\n\n\t\t\tunset(ee()->TMPL->var_single['calendar_url_title']);\n\n\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_url_title' . RD,\n\t\t\t\t\t'\"calendar_url_title\"',\n\t\t\t\t\t\"'calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_borked_title' . RD,\n\t\t\t\t\t'\"calendar_borked_title\"',\n\t\t\t\t\t\"'calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t}\n\n\t\tforeach ($channel->query->result as $k => $row)\n\t\t{\n\t\t\t$channel->query->result[$k]['author'] = ($row['screen_name'] != '') ?\n\t\t\t\t\t\t\t\t\t\t$row['screen_name'] : $row['username'];\n\n\t\t\tforeach ($aliases as $old => $new)\n\t\t\t{\n\t\t\t\t$channel->query->result[$k][$new] = $channel->query->result[$k][$old];\n\t\t\t}\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tRedeclare\n\t\t//\t----------------------------------------\n\t\t//\tWe will reassign the $channel->query->result with our\n\t\t//\treordered array of values.\n\t\t//\t----------------------------------------\n\n\t\t$channel->query->result_array = $channel->query->result;\n\n\t\t// --------------------------------------------\n\t\t// Typography\n\t\t// --------------------------------------------\n\n\t\tee()->load->library('typography');\n\t\tee()->typography->initialize();\n\t\tee()->typography->convert_curly = FALSE;\n\n\t\t$channel->fetch_categories();\n\n\t\t// -------------------------------------\n\t\t// Parse\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing, via channel module');\n\n\n\n\t\t$channel->parse_channel_entries();\n\n\t\t// -------------------------------------\n\t\t// Paginate\n\t\t// -------------------------------------\n\n\t\t$channel = $this->add_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Related entries\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing related entries, via Weblog module');\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\t\t\tif (count(ee()->TMPL->related_data) > 0 AND\n\t\t\t\tcount($channel->related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_related_entries();\n\t\t\t}\n\n\t\t\tif (count(ee()->TMPL->reverse_related_data) > 0 AND\n\t\t\t\tcount($channel->reverse_related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_reverse_related_entries();\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Send 'em home\n\t\t// -------------------------------------\n\n\t\t$tagdata = $channel->return_data;\n\n\t\t//ee()->TMPL->log_item('Calendar: Done!');\n\n\t\t//on the off chance someone just wrote the word\n\t\t//'calendar_url_title', we should fix that before\n\t\t//output. (See above calendar_url_title fix)\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_borked_title' . RD,\n\t\t\t\t\t'\"calendar_borked_title\"',\n\t\t\t\t\t\"'calendar_borked_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_url_title' . RD,\n\t\t\t\t\t'\"calendar_url_title\"',\n\t\t\t\t\t\"'calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\t\t}\n\n\t\treturn $tagdata;\n\n\t}",
"public function initialize_from_google_calendar_event($google_calendar_event)\n\t{\n\t\tif (isset($google_calendar_event[c_google_calendar::k_key_location]))\n\t\t{\n\t\t\t$this->m_data[self::k_key_address][self::k_key_address_street1]= $google_calendar_event[c_google_calendar::k_key_location];\n\t\t}\n\t\tif (isset($google_calendar_event[c_google_calendar::k_key_start_time]) &&\n\t\t\tisset($google_calendar_event[c_google_calendar::k_key_start_time][c_google_calendar::k_key_start_date_time]))\n\t\t{\n\t\t\t//$bbbs_event['datebegin']= strtotime($google_event['start']['dateTime']) * 1000;\n\t\t\t$time_zone= isset($google_calendar_event[c_google_calendar::k_key_start_time][c_google_calendar::k_key_time_zone]) ?\n\t\t\t\tnew DateTimeZone($google_calendar_event[c_google_calendar::k_key_start_time][c_google_calendar::k_key_time_zone]) :\n\t\t\t\tnew DateTimeZone(\"UTC\");\n\t\t\t$this->m_data[self::k_key_start_time]= new DateTime(\n\t\t\t\t$google_calendar_event[c_google_calendar::k_key_start_time][c_google_calendar::k_key_start_date_time],\n\t\t\t\t$time_zone);\n\t\t}\n\t\tif (isset($google_calendar_event[c_google_calendar::k_key_title]))\n\t\t{\n\t\t\t$this->m_data[self::k_key_title]= $google_calendar_event[c_google_calendar::k_key_title];\n\t\t}\n\t\tif (isset($google_calendar_event[c_google_calendar::k_key_url]))\n\t\t{\n\t\t\t$this->m_data[self::k_key_url]= $google_calendar_event[c_google_calendar::k_key_url];\n\t\t}\n\t\t\n\t\t// handle description last, since parsing this field may (re)set other event parameters\n\t\tif (isset($google_calendar_event[c_google_calendar::k_key_description]))\n\t\t{\n\t\t\t$this->m_data[self::k_key_description]= $google_calendar_event[c_google_calendar::k_key_description];\n\t\t\tif (PARSE_GCAL_EVENT_DESCRIPTION)\n\t\t\t{\n\t\t\t\t// attempt to extract additional event details from the provided event description field\n\t\t\t\t$this->parse_google_calendar_event_description_field_parameters($google_calendar_event[c_google_calendar::k_key_description]);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn;\n\t}",
"public function setData($data)\r\n\t{\r\n\t\t$this->data = $data;\r\n\t}",
"public function setData( $data )\n {\n $this->data = $data;\n }",
"public function setClient($clientObject) {\n\t\t$this->service = new Google_Service_Calendar($clientObject); \n\t}",
"public function saveCalendar($appointment = null){\n $client = Yii::$app->calendarService;\n return $client->save(['sid'=>$this->sid,'appointment'=>$appointment]);\n }",
"function bindEventObject()\r\n\t{\r\n JTable::addIncludePath( JPATH_ADMINISTRATOR . '/components/com_calendar/tables' );\r\n\t\t$table = JTable::getInstance( 'Events', 'CalendarTable' );\r\n\t\t\r\n\t if (!empty($this->event_id))\r\n\t {\r\n\t $table->load( $this->event_id );\r\n\t }\r\n\t \r\n\t\t$table->trimProperties();\r\n\t\t\r\n\t\t$properties = $this->getProperties();\r\n\t\t$table_properties = $table->getProperties();\r\n\r\n\t\tforeach ($table_properties as $prop=>$value)\r\n\t\t{\r\n\t\t if (!array_key_exists($prop, $properties))\r\n\t\t {\r\n\t\t $this->$prop = $table->$prop;\r\n\t\t }\r\n\t\t}\r\n\t}",
"public function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"public function set_data($data)\n {\n $this->data = $data;\n }",
"public function setData($data)\n {\n $this->data = $data;\n }",
"public function setData($data)\n {\n $this->data = $data;\n }",
"protected function get_calendar_data(){\r\n global $user;\r\n \r\n \r\n if (Go_to::is_on_page(\"edit_room\")){\r\n $this->room_name = $_GET['room'];\r\n $this->owner = $user->username();\r\n $this->facility_name = $_SESSION['active_fac'] ;\r\n// $this->room = $user->username()\";\r\n// var_dump($_SESSION);\r\n// var_dump($this);\r\n }\r\n \r\n \r\n \r\n\r\n }",
"public function setData($data) \n\t{\n $this->data = $data;\n }",
"public function set($data);",
"public function setCalendar(Mymodules_Google_Model_Calendar $calendar)\r\n {\r\n $this->_calendar = $calendar;\r\n\r\n return $this;\r\n }",
"public function setData($data) { \n $this->data = $data; \n }",
"private function setData($data)\n {\n \t$this->data = $data;\n }",
"public function setData($data)\r\n {\r\n }",
"private function set_date()\r\n\t{\r\n\t\tif ($this->month > 12)\r\n\t\t{\r\n\t\t\t$this->month=1;\r\n\t\t\t$this->year++;\r\n\t\t}\r\n\r\n\t\tif ($this->month < 1)\r\n\t\t{\r\n\t\t\t$this->month=12;\r\n\t\t\t$this->year--;\r\n\t\t}\r\n\r\n\t\tif ($this->year > 2037) $this->year = 2037;\r\n\t\tif ($this->year < 1971) $this->year = 1971;\r\n\t}",
"public function ics_update()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'category',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'site_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'min_value' => 1,\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'min_value' => 1,\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_name',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'minute_interval',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 60\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'status',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => 'open'\n\t\t\t\t\t)\n\t\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// If we are not currently in the time range, scram\n\t\t// -------------------------------------\n\n\t\t$time = date('Hi', time());\n\n\t\tif ($this->P->value('time_range_start', 'time') !== FALSE AND\n\t\t\t$this->P->value('time_range_start', 'time') > $time)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: It is not time to update icalendar data yet.');\n\t\t\treturn;\n\t\t}\n\t\telse if ($this->P->value('time_range_end', 'time') !== FALSE AND\n\t\t\t\t$this->P->value('time_range_end', 'time') < $time)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: The time to update icalendar data has passed.');\n\t\t\treturn;\n\t\t}\n\n\t\tif ($this->P->value('calendar_id') == '')\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// For those who prefer names over numbers\n\t\t\t// -------------------------------------\n\n\t\t\tif ($this->P->value('calendar_name') != '')\n\t\t\t{\n\t\t\t\t$ids = $this->data->get_calendar_id_from_name($this->P->value('calendar_name'));\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Just a site ID -- get all calendars\n\t\t\t// -------------------------------------\n\n\t\t\telse\n\t\t\t{\n\t\t\t\t$ids = $this->data->get_calendars_by_site_id($this->P->value('site_id'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ids = explode('|', $this->P->value('calendar_id'));\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Only look at calendars that are due for an update\n\t\t// -------------------------------------\n\n\t\tif ( ! empty($ids) AND $this->P->value('minute_interval') !== FALSE)\n\t\t{\n\t\t\t$ids = $this->data->get_calendars_needing_update(\n\t\t\t\t$ids,\n\t\t\t\t$this->P->value('minute_interval')\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Leave if empty\n\t\t// -------------------------------------\n\n\t\tif (empty($ids))\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: Nobody is due for an update');\n\t\t\treturn;\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Go get those data!\n\t\t// -------------------------------------\n\n\t\t$this->actions();\n\n//ee()->TMPL->log_item('Calendar: Fetching data');\n\n\t\tforeach ($ids as $id)\n\t\t{\n\t\t\t$this->actions->import_ics_data($id);\n\t\t}\n\t}",
"public function init() {\n\n //AUTHORIZATION CHECK\n if (!$this->_helper->requireAuth()->setAuthParams('siteevent_event', null, \"view\")->isValid())\n $this->respondWithError('unauthorized');\n\n //RETURN IF SUBJECT IS ALREADY SET\n if (Engine_Api::_()->core()->hasSubject())\n $this->respondWithError('unauthorized');\n\n //SET TOPIC OR EVENT SUBJECT\n if (0 != ($organizer_id = (int) $this->_getParam('organizer_id')) &&\n null != ($organizer = Engine_Api::_()->getItem('siteevent_organizer', $organizer_id))) {\n Engine_Api::_()->core()->setSubject($organizer);\n }\n }",
"private function setData()\n {\n if ($this->config->has('auth.external_concrete')) {\n $data = $this->config->get('auth.external_concrete', '');\n } else {\n // legacy support\n $data = $this->config->get('auth.external_concrete5', '');\n }\n $authUrl = $this->urlResolver->resolve(['/ccm/system/authentication/oauth2/external_concrete/attempt_auth']);\n $attachUrl = $this->urlResolver->resolve(['/ccm/system/authentication/oauth2/external_concrete/attempt_attach']);\n $baseUrl = $this->urlResolver->resolve(['/']);\n $path = $baseUrl->getPath();\n $path->remove('index.php');\n $name = trim((string) array_get($data, 'name', t('External concrete')));\n\n $this->set('data', $data);\n $this->set('authUrl', $authUrl);\n $this->set('attachUrl', $attachUrl);\n $this->set('baseUrl', $baseUrl);\n $this->set('assetBase', $baseUrl->setPath($path));\n $this->set('name', $name);\n $this->set('user', $this->app->make(User::class));\n }",
"public function cal()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Start up\n\t\t// -------------------------------------\n\n\t\t$this->get_first_day_of_week();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$disable = array(\n\t\t\t'categories',\n\t\t\t'category_fields',\n\t\t\t'custom_fields',\n\t\t\t'member_data',\n\t\t\t'pagination',\n\t\t\t'trackbacks'\n\t\t);\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name' => 'category',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'site_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'status',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => 'open'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_end',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date',\n\t\t\t\t//'default' => 'today'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'show_days',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'default' => 1\n\t\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'show_weeks',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'show_months',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'show_years',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'time_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'time',\n\t\t\t\t'default' => '0000'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'time_range_end',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'time',\n\t\t\t\t'default' => '2359'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'day_limit',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'default' => '10'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_limit',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'default' => '0'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'first_day_of_week',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'default' => $this->first_day_of_week\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'pad_short_weeks',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'bool',\n\t\t\t\t'default' => 'yes',\n\t\t\t\t'allowed_values' => array('yes', 'no')\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'enable',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'default' => '',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'allowed_values' => $disable\n\t\t\t)\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Do some voodoo on P\n\t\t// -------------------------------------\n\n\t\t$this->process_events_params();\n\n\t\t// -------------------------------------\n\t\t// Let's go build us a gosh darn calendar!\n\t\t// -------------------------------------\n\n\t\t$this->parent_method = __FUNCTION__;\n\n\t\treturn $this->build_calendar();\n\t}",
"public function setData($dtData) {\n $this->dtData = $dtData;\n }",
"public function setEventDate($value) \n {\n $this->_fields['EventDate']['FieldValue'] = $value;\n return $this;\n }",
"protected function setData($data) {\n $this->data = collect($data);\n }",
"public function eventTypesSetData($data) {\r\n\t\t$this->data = $data;\r\n\t\treturn( true );\r\n\t}",
"public function open($calendar)\n {\n $this->calendar = $calendar;\n }",
"protected function initPdCalendarIds()\n {\n $this->pd_calendar_ids = array(\n 'A' => '[email protected]',\n 'B' => '[email protected]',\n 'C' => '[email protected]',\n 'D' => '[email protected]',\n 'E' => '[email protected]',\n );\n }",
"public function setData($data)\n {\n// -- `idVeiculo` INT(11) NOT NULL,\n// -- `idMotorista` INT(11) NOT NULL,\n// -- `idTiposFretes` INT(11) NOT NULL,\n// -- `Observacoes` VARCHAR(255) NULL DEFAULT NULL,\n// -- `ValorPedagios` DECIMAL(10,2) NOT NULL,\n// -- `Distancia` DECIMAL(10,3) NOT NULL,\n// -- `DataEntrega` DATE NULL DEFAULT NULL,\n// -- `ValorFrete` DECIMAL(10,2) NOT NULL,\n $this->SetIdNotaTransporte($data['IdNotaTransporte']);\n $this->SetIdVeiculo($data['idVeiculo']);\n $this->SetIdMotoriste($data['idMotorista']);\n $this->SetIdTipoFrete($data['idTipoFretes']);\n $this->SetDistancia($data['Distancia']); \n $this->SetValorFrete($data['ValorFrete']);\n $this->SetDataEmissao($data['DataEntrega']);\n }",
"private function setDate($data, $key, $currentDate, callable $setCallback)\n {\n if (($date = $this->getProperty($data, $key, $currentDate)) !== null) {\n if (is_string($date)) {\n $date = new \\DateTime($data[$key]);\n }\n } else {\n $date = null;\n }\n\n call_user_func($setCallback, $date);\n }",
"public function setCalendarId($id)\n {\n if ($id) {\n $this->calendarId = $id;\n }\n\n return $this;\n }",
"public function setDate($date){\n\t\t$this->date = $date;\n\t}",
"public function setData(array $data) {\n\t\t$this->_data = $data;\n\t}",
"abstract public function calendar($value, $name, $id = null, $format = null, array $attributes = array());",
"public function getCalendar() {\n return $this->calendar;\n }",
"function _initData()\r\n\t{\r\n\t\t// Lets load the content if it doesn't already exist\r\n\t\tif (empty($this->_data))\r\n\t\t{\r\n\t\t\t$event = new stdClass();\r\n\t\t\t$event->id\t\t\t\t\t= 0;\r\n\t\t\t$event->locid\t\t\t\t= 0;\r\n\t\t\t$event->catsid\t\t\t\t= 0;\r\n\t\t\t$event->dates\t\t\t\t= null;\r\n\t\t\t$event->enddates\t\t\t= null;\r\n\t\t\t$event->times\t\t\t\t= null;\r\n\t\t\t$event->endtimes\t\t\t= null;\r\n\t\t\t$event->title\t\t\t\t= null;\r\n\t\t\t$event->alias\t\t\t\t= null;\r\n\t\t\t$event->created\t\t\t\t= null;\r\n\t\t\t$event->author_ip\t\t\t= null;\r\n\t\t\t$event->created_by\t\t\t= null;\r\n\t\t\t$event->published\t\t\t= 1;\r\n\t\t\t$event->registra\t\t\t= 0;\r\n\t\t\t$event->unregistra\t\t\t= 0;\r\n\t\t\t$event->datdescription\t\t= null;\r\n\t\t\t$event->meta_keywords\t\t= null;\r\n\t\t\t$event->meta_description\t= null;\r\n\t\t\t$event->recurrence_number\t= 0;\r\n\t\t\t$event->recurrence_type\t\t= 0;\r\n\t\t\t$event->recurrence_counter\t= '0000-00-00';\r\n\t\t\t$event->datimage\t\t\t= JText::_('SELECTIMAGE');\r\n\t\t\t$event->venue\t\t\t\t= JText::_('SELECTVENUE');\r\n\t\t\t$this->_data\t\t\t\t= $event;\r\n\t\t\treturn (boolean) $this->_data;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"function setEvent() {\n \n if($_POST['am'] == 1){\n $star_time = $_POST['stime_a'] + 12 . \":\". $_POST['stime_b'];\n }else{\n $star_time = $_POST['stime_a'] . \":\". $_POST['stime_b'];\n }\n \n if($_POST['am1'] == 1){\n $end_time = $_POST['stime_c'] + 12 . \":\". $_POST['stime_d'];\n }else{\n $end_time = $_POST['stime_c'] . \":\". $_POST['stime_d'];\n }\n\n $values = array('event_id' => uniqid(),\n 'web_id' => WEB_ID,\n 'title' => $_POST['title'],\n 's_time' => $star_time,\n 'e_time' => $end_time,\n 'date' => date('Y-m-d H:i:s', strtotime($_POST['sDate'])),\n 'location' => $_POST['location'],\n 'description' => $_POST['disc'],\n 'end_date' => date('Y-m-d H:i:s', strtotime($_POST['eDate'])),\n 'visible' => \"on\"\n );\n\n $this->db->insert('events', $values);\n }",
"public function setData($data);",
"public function setData($data);",
"public function setData($data);",
"public function setData($data);",
"public function setData($data);",
"public function setDate($value) {\n\t\t$this->_date = $value;\n\t}",
"public function setCalendarName($value)\n {\n return $this->set('CalendarName', $value);\n }",
"public function setData( $data ) {\n\t\t$this->data = $data;\n\t\t$this->addField( new ACHRecordField([4,83], $data) );\n\t}",
"private function setData($data) {\r\n\t\t$this->set_cd_jogo($data[\"cd_jogo\"]);\r\n\t\t$this->set_nm_jogo($data[\"nm_jogo\"]);\r\n\t\t$this->set_vl_jogo($data[\"vl_jogo\"]);\r\n\t\t$this->set_ds_sinopse(utf8_decode($data[\"ds_sinopse\"]));\r\n\t\t$this->set_dt_lancamento($data[\"dt_lancamento_jogo\"]);\r\n\t\t$this->set_ds_requisito_minimo($data[\"ds_requesito_minimo\"]);\r\n\t\t$this->set_ds_requisito_sugerido($data[\"ds_requesito_sugerido\"]);\r\n\t}",
"function setAllData(&$data) {\n\t\t$this->_data =& $data;\n\t}",
"function update() {\n\t\t$vars = $this->params['url'];\n\t\t$this->Event->id = $vars['id'];\n\t\t$this->Event->saveField('start', $vars['start']);\n\t\t$this->Event->saveField('end', $vars['end']);\n\t\t$this->Event->saveField('all_day', $vars['allday']);\n\t}",
"public function setValues($data)\n {\n $this->name = $data['name'];\n $this->author_name = $data['author_name'];\n $this->author_surname = $data['author_surname'];\n $this->release_year = $data['release_year'];\n $this->request_date = $data['request_date'];\n $this->reserve_day = $data['reserve_day'];\n $this->return_day = $data['return_day'];\n $this->picture = $data['picture'];\n }",
"private function _ParseASToVCalendar($data, $folderid, $id) {\n $ical = new iCalComponent();\n $ical->SetType(\"VCALENDAR\");\n $ical->AddProperty(\"VERSION\", \"2.0\");\n $ical->AddProperty(\"PRODID\", \"-//z-push-contrib//NONSGML Z-Push-contrib Calendar//EN\");\n $ical->AddProperty(\"CALSCALE\", \"GREGORIAN\");\n\n if ($folderid[0] == \"C\") {\n $vevent = $this->_ParseASEventToVEvent($data, $id);\n $vevent->AddProperty(\"UID\", $id);\n $ical->AddComponent($vevent);\n if (isset($data->exceptions) && is_array($data->exceptions)) {\n foreach ($data->exceptions as $ex) {\n if (isset($ex->deleted) && $ex->deleted == \"1\") {\n if ($exdate = $vevent->GetPValue(\"EXDATE\")) {\n $vevent->SetPValue(\"EXDATE\", $exdate.\",\".gmdate(\"Ymd\\THis\\Z\", $ex->exceptionstarttime));\n }\n else {\n $vevent->AddProperty(\"EXDATE\", gmdate(\"Ymd\\THis\\Z\", $ex->exceptionstarttime));\n }\n continue;\n }\n\n $exception = $this->_ParseASEventToVEvent($ex, $id);\n if ($data->alldayevent == 1) {\n $exception->AddProperty(\"RECURRENCE-ID\", $this->_GetDateFromUTC(\"Ymd\", $ex->exceptionstarttime, $data->timezone), array(\"VALUE\" => \"DATE\"));\n }\n else {\n $exception->AddProperty(\"RECURRENCE-ID\", gmdate(\"Ymd\\THis\\Z\", $ex->exceptionstarttime));\n }\n $exception->AddProperty(\"UID\", $id);\n $ical->AddComponent($exception);\n }\n }\n }\n if ($folderid[0] == \"T\") {\n $vtodo = $this->_ParseASTaskToVTodo($data, $id);\n $vtodo->AddProperty(\"UID\", $id);\n $vtodo->AddProperty(\"DTSTAMP\", gmdate(\"Ymd\\THis\\Z\"));\n $ical->AddComponent($vtodo);\n }\n\n return $ical->Render();\n }",
"public function setData($_data)\n {\n $this->_data = $_data;\n }",
"function target_load_calendar_event($event)\n{\n\tif ($GLOBALS['VERBOSE']) pf('...'. $event['descr']);\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'calendar (event_day, event_month, event_year, link, descr)\n\tVALUES(\n\t\t'. _esc($poll['day']) .',\n\t\t'. _esc($poll['month']) .',\n\t\t'. _esc($poll['year']) .',\n\t\t'. _esc($poll['link']) .',\n\t\t'. _esc($poll['descr']) .')'\n\t);\n}",
"public static function icalendar() {\r\n $ical = \"BEGIN:VCALENDAR\".PHP_EOL;\r\n $ical .= \"VERSION:2.0\".PHP_EOL;\r\n\r\n $show_personal_bak = Calendar_Events::$calsettings->show_personal;\r\n $show_course_bak = Calendar_Events::$calsettings->show_course;\r\n $show_deadline_bak = Calendar_Events::$calsettings->show_deadline;\r\n $show_admin_bak = Calendar_Events::$calsettings->show_admin;\r\n Calendar_Events::set_calendar_settings(1,1,1,1);\r\n Calendar_Events::get_calendar_settings();\r\n $eventlist = Calendar_Events::get_calendar_events();\r\n Calendar_Events::set_calendar_settings($show_personal_bak,$show_course_bak,$show_deadline_bak,$show_admin_bak);\r\n Calendar_Events::get_calendar_settings();\r\n\r\n $events = array();\r\n foreach ($eventlist as $event) {\r\n $ical .= \"BEGIN:VEVENT\".PHP_EOL;\r\n $startdatetime = new DateTime($event->start);\r\n $ical .= \"DTSTART:\".$startdatetime->format(\"Ymd\\THis\").PHP_EOL;\r\n $duration = new DateTime($event->duration);\r\n $ical .= \"DURATION:\".$duration->format(\"\\P\\TH\\Hi\\Ms\\S\").PHP_EOL;\r\n $ical .= \"SUMMARY:[\".strtoupper($event->event_group).\"] \".$event->title.PHP_EOL;\r\n $ical .= \"DESCRIPTION:\".canonicalize_whitespace(strip_tags($event->content)).PHP_EOL;\r\n if ($event->event_group == 'deadline')\r\n {\r\n $ical .= \"BEGIN:VALARM\".PHP_EOL;\r\n $ical .= \"TRIGGER:-PT24H\".PHP_EOL;\r\n $ical .= \"DURATION:PT10H\".PHP_EOL;\r\n $ical .= \"ACTION:DISPLAY\".PHP_EOL;\r\n $ical .= \"DESCRIPTION:DEADLINE REMINDER for \".canonicalize_whitespace(strip_tags($event->title)).PHP_EOL;\r\n $ical .= \"END:VALARM\".PHP_EOL;\r\n }\r\n $ical .= \"END:VEVENT\".PHP_EOL;\r\n }\r\n $ical .= \"END:VCALENDAR\".PHP_EOL;\r\n return $ical;\r\n }"
] | [
"0.6326102",
"0.62080693",
"0.59551716",
"0.5905344",
"0.58078855",
"0.5721358",
"0.5721358",
"0.57208437",
"0.57203865",
"0.57196915",
"0.5718755",
"0.5718755",
"0.5718755",
"0.5718755",
"0.56782216",
"0.5675194",
"0.5636373",
"0.5578467",
"0.55449253",
"0.55270684",
"0.5507202",
"0.5485339",
"0.5480922",
"0.5461625",
"0.5436925",
"0.542966",
"0.539585",
"0.53921574",
"0.5391958",
"0.53855145",
"0.53690124",
"0.536639",
"0.53512615",
"0.53512615",
"0.53512615",
"0.53462803",
"0.53348947",
"0.530605",
"0.5304249",
"0.53011113",
"0.5290192",
"0.52770644",
"0.52705544",
"0.5270065",
"0.5268709",
"0.526455",
"0.52549434",
"0.52519006",
"0.5250052",
"0.5223491",
"0.5220587",
"0.52170736",
"0.5215599",
"0.5203013",
"0.5199165",
"0.5198237",
"0.5198237",
"0.5197168",
"0.5193531",
"0.5193017",
"0.5190553",
"0.51903903",
"0.51838994",
"0.5179061",
"0.5177352",
"0.51729435",
"0.51559895",
"0.51557475",
"0.51473594",
"0.5146873",
"0.5146215",
"0.5141746",
"0.5133605",
"0.5119624",
"0.5118579",
"0.5117204",
"0.5116977",
"0.51131535",
"0.51030236",
"0.5101682",
"0.5100868",
"0.50961685",
"0.50737005",
"0.50618905",
"0.5052834",
"0.5052834",
"0.5052834",
"0.5052834",
"0.5052834",
"0.5052608",
"0.50486296",
"0.5044445",
"0.50422287",
"0.504209",
"0.50319",
"0.5025209",
"0.50219893",
"0.50040406",
"0.49971342",
"0.4991336"
] | 0.70743966 | 0 |
Set the contact info from this event. | public function setContactInfo(CultureFeed_Cdb_Data_ContactInfo $contactInfo) {
$this->contactInfo = $contactInfo;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setContact($contact)\r\n {\r\n $this->contact= array();\r\n if (is_array($contact)) {\r\n foreach ($contact as $key => $value) \r\n\t\t\t{\r\n $this->contact[$key] = $value;\r\n }\r\n }\r\n }",
"public function setContact($contact): void\n {\n $this->_contact = $contact;\n }",
"public function __construct($contact)\n {\n $this->contactData = $contact;\n }",
"public function setContact($value){\n return $this->setParameter('contact', $value);\n }",
"public function getContactInfo() {\n return $this->contactInfo;\n }",
"public function __construct($contact)\n {\n $this->contact = $contact;\n }",
"public function setContactDate($date) {\n $this->date = $date;\n }",
"public function __construct($contact)\n {\n $this->contact = $contact;\n }",
"public function setContactByID($id){\n $result = \\CRest::call('crm.contact.get', [\n 'id' => $id\n ]);\n\n $result = $result['result'];\n\n $this->setName($result['NAME']);\n $this->setEmail(array_value_recursive('VALUE', $result['EMAIL']));\n $this->setPhone(array_value_recursive('VALUE', $result['PHONE']));\n $this->setCpf($result['UF_CRM_CPF']);\n }",
"public function setContactID($contact_id)\n {\n self::$contact_id = $contact_id;\n }",
"public function setInfoContact(string $title = null, string $content = null, string $image = null) {\n $this->setInfo(\"contact\", $title, $content, $image);\n }",
"public function addContact(\\aruba_telemetry\\Contact $value)\n {\n if ($this->contact === null) {\n $this->contact = new \\Protobuf\\MessageCollection();\n }\n\n $this->contact->add($value);\n }",
"public function setContact($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->contact !== $v) {\n $this->contact = $v;\n $this->modifiedColumns[OrdrhedTableMap::COL_CONTACT] = true;\n }\n\n return $this;\n }",
"public function getContact()\n {\n return $this->contact;\n }",
"public function setContact(array $contact = []): object\n\t{\n\t\tif ([] !== $this->contact) {\n\t\t\t$this->_trackValuesRemoved(count($this->contact));\n\t\t\t$this->contact = [];\n\t\t}\n\t\tif ([] === $contact) {\n\t\t\treturn $this;\n\t\t}\n\t\tforeach ($contact as $v) {\n\t\t\tif ($v instanceof FHIRStructureDefinitionContact) {\n\t\t\t\t$this->addContact($v);\n\t\t\t} else {\n\t\t\t\t$this->addContact(new FHIRStructureDefinitionContact($v));\n\t\t\t}\n\t\t}\n\t\treturn $this;\n\t}",
"function getContact()\n\t{\n\t\treturn $this->Info['Contact'];\n\t}",
"public function __construct(Contact $contact)\n {\n $this->contact = $contact;\n }",
"public function __construct(Contact $contact)\n {\n $this->contact = $contact;\n }",
"public function __construct(Contact $contact)\n {\n $this->contact = $contact;\n }",
"public function __construct(Contact $contact)\n {\n $this->contact = $contact;\n }",
"function init() {\n $contact_details = $this->get_acf_value( 'contact_details' );\n\n if ( $contact_details ) {\n $this->email = isset( $contact_details['email_address'] ) ? $contact_details['email_address'] : '';\n $this->phone = isset( $contact_details['phone_number'] ) ? $contact_details['phone_number'] : '';\n $this->address = isset( $contact_details['address'] ) ? $contact_details['address'] : '';\n }\n\n /**\n * Tracking.\n * \n * @since v1.6\n */\n $tracking = $this->get_acf_value( 'tracking', false );\n\n if ( $tracking ) {\n $this->tracking = (object) $tracking;\n }\n }",
"public function setRequestContact(?bool $requestContact): void\n {\n $this->requestContact = $requestContact;\n }",
"public function __construct($contact = null)\n {\n $this\n ->setContact($contact);\n }",
"public function getContact()\n {\n return $this->contact;\n }",
"public function getContact()\n {\n return $this->contact;\n }",
"public function getContact()\n {\n return $this->contact;\n }",
"public function __construct(Contact $contact)\n\t{\n\t\t//\n $this->contact = $contact;\n }",
"public function setRequestContact(bool $requestContact): void {\n\t\t$this->requestContact = $requestContact;\n\t}",
"public function setContact($contact = null)\n {\n // validation for constraint: string\n if (!is_null($contact) && !is_string($contact)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($contact)), __LINE__);\n }\n if (is_null($contact) || (is_array($contact) && empty($contact))) {\n unset($this->contact);\n } else {\n $this->contact = $contact;\n }\n return $this;\n }",
"public function __construct(Contact $contact)\n {\n $this->contacto = $contact;\n }",
"public function reconstruct() {\r\n\t\t\t$this->setContactData( ContactDataEntity::retrieveUserContactData( $this->getUserEntity() ) );\r\n\t\t\t\r\n\t\t}",
"public function setContacts(string $contacts)\n\t{\n\t\t$this->contacts=$contacts; \n\t\t$this->keyModified['Contacts'] = 1; \n\n\t}",
"protected function populateContactInformation(ProgramLocation $model)\n {\n if($vendor = data_get($model, 'address.owner') AND $vendor instanceOf Vendor){\n # I imagine we are working on the same model.. right?\n $model->fill([\n 'contact_name' => $vendor->contact_name ?: '' ,\n 'contact_email' => $vendor->contact_email ?: '' ,\n 'contact_phone' => $vendor->contact_phone ?: '' ,\n ]);\n }\n }",
"public function setContactName(?string $contactName): void\n {\n $this->contactName = $contactName;\n }",
"public function __construct(Contact $name)\n {\n $this->contact = $name;\n }",
"public function setEventAddress($value) \n {\n $this->_fields['EventAddress']['FieldValue'] = $value;\n return;\n }",
"public function setContacts($val)\n {\n $this->_propDict[\"contacts\"] = $val;\n return $this;\n }",
"public function setContactNumber($contact,$dataCustomerArray,$smsEnabled,$collection){\n if (isset ( $contact )) {\n if(isset($smsEnabled)){\n $collection->setContactNumber ( $dataCustomerArray );\n }else{\n $collection->setContactNumber ( $contact );\n }\n }\n return $collection;\n }",
"function ImportContact() {\n\t\t$this->log = LoggerManager::getLogger('import_contact');\n\t\t$this->db = & getSingleDBInstance();\n\t\t$colf = getColumnFields(\"Contacts\");\n\t\tforeach($colf as $key=>$value)\n\t\t\t$this->importable_fields[$key]=1;\n\t}",
"public function setContactId($value)\n {\n return $this->set('ContactId', $value);\n }",
"public function setContact($contact)\n {\n $this->contact = $contact;\n\n return $this;\n }",
"private function initContactInsertArgs() {\n $this->esitWScontact = new Api\\esitWScontact();\n $this->esitWScontactAddress = new Api\\esitWScontactAddress();\n $this->esitWScontactAttribute = new Api\\esitWScontactAttribute();\n // Defaults should be opt-out for data protection, according to best\n // practices. All boolean.\n // $doNotContact, $doNotMail, $doNotPhone, $doNotEmail, $doNotSMS, $mailThirdParty, $emailThirdParty, $phoneThirdParty, $dmEmailOptIn, $dmMailOptIn\n $this->esitWScontactDataProtection = new Api\\esitWScontactDataProtection(FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE);\n }",
"public function testUpdateMyContact()\n {\n\n }",
"public function __construct(ContactRequest $request)\n {\n $this->subject = trans('mail.subjects.contact');\n $this->data = $request;\n }",
"public function setContactID($value)\n {\n return $this->set('ContactID', $value);\n }",
"public function setReportedByCustomerContact($value)\n {\n $this->setItemValue('reported_by_customer_contact', ['id' => (int)$value]);\n }",
"public function setContactUrl(?string $contactUrl): void\n {\n $this->contactUrl = $contactUrl;\n }",
"public function __construct(ContactUs $contact)\n {\n $this->contact = $contact;\n }",
"public function setCreditInfo() {\n\t\t$this->creditInfo = $this->photo['title'] . \" by \" . $this->userName;\n\t}",
"public function contact()\n {\n add_settings_field(\n 'contact',\n apply_filters($this->plugin_name . 'label-contact', esc_html__('Contact', $this->plugin_name)),\n [$this->builder, 'text'],\n $this->plugin_name,\n $this->plugin_name . '-directives',\n [\n 'description' => 'Your contact address. Valid formats: e-mail, URL, phone number. (Required)',\n 'id' => 'contact',\n 'class' => 'text widefat hide-when-disabled',\n 'value' => isset($this->options['contact']) ? $this->options['contact'] : false,\n 'placeholder' => get_bloginfo('admin_email'),\n ]\n );\n }",
"public function getContact()\n {\n return isset($this->contact) ? $this->contact : null;\n }",
"public function setContactEmail(?string $contactEmail): void\n {\n $this->contactEmail = $contactEmail;\n }",
"function setFromName($to_set=\"noreply\"){\n\t\t\t$this->from_name = $to_set;\n\t\t}",
"public function getContactInfo()\n {\n $phoneNumbers = [];\n if (isset($this->properties['contact_mobile_phone'])) {\n $phoneNumbers[] = $this->properties['contact_mobile_phone']->value;\n }\n if (isset($this->properties['contact_home_phone'])) {\n $phoneNumbers[] = $this->properties['contact_home_phone']->value;\n }\n $emailAddresses = [];\n if (isset($this->properties['email'])) {\n $emailAddresses[] = $this->properties['email']->value;\n }\n if (isset($this->properties['contact_alt_email'])) {\n $emailAddresses[] = $this->properties['contact_alt_email']->value;\n }\n return new Model\\ContactInfo(\n $phoneNumbers,\n $emailAddresses\n );\n }",
"private function setFromData()\n {\n return $this->setEmailNameString($this->getFrom(), $this->getFromName());\n }",
"public function setContactUrl($contactUrl) {\n\t\t$this->contactUrl = $contactUrl !== null ? ((string) $contactUrl) : null;\n\t}",
"protected function setMessage(\\Google_Service_Calendar_Event $message)\n\t{\n\t\t$this->id = $message->getId();\n\t\t$this->summary = $message->getSummary();\n\t\t$this->description = $message->getDescription();\n\t}",
"public function setSender($address);",
"function editing_phonebook_contact_info($phoneContactId, $phoneContactType, $name, $phone, $address, $email, $contactPerson, $contactType){\n\t\tif( isset($phoneContactId) ){\n\t\t\tglobal $base;\n\n\t\t\t$contact_id \t= $base->clear_string($_POST[$phoneContactId]);\n\t\t\t$contact_type \t= $base->clear_string($_POST[$phoneContactType]);\n\t\t\t\n\t\t\tswitch($contact_type){\n\t\t\t\tcase 'delete-phonebook-contact':\n\t\t\t\t\tphonebook::delete_phonebook_info($contact_id);\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'update-phonebook-contact':\n\t\t\t\t\tphonebook::update_phonebook_info($contact_id, $_POST[$name], $_POST[$phone], $_POST[$address], $_POST[$email], $_POST[$contactPerson], $_POST[$contactType]);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t}",
"public function update($contact);",
"public function getContactInfo()\n {\n return array_filter([\n 'email' => $this->getEmail(),\n 'phoneNumber' => $this->getPhoneNumber(),\n ]);\n }",
"public function __construct(ContactForm $contact)\n {\n $this->contact=$contact;\n\n }",
"public function setCorrespondentAddress($value) {\n\t\tself::$_correspondentAddress = $value;\n\t}",
"public function getContactDetailAttribute()\n {\n return $this->contact()->first();\n }",
"public function setContact(\\horstoeko\\ubl\\entities\\cac\\Contact $contact)\n {\n $this->contact = $contact;\n return $this;\n }",
"function setFrom($email, $name = '') {\n\t\t$this->setData('from', array('name' => $name, 'email' => $email));\n\t}",
"public function getIdContact()\n {\n return $this->id_contact;\n }",
"protected function setTo() {}",
"protected function seteoContacto() {\n if (is_object($this->responsable)) {\n if ($this->responsable->getNombre() != '') {\n $this->arrayContacto[] = \"<nombre>\" . $this->responsable->getNombre() . \"</nombre>\";\n $this->arrayObligatorios[$this->NOMBRE] = 1;\n }\n if ($this->responsable->getApellido() != '') {\n $this->arrayContacto[] = \"<apellido>\" . $this->responsable->getApellido() . \"</apellido>\";\n $this->arrayObligatorios[$this->APELLIDO] = 1;\n }\n if ($this->responsable->getEmail() != '') {\n $this->arrayContacto[] = \"<email>\" . $this->responsable->getEmail() . \"</email>\";\n $this->arrayObligatorios[$this->EMAIL] = 1;\n }\n $this->arrayContacto[] = \"<horarioContacto>9 a 13 y 15 a 19 hs</horarioContacto>\";\n $this->arrayObligatorios[$this->HORARIOCONT] = 1;\n }\n }",
"public function __construct(Contact $contact, CustomerRequest $customerRequest)\n\t{\n $this->contact = $contact;\n $this->feedback = $contact->feedback;\n $this->customerRequest = $customerRequest;\n }",
"public function setMeetingInfo($val)\n {\n $this->_propDict[\"meetingInfo\"] = $val;\n return $this;\n }",
"public function setInfoAttribute($info)\n {\n $this->attributes['info'] = serialize($info);\n }",
"public function setContactDataFields(ContactDataFieldArray $contactDataFields);",
"public function setAddress($data=null) {\n if(!is_array($data)) {\n $b = $this->getBilling();\n $p = $this->getPayment();\n $data = array(\n 'STREET' => $b['address'],\n 'STREET2' => $b['address2'],\n 'CITY' => $b['city'],\n 'STATE' => $b['state'],\n 'COUNTRYCODE' => $b['country'],\n 'ZIP' => $b['zip'],\n 'SHIPTOPHONENUM' => $p['phone']\n );\n }\n $this->_payerAddress = $data;\n }",
"public function getContactID()\n {\n return $this->ContactID;\n }",
"public function setFakeFrom($name, $email){\n $this->fakeFrom['name'] = $name;\n $this->fakeFrom['email'] = $email;\n }",
"public function setUp() : void {\n parent::setUp();\n $this->contact = Contact::fromBasicData('[email protected]', 'First', 'Last', 'contact');\n $this->contact->save();\n }",
"public function setIdContact($id_contact)\n {\n $this->id_contact = $id_contact;\n\n return $this;\n }",
"public function setInfo($info);",
"public function setEmailCCAddress($value) { $this->_emailCCAddress = $value; }",
"public function getContactId()\n\t{\n\t\treturn $this->_contactId;\n\t}",
"public function __construct(Contact $contact)\n {\n $this->contact = $contact;\n $this->title = $contact->name.'様 | お問い合わせありがとうございます | Orchards';\n }",
"function setInfo($info) {\n\t\t\t$this->updateResponse('info', $info);\n\t\t}",
"function setCC($cc){\n\t\t\t$this->cc = $cc;\n\t\t}",
"public function getContactValues()\n\t{\n\n\t\t$settings = $this->setup->getClient()->getAllSettings();\n\n\t\t$values = $settings;\n\n\t\t$values[\"inst_name\"] = ($this->setup->getClient()->getName())\n\t\t\t? $this->setup->getClient()->getName()\n\t\t\t: $this->setup->getClient()->getId();\n\t\t$values[\"inst_info\"] = $this->setup->getClient()->getDescription();\n\n\t\t$this->form->setValuesByArray($values);\n\t}",
"public function __construct(Contacts $contacts)\n {\n $this->contacts = $contacts;\n }",
"function displayContactData($a_omit_init = false)\n\t{\n\t\t$this->checkDisplayMode(\"setup_contact_data\");\n\t\t$settings = $this->setup->getClient()->getAllSettings();\n\n\t\tif (!$a_omit_init)\n\t\t{\n\t\t\t$this->initContactDataForm();\n\t\t\t$this->getContactValues();\n\t\t}\n\t\t$this->tpl->setVariable(\"SETUP_CONTENT\", $this->form->getHTML());\n\t\t$this->tpl->setVariable(\"TXT_INFO\", $this->lng->txt(\"info_text_contact\"));\n\t\t$this->setButtonPrev(\"lang\");\n\n\t\t$check = $this->setup->checkClientContact($this->setup->client);\n\n\t\t$this->setup->getClient()->status[\"contact\"][\"status\"] = $check[\"status\"];\n\t\t$this->setup->getClient()->status[\"contact\"][\"comment\"] = $check[\"comment\"];\n\n\t\tif ($check[\"status\"])\n\t\t{\n\t\t\t$this->setButtonNext(\"proxy\");\n\t\t}\n\n\t\t$this->checkPanelMode();\n\t}",
"public function set( $recipient ) {\n\t\tswitch ( gettype( $recipient ) ) {\n\t\t\tcase 'string':\n\t\t\t\t$this->parse( $recipient );\n\t\t\t\tbreak;\n\t\t\tcase 'object':\n\t\t\t\t$recipient = (array) $recipient; // Convert and continue to 'array' case\n\t\t\tcase 'array':\n\t\t\t\tif ( isset( $recipient['name'] ) ) {\n\t\t\t\t\t$this->name = $recipient['name'];\n\t\t\t\t}\n\t\t\t\tif ( isset( $recipient['email'] ) ) {\n\t\t\t\t\t$this->email = $recipient['email'];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function setInfo( $info )\n {\n $this->data['info'] = $info;\n }",
"function changeNumber() {\r\n\t\r\n\t\t//set phone number as is, with () and - in it.\r\n\t\t$phoneNumber = $this->phone_number;\r\n\r\n\t\t//seperate phone number into 3 parts\r\n\t\t$phoneNum1 = substr($phoneNumber, -13, 3);\r\n\t\t$phoneNum2 = substr($phoneNumber, -8, 3);\r\n\t\t$phoneNum3 = substr($phoneNumber, -4, 4);\r\n\t\t\r\n\t\t//combine three parts of phone number into one.\r\n\t\t$phoneNumberFull = $phoneNum1 . $phoneNum2 . $phoneNum3;\r\n\r\n\t\t//change phoneNumber data for specific carrier\r\n\t\t$phoneCarrier = $this->carrier;\r\n\t\t\r\n\t\tswitch($phoneCarrier) {\r\n\t\t\t//Verizon\r\n\t\t\tcase \"verizon\":\r\n\t\t\t\t$phoneNumberFull .= \"@vtext.com\";\r\n\t\t\t\tbreak;\r\n\t\t\t//AT & T\r\n\t\t\tcase \"at&t\":\r\n\t\t\t\t$phoneNumberFull .= \"@txt.att.net\";\r\n\t\t\t\tbreak;\r\n\t\t\t//Sprint\r\n\t\t\tcase \"sprint\":\r\n\t\t\t\t$phoneNumberFull .= \"@messaging.sprintpcs.com\";\r\n\t\t\t\tbreak;\r\n\t\t\t//T-Mobile\r\n\t\t\tcase \"tmobile\":\r\n\t\t\t\t$phoneNumberFull .= \"@tmomail.net\";\r\n\t\t\t\tbreak;\r\n\t\t\t//Default case where error occurred.\r\n\t\t\tdefault:\r\n\t\t\t\tdie(\"Converting phoneNumber failed.<br />\");\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\t//assigns phone number to event class\r\n\t\t$this->phone_number = $phoneNumberFull;\r\n\t\r\n\t}",
"public function __construct($contacto)\n {\n $this->contacto = $contacto;\n }",
"public function contact()\n {\n return new Contact($this);\n }",
"public function saveContact() {\n $this->checkValidUser();\n\n $this->db->sql = 'UPDATE '.$this->db->dbTbl['contact'].' SET '.$this->getData('field').' = :value WHERE id = :id';\n\n $res = $this->db->execute(array(\n ':value' => $this->getData('value'),\n ':id' => $this->getData('id')\n ));\n\n if($res === false) {\n $this->output = array(\n 'success' => false,\n 'key' => 'sGty6'\n );\n } else {\n $this->output = array(\n 'success' => true,\n 'key' => 'gSeD5'\n );\n }\n\n $this->renderOutput();\n }",
"public function __construct($contact)\n {\n $this->contact=$contact;\n if($contact->archiver==1){\n $this->couleur_info='danger';\n $this->status_info=\"Archivé\";\n }\n if($contact->compte>0){\n $this->compte_info= number_format($contact->compte,0,'.',' ').' FCFA';\n }\n else{\n $this->couleurCompte_info=\"danger\";\n }\n }",
"public function retain_contact_list(){\n\t\t$contact_data = array();\t\t\n\t\tforeach($this->request->data['Client'] as $key => $data){ \n\t\t\t// for the form fields\n\t\t\tif($new_key = $this->get_key_val($key)){ \n\t\t\t\t$contact_data['Contact'][$new_key][] = $data;\n\t\t\t}\t\t\t\n\t\t}\n\t\t$this->request->data['Contact'] = '1';\n\t\t$this->set('contact_list', $contact_data);\n\t}",
"public function __construct(ContactRequest $model)\n {\n $this->model = $model;\n }",
"public function setEmailFromName($value) { $this->_emailFromName = $value; }",
"public function setAddress($value)\n {\n $this->_address = $value;\n }",
"function hook_campaignion_action_contact_alter(Contact $contact, Submission $submission, $node) {\n}",
"private function tx_magenerator_domain_model_contacts($table, &$row, t3lib_tceforms $that) {\n\n $this->removeFieldFromTca($table, 'contact');\n $contact = unserialize($row['contact']);\n\n foreach ($contact as $field => $value) {\n\n $config = array();\n if (strlen($value) > 50) {\n $config = array(\n 'type' => 'text',\n 'cols' => '50',\n 'rows' => '10',\n 'eval' => 'trim'\n );\n }\n\n $this->addFieldToTca($table, $field, $config);\n }\n\n $row = array_merge($row, $contact);\n }"
] | [
"0.6492941",
"0.6372278",
"0.61205775",
"0.5877692",
"0.58741856",
"0.5793341",
"0.5775056",
"0.57304496",
"0.56496054",
"0.56458104",
"0.56340736",
"0.5630197",
"0.56172955",
"0.55840105",
"0.5582631",
"0.5556295",
"0.5554712",
"0.55256623",
"0.55256623",
"0.55256623",
"0.55241334",
"0.5523032",
"0.5459982",
"0.5442446",
"0.5442446",
"0.5442446",
"0.5405564",
"0.5404807",
"0.53985095",
"0.5388298",
"0.53877264",
"0.5348563",
"0.5309398",
"0.53035635",
"0.52667904",
"0.5241695",
"0.5218482",
"0.5217903",
"0.5195466",
"0.5148438",
"0.5127973",
"0.5114825",
"0.5102689",
"0.51014024",
"0.50933176",
"0.5073409",
"0.5066414",
"0.50644845",
"0.50502187",
"0.50431454",
"0.50409436",
"0.5033119",
"0.50264734",
"0.50248104",
"0.5013156",
"0.5011952",
"0.5004169",
"0.5000121",
"0.4998346",
"0.4969114",
"0.49601048",
"0.4951812",
"0.4946033",
"0.49172193",
"0.4914147",
"0.4910107",
"0.4900291",
"0.48946118",
"0.48917314",
"0.4875555",
"0.4872478",
"0.4862835",
"0.48572978",
"0.48494878",
"0.48394263",
"0.4836392",
"0.4836367",
"0.48216248",
"0.4797407",
"0.4774516",
"0.4765593",
"0.4764697",
"0.47620732",
"0.47567102",
"0.47557956",
"0.47551337",
"0.4753241",
"0.4748479",
"0.4733836",
"0.47233272",
"0.47033864",
"0.47006768",
"0.46949285",
"0.4688981",
"0.4686666",
"0.4685625",
"0.46793485",
"0.4676852",
"0.46707675",
"0.46683183"
] | 0.6179459 | 2 |
Set the location from this event. | public function setLocation(CultureFeed_Cdb_Data_Location $location) {
$this->location = $location;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setEventLocation($value)\n {\n return $this->set('EventLocation', $value);\n }",
"function setLocation($location);",
"protected function setLocation($location) {\r\n // TODO: Don't really know what this is?\r\n $this->location = $this->create($location);\r\n }",
"public function setLocation($value)\n {\n $this->location = $value;\n }",
"public function setLocation($location)\n {\n $this->location = $location;\n }",
"public function setLocation($location)\n {\n $this->location = $location;\n }",
"public function setLocation(string $location): void;",
"public function setOriginLocation($location)\n {\n $this->originLocation = $location;\n }",
"public function setLocation(Location $location = null)\n {\n $this->location = $location;\n }",
"public function setLocation($value)\n {\n return $this->set('Location', $value);\n }",
"public function setPosition() {\n }",
"public function setLocation($value)\n {\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_LOCATION] \n = $value;\n }",
"public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }",
"public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }",
"public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }",
"public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }",
"public function setLocationAttribute($value)\n {\n $value=empty($value)?'0,0':$value;\n $this->attributes['location'] = DB::raw(\"POINT($value)\") ;\n }",
"public function setLocation($newLocation) {\n\t\t// verify the location is secure\n\t\t$newLocation = trim($newLocation);\n\t\t$newLocation = filter_var($newLocation, FILTER_SANITIZE_STRING);\n\t\tif(empty($newLocation) === true) {\n\t\t\tthrow(new InvalidArgumentException(\"location is empty or insecure\"));\n\t\t}\n\n\t\t// verify the location name will fit in the database\n\t\tif(strlen($newLocation) > 64) {\n\t\t\tthrow(new RangeException(\"location name too long\"));\n\t\t}\n\n\t\t// store the location\n\t\t$this->location = $newLocation;\n\t}",
"public function setCurrentLocation($location) {\n $this->currentLocation = $location;\n }",
"public function setLocation()\n\t{\n\t\t$form=$this->createForm();\n\n\t\tif($form->isValid()){\n\t\t\t$data=$form->getData();\n\n\t\t\t$this->getUser()->setLocation($this->cast('Mapper\\Location',$data['location']));\n\t\t\t$this->flush();\n\t\t\t$response=new Response();\n\t\t\t$response->redirect('/');\n\t\t\treturn $response;\n\t\t}\n\t\treturn compact('form');\n\t}",
"public function getLocation() { return $this->location; }",
"public function setLocation($location = null)\n {\n // validation for constraint: string\n if (!is_null($location) && !is_string($location)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($location, true), gettype($location)), __LINE__);\n }\n if (is_null($location) || (is_array($location) && empty($location))) {\n unset($this->location);\n } else {\n $this->location = $location;\n }\n return $this;\n }",
"public function getEventLocation() {\n\t\treturn ($this->eventLocation);\n\t}",
"public function setOfficeLocation($value)\n {\n $this->setProperty(\"OfficeLocation\", $value, true);\n }",
"public function testSetPosition ( ) {\n $this->markTestIncomplete (\n 'This test has not been implemented yet.'\n );\n\n }",
"public function setLocation($url = null);",
"public function setLocation($x_location, $y_location, $barID) {\n $this->curLocation->setLocationWithCoordinatesAndMapId($x_location, $y_location, $barID);\n }",
"public function location()\n {\n $city = $this->city;\n if ($city) {\n $subdivision = $city->subdivision;\n $country = $subdivision->country;\n\n $this->attributes['location'] = $city->name . ' ' . $subdivision->abbreviation . ', ' . $country->name;\n } else {\n $this->attributes['location'] = null;\n }\n }",
"public function setPosition()\n {\n // get the current position\n $currentX = $this->_pdf->getX();\n $currentY = $this->_pdf->getY();\n\n // save it\n $this->value['xc'] = $currentX;\n $this->value['yc'] = $currentY;\n\n if ($this->value['position']=='relative' || $this->value['position']=='absolute') {\n if ($this->value['right']!==null) {\n $x = $this->getLastWidth(true) - $this->value['right'] - $this->value['width'];\n if ($this->value['margin']['r']) $x-= $this->value['margin']['r'];\n } else {\n $x = $this->value['left'];\n if ($this->value['margin']['l']) $x+= $this->value['margin']['l'];\n }\n\n if ($this->value['bottom']!==null) {\n $y = $this->getLastHeight(true) - $this->value['bottom'] - $this->value['height'];\n if ($this->value['margin']['b']) $y-= $this->value['margin']['b'];\n } else {\n $y = $this->value['top'];\n if ($this->value['margin']['t']) $y+= $this->value['margin']['t'];\n }\n\n if ($this->value['position']=='relative') {\n $this->value['x'] = $currentX + $x;\n $this->value['y'] = $currentY + $y;\n } else {\n $this->value['x'] = $this->_getLastAbsoluteX()+$x;\n $this->value['y'] = $this->_getLastAbsoluteY()+$y;\n }\n } else {\n $this->value['x'] = $currentX;\n $this->value['y'] = $currentY;\n if ($this->value['margin']['l']) $this->value['x']+= $this->value['margin']['l'];\n if ($this->value['margin']['t']) $this->value['y']+= $this->value['margin']['t'];\n }\n\n // save the new position\n $this->_pdf->setXY($this->value['x'], $this->value['y']);\n }",
"function getLocation(){ return $this->_Location;}",
"public function setLocation(Location $location)\n\t{\n\t\t$this->location = $location;\n\t\treturn $this;\n\t}",
"public function setLocation($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->location !== $v) {\n\t\t\t$this->location = $v;\n\t\t\t$this->modifiedColumns[] = UserPeer::LOCATION;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function location()\n {\n //\n return view('event.location');\n }",
"public function get_location()\n\t{\n\t\treturn $this->location;\n\t}",
"public function getLocation() {\n return $this->location;\n }",
"public function setLocation($location)\n {\n $this->location = $location;\n return $this;\n }",
"public static function setLogLocation($location) {\n\t\tself::$log_location = $location;\n\t}",
"public function getLocation() {\r\n return $this->location;\r\n }",
"public function set_current_location() {\n\t\t\t$this->location_id = get_the_ID();\n\t\t\t$meta_data = $this->wpseo_local_locations_repository->get( [ 'id' => $this->location_id ] );\n\n\t\t\t$this->location_meta['business_type'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_type'] : '';\n\t\t\t$this->location_meta['business_address'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_address'] : '';\n\t\t\t$this->location_meta['business_address_2'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_address_2'] : '';\n\t\t\t$this->location_meta['business_city'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_city'] : '';\n\t\t\t$this->location_meta['business_state'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_state'] : '';\n\t\t\t$this->location_meta['business_zipcode'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_zipcode'] : '';\n\t\t\t$this->location_meta['business_country'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_country'] : '';\n\t\t\t$this->location_meta['business_phone'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_phone'] : '';\n\t\t\t$this->location_meta['business_phone_2nd'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_phone_2nd'] : '';\n\t\t\t$this->location_meta['business_fax'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_fax'] : '';\n\t\t\t$this->location_meta['business_email'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_email'] : '';\n\t\t\t$this->location_meta['business_url'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_url'] : '';\n\t\t\t$this->location_meta['business_vat'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_vat'] : '';\n\t\t\t$this->location_meta['business_tax'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_tax'] : '';\n\t\t\t$this->location_meta['business_coc'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_coc'] : '';\n\t\t\t$this->location_meta['business_price_range'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_price_range'] : '';\n\t\t\t$this->location_meta['business_currencies_accepted'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_currencies_accepted'] : '';\n\t\t\t$this->location_meta['business_payment_accepted'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_payment_accepted'] : '';\n\t\t\t$this->location_meta['business_area_served'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_area_served'] : '';\n\t\t\t$this->location_meta['coords']['lat'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['coords']['lat'] : '';\n\t\t\t$this->location_meta['coords']['long'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['coords']['long'] : '';\n\t\t\t$this->location_meta['business_timezone'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_timezone'] : '';\n\t\t\t$this->location_meta['business_logo'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_logo'] : '';\n\t\t\t$this->location_meta['custom_marker'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['custom_marker'] : '';\n\t\t}",
"public function getLocation()\r\n {\r\n return $this->location;\r\n }",
"public function location()\n {\n return $this->resolvedLocation ?: $this->location;\n }",
"public function setLocation($url);",
"public function getLocation();",
"public function getLocation();",
"public function setLocation(string $url): void\n {\n if (!filter_var($url, FILTER_VALIDATE_URL)) {\n throw new UserException(\"Invalid value for header: Location\");\n }\n $this->location = $url;\n }",
"public function setPhotoLocation($value)\n {\n return $this->set('PhotoLocation', $value);\n }",
"public function set_location($location_slug, $args) {\n\n // Verify if the location has valid fields\n if ( $location_slug && isset($args['location_name']) && isset($args['location_icon']) ) {\n\n // Set the location in the queue\n self::$the_locations[][$location_slug] = $args;\n \n }\n\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function setLocation(FileDescriptor $file, int $line = 0): void;",
"public function setLocation($location)\n {\n $this->setParameter('location', $location);\n\n return $this;\n }",
"public function setRequestLocation(?bool $requestLocation): void\n {\n $this->requestLocation = $requestLocation;\n }",
"public function setLocation($location)\n\t{\n\t\t$this->location = $location;\n\n\t\treturn $this;\n\t}",
"private function getLocation() {\n }",
"public function getLocation() {\n return $this->location;\n }",
"public function setRequestLocation(bool $requestLocation) {\n\t\t$this->requestLocation = $requestLocation;\n\t}",
"public function initialize(){\n $this->setSource('location');\n }",
"private function setNameLocation($newName)\n\t {\n\t $this->nameLocation = $newName;\n\t }",
"public function setLocation($location)\n {\n $this->location = $location;\n\n return $this;\n }",
"public function setLocation($location)\n {\n $this->location = $location;\n\n return $this;\n }",
"public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}",
"public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}",
"public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}",
"public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}",
"public function setOrigin(Point $origin)\n {\n $this->options['origin'] = $origin;\n }",
"public function set_locations() {\n\t\t\t$this->locations = $this->wpseo_local_locations_repository->get( [], false );\n\t\t}",
"public function setPosition($x, $y, $unit = null);",
"public function setLocation($var)\n {\n GPBUtil::checkMessage($var, \\Rect::class);\n $this->location = $var;\n\n return $this;\n }",
"public function getLocation() {\n\t\treturn($this->location);\n\t}",
"public function setCoordinate( Coordinate $coordinate ) {\n\n $this->coordinate = $coordinate;\n }",
"public function publicLocation()\n {\n return $this->state(function (array $attributes) {\n return [\n 'location' => 1,\n ];\n });\n }",
"function setPosition($s)\n\t{\n\t\t$this->Info['Position'] = $s;\n\t\tupdateTableByUser('Developer', 'Position', $s, $this->Username);\n\t}",
"function AssignLocation($location = array())\n\t{\treturn new AdminLocation($location);\n\t}",
"public function getLocation()\n\t{\n\t\treturn $this->_location;\n\t}",
"public function setEventAddress($value) \n {\n $this->_fields['EventAddress']['FieldValue'] = $value;\n return;\n }",
"public function setPreferredLocation($location) {\n $this->preferredLocation = $location;\n }",
"public function setLocation(Coordinate $start, Coordinate $end)\n {\n return $this->setStart($start)->setEnd($end);\n }",
"public function setLocation($x, $y, $alignment=Zend_Pdf_Cell::ALIGN_LEFT) {\n\t\t$this->_position=$alignment;\n\t\t$this->_x=$x;\n\t\t$this->_y=$y;\n\t\t\n\t}",
"public function setCoordinate()\n {\n $args = func_get_args();\n\n if (isset($args[0]) && ($args[0] instanceof Coordinate)) {\n $this->coordinate = $args[0];\n } elseif ((isset($args[0]) && is_numeric($args[0])) && (isset($args[1]) && is_numeric($args[1]))) {\n if (!$this->hasCoordinate()) {\n $this->coordinate = new Coordinate();\n }\n\n $this->coordinate->setLatitude($args[0]);\n $this->coordinate->setLongitude($args[1]);\n\n if (isset($args[2]) && is_bool($args[2])) {\n $this->coordinate->setNoWrap($args[2]);\n }\n } elseif (!isset($args[0])) {\n $this->coordinate = null;\n } else {\n throw GeocodingException::invalidGeocoderRequestCoordinate();\n }\n\n return $this;\n }",
"function setCoords($a_coords)\n\t{\n\t\t$this->coords = $a_coords;\n\t}",
"public function setPositionAttribute($input)\n {\n $this->attributes['position'] = $input ? $input : null;\n }",
"function setPlace( &$value )\n {\n $this->Place = $value;\n }",
"public function setEvent($Event)\r\n {\r\n $this->Event = $Event;\r\n }",
"public function setServiceLocation($val)\n {\n $this->_propDict[\"serviceLocation\"] = $val;\n return $this;\n }",
"function get_location() {\n\n\t\tif ( ! isset( $this->location ) ) {\n\t\t\t$this->location = new Workflow_Location( $this );\n\t\t\t$this->location = apply_filters( 'automatewoo/workflow/location', $this->location, $this );\n\t\t}\n\n\t\treturn $this->location;\n\t}",
"public function getLocation()\n {\n return isset($this->location) ? $this->location : null;\n }",
"public function setPosition( $position )\n\t\t{\n\t\t\t$this->_position = $position;\n\t\t}",
"public function getLocation()\n {\n return $this->get('location');\n }",
"public function setLocationId(?string $locationId): void\n {\n $this->locationId = $locationId;\n }"
] | [
"0.7046827",
"0.68352",
"0.66205657",
"0.66104794",
"0.65986675",
"0.65986675",
"0.6495043",
"0.6319889",
"0.61739516",
"0.6088395",
"0.6070066",
"0.59720474",
"0.5882476",
"0.5882476",
"0.5882476",
"0.5882476",
"0.58578193",
"0.5824926",
"0.5809232",
"0.57715595",
"0.57209647",
"0.56587744",
"0.5652027",
"0.5640163",
"0.5636914",
"0.56365323",
"0.5626983",
"0.56107056",
"0.5609019",
"0.5585674",
"0.55544496",
"0.55201334",
"0.5516686",
"0.55072504",
"0.5486095",
"0.5468386",
"0.5461185",
"0.5459827",
"0.5446826",
"0.54389083",
"0.5435006",
"0.5434424",
"0.54262435",
"0.54262435",
"0.53990304",
"0.5398623",
"0.5387344",
"0.5380288",
"0.5380288",
"0.5380288",
"0.5380288",
"0.5380288",
"0.5380288",
"0.5380288",
"0.5380288",
"0.5380288",
"0.5380288",
"0.5380288",
"0.5380288",
"0.5380288",
"0.53800017",
"0.5375618",
"0.5363739",
"0.5350169",
"0.53460735",
"0.5340768",
"0.53401303",
"0.53159577",
"0.52965224",
"0.5283196",
"0.5283196",
"0.5263583",
"0.5263583",
"0.5263583",
"0.5263583",
"0.52586466",
"0.5248634",
"0.52343404",
"0.52232605",
"0.52170557",
"0.52166057",
"0.52038",
"0.5187871",
"0.5176384",
"0.51751006",
"0.51740175",
"0.5157564",
"0.5152789",
"0.514608",
"0.51384354",
"0.512505",
"0.5115798",
"0.5108612",
"0.5095441",
"0.50854796",
"0.50561196",
"0.50347406",
"0.5021114",
"0.5017933",
"0.5015977"
] | 0.5973129 | 11 |
Set the organiser from this event. | public function setOrganiser(CultureFeed_Cdb_Data_Organiser $organiser) {
$this->organiser = $organiser;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getOrganiser() {\n return $this->organiser;\n }",
"protected function setOrganization() {}",
"public function set_organizer_key($organizer_key) {\n\t\t$_SESSION['citrix_organizer_key'] = $organizer_key;\n\t\t$this->organizer_key = $organizer_key;\n\t}",
"public function organizer()\n {\n return $this->belongsTo(User::class, 'organizer_id');\n }",
"public function setOrganisation($organisation)\n\t{\n\t\t$this->_organisation = $organisation;\n\t}",
"public function deleteOrganiser() {\n $this->organiser = NULL;\n }",
"public function isOrganizer() {\n\t\treturn $this->organizer;\n\t}",
"function getOrganisers(&$organisers, $event)\n{\n\tif( $event->has( \"event:agent\" ) )\n\t{\n\t\tforeach( $event->all( \"event:agent\" ) as $agent )\n\t\t{\n\t\t\tif(!$agent->isType(\"http://www.w3.org/ns/org#Organization\"))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$organisers[sid((string)$agent)] = $agent->label();\n\t\t\twhile($agent->has(\"-http://www.w3.org/ns/org#hasSubOrganization\"))\n\t\t\t{\n\t\t\t\t$agent = $agent->get(\"-http://www.w3.org/ns/org#hasSubOrganization\");\n\t\t\t\t$organisers[sid((string)$agent)] = $agent->label();\n\t\t\t}\n\t\t}\n\t}\n}",
"function setOrg( $org )\n {\n $org = trim( $org );\n $this->properties['ORG'] = $org;\n }",
"public function organizers()\n {\n return $this->belongsToMany('DavideCasiraghi\\LaravelEventsCalendar\\Models\\Organizer', 'event_has_organizers', 'event_id', 'organizer_id');\n }",
"public function getOrganismeAssedic() {\n return $this->organismeAssedic;\n }",
"protected function setUp()\n {\n $this->object = new Organizer;\n }",
"public function setAutor($autor)\n {\n $this->autor = $autor;\n }",
"public function setEventManager(EventManagerInterface $eventManager)\n {\n $eventManager->setIdentifiers(array(__CLASS__, get_class($this)));\n\n $this->eventManager = $eventManager;\n }",
"public function setEventManager(EventManagerInterface $eventManager)\n {\n $eventManager->setIdentifiers(array(__CLASS__, get_class($this)));\n\n $this->eventManager = $eventManager;\n }",
"public function setEventManager(EventManagerInterface $eventManager)\n {\n $eventManager->setIdentifiers(array(__CLASS__, get_class($this)));\n\n $this->eventManager = $eventManager;\n }",
"public function edit(Organizator $organizator)\n {\n //\n }",
"public function setInspector($inspector) {\n $this->_inspector = $inspector;\n }",
"function organiser($key = null)\n {\n if(!current_route_is('organiser.*'))\n return null;\n\n $organiser = request()->route('organiser');\n\n if ($key)\n return $organiser->$key;\n\n return $organiser;\n }",
"public function setCodeOrganisme(?string $codeOrganisme): RetraitesEmp {\n $this->codeOrganisme = $codeOrganisme;\n return $this;\n }",
"public function testSetAnnulationClient() {\n\n $obj = new Collaborateurs();\n\n $obj->setAnnulationClient(true);\n $this->assertEquals(true, $obj->getAnnulationClient());\n }",
"private function set_community( $community ) {\n\t\t$this->community = $community;\n\t}",
"public function setAuthor(UserInterface $author);",
"public function setAuthor(UserInterface $author);",
"public function setAuthor(UserInterface $author)\n {\n $this->author = $author;\n }",
"public function setEventManager(EventManagerInterface $eventManager)\n {\n if ($this->eventManager === $eventManager || $eventManager === null) {\n return;\n }\n\n if ($this->eventManager !== null) {\n $this->detach($this->eventManager);\n }\n\n $this->eventManager = $eventManager;\n $this->eventManager->addIdentifiers([\n 'EntityService',\n 'PolderKnowledge\\EntityService\\Service\\EntityService',\n $this->getEntityServiceName(),\n trim($this->getEntityServiceName(), '\\\\'),\n ]);\n\n $this->attach($this->eventManager);\n }",
"public function setEventManager(EventManagerInterface $eventManager)\n {\n $this->eventManager = $eventManager;\n }",
"public function getOrganisation()\n {\n return $this->organisation;\n }",
"public function setPresenter($presenter)\n\t{\n\t\t$this->presenter = $presenter;\n\t}",
"function Organization( $org )\r\n\t\t{\r\n\t\tif( trim( $org != \"\" ) )\r\n\t\t\t$this->organization= $org;\r\n\t\t}",
"public function setEditorial($editorial)\n {\n $this->editorial = $editorial;\n }",
"public function set_reporter($reporter){\r\n\t\t\t$this->_reporter = $reporter;\r\n\t\t}",
"public function getOrganization()\n {\n return $this->organization;\n }",
"public function getOrganization()\n {\n return $this->organization;\n }",
"public function getOrganization()\n {\n return $this->organization;\n }",
"public function init() {\n\n //AUTHORIZATION CHECK\n if (!$this->_helper->requireAuth()->setAuthParams('siteevent_event', null, \"view\")->isValid())\n $this->respondWithError('unauthorized');\n\n //RETURN IF SUBJECT IS ALREADY SET\n if (Engine_Api::_()->core()->hasSubject())\n $this->respondWithError('unauthorized');\n\n //SET TOPIC OR EVENT SUBJECT\n if (0 != ($organizer_id = (int) $this->_getParam('organizer_id')) &&\n null != ($organizer = Engine_Api::_()->getItem('siteevent_organizer', $organizer_id))) {\n Engine_Api::_()->core()->setSubject($organizer);\n }\n }",
"function organization ($org) {\n if(!empty($org)) $this->xheaders['Organization'] = $org;\n }",
"public function setEventManager(EventManager $eventManager)\n {\n $this->eventManager = $eventManager;\n }",
"public function show(Organizator $organizator)\n {\n //\n }",
"public function testSetOrganismeCacm() {\n\n $obj = new AttestationCacm();\n\n $obj->setOrganismeCacm(\"organismeCacm\");\n $this->assertEquals(\"organismeCacm\", $obj->getOrganismeCacm());\n }",
"public function setEventManager(EventManager $eventManager): void\n {\n $this->eventManager = $eventManager;\n }",
"Public Function setPublisherLogin($PublisherLogin) {\n\t\t$this->publisherLogin = $PublisherLogin;\n\t\n\t}",
"function setDistributor($inDistributor){\n\t\treturn $this->setParam(self::PARAM_DISTRIBUTOR, $inDistributor);\n\t}",
"function setEnvelopeSender($envelopeSender) {\n\t\t$this->setData('envelopeSender', $envelopeSender);\n\t}",
"public function getOrganisation()\n\t{\n\t\treturn $this->_organisation;\n\t}",
"public function setter() {\n return $this->belongsTo('App\\User', 'marketer');\n }",
"public function getOrganisateurSpectacle() {\n return $this->organisateurSpectacle;\n }",
"public function setArtist($artist) {\r\n $this->_artist = $artist;\r\n }",
"public function setOwner($owner) {\n\t\t$this->owner = $owner;\n\t}",
"public function setOwner($owner) {\n\t\t$this->owner = $owner;\n\t}",
"public function setAssignedToAttribute($value)\n {\n $this->attributes['assigned_to'] = $value['id'];\n }",
"public function set_autor($_autor)\n {\n $this->_autor = $_autor;\n\n return $this;\n }",
"function set_owner($owner)\n {\n $this->set_default_property(self :: PROPERTY_OWNER, $owner);\n }",
"function setEstanteria($_codigoEstanteria){\r\n $this->estanteria=$_codigoEstanteria;\r\n }",
"public function __construct($organization)\n {\n $this->organization = $organization;\n }",
"public function setOrganization($val)\n {\n $this->_propDict[\"organization\"] = $val;\n return $this;\n }",
"public function organization() {\n return $this->belongsTo('App\\Models\\Organization');\n }",
"public function setCreatedByAttribute(){\n $this->attributes['created_by'] = Auth::user()->id;\n }",
"public function organization()\n {\n return $this->belongsTo('App\\Organization');\n }",
"public function setRegistrant($value) {\n\t\tself::$_registrant = $value;\n\t}",
"public function setPublisher($val)\n {\n $this->_propDict[\"publisher\"] = $val;\n return $this;\n }",
"public function setEventManager(EventManagerInterface $events)\n {\n\n $entityManager = $this->entityManager;\n $role_id = $this->auth_user_role;\n // echo \" the fuck? ... not sure why this runs twice\";\n $events->attach('load-person', function (EventInterface $e) use ($entityManager, $role_id) {\n $person = $e->getParam('person');\n $hat = $person->getHat();\n $form = $e->getParam('form');\n $hat_options = $form->get('user')->get('person')->get('hat')\n ->getValueOptions();\n $hats_allowed = array_column($hat_options, 'value');\n if (! in_array($hat->getId(), $hats_allowed)) {\n $message = sprintf(\n 'The person identified by id %d, %s %s, wears the hat %s, '\n . 'but people in that category do not have user accounts '\n . 'in this system.',\n $person->getId(),\n $person->getFirstName(),\n $person->getLastname(),\n $hat\n );\n $controller = $e->getTarget();\n $controller->flashMessenger()->addErrorMessage($message);\n return $controller->redirect()->toRoute('users');\n }\n\n /**\n * this needs work. there are rare cases where one and the same\n * person may legitimately have to have more than one user account,\n * only one of which can be active at any one time, and each having\n * a different role from the other: 'submitter' vs any of the other\n * roles.\n */\n $user = $entityManager->getRepository('InterpretersOffice\\Entity\\User')\n ->findOneBy(['person' => $person]);\n //->getUser(['entity'=>'person','id' => $person->getId()]);\n if ($user) {\n $container = $e->getTarget()->getEvent()->getApplication()\n ->getServiceManager();\n\n $message = sprintf(\n 'We can\\'t create a new user account because this person '\n . ' (%s %s, id %d) already has one. ',\n $person->getFirstname(),\n $person->getLastname(),\n $person->getId()\n );\n $acl = $e->getTarget()->getEvent()->getApplication()\n ->getServiceManager()->get('acl');\n if ($acl->isAllowed($role_id, $user->getResourceId())) {\n $helper = $container->get('ViewHelperManager')->get('url');\n $url = $helper('users/edit', ['id' => $user->getId()]);\n $message .= sprintf(\n 'You can <a href=\"%s\">edit it</a> if you want to.',\n $url\n );\n }\n $controller = $e->getTarget();\n $controller->flashMessenger()->addErrorMessage($message);\n return $controller->redirect()->toRoute('users');\n }\n });\n // are they authorized to edit this user account?\n $events->attach('load-user', function (EventInterface $e) use ($role_id) {\n $resource_id = $e->getParam('user')->getResourceId();\n $acl = $e->getTarget()->getEvent()->getApplication()\n ->getServiceManager()->get('acl');\n if (! $acl->isAllowed($role_id, $resource_id)) {\n $controller = $e->getTarget();\n $message = \"Access denied to {$resource_id}'s user account\";\n $controller->flashMessenger()->addErrorMessage($message);\n return $controller->redirect()->toRoute('users');\n } else {\n $services = $e->getTarget()->getEvent()->getApplication()\n ->getServiceManager();\n $services->get(Entity\\Listener\\UpdateListener::class)\n ->setAuth($this->auth);\n }\n });\n\n return parent::setEventManager($events);\n }",
"public function setEmployer($employer)\n {\n $this->employer = $employer;\n }",
"public function organization()\n {\n return $this->belongsTo('F3\\Models\\Organization', 'party_id', 'party_id');\n }",
"protected function setOwner($owner) {\r\n $this->owner = $this->create($owner);\r\n }",
"public function testCanSetAndGetOrganizationName()\n {\n $mockOrgName = 'GRIIDC';\n\n $this->dataCenter->setOrganizationName($mockOrgName);\n\n $this->assertEquals($mockOrgName, $this->dataCenter->getOrganizationName());\n }",
"protected function setTo() {}",
"public function setPublisher(?string $value): void {\n $this->getBackingStore()->set('publisher', $value);\n }",
"public function setPublisher(?string $value): void {\n $this->getBackingStore()->set('publisher', $value);\n }",
"public function setPublisher(?string $value): void {\n $this->getBackingStore()->set('publisher', $value);\n }",
"public function setTransportation($transportation)\n {\n $this->_transportation = $transportation;\n }",
"public function testSetAnnulationArticle() {\n\n $obj = new Collaborateurs();\n\n $obj->setAnnulationArticle(true);\n $this->assertEquals(true, $obj->getAnnulationArticle());\n }",
"public function setCreatedBy(?IdentitySet $value): void {\n $this->getBackingStore()->set('createdBy', $value);\n }",
"public function setCreatedBy(?IdentitySet $value): void {\n $this->getBackingStore()->set('createdBy', $value);\n }",
"public function __construct(Organisation $organisation)\n {\n $this->organisation = $organisation;\n }",
"public function setPublisher($publisher = null): object\n\t{\n\t\tif (null !== $publisher && !($publisher instanceof FHIRString)) {\n\t\t\t$publisher = new FHIRString($publisher);\n\t\t}\n\t\t$this->_trackValueSet($this->publisher, $publisher);\n\t\t$this->publisher = $publisher;\n\t\treturn $this;\n\t}",
"public function setInitiator(?IdentitySet $value): void {\n $this->getBackingStore()->set('initiator', $value);\n }",
"public function setReportedBy($value)\n {\n $this->setItemValue('reported_by', ['id' => (int)$value]);\n }",
"public function setBy($x) { $this->by = $x; }",
"public function add_organiser($memberid){\n $sql = \"INSERT INTO tournamentOrganisers(tournamentID, organiserID) VALUES ($this->id, $memberid)\";\n $result = self::$database->query($sql);\n if (!$result){\n $this->errors[] = \"Insertion of organiser failed. Either member id doesnt exist or member is already an organiser.\";\n }\n }",
"public function setReceiver($receiver) {\n $this->_receiver = $receiver;\n }",
"public function setArtist($artist)\n {\n $this->artist = $artist;\n }",
"public function setVenue()\n {\n // Set the font.\n $this->AddFont('MTCORSVA', '', 'MTCORSVA.php');\n $this->SetFont('MTCORSVA', '', 18);\n\n // Line break.\n $this->Ln(11);\n\n $this->Cell(259, 35, 'Given this ' . date('jS \\d\\a\\y \\of F, Y', strtotime($this->aScheduleDetails['toDate'])) . ' at', 0, 0, 'C');\n\n // Line break.\n $this->Ln(10);\n\n $this->Cell(259, 35, $this->aScheduleDetails['address'], 0, 0, 'C');\n }",
"public function setEventManager(EventCollection $event_manager)\r\n {\r\n $this->events = $event_manager;\r\n return $this;\r\n }",
"public function getEnterer()\n {\n return $this->enterer;\n }",
"public function __construct()\n {\n $this->name = 'Organizer';\n $this->typeModule = 'back';\n }",
"public function setAgency(\\bunge\\StructType\\RespPlateAuthTransporter $agency = null)\n {\n if (is_null($agency) || (is_array($agency) && empty($agency))) {\n unset($this->agency);\n } else {\n $this->agency = $agency;\n }\n return $this;\n }",
"protected function setAuthors() {\r\n\t\t// authors, yes, we can handle more than one per article\r\n\t\t$authorsStg = $this->newsItem->getAuthor();\r\n\t\tif (!empty($authorsStg)) {\r\n\t\t\t$authors = t3lib_div::trimExplode(',', $authorsStg);\r\n\t\t\t$allowedCount = intval($this->settings['news']['semantic']['general']['author']['max']);\r\n\t\t\t$this->authors = (empty($allowedCount)) ? $authors : array_slice($authors, 0, $allowedCount);\r\n\t\t}\r\n\t}",
"public function set($identifier, $participation);",
"public function __construct(\n EventRepository $local_event_repository,\n EntryAPIImprovedFactory $improved_entry_api,\n EventImporterInterface $event_importer,\n PlaceService $place_service,\n OrganizerService $organizer_service,\n MetadataEnrichingEventStreamDecorator $event_stream_metadata_enricher,\n ConfigFactory $config\n ) {\n $this->localEventRepository = $local_event_repository;\n $this->improvedEntryApi = $improved_entry_api;\n $this->eventImporter = $event_importer;\n $this->organizerService = $organizer_service;\n $this->placeService = $place_service;\n $this->eventStreamMetadataEnricher = $event_stream_metadata_enricher;\n $this->config = $config->get('culturefeed_udb3.settings');\n }",
"protected function setSubject() {}",
"protected function setEventsManager(EventsManagerInterface $eventsManager) {}",
"public function setEventManager(EventManagerInterface $eventManager)\n {\n $eventManager->setIdentifiers(\n array(\n __CLASS__,\n get_class($this),\n )\n );\n $this->_events = $eventManager;\n return $this;\n }",
"public function setOrganismeAssedic($organismeAssedic) {\n $this->organismeAssedic = $organismeAssedic;\n return $this;\n }",
"public function initEvent()\n {\n $this->owner->{$this->createdAtField} = date($this->format);\n $this->owner->{$this->updatedAtField} = date($this->format);\n }",
"public function setAggregateResolver(ResolverInterface $aggregateResolver)\n {\n $this->aggregateResolver = $aggregateResolver;\n }",
"public function setAggregateResolver(ResolverInterface $aggregateResolver)\n {\n $this->aggregateResolver = $aggregateResolver;\n }",
"public function get_organizer_by_id( $organizer_id ) {\r\n\t\t$existing_organizer = get_posts( array(\r\n\t\t\t'posts_per_page' => 1,\r\n\t\t\t'post_type' => $this->oraganizer_posttype,\r\n\t\t\t'meta_key' => 'ime_event_organizer_id',\r\n\t\t\t'meta_value' => $organizer_id,\r\n\t\t\t'suppress_filters' => false,\r\n\t\t) );\r\n\r\n\t\tif ( is_array( $existing_organizer ) && ! empty( $existing_organizer ) ) {\r\n\t\t\treturn $existing_organizer[0]->ID;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function setCreator(UserInterface $user)\n {\n $this->entity->setCreator($user);\n }",
"public function setOrganizations(?int $value): void {\n $this->getBackingStore()->set('organizations', $value);\n }"
] | [
"0.6622959",
"0.61169004",
"0.59210384",
"0.5665311",
"0.5624373",
"0.56112605",
"0.5436014",
"0.5255994",
"0.51777697",
"0.5140903",
"0.5056154",
"0.50486976",
"0.50321203",
"0.5020482",
"0.5020482",
"0.5020482",
"0.5015321",
"0.49897176",
"0.4970243",
"0.49462056",
"0.49192056",
"0.48956954",
"0.4891",
"0.4891",
"0.488938",
"0.48780406",
"0.48684648",
"0.48647848",
"0.48354313",
"0.48285642",
"0.48282015",
"0.48268348",
"0.4807297",
"0.4807297",
"0.4807297",
"0.47888383",
"0.47869647",
"0.4776125",
"0.47743756",
"0.47591963",
"0.47558895",
"0.47324154",
"0.47153538",
"0.47116867",
"0.4694656",
"0.46830505",
"0.46752307",
"0.4675051",
"0.46737248",
"0.46737248",
"0.46607974",
"0.46567318",
"0.46550387",
"0.46516624",
"0.46397",
"0.463175",
"0.46288493",
"0.4616717",
"0.461096",
"0.46020114",
"0.458921",
"0.45878032",
"0.4582298",
"0.457718",
"0.4570258",
"0.45675895",
"0.45672366",
"0.4557325",
"0.4557325",
"0.4557325",
"0.4554845",
"0.45529926",
"0.45453104",
"0.45453104",
"0.45377025",
"0.4528113",
"0.4520987",
"0.4514225",
"0.45048258",
"0.44972256",
"0.4492026",
"0.4490058",
"0.4488262",
"0.44866148",
"0.44788122",
"0.4467601",
"0.4464267",
"0.44511622",
"0.44505897",
"0.44486663",
"0.4437937",
"0.44324592",
"0.4431639",
"0.44208866",
"0.44208342",
"0.44179425",
"0.44179425",
"0.4407028",
"0.44052312",
"0.44024518"
] | 0.72573936 | 0 |
Delete the organiser from this event. | public function deleteOrganiser() {
$this->organiser = NULL;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function destroy(Organizator $organizator)\n {\n //\n }",
"public function remove_organiser($memberid){\n $sql = \"DELETE FROM tournamentOrganisers WHERE tournamentID=$this->id AND organiserID=$memberid\";\n $result = self::$database->query($sql);\n }",
"public function delete()\n {\n if ($this->sportevent) {\n return $this->sportevent->delete();\n }\n }",
"public function delete(): void\n {\n $this->record(new AgendaWasDeleted($this->identity));\n }",
"public function destroy($event_id,$presenter)\n {\n $event = Event::find($event_id);\n if($event->organiser->id != auth()->user()->id){\n return redirect()->route(\"events.index\");\n }\n if($event->presenters()->where(\"user_id\",$presenter)->count() == 1){\n $event->presenters()->detach($presenter);\n }\n return redirect()->route(\"presenters.create\",['event_id'=>$event_id]);\n\n }",
"public function delete($organization);",
"public function destroy($id)\n {\n $organisation = Organisation::find($id);\n $organisation->delete();\n }",
"public function destroy($distributor_id)\n {\n if(auth()->user()->hasPermissionTo('distributor-delete')){\n $distributor = $this->model->show($distributor_id); \n $details = Distributors::where([\n \"distributor_id\" => $distributor_id, \n ])->first();\n // $email = $details->email;\n // $user = User::where([\n // \"email\" => $email, \n // ])->first();\n // $user_id = $user->user_id;\n \n $details= $distributor->name; \n $log = new ActivityLog([\n \"operations\" => \"Deleted \". \" \". $details. \" \". \" From The Distributors List\",\n \"user_id\" => Auth::user()->user_id,\n ]);\n if (($distributor->delete($distributor_id)) AND ($distributor->trashed())) {\n $user->removeRole(\"Distributor\");\n return redirect()->back()->with([\n 'success' => \"You Have Deleted \". \" \". $details. \" \". \"From The Distributor Details Successfully\",\n ]);\n }\n } else{\n return redirect()->back()->with([\n 'error' => \"You Dont have Access To Delete A Distributor\",\n ]);\n }\n }",
"public function delete()\n {\n DB::transaction(function () {\n $this->devedores()->delete();\n parent::delete();\n });\n }",
"public function destroy(Designation $designation)\n {\n //\n }",
"public function delete()\n {\n $workflow = $this->site->getWorkflows()->create(\n 'remove_site_organization_membership',\n ['params' => ['organization_id' => $this->id,],]\n );\n return $workflow;\n }",
"public function deleteEvent($event)\n {\n $this->entityManager->remove($event);\n $this->entityManager->flush();\n }",
"public function delete() {\r\n\r\n\t\t// Does the Genre object have an ID?\r\n\t\tif ( is_null( $this->id ) ) trigger_error ( \"Genre::delete(): Attempt to delete an Genre object that does not have its ID property set.\", E_USER_ERROR );\r\n\r\n\t\t// Delete the Article\r\n\t\t$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\r\n\t\t$st = $conn->prepare ( \"DELETE FROM :table WHERE id = :id LIMIT 1\" );\r\n\t\t$st->bindValue( \":table\", DB_TBL_GENRE, PDO::PARAM_STR );\r\n\t\t$st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n\t\t$st->execute();\r\n\t\t$conn = null;\r\n\t}",
"public function destroy(Attendace $attendace)\n {\n //\n }",
"public function delete()\n {\n $this->_validateModifiable();\n\n $this->_getDataSource()->delete($this);\n }",
"public function destroy($id)\n {\n $Organizer = User::where('role','Organizer')->findOrFail($id);\n\n $Organizer->delete();\n\n if ($Organizer) {\n return ['Success'=>'Organizer Deleted Successfuly.'];\n }else{\n return ['Erorr'=>'Try Agin Later.'];\n }\n }",
"public function delete() {\r\n\t\t$this->getMapper()->delete($this);\r\n\t}",
"public function destroy(DesignInstitute $designInstitute)\n {\n //\n }",
"public function destroy(Employer $employer)\n {\n //\n }",
"public function delete(){\n $this->probe_requests()->detach();\n\n // Delete the event itself\n $result = parent::delete();\n\n return $result;\n }",
"public function destroy(Agenda $agenda)\n {\n //\n }",
"public function destroy(Corporate $corporate)\n {\n dd('delete corporate');\n }",
"public function destroy(Event $event)\n {\n $event->delete();\n }",
"public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }",
"public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }",
"public function destroy($group_id,$corporation_id)\n {\n $seatgroup=Seatgroup::find($group_id);\n $name=$seatgroup->corporation()->find($corporation_id)->get();\n $seatgroup->corporation()->detach($corporation_id);\n\n return redirect()->back()->with('success', $name->pluck('name'). ' removed');\n\n }",
"public function destroy(Org $org)\n {\n //\n }",
"function delete() {\n $this->that->delete($this->id, $this->name);\n $this->put_id();\n }",
"public function destroy(Volunteer $volunteer)\n {\n //\n }",
"public function delete()\n {\n $this->repository->delete($this->id);\n }",
"public function deleteAlbum()\n {\n if (Auth::user()->cannot('delete', Album::class)) {\n redirect()->to('artist.list');\n }\n \n // get album\n $album = Album::find($this->albumId);\n $album->delete();\n\n // reset\n $this->albumId = null;\n $this->album = null;\n $this->modalMessage = null;\n\n // event\n $this->emit('albumDeleted');\n $this->dispatchBrowserEvent('albumDeleted');\n }",
"public function delete()\n {\n $this->abilities()->detach();\n parent::delete();\n }",
"public final function delete() {\n }",
"public function delete() {\n\t\t$this->assignment->delete();\n\t}",
"public function delete() \n {\n DomainWatcher::addDeletedObject($this);\n }",
"public function destroy(Organization $organization)\n {\n //\n }",
"public function destroy(InternCalendar $internCalendar)\n {\n //\n }",
"public function destroy(Instructor $instructor)\n {\n //\n }",
"public function getOrganiser() {\n return $this->organiser;\n }",
"public function destroy(Order $order, Calification $calification)\n {\n //\n }",
"public function deleteUserAgendaAction()\n {\n /** @var Object_Agenda $agenda */\n $data = $this->getRequestData();\n if (isset($data['agenda_id'])) {\n $agenda = Object_Agenda::getById($data['agenda_id']);\n if (!$agenda) {\n $this->setErrorResponse('no Agenda with this agenda_id!');\n } elseif ($this->getDeviceSession()->getUserId() == $agenda->getCreator()->getId()) {\n $agenda->setPublished(false);\n if (!$agenda->save()) {\n $this->setErrorResponse('cannot delete Agenda object!');\n }\n } else {\n $this->setErrorResponse('no Agenda for this user with current agenda_id!');\n }\n } else {\n $this->setErrorResponse('agenda_id is mandatory field for this request!');\n }\n $this->_helper->json(array('deleted' => true));\n }",
"public function delete()\n {\n $this->staff->delete();\n $this->notify('Staff member was removed', 'hub.staff.index');\n }",
"public function destroy(Organization $organization)\n {\n $organization->delete(); \n \n return Redirect::route('organizations.index')->with(['success' => 'Organization Deleted Successful']);\n }",
"public function destroy($id)\n {\n\n $event = Event::find($id);\n\n $registra = $event->event_registra;\n \n if(Gate::allows('delete-event',$registra)){\n\n $title = $event->title;\n $event_delete_status = $event->delete();\n\n if($event_delete_status){\n\n $action = \"Deleted an event with the title '\".$title.\"'\";\n LogsController::logger($action, $this->date_of_action); \n\n return redirect('/events')->with('event-success','Event successfully deleted');\n }\n else{\n return redirect('/events')->with('event-fail','Event not deleted!');\n }\n\n }\n\n }",
"public function delete(){\r\n\t\t// Check for request forgeries\r\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\r\n\t\r\n\t\t// Get the model.\r\n\t\t$model = $this->getModel(\"ManageCompanyEvent\");\r\n\t\t$this->deleteEvents($model);\r\n\t\r\n\t\t$this->setRedirect('index.php?option=com_jbusinessdirectory&view='.$this->input->get('view'));\r\n\t}",
"public function destroy(ocupation $ocupation)\n {\n //\n }",
"public function destroy(Reviewer $reviewer)\n {\n //\n }",
"public function purge()\n {\n $this->owner()->where('current_organization_id', $this->id)\n ->update(['current_organization_id' => null]);\n\n $this->users()->where('current_organization_id', $this->id)\n ->update(['current_organization_id' => null]);\n\n $this->users()->detach();\n\n $this->delete();\n }",
"public function deletePoster()\r\n\t{\r\n\t\t// Donnees\r\n\t\t$eventId = Bn::getValue('event_id');\r\n\t\t$oEvent = new Oevent($eventId);\r\n\t\t$oEvent->deletePoster();\r\n\t\treturn BPREF_PAGE_PRESENTATION;\r\n\t}",
"public function destroy(DonationCentre $donationCentre)\n {\n //\n }",
"public function destroy(Estudiante $estudiante)\n {\n //\n }",
"public function delete($Enterprise) { ; }",
"public function destroy(Saler $saler)\n {\n //\n }",
"public function delete()\n {\n // TODO: Implement delete() method.\n }",
"public static function destroyEstudiante($idEstu)\n{\n $estudiante = Estudiante::find($idEstu);\n $estudiante->delete();\n}",
"public function destroy($event_id)\n { \n $events=new Events;\n $events->find($event_id)->delete();\n }",
"public function destroy(Professionnel $professionnel)\n {\n //\n }",
"public function destroy($id)\n {\n if (Sentry::check()) {\n // Find active user\n $user = Sentry::getUser();\n $event = Appointment::find($id);\n\n // Check if User belongs to group/school which the appointment is from\n if ($user->hasAccess('school') || ($user->hasAccess('event') && $user->school_id == $event->group->school_id)) {\n $event->delete();\n }\n\n return Redirect::route('calendar.index');\n } else {\n return Redirect::route('landing');\n }\n }",
"public function destroy(attendence $attendence)\n\t{\n\t\t//\n\t}",
"public function destroy($id)\n {\n $organization = Organization::find($id);\n $organization->delete();\n flash('Organization Deleted!');\n return redirect('/cabinet/organizations');\n }",
"public function destroy(Request $request)\n {\n $this->authorize('delete', new Evento());\n $evento = Evento::findOrFail($request->id);\n $evento->delete();\n toast('Evento eliminado correctamente', 'success');\n return redirect()->route('evento.index');\n }",
"public function deleted(Investor $investor)\n {\n //\n }",
"public function delete() {\n\t\t$this->deleted = true;\n\t}",
"public static function destroy()\n {\n if (!Authentication::is_logged_in()) {\n AnswerHandler::create_response_and_kill_page(false, \"unauthorized\", 401);\n } else {\n $tutor = Tutor::get_Tutor(Authentication::$user_email);\n if ($tutor == false) {\n AnswerHandler::create_response_and_kill_page(false, \"No Data\", 400);\n } else {\n $tutor->delete_tutor();\n User::getUser(Authentication::$user_email)->deleteAllSubjects();\n AnswerHandler::create_response_and_kill_page(true, \"Sucessfully deleted\");\n }\n }\n }",
"public function destroy($incidencia)\n {\n //\n Incidencies::find($incidencia)->delete();\n }",
"public function deleteSportsVenue($venue);",
"public function destroy(Distributor $distributor, Request $request)\n {\n $logued_user = Auth::user();\n if($logued_user->usrc_admin || $logued_user->can('delete.dist')){\n if(!$this->controllerUserCanAccess(Auth::user(),$distributor->id)){\n return view('errors.403');\n }\n if (isset($distributor)){\n $fmessage = 'Se ha eliminado el distribuidor: '.$distributor->distrib_nom;\n \\Session::flash('message',$fmessage);\n $this->registeredBinnacle($request->all(), 'destroy', $fmessage, $logued_user ? $logued_user->id : '', $logued_user ? $logued_user->name : '');\n $distributor->delete();\n }\n return redirect()->route('distributor.index');\n }else{\n return view('errors.403');\n }\n }",
"public function setOrganiser(CultureFeed_Cdb_Data_Organiser $organiser) {\n $this->organiser = $organiser;\n }",
"public function destroy(Announcement $announcement)\n {\n //\n }",
"public function destroy(Announcement $announcement)\n {\n //\n }",
"public function destroy(fornecedor $fornecedor)\n {\n //\n }",
"public function destroy(Event $event)\n {\n $event->delete();\n return redirect('events');\n }",
"public function destroy(Dateplanner $dateplanner)\n {\n //\n }",
"public function delete()\n {\n $this->throwForbiddenUnless(SecurityUtil::checkPermission('PostCalendar::', '::', ACCESS_ADD), LogUtil::getErrorMsgPermission());\n\n $eid = FormUtil::getPassedValue('eid'); // seems like this should be handled by the eventHandler\n $render = FormUtil::newForm('PostCalendar', $this);\n\n // get the event from the DB\n $event = DBUtil::selectObjectByID('postcalendar_events', $eid, 'eid');\n $event = ModUtil::apiFunc('PostCalendar', 'event', 'formateventarrayfordisplay', $event);\n\n $render->assign('loaded_event', $event);\n return $render->execute('event/deleteeventconfirm.tpl', new PostCalendar_Form_Handler_EditHandler());\n }",
"public function delete(Event $event){\r\n $stmt = $this->db->prepare(\"DELETE FROM event WHERE id_event = ?\");\r\n $stmt->execute(array($event->getIdEvent()));\r\n }",
"public function destroy(Oficina $oficina)\n {\n //\n }",
"public function destroy(Designation $designation)\n {\n $designation->delete();\n return redirect()->route('designation.index')->with('info','Designation Deleted Successfully');\n }",
"public function deleted(Invitation $invitation)\n {\n //\n }",
"public function deleted(Invitation $invitation)\n {\n //\n }",
"public function delete()\n {\n $this->administrador()->delete();\n $this->vendedor()->delete();\n return parent::delete();\n }",
"public function deleteEvent() {\n $event = EventDCI::find(Input::get('id'));\n if($event->user_id == Auth::user()->id) {\n /* Sending email to all boss that have relation with the services */\n $departments_sended_mail = array();\n foreach ($event->services()->wherePivot('deleted_at', '=', NULL)->get() as $service) {\n /* Getting the departments associated to the services */\n $department = $service->department()->first();\n\n if(!in_array($department->id, $departments_sended_mail)) {\n /* Getting the users associated to a department that they are bosses */\n $users = $department->users()->where('user_type_id', '=', 3)->where('status', '=', 1)->get();\n\n if($users->isEmpty()) {\n /* Getting the admin users */\n $users = User::where('user_type_id', '=', 4)->where('status', '=', 1)->get();\n }\n\n /* Sending email to bosses or admins (users) */\n foreach ($users as $user) {\n Mail::send('emails.notification.deleteevent',\n array(\n 'event' => $event->name,\n ),\n function($message) use($user) {\n $message->to($user->email)->subject('Evento eliminado - DCI');\n }\n\n );\n }\n\n array_push($departments_sended_mail, $department->id);\n }\n }\n $event->delete();\n return Redirect::to('dashboard')->with('alert', 'Evento eliminado exitosamente ' . $event->id_dci);\n }\n else {\n return Redirect::to('dashboard')->with('alert', 'Usted no tiene permisos para eliminar este evento' . $event->id_dci);\n }\n\n }",
"public function deleteOrg($orgUsername)\n {\n $values=array($orgUsername);\n \n //Check If There Is Appointment In The DB That Linked To This Organization\n $check=$this->getInfo(\"SELECT count(*) as nt FROM appointment WHERE username=?\",$values);\n\n if($check[0]['nt'])\n die(\"לא ניתן למחוק ארגון שעבורו נקבע תור\");\n \n //Query To Get All The Branches ID's Of This Organization \n $sqlSelect =\"SELECT branch_id FROM branch WHERE org_username=?\";\n $branches=$this->getInfo($sqlSelect,$values);\n \n foreach($branches as $br)\n {\n $this->deleteBranch($br['branch_id']);\n }\n \n //Delete From org_represent Table All The data That Linked To This Organization\n $sqlDel=\"DELETE FROM org_represent WHERE username=?\";\n $this->execute($sqlDel,$values);\n \n //Delete From org_manager Table All The data That Linked To This Organization\n $sqlDel=\"DELETE FROM org_manager WHERE username=?\";\n $this->execute($sqlDel,$values);\n \n //Delete From organization Table All The data That Linked To This Organization\n $sqlDel=\"DELETE FROM organization WHERE organization_username=?\";\n $this->execute($sqlDel,$values);\n \n die(\"בוצע בהצלחה\");\n }",
"public function destroy(scholarshipRegistration $scholarshipRegistration)\n {\n //\n }",
"public function deleted(Instructor $instructor)\n {\n //\n }",
"public function destroy($id)\n {\n $org = Orgjed::find($id);\n $org->delete();\n // redirect\n Session::flash('message', 'Organizacijska jedinica je uspješno obrisana!');\n return Redirect::to('orgjed');\n }",
"public function delete($calendario);",
"public function destroy(Event $event)\n {\n //$event = Event::findOrFail($id);\n $event->delete($event);\n flash('Evenement supprimer avec succes','danger');\n return redirect(route('home'));\n }",
"public function destroy()\n {\n ConsultantAssignment::where('id','=',Input::get('id'))->delete();\n\n return Response::json(array('msg' => 'Registered consultancy deleted','success'=>true), 200);\n }",
"function delete() {\n\t\n\t\t$this->getMapper()->delete($this);\n\t\t\n\t}",
"public function deleteOrganisation($id)\n {\n\n $organisation = Organisation::where('org_id','=', $id)->delete();\n if ($organisation) {\n return response()->json([\n \"status\" => \"sussess\",\n \"message\" => \"Organisation deleted successfully\",\n \"code\" => 200\n ], 200);\n\n } else {\n\n return response()->json([\n \"status\" => \"failed\", \n \"message\" => \"Organisation not found\",\n \"code\" => 404\n ], 404);\n\n }\n }",
"public function unassignDepartment() {\n if($this->department)\n $this->department()->delete();\n }",
"public function destroy($id)\n {\n \t//valida se User tem Autorização\n \t$this->authorize('evento_delete');\n \t\n \t$evento = $this->Evento->find($id);\n \t//Valida Multi-Empresa\n \t$this->authorize('mesma-igreja', $evento->Igrejas_idIgrejas);\n \t\n \t$evento->delete();\n \tflash('Evento Deletado com sucesso!', 'success');\n \treturn redirect()->route('evento.index');\n }",
"public function remove_officer()\n {\n if ($this->mgovdb->deleteData('Dept_Officers', get_post('o'))) {\n $return_data = array(\n 'status' => true,\n 'message' => 'Officer has been removed.'\n );\n } else {\n $return_data = array(\n 'status' => false,\n 'message' => 'Removing officer failed.'\n );\n }\n\n response_json($return_data);\n }",
"public function destroy(EstabelecimentoSaude $estabelecimentoSaude)\n {\n //\n }",
"public function destroy(Attendance $attendance)\n {\n //\n }",
"public function destroy(Attendance $attendance)\n {\n //\n }",
"public function destroy(Attendance $attendance)\n {\n //\n }",
"public function delete(User $user, AcademicYear $academicYear)\n {\n //\n }",
"public function destroy(ClientUnification $clientUnification)\n {\n //\n }",
"public function delete() {\n\n $id = $this->uri->segment(4);\n $this->events_model->delete_event($id);\n redirect('admin/events');\n\n }"
] | [
"0.69003993",
"0.631365",
"0.59371656",
"0.5741597",
"0.57172453",
"0.5633651",
"0.55949855",
"0.5469599",
"0.54365337",
"0.5415219",
"0.5362119",
"0.53501904",
"0.53059244",
"0.53002864",
"0.52841663",
"0.5278787",
"0.5266372",
"0.5265326",
"0.5262433",
"0.5243839",
"0.52348393",
"0.5230527",
"0.52273977",
"0.522355",
"0.52199006",
"0.52091575",
"0.51912534",
"0.5184566",
"0.518366",
"0.51755154",
"0.5170424",
"0.5169815",
"0.5166991",
"0.5160456",
"0.51569253",
"0.5153351",
"0.5123581",
"0.5121467",
"0.51188034",
"0.51163715",
"0.5111572",
"0.5105951",
"0.5104516",
"0.5100742",
"0.50699884",
"0.50658274",
"0.50636053",
"0.5062155",
"0.5047399",
"0.50471747",
"0.50463134",
"0.5043354",
"0.5041537",
"0.50385237",
"0.50380045",
"0.5023305",
"0.50213224",
"0.5017242",
"0.50138867",
"0.5011659",
"0.50082844",
"0.5006771",
"0.49931976",
"0.49914",
"0.49900663",
"0.49839133",
"0.49815458",
"0.49782562",
"0.49707934",
"0.49707934",
"0.49585712",
"0.49558258",
"0.49489647",
"0.49477154",
"0.4943582",
"0.49405757",
"0.4939677",
"0.49396363",
"0.49396363",
"0.49370623",
"0.49364665",
"0.49361897",
"0.49315703",
"0.49298936",
"0.49270806",
"0.49258888",
"0.49169943",
"0.49130732",
"0.4910668",
"0.49092105",
"0.49081194",
"0.4907453",
"0.49059618",
"0.49057424",
"0.4904826",
"0.4904826",
"0.4904826",
"0.49001512",
"0.48937824",
"0.48926997"
] | 0.79746175 | 0 |
Set the maximum amount of participants. | public function setMaxParticipants($maxParticipants) {
$this->maxParticipants = $maxParticipants;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setMaxParticipants($max_participants)\n {\n $this->max_participants = $max_participants;\n }",
"public function setMaxParticipants(int $maxParticipants): self\n {\n $this->options['maxParticipants'] = $maxParticipants;\n return $this;\n }",
"public function set_group_default_max_recipients()\n\t{\n\t\t$sql = 'UPDATE ' . GROUPS_TABLE . ' SET group_max_recipients = 5\n\t\t\tWHERE ' . $this->db->sql_in_set('group_name', array('GUESTS', 'REGISTERED', 'REGISTERED_COPPA', 'BOTS'));\n\t\t$this->sql_query($sql);\n\t}",
"public function setMax( int $max ): void {\n\t\t\t$this->maximum = $max;\n\t\t}",
"public function setMaximum($value) {\r\n $this->internalSetMaximum($value);\r\n }",
"public function SetMaxCount ($maxCount);",
"public function setMaximumValue(int $maximumValue): void;",
"public function getMaxParticipants() {\n return $this->maxParticipants;\n }",
"public function setMaxLength(int $max):void {\r\n\t\t$this->maxLength = $max;\r\n\t}",
"public function setLimit ($value)\r\n\t{\r\n\t\t$this->limit = $value;\r\n\t}",
"public function getMaxParticipants()\n {\n return $this->max_participants;\n }",
"public function setMaxChatters($var)\n {\n GPBUtil::checkInt32($var);\n $this->maxChatters = $var;\n\n return $this;\n }",
"public function test_admin_set_max_num_players()\n {\n $this->assertTrue($this->postScriptumServer->adminSetMaxNumPlayers(78));\n }",
"public function setMaximumAttendeesCount($val)\n {\n $this->_propDict[\"maximumAttendeesCount\"] = intval($val);\n return $this;\n }",
"public function setMaxAttendees($value)\n {\n return $this->set('MaxAttendees', $value);\n }",
"public function test_admin_set_max_num_players()\n {\n $this->assertTrue($this->btwServer->adminSetMaxNumPlayers(78));\n }",
"public function test_admin_set_max_num_players()\n {\n $this->assertTrue($this->btwServer->adminSetMaxNumPlayers(78));\n }",
"public function setMaxValue($maxValue);",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }",
"public function setMaximumAmount($max, bool $inclusive = false, ?string $message = null) : void\n {\n $this->maximumOptions = [\n 'max' => $max,\n 'inclusive' => $inclusive,\n 'message' => $message,\n ];\n }",
"public function setMax($value)\n {\n $this->_maxValue = $value;\n return $this;\n }",
"function setMax($max) {\n $this->field['max'] = (int) $max;\n\n return $this;\n }",
"public function setLimit(int $limit): self;",
"public function setLimit($x) { $this->limit = $x; }",
"public function limitPerParticipant()\n {\n if ($this->acceptsGuestEntries()) {\n return;\n }\n\n $limit = $this->settings['limit-per-participant'] ?? 1;\n\n return $limit !== -1 ? $limit : null;\n }",
"public function setMax($max) {\n $this->max = $max;\n return $this;\n }",
"public function setMax($max) {\n $this->max = $max;\n return $this;\n }",
"public function setMaxcount($count)\n {\n $this->maxCount = $count;\n }",
"public function setMaxLimit($var)\n {\n GPBUtil::checkInt64($var);\n $this->max_limit = $var;\n\n return $this;\n }",
"public function setMaxBeds($maxBeds);",
"public function setMaxSize($num) {\n if (is_numeric($num) && $num > 0) {\n $this->_max = (int) $num;\n }\n }",
"public function setMaximumSessions($maximumSessions)\n {\n $this->maximumSessions = (int) $maximumSessions;\n }",
"public function setMaxSize($max){\n $this->maxSize = $max;\n return $this;\n }",
"public function setMaxRunTimeInMinutes(?int $value): void {\n $this->getBackingStore()->set('maxRunTimeInMinutes', $value);\n }",
"public function setMax($max) {\n\t\t$this->attributes['max'] = $max;\n\t\t$this->max = $max;\n\t\treturn $this;\n\t}",
"public function setMax($max)\n {\n $this->max = $max;\n\n return $this;\n }",
"public function limit($max)\n {\n $this->limit = intval($max);\n return $this;\n }",
"public function setMaxJitter($val)\n {\n $this->_propDict[\"maxJitter\"] = $val;\n return $this;\n }",
"public function setProgressMax(int $value)\n {\n $this->update(['progress_max' => $value]);\n }",
"public function setMax($value)\n {\n $this->_fields['Max']['FieldValue'] = $value;\n return $this;\n }",
"private function setMaximumRecords($maximum){\n\t\t$this->maximumRecords = $maximum;\n\t}",
"public function setMaxLength($maxLength) {}",
"public function setMaximumNumberOfTokens($maximum)\n {\n return $this->setOption('maximumnumberoftokens', $maximum);\n }",
"public function setLimit($value)\n {\n return $this->setParameter('limit', $value);\n }",
"public function setMaxPoints($value) {}",
"public function setMaxTries($tries)\n {\n $this->maxTries = $tries;\n }",
"public function setMaxValue($value)\n {\n $this->set('MaxValue', (int) $value);\n return $this;\n }",
"public function setLimit(int $limit): void\n {\n $this->limit = $limit;\n }",
"public function setMaxRecords($value)\n {\n return $this->set('MaxRecords', $value);\n }",
"public function setMaxRecords($value)\n {\n return $this->set('MaxRecords', $value);\n }",
"public function setMaxRecords($value)\n {\n return $this->set('MaxRecords', $value);\n }",
"public function setMaxResults($maxResults);",
"public function setLimit(?int $limit): void\n {\n $this->limit = $limit;\n }",
"public function setLimit(?int $limit): void\n {\n $this->limit = $limit;\n }",
"public function setLimit(int $limit): void\n {\n $this->_limit = $limit;\n }",
"function setNota_max($inota_max = '')\n {\n $this->inota_max = $inota_max;\n }",
"function setNota_max($inota_max = '')\n {\n $this->inota_max = $inota_max;\n }",
"public static function setNumberMaxBlocked($nb){\n Configuration::where('id', 1)\n ->update(['nb_max_times_bloked' => $nb]);\n }",
"public function limit($value) {\r\n $this->limit = (int)$value;\r\n return $this;\r\n }",
"public function setAutomaticMaximum($value) {\r\n $this->automaticMaximum = $this->setAutoMinMax($this->automaticMaximum, $this->automaticMinimum,\r\n $value);\r\n }",
"public function maxAutoRetries($value) {\n return $this->setProperty('maxAutoRetries', $value);\n }",
"public function setMaxCount($s)\n {\n if (is_int($s) && $s >= 1 && $s <= 100) {\n $this->options['MaxCount'] = $s;\n } else {\n return false;\n }\n }",
"public function maxAttempts(): int\n {\n return 5;\n }",
"public function set_limit($limit);",
"public function setMaximumAllowedRows($maximumAllowedRows)\n {\n $this->maximumAllowedRows = $maximumAllowedRows;\n }",
"public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }",
"public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }",
"public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }",
"public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }",
"public function setMaxPerUserId($maxPerUserId)\n {\n if ($maxPerUserId != $this->maxPerUserId) {\n $this->maxPerUserId = $maxPerUserId;\n }\n }",
"public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }",
"public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }",
"public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }",
"public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }"
] | [
"0.78886503",
"0.77239615",
"0.6783981",
"0.67523926",
"0.6752334",
"0.67200416",
"0.66341704",
"0.66165245",
"0.6608612",
"0.660743",
"0.6554045",
"0.65503496",
"0.6531691",
"0.6506651",
"0.648476",
"0.6442044",
"0.6442044",
"0.6341335",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.6337405",
"0.62770665",
"0.6252381",
"0.6249814",
"0.6243742",
"0.6239728",
"0.62374425",
"0.6227275",
"0.6227275",
"0.62052435",
"0.61806446",
"0.6161178",
"0.61357087",
"0.6119392",
"0.6108221",
"0.6088388",
"0.60782456",
"0.60722816",
"0.60345227",
"0.603114",
"0.6000814",
"0.59931624",
"0.59748834",
"0.5958815",
"0.59493834",
"0.5942802",
"0.5942369",
"0.5924103",
"0.5919781",
"0.5907492",
"0.58918303",
"0.58918303",
"0.58918303",
"0.58636814",
"0.5852371",
"0.5852371",
"0.5841592",
"0.5820379",
"0.5820379",
"0.5810832",
"0.58002037",
"0.5788315",
"0.5783919",
"0.5783636",
"0.5774648",
"0.5772536",
"0.57720906",
"0.5764039",
"0.5764039",
"0.5764039",
"0.5764039",
"0.5763832",
"0.5763648",
"0.5763648",
"0.5763648",
"0.5763648"
] | 0.8105075 | 0 |
Set the booking period. | public function setBookingPeriod(CultureFeed_Cdb_Data_Calendar_BookingPeriod $bookingPeriod) {
$this->bookingPeriod = $bookingPeriod;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setPeriod($_period){\n\t\t$this->period=$_period;\n\t}",
"private function _setBookingData()\n {\n // Request the booking data from the tabs api instance\n $booking = \\tabs\\api\\booking\\booking::createBookingFromId(\n $this->getBookingId()\n );\n\n // Loop through the accessors of the requested booking object\n if ($booking) {\n $reflection = new \\ReflectionObject($booking->getPricing());\n foreach ($reflection->getProperties(\\ReflectionProperty::IS_PROTECTED) as $property) {\n $setter = 'set' . ucfirst($property->name);\n $getter = 'get' . ucfirst($property->name);\n $this->$setter($booking->$getter());\n }\n }\n \n return $this;\n }",
"public function getBookingPeriod() {\n return $this->bookingPeriod;\n }",
"public function setPeriod($value)\n {\n return $this->set('Period', $value);\n }",
"public function setPeriod($value)\n {\n return $this->set('Period', $value);\n }",
"public function setPeriod($value)\n {\n return $this->set('Period', $value);\n }",
"public function setAccelerationPeriod($period)\n {\n $payload = '';\n $payload .= pack('V', $period);\n\n $this->sendRequest(self::FUNCTION_SET_ACCELERATION_PERIOD, $payload);\n }",
"public function setUntil(DateTime $oUntil)\n\t{\n\t\t$this->aParameters['until'] = $oUntil->format('Y-m-d');\n\t}",
"public function setOpenPeriod(?int $openPeriod): void\n {\n $this->openPeriod = $openPeriod;\n }",
"public function setAngularVelocityPeriod($period)\n {\n $payload = '';\n $payload .= pack('V', $period);\n\n $this->sendRequest(self::FUNCTION_SET_ANGULAR_VELOCITY_PERIOD, $payload);\n }",
"public function setPeriod($period)\n {\n $this->period = $period;\n return $this;\n }",
"public function set(int $offset, Period $interval): void\n {\n $this->periods[$this->getOffset($offset)] = $interval;\n }",
"function lb_subscription_set_billing_period($account, $subscription, $billing_period) {\n // The $account that rules passes contains the original information, which may have\n // changed as a result of an action that has run.\n $entity = entity_load_single('user', $account->uid);\n $account_subscription_data = lb_subscription_retrieve_account_subscription_data($entity, $subscription);\n if ($account_subscription_data['delta'] === NULL) {\n lb_subscription_set_subscription($entity, $subscription);\n $entity = entity_load_single('user', $account->uid);\n $account_subscription_data = lb_subscription_retrieve_account_subscription_data($entity, $subscription);\n }\n if ($account_subscription_data['delta'] !== NULL) {\n if ($account_subscription_data['billing_period'] != $billing_period) {\n $entity->field_subscription[LANGUAGE_NONE][$account_subscription_data['delta']]['field_billing_period'] = array(\n LANGUAGE_NONE => array(\n 0 => array(\n 'value' => $billing_period,\n ),\n ),\n );\n entity_save('user', $entity);\n }\n }\n}",
"public function setCertificateValidityPeriod(?int $value): void {\n $this->getBackingStore()->set('certificateValidityPeriod', $value);\n }",
"protected function enableApplicationsPeriod()\n {\n $settings = app('settings');\n $settings->applications_start_at = Carbon::yesterday();\n $settings->applications_end_at = Carbon::tomorrow();\n $settings->min_team_members = 2;\n $settings->max_team_members = 4;\n $settings->save();\n }",
"public function setCertificateValidityPeriodValue(?int $value): void {\n $this->getBackingStore()->set('certificateValidityPeriodValue', $value);\n }",
"private function set_date()\r\n\t{\r\n\t\tif ($this->month > 12)\r\n\t\t{\r\n\t\t\t$this->month=1;\r\n\t\t\t$this->year++;\r\n\t\t}\r\n\r\n\t\tif ($this->month < 1)\r\n\t\t{\r\n\t\t\t$this->month=12;\r\n\t\t\t$this->year--;\r\n\t\t}\r\n\r\n\t\tif ($this->year > 2037) $this->year = 2037;\r\n\t\tif ($this->year < 1971) $this->year = 1971;\r\n\t}",
"public function setPeriod(\\TNTExpressConnect\\Tracking\\XSD\\Period $period)\n {\n $this->period = $period;\n return $this;\n }",
"public function setPeriod(int $period) : self\n {\n $this->period = $period;\n return $this;\n }",
"public function definePeriod($period)\n {\n return $period;\n }",
"function set( $start = 0, $end = NULL )\n {\n $this->setStart( $start );\n \n if ( NULL === $end )\n {\n $this->setEnd( $start );\n }\n else\n {\n switch ( $end )\n {\n \tcase 'year': \n // add one year to end\n \t\tbreak;\n \tcase 'month':\n \t\t// add one month\n \t\tbreak;\n \tcase 'week': \n // add one year to end\n \t\tbreak;\n \tcase 'day': \n // add one year to end\n \t\tbreak;\n \tcase 'calendarweek': \n // set start and end date to start and end of week for current date\n $this->start->date->setToStartOfWeek();\n $this->setEnd( $start );\n $this->end->date->setToEndOfWeek();\n \t\tbreak;\n \tdefault:\n $this->setEnd( $end );\n } // switch\n }\n \n //$this->updatePorperties();\n }",
"protected function disableApplicationsPeriod()\n {\n $settings = app('settings');\n $settings->applications_start_at = Carbon::yesterday();\n $settings->applications_end_at = Carbon::yesterday();\n $settings->save();\n }",
"public function setPeriod($period)\n\t{\n\t\t$this->period = $period;\n\n\t\treturn $this;\n\t}",
"public function setDebouncePeriod($debounce)\n {\n $payload = '';\n $payload .= pack('V', $debounce);\n\n $this->sendRequest(self::FUNCTION_SET_DEBOUNCE_PERIOD, $payload);\n }",
"public function setBookingId(?string $bookingId): void\n {\n $this->bookingId = $bookingId;\n }",
"public function setBookings(?array $bookings): void\n {\n $this->bookings = $bookings;\n }",
"private function setDate(){\n\t// Validate incoming parameters\n\t\t$this->di->logger->stamp(__CLASS__, __METHOD__, '');\n\tif (isset($_GET['month'])) {\n\t\tis_numeric($_GET['month']) or die('month has to be numeric');\n\t}\n\tif (isset($_GET['year'])) {\n\t\tis_numeric($_GET['year']) or die('year has to be numeric');\n\t}\n\n\t// Set new date\n\t$this->newMonth = isset($_GET['month']) ? ($_GET['month']) : $this->currentMonth;\n\t$this->newYear = isset($_GET['year']) ? ($_GET['year']) : $this->currentYear;\n\n\tif ($this->newMonth > 12) {\n\t\t$this->newYear = $this->newYear +1;\n\t\t$this->newMonth = 1;\n\t\t$_GET['month'] = 1;\n\n\t}\n\telse if ($this->newMonth < 1) {\n\t\t$this->newYear = $this->newYear -1;\n\t\t$this->newMonth = 12;\n\t\t$_GET['month'] = 12;\n\t}\n\t\n\t}",
"public function setPaid()\n {\n $this->update([\n 'status' => self::STATUS_PAID,\n 'paid_date' => Carbon::now(),\n ]);\n }",
"public function setOrientationPeriod($period)\n {\n $payload = '';\n $payload .= pack('V', $period);\n\n $this->sendRequest(self::FUNCTION_SET_ORIENTATION_PERIOD, $payload);\n }",
"public function setSchedule ()\n {\n $this->loadComponent('DateTime');\n $this->loadModel('ScheduleTime');\n $data = $this->Auth->user();\n $id_fortune = $data['id'];\n $days = $this->DateTime->allDayInWeek();\n $months = $this->DateTime->allDayInMonth();\n $times = $this->ScheduleTime->getListTime();\n if ($this->Check->isId($id_fortune)) {\n $this->set([\n 'times' => $times,\n 'days' => $months,\n 'id' => $id_fortune\n ]);\n } else{\n $this->Flash->error(__('Id not found'));\n }\n }",
"public function setDate(Carbon $date) {\n\t\t$this->setDateRange($date, $to);\n\t}",
"public function validateByGracePeriod() : void\n {\n if (!is_null($this->grace_period_ends)) {\n if (($this->charge_date == $this->grace_period_ends) && !$this->paid) {\n $this->is_active = 0;\n $this->grace_period_ends = Carbon::now()->addDays(Subscription::DEFAULT_GRACE_PERIOD_DAYS)->toDateTimeString();\n }\n } else {\n $this->grace_period_ends = Carbon::now()->addDays(Subscription::DEFAULT_GRACE_PERIOD_DAYS)->toDateTimeString();\n }\n }",
"public function setInGracePeriodUntilDateTime($val)\n {\n $this->_propDict[\"inGracePeriodUntilDateTime\"] = $val;\n return $this;\n }",
"public function setScheduler() {}",
"public function setDate(?TimeRange $date): void\n {\n $this->date = $date;\n }",
"public function setEndDate($value)\n {\n $this->endDate = $value;\n }",
"public function setQuaternionPeriod($period)\n {\n $payload = '';\n $payload .= pack('V', $period);\n\n $this->sendRequest(self::FUNCTION_SET_QUATERNION_PERIOD, $payload);\n }",
"public function setCertificateValidityPeriodValue($val)\n {\n $this->_propDict[\"certificateValidityPeriodValue\"] = intval($val);\n return $this;\n }",
"public function setDueAtAttribute($param) {\n $this->attributes['due_at'] = $param ? (new Carbon($param)) : null;\n }",
"public function update() {\n $bookingJson = array(\n 'adults' => $this->getAdults(),\n 'children' => $this->getChildren(),\n 'infants' => $this->getInfants()\n );\n $response = \\tabs\\api\\client\\ApiClient::getApi()->put(\n \"/booking/{$this->getBookingId()}\",\n array(\n 'data' => json_encode($bookingJson)\n )\n );\n if ($response->status !== 204) {\n throw new \\tabs\\api\\client\\ApiException(\n $response,\n 'Could not update booking'\n );\n }\n\n return $this;\n }",
"public function setDateRange(Carbon $from, Carbon $to) {\n\t\t$this->from_date = new Carbon($from);\n\t\t$this->to_date = new Carbon($to);\n\t}",
"public function __construct(Booking $booking)\n {\n $this->booking = $booking;\n }",
"public function __construct(Booking $booking)\n {\n $this->booking = $booking;\n }",
"function savePeriod(\\Period $period) {\n // We need the attributes in local variables\n $periodId = $period->getPeriodId();\n $startDay = $period->getStartDay()->val();\n $startHour = $period->getStartHour();\n $startMin = $period->getStartMinutes();\n $endDay = $period->getEndDay()->val();\n $endHour = $period->getEndHour();\n $endMin = $period->getEndMinutes();\n $itemId = $period->getItemId();\n\n $stmt = $this->mysqli->prepare(\n 'UPDATE opening_hours SET start_day=?,start_hour=?,start_minutes=?,end_day=?,end_hour=?,end_minutes=?,item_id=? WHERE period_id=?');\n if($stmt === false) {\n throw new DatabaseInternalException($this->mysqli->error, $this->mysqli->errno);\n }\n try {\n $stmt->bind_param('siisiiii', $startDay, $startHour, $startMin, $endDay, $endHour, $endMin, $itemId, $periodId);\n if (!$stmt->execute()) {\n // Check for invalid hour or minute triggers\n if($this->mysqli->sqlstate == 45000) {\n throw new InvalidValueInBodyException($this->mysqli->error);\n } else {\n throw new DatabaseInternalException($this->mysqli->error, $this->mysqli->errno);\n }\n }\n } finally {\n $stmt->close();\n }\n }",
"public function setAllDataPeriod($period)\n {\n $payload = '';\n $payload .= pack('V', $period);\n\n $this->sendRequest(self::FUNCTION_SET_ALL_DATA_PERIOD, $payload);\n }",
"public function setNotificationPeriod($notificationPeriod) {\n\t\t$this->notificationPeriod = (int) $notificationPeriod;\n\t}",
"public function setToDate($toDate)\n {\n // $this->toDate = $newDate->format('c');\n $this->toDate = $toDate;\n }",
"public function set_location_trading_hour_days(){}",
"public function setEndDate(?Date $value): void {\n $this->getBackingStore()->set('endDate', $value);\n }",
"public function setEndDateAttribute($value)\n {\n $this->attributes['end_date'] = Carbon::parse($value);\n }",
"public function setToDate($toDate)\n {\n if (stristr($toDate, \"-\")) {\n $toDate = strtotime($toDate);\n }\n $this->toDate = $toDate;\n }",
"public function setPeriod(FHIRPeriod $period = null)\n {\n $this->period = $period;\n return $this;\n }",
"public function set_recurring_period( $recurring_period, $recurring_period_type = self::RECUR_PERIOD_TYPE_DAYS ) {\n\t\t$this->payment['recurring_period'] = $recurring_period;\n\t\t$this->payment['recurring_period_type'] = $recurring_period_type;\n\t\t$this->update_meta( 'recurring_period', $this->payment['recurring_period'] );\n\t\t$this->update_meta( 'recurring_period_type', $this->payment['recurring_period_type'] );\n\t}",
"public function setEndDate($endDate) {\n $this->endDate = $endDate;\n }",
"public function setTimeSlot($timeSlot) {\r\n\t\t$this->timeSlot = $timeSlot;\r\n\t}",
"public function setDueDateTime($timestamp);",
"public function setEndDate($endDate)\n {\n if (is_object($endDate) && $endDate instanceOf \\DateTime) {\n $this->endDate = $endDate;\n } else {\n $this->endDate = new \\DateTime($endDate);\n }\n }",
"public function setBookingClass($bookingClass = null)\n {\n // validation for constraint: string\n if (!is_null($bookingClass) && !is_string($bookingClass)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($bookingClass)), __LINE__);\n }\n if (is_null($bookingClass) || (is_array($bookingClass) && empty($bookingClass))) {\n unset($this->BookingClass);\n } else {\n $this->BookingClass = $bookingClass;\n }\n return $this;\n }",
"public function setBookingClass($bookingClass = null)\n {\n // validation for constraint: string\n if (!is_null($bookingClass) && !is_string($bookingClass)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($bookingClass)), __LINE__);\n }\n if (is_null($bookingClass) || (is_array($bookingClass) && empty($bookingClass))) {\n unset($this->BookingClass);\n } else {\n $this->BookingClass = $bookingClass;\n }\n return $this;\n }",
"public function setMonth($month){\n\t\tif($month>12){\n\t\t\t$this->_month = $month%12;\n\t\t\t$this->_year += ((int)($month/12));\n\t\t} else {\n\t\t\tif($month<1){\n\t\t\t\t$this->_month = 13-(abs($month)%12);\n\t\t\t\t$this->_year -= (((int)(abs($month)/12))+1);\n\t\t\t} else {\n\t\t\t\t$this->_month = (int) $month;\n\t\t\t}\n\t\t}\n\t\t$monthDays = self::$_monthTable[$this->_month-1];\n\t\tif($this->isLeapYear()==true&&$this->_month==2){\n\t\t\t++$monthDays;\n\t\t}\n\t\tif($this->_day>$monthDays){\n\t\t\t$this->_day = self::$_monthTable[$this->_month-1];\n\t\t}\n\t\t$this->_mktime();\n\t\t$this->_setDate();\n\t}",
"public function setDate($date);",
"public function update(Request $request, Period $period, $id)\n {\n $periodName = DB::table('periods')->where('id',$id)->pluck('name');\n $time_range = array(\n 'name'=> $periodName[0],\n 'time_range' =>$request->input('time_range'),\n );\n if(Period::where('id',$id)->update($time_range)){\n return redirect()->route('period.show')->with('msg','Period updated Successfully!!');\n }else{\n return back()->with('msg', 'Error Occured!');\n }\n }",
"public function setSuspendPeriodUntil(?DateTime $suspendPeriodUntil): Card {\n $this->suspendPeriodUntil = $suspendPeriodUntil;\n return $this;\n }",
"public function update(Request $request, Period $period)\n {\n $period->fill($request->except('_method', '_token'))->save();\n return redirect()->route('period.index');\n }",
"public function update(Request $request){\n $code = $request->codigo_semestre;\n $period = Period::where(['codigo_semestre' => $code])->first();\n $period->timestamps = false;\n\n if ($period != null){\n if ($period->estado === 1){\n //$period->estado = 0;\n $period->update(['estado' => 0]);\n }\n else{\n //$period->enabled = 1;\n //$period->description = $request->description;\n }\n //$period->save();\n }\n return redirect('/dashboard/periods');\n }",
"function setEndDate(&$oDate)\n {\n if (is_a($oDate, 'date')) {\n $oDate->setHour(23);\n $oDate->setMinute(59);\n $oDate->setSecond(59);\n $oDate->subtractSeconds(25200);\n }\n }",
"public function setEndDate( KCommandContext $context )\n {\n $data = $context->data;\n \n if( $data->day || $data->month || $data->year )\n { \n $date = new KDate();\n \n $date->day( (int) $data->day );\n \n $date->month( (int) $data->month );\n \n $date->year( (int) $data->year );\n \n $data->endDate = $date;\n }\n }",
"function setSyncWarranty()\n {\n }",
"public function setBookingStatus($bookingStatus = null)\n {\n // validation for constraint: string\n if (!is_null($bookingStatus) && !is_string($bookingStatus)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($bookingStatus)), __LINE__);\n }\n if (is_null($bookingStatus) || (is_array($bookingStatus) && empty($bookingStatus))) {\n unset($this->BookingStatus);\n } else {\n $this->BookingStatus = $bookingStatus;\n }\n return $this;\n }",
"public function setMagneticFieldPeriod($period)\n {\n $payload = '';\n $payload .= pack('V', $period);\n\n $this->sendRequest(self::FUNCTION_SET_MAGNETIC_FIELD_PERIOD, $payload);\n }",
"function tradeoff_date_range($definition)\n {\n return app(Models\\Problem\\Range\\DateRange::class)->setData($definition);\n }",
"public function setBookExpiryAttribute($value)\n {\n if (!empty($value)) {\n $this->attributes['book_expiry'] = Carbon::parse($value)->format('Y-m-d H:i:s');\n }\n }",
"function setParam()\n {\n $this->rFromDate = '0000-00-00';\n $this->rToDate = date('Y-m-d');\n $this->rAllDate = false;\n $this->rColumns = array();\n }",
"public function setDateOfBirth()\n {\n $dateOfBirth = request('dob_year') . '-' . request('dob_month') . '-' . request('dob_day');\n\n $this->date_of_birth = $dateOfBirth;\n $this->save();\n }",
"function setEndDate($end_date = \"\") \n\t{\n\t\t$this->end_date = $end_date;\n\t}",
"public function setPeriod($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Cloud\\ErrorReporting\\V1beta1\\QueryTimeRange\\Period::class);\n $this->period = $var;\n\n return $this;\n }",
"function setData($data)\n {\n $this->date=$data;\n }",
"public function set(DateTimeImmutable $nowCurrent): void\n {\n $this->interval = $this->realClockService->get()->diff($nowCurrent);\n $this->sesionSection->offsetSet(static::INTERVAL, serialize($this->interval));\n }",
"public function setDate($value) {\n\t\t$this->_date = $value;\n\t}",
"public function setSleep($sleep)\n {\n $this->sleep = $sleep;\n }",
"public function testSetDateValidationBudget() {\n\n // Set a Date/time mock.\n $dateValidationBudget = new DateTime(\"2018-09-10\");\n\n $obj = new Collaborateurs();\n\n $obj->setDateValidationBudget($dateValidationBudget);\n $this->assertSame($dateValidationBudget, $obj->getDateValidationBudget());\n }",
"public function setEndDate(string $date);",
"public function updateperiod($id)\n {\n if (!Gate::allows('Administrator')) return redirect('/home')->with('warning', __('Somehow you the system tried to let you do something which is not allowed. So you are sent home!'));\n $model = Period::Find($id);\n $fields = ['baseprice','basepersons', 'maxpersons','personprice', 'from', 'to'];\n\n foreach($fields as $field)\n {\n if (($field == \"from\") || ($field == \"to\")) $model->$field = Carbon::parse(Input::get($field));\n else $model->$field = Input::get($field);\n }\n\n\n $success = __('Period updated');\n $errors = [];\n if (!$model->save())\n {\n $errors = $model->getErrors();\n $success = '';\n }\n return redirect('house/editperiod/'.$id)->with('success', $success)->with('errors', $errors);\n }",
"public function __construct(array $periods = array())\n {\n $this\n ->setPeriods($periods);\n }",
"public function setEndDate($endDate='')\r\n\t\t{\r\n\t\t\tif ($endDate != '')\r\n\t\t\t{\r\n\t\t\t\t$this->end_date = $endDate;\r\n\t\t\t}\r\n\t\t}",
"public function scopeWithinPeriod(Builder $query, Period $period);",
"public function lifetime($period)\n {\n return $this->update([\n $this->model->getExpirationAttribute() => is_string($period) ? Carbon::now()->add($period) : null\n ]);\n }",
"public function testUpdate()\n\t{\n\t\t$this->resetReservationTable();\n\t\t$this->resetDateTimes();\n\t\t\n\t\t$reservation = new Reservation();\n\t\t$reservation->setAttributes(array(\n\t\t\t\t'roomid' => 1,\n\t\t\t\t'datefrom' => $this->_dateOverlapFrom,\n\t\t\t\t'numberofnights'=> $this->_numberofnights,\n\t\t\t\t));\n\t\t$reservation->save(false);\t\n\t\t$newDateTo = DateTime::createFromFormat('Y-m-d',$this->_dateOverlapToObj->format('Y-m-d'));;\n\t\t$newDateTo->add(new DateInterval('P10D'));\n\n\n\t\t$reservation = Reservation::model()->findByPk($reservation->getAttribute('id'));\n\t\t$reservation->setAttribute('dateto',$newDateTo->format('Y-m-d'));\n\t\t$reservation->setAttribute('confirmreservation',true);\n\t\t\n\t\t//must run validation rules\n\t\t$this->assertTrue($reservation->save());\n\t\n\t\t\n\t\t$reservation = Reservation::model()->findByPk($reservation->getAttribute('id'));\n\t\t$this->assertEquals($newDateTo->format('Y-m-d'),$reservation->dateto);\t\n\n\t\t\n\t}",
"function fillPeriods($per) {\n global $db;\n\n //vyber vsetkych volieb\n $optionsQuery = \"SELECT * FROM volby\";\n $optionsStmt = $db->query($optionsQuery);\n $options = $optionsStmt->fetchAll(PDO::FETCH_ASSOC);\n\n //volebne obdobie (napr 2016 - 2020) sa rozdeli na pole\n $parts = explode(\" - \", $per);\n\n $prevYear = date('Y', strtotime($options[0]['den1']));\n for($i = 1; $i < count($options); $i++) {\n $year = date('Y', strtotime($options[$i]['den1']));\n\n //po vybere niektoreho obdobia tato volba zostane v zozname vybrana\n if ($parts[0] == $prevYear) {\n echo \"<option value=\\\"{$prevYear} - {$year}\\\" selected>{$prevYear} - {$year}</option>\";\n }\n else {\n echo \"<option value=\\\"{$prevYear} - {$year}\\\">{$prevYear} - {$year}</option>\";\n }\n $prevYear = $year;\n }\n}",
"public function testSetPeriodeEmploiDeb() {\n\n // Set a Date/time mock.\n $periodeEmploiDeb = new DateTime(\"2018-09-10\");\n\n $obj = new AttestationCacm();\n\n $obj->setPeriodeEmploiDeb($periodeEmploiDeb);\n $this->assertSame($periodeEmploiDeb, $obj->getPeriodeEmploiDeb());\n }",
"public function setAvailabilityEndDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('availabilityEndDateTime', $value);\n }",
"public function setSchedule(?GovernanceSchedule $value): void {\n $this->getBackingStore()->set('schedule', $value);\n }",
"public function setVacancy($vac){\n $this->vacancy = $vac;\n }",
"public function setDates($dates);",
"public function payWages($period)\n {\n $inventory = $this->inventory;\n $unitWage = $this->rules()->getUnitWage();\n $inventory->cash -= self::rd2($unitWage * $period);\n $this->inventory = $inventory;\n }",
"public function setMonth($month)\n {\n $this->month = $month;\n }",
"public function setReminderPeriod(array $reminderPeriod)\n {\n $this->reminderPeriod = $reminderPeriod;\n return $this;\n }",
"public function setMonth($month) {\n\t\t$this->month = $month;\n\t}",
"private function _setDate(){\n\t\tif($this->_year>=1970&&$this->_year<=2038){\n\t\t\t$this->_day = date('d', $this->_timestamp);\n\t\t\t$this->_month = date('m', $this->_timestamp);\n\t\t\t$this->_year = date('Y', $this->_timestamp);\n\t\t} else {\n\t\t\t$dateParts = self::_getDateParts($this->_timestamp, true);\n\t\t\t$this->_day = sprintf('%02s', $dateParts['mday']);\n\t\t\t$this->_month = sprintf('%02s', $dateParts['mon']);\n\t\t\t$this->_year = $dateParts['year'];\n\t\t}\n\t\t$this->_date = $this->_year.'-'.$this->_month.'-'.$this->_day;\n\t}",
"protected function setOfferApplicablePricing ()\n {\n $offerApplicableAccountHeads = $this->getOfferApplicableAccountHeads();\n\n foreach ( $this->request->pricing as $accountHead => $amount ) {\n if ( in_array($accountHead, $offerApplicableAccountHeads) ) {\n $this->offerApplicablePricing[ $accountHead ] = $amount;\n $this->offerApplicableAmount += $amount;\n }\n }\n }"
] | [
"0.7051499",
"0.5833409",
"0.5730289",
"0.5631127",
"0.5631127",
"0.5631127",
"0.56135935",
"0.55542153",
"0.5504153",
"0.5479121",
"0.5470114",
"0.5467011",
"0.54498273",
"0.5427049",
"0.54265",
"0.5397962",
"0.53862077",
"0.5379819",
"0.5339468",
"0.53365767",
"0.5327102",
"0.5323707",
"0.53229195",
"0.53090286",
"0.52906597",
"0.5285673",
"0.526753",
"0.51790905",
"0.50871253",
"0.5078345",
"0.50735766",
"0.5068782",
"0.5064657",
"0.5030312",
"0.501906",
"0.5012773",
"0.49824393",
"0.49792913",
"0.495038",
"0.4941595",
"0.49311012",
"0.49135542",
"0.49135542",
"0.48819175",
"0.4867169",
"0.48651743",
"0.48451558",
"0.4839992",
"0.4838354",
"0.48046324",
"0.4798332",
"0.47888285",
"0.47784704",
"0.47774014",
"0.4775368",
"0.47716567",
"0.476904",
"0.47640267",
"0.47640267",
"0.47629446",
"0.47618413",
"0.47594637",
"0.4750013",
"0.4742859",
"0.4721795",
"0.47211516",
"0.471744",
"0.47171983",
"0.47165677",
"0.4708624",
"0.4706402",
"0.46920046",
"0.46888462",
"0.46835127",
"0.4680785",
"0.46665457",
"0.46624345",
"0.46598017",
"0.4653832",
"0.46496376",
"0.46440536",
"0.46417326",
"0.46398246",
"0.46342868",
"0.46230802",
"0.46122783",
"0.4606827",
"0.46064234",
"0.4597721",
"0.45856053",
"0.4584331",
"0.45824936",
"0.45802894",
"0.45750132",
"0.4574591",
"0.4570271",
"0.4559624",
"0.45558858",
"0.45504168",
"0.45471644"
] | 0.65940213 | 1 |
Appends the current object to the passed DOM tree. | public function appendToDOM(DOMElement $element, $cdbScheme = '3.2') {
$dom = $element->ownerDocument;
$eventElement = $dom->createElement('event');
if ($this->ageFrom) {
$eventElement->appendChild($dom->createElement('agefrom', $this->ageFrom));
}
if ($this->availableFrom) {
$eventElement->setAttribute('availablefrom', $this->availableFrom);
}
if ($this->availableTo) {
$eventElement->setAttribute('availableto', $this->availableTo);
}
if ($this->cdbId) {
$eventElement->setAttribute('cdbid', $this->cdbId);
}
if ($this->createdBy) {
$eventElement->setAttribute('createdby', $this->createdBy);
}
if ($this->creationDate) {
$eventElement->setAttribute('creationdate', $this->creationDate);
}
if ($this->externalId) {
$eventElement->setAttribute('externalid', $this->externalId);
}
if (isset($this->isParent)) {
$eventElement->setAttribute('isparent', $this->isParent ? 'true' : 'false');
}
if (isset($this->lastUpdated)) {
$eventElement->setAttribute('lastupdated', $this->lastUpdated);
}
if (isset($this->lastUpdatedBy)) {
$eventElement->setAttribute('lastupdatedby', $this->lastUpdatedBy);
}
if (isset($this->owner)) {
$eventElement->setAttribute('owner', $this->owner);
}
if (isset($this->pctComplete)) {
$eventElement->setAttribute('pctcomplete', $this->pctComplete);
}
if (isset($this->private)) {
$eventElement->setAttribute('private', $this->private ? 'true' : 'false');
}
if (isset($this->published)) {
$eventElement->setAttribute('published', $this->published ? 'true' : 'false');
}
if (isset($this->validator)) {
$eventElement->setAttribute('validator', $this->validator);
}
if (isset($this->wfStatus)) {
$eventElement->setAttribute('wfstatus', $this->wfStatus);
}
if ($this->publisher) {
$eventElement->setAttribute('publisher', $this->publisher);
}
if ($this->calendar) {
$this->calendar->appendToDOM($eventElement);
}
if ($this->categories) {
$this->categories->appendToDOM($eventElement);
}
if ($this->contactInfo) {
$this->contactInfo->appendToDOM($eventElement);
}
if ($this->details) {
$this->details->appendToDOM($eventElement);
}
if (count($this->keywords) > 0) {
$keywordsElement = $dom->createElement('keywords');
if (version_compare($cdbScheme, '3.3', '>=')) {
foreach ($this->keywords as $keyword) {
$keyword->appendToDOM($keywordsElement);
}
$eventElement->appendChild($keywordsElement);
} else {
$keywords = array();
foreach ($this->keywords as $keyword) {
$keywords[$keyword->getValue()] = $keyword->getValue();
}
$keywordsElement->appendChild($dom->createTextNode(implode(';', $keywords)));
$eventElement->appendChild($keywordsElement);
}
}
if (isset($this->languages)) {
$this->languages->appendToDOM($eventElement);
}
if ($this->location) {
$this->location->appendToDOM($eventElement);
}
if ($this->organiser) {
$this->organiser->appendToDOM($eventElement);
}
if ($this->maxParticipants) {
$eventElement->appendChild($dom->createElement('maxparticipants', $this->maxParticipants));
}
if ($this->bookingPeriod) {
$this->bookingPeriod->appendToDOM($eventElement);
}
if (!empty($this->relations)) {
$relationsElement = $dom->createElement('eventrelations');
foreach ($this->relations as $relation) {
$relationElement = $dom->createElement('relatedproduction');
$relationElement->appendChild($dom->createTextNode($relation->getTitle()));
$relationElement->setAttribute('cdbid', $relation->getCdbid());
$externalId = $relation->getExternalId();
if ($externalId) {
$relationElement->setAttribute('externalid', $relation->getExternalId());
}
$relationsElement->appendChild($relationElement);
}
$eventElement->appendChild($relationsElement);
}
$element->appendChild($eventElement);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function append($obj) {\r\n\t\t$obj->pzkParentId = @$this->id;\r\n\t\t$this->children[] = $obj;\r\n\t}",
"function append ( $element ) {\n $this->childrenElements[] = $element;\n }",
"public function append() {\n $num_of_args = func_num_args();\n if ( $num_of_args == 1 && gettype( func_get_arg( 0 ) ) == \"array\" ) {\n $args = func_get_arg( 0 );\n $num_of_args = count( $args );\n } else {\n $args = func_get_args();\n }\n for ( $i = 0; $i < $num_of_args; $i++ ) {\n $arg = $args[$i];\n if ( $arg instanceof AbstractHTMLElement ) {\n $this->content .= $arg->asHTML();\n } else {\n $this->content .= $arg;\n }\n }\n return $this;\n }",
"function append($content) {\r\n\t\tif (is_string($content)) {\r\n\t\t\t$this->append($this->domFragment->createTextNode($content));\r\n\t\t} else {\r\n\t\t\t$this->root->appendChild($content);\r\n\t\t}\r\n\t}",
"function addSelfToDocument($domtree, $parentElement) { \n // create the root element for this class and append it to our parent\n $xmlRoot = $parentElement->appendChild($domtree->createElement('view'));\n $xmlRoot->appendChild($domtree->createElement('siteicon_url', get_option('hbo_siteicon_url')));\n $xmlRoot->appendChild($domtree->createElement('housekeepingurl', get_option('hbo_housekeeping_url')));\n $xmlRoot->appendChild($domtree->createElement('split_room_report_url', get_option('hbo_split_room_report_url')));\n $xmlRoot->appendChild($domtree->createElement('unpaid_deposit_report_url', get_option('hbo_unpaid_deposit_report_url')));\n $xmlRoot->appendChild($domtree->createElement('group_bookings_report_url', get_option('hbo_group_bookings_report_url')));\n $xmlRoot->appendChild($domtree->createElement('guest_comments_report_url', get_option('hbo_guest_comments_report_url')));\n $xmlRoot->appendChild($domtree->createElement('bedcounts_url', get_option('hbo_bedcounts_url')));\n $xmlRoot->appendChild($domtree->createElement('manual_charge_url', get_option('hbo_manual_charge_url')));\n $xmlRoot->appendChild($domtree->createElement('generate_payment_link_url', get_option('hbo_generate_payment_link_url')));\n $xmlRoot->appendChild($domtree->createElement('payment_history_url', get_option('hbo_payment_history_url')));\n $xmlRoot->appendChild($domtree->createElement('payment_history_inv_url', get_option('hbo_payment_history_inv_url')));\n $xmlRoot->appendChild($domtree->createElement('process_refunds_url', get_option('hbo_process_refunds_url')));\n $xmlRoot->appendChild($domtree->createElement('refund_history_url', get_option('hbo_refund_history_url')));\n $xmlRoot->appendChild($domtree->createElement('report_settings_url', get_option('hbo_report_settings_url')));\n $xmlRoot->appendChild($domtree->createElement('view_log_url', get_option('hbo_view_log_url')));\n $xmlRoot->appendChild($domtree->createElement('job_history_url', get_option('hbo_job_history_url')));\n $xmlRoot->appendChild($domtree->createElement('job_scheduler_url', get_option('hbo_job_scheduler_url')));\n $xmlRoot->appendChild($domtree->createElement('blacklist_url', get_option('hbo_blacklist_url')));\n $xmlRoot->appendChild($domtree->createElement('online_checkin_url', get_option('hbo_online_checkin_url')));\n $xmlRoot->appendChild($domtree->createElement('redirect_to_url', get_option('hbo_redirect_to_url')));\n $xmlRoot->appendChild($domtree->createElement('log_directory', get_option('hbo_log_directory')));\n $xmlRoot->appendChild($domtree->createElement('log_directory_url', get_option('hbo_log_directory_url')));\n $xmlRoot->appendChild($domtree->createElement('run_processor_cmd', get_option('hbo_run_processor_cmd')));\n }",
"public function & append( $a_tag )\n\t{\n\t\tif($a_tag instanceof ZXmlTag)\n\t\t\t$this->m_document->appendChild($a_tag->node());\n\t\telse if($a_tag instanceof DOMNode)\n\t\t\t$this->m_document->appendChild($a_tag);\n\t\treturn $this;\n\t}",
"private function pushNode(\\DOMElement $node)\r\n {\r\n $this->currentNode = $this->currentNode->appendChild($node);\r\n }",
"public function appendTo ($target) { \r\n\t\t\r\n\t\tif ($target = $this->process($target))\r\n\t\t\tforeach ($this as $node) \r\n\t\t\t\tif (get_class($target) === 'XDTNodeList' OR is_array($target)) \r\n\t\t\t\t\tforeach ($target as $t) $t->appendChild($node);\r\n\t\t\t\telse $target->appendChild($node);\r\n\t\t\t\t\r\n\t\treturn $this;\r\n\t}",
"public function appendChildCopy($item) {}",
"public function appendNode($type) {\n $node = new Node($type, $this->current);\n $this->current->append($node);\n $this->current = $node;\n }",
"public function add ($obj) {\n\t\treturn $this->append($obj);\t\n\t}",
"public function appendTo(Element $parentNode): void {\n foreach ($this->_document->childNodes as $node) {\n if ($node instanceof \\DOMElement) {\n $this->addNode($parentNode, $node);\n }\n }\n }",
"public function appendChild(Pagemill_Node $node) {\r\n\t\t$tmp = new Pagemill_Stream(true);\r\n\t\t$node->rawOutput($tmp);\r\n\t\t$this->_text .= $tmp->peek();\r\n\t}",
"function OBJM_AddNewObjectToSCXML($elemID, $type, $class, $level, $nodeTitle, $parentID, $dataID, $datatype, $dataOrig)\r\n{\r\n\t$retval = $_SESSION['sceneCompXMLDOM']->load($_SESSION['sceneCompXMLFilePath']);\r\n\tif($retval != true)\r\n\t\treturn false;\r\n\r\n\t$displaystring = $nodeTitle;\r\n\tglobal $treehandlerfnname;\r\n\t\r\n\t//\r\n\t$elemID = strtoupper($elemID); \r\n\t$type = strtoupper($type);\r\n\t$class = strtoupper($class);\r\n\t$level = strtoupper($level); \r\n\t$parentID = strtoupper($parentID); \r\n\t//$attrdefinition = array(\"id\"=>$elemID, \"type\"=>$type,\"class\"=>$class,\"level\"=>$level, \"data-origin\"=>\"original\" , \"data-srcid\"=>\"none\", \"onclick\"=>$treehandlerfnname, \"dataid\"=>$dataID, \"data-type\"=>$datatype);\r\n\t$attrdefinition = array(\"id\"=>$elemID, \"type\"=>$type,\"class\"=>$class,\"level\"=>$level, \"data-origin\"=>$dataOrig , \"data-srcid\"=>\"none\", \"dataid\"=>$dataID, \"data-type\"=>$datatype, \"name\"=>$nodeTitle);\r\n\t$retval = CDOC_COMMON_AddXMLElement($_SESSION['sceneCompXMLDOM'], $_SESSION['sceneCompXMLFilePath'],\r\n\t\t\t\"li\", $displaystring, $parentID, $attrdefinition, true);\r\n\tif($retval != true)\r\n\t\treturn false;\r\n\t$newObj = $_SESSION['sceneCompXMLDOM']->getElementById($elemID);\t \r\n\t$retval = $_SESSION['sceneCompXMLDOM']->saveXML($newObj); \r\n\treturn $retval;\r\n}",
"public function append()\n {\n $this->append = true;\n\n return $this;\n }",
"public function appendChild($item, ?\\SetaPDF_Core_Document $document = null, $mode = null) {}",
"public function addChild(HTMLElement $el) {\n\t\tparent::addChild($el);\n\t\t/* Add pointer to last child, and its children */\n\t\t$this->rAddPointers($this->getChild($this->getNoOfChildren()-1));\n\t}",
"public function append ($content) {\r\n\t\t\r\n\t\tif ($this->length < 1) return null;\r\n\t\t\r\n\t\t$args = func_get_args();\r\n\t\tforeach ($args as $offset => $value) \r\n\t\t\tif ($value = $this->process($value)) \r\n\t\t\t\tforeach ($this as $node) \r\n\t\t\t\t\tif (get_class($value) === 'XDTNodeList') $node->appendChild($value[0]);\r\n\t\t\t\t\telse $node->appendChild($value);\r\n\t\t\t\t\r\n\t\treturn $this;\r\n\t}",
"function append($data) {}",
"public function pushNode( $node );",
"public function attachTo($parentNode)\r\n {\r\n $parentNode->appendChild($this);\r\n }",
"abstract protected function addNode(\\DOMNode $target, \\DOMNode $source);",
"public function appendToDom($doc, $parentNode, $parent=NULL)\n\t{\n\t\t$node = $doc->createElement($this->dom->nodeName);\n\t\t\n\t\t// Apply the style to this node\n\t\t$node->setAttribute(\"style\", $this->getStyle()->getHTMLStyleAttributeValue());\n\n\t\t// Apply the shape attributes to this node\n\t\t$node->setAttribute(\"type\", $this->dom->getAttribute(\"type\"));\n\t\t$node->setAttribute(\"values\", $this->dom->getAttribute(\"values\"));\n\n\t\t// Append this node to the parentNode\n\t\t$parentNode->appendChild($node);\n\t}",
"function append($node) {\n\t\tif (!is_array($node)) {\n\t\t\t$this->child[]=$node;\n\t\t} else if (is_array($node)) {\n\t\t\tfor ($childIdx=0; $childIdx<count($node); $childIdx++)\n\t\t\t\t$this->child[]=$node[$childIdx];\n\t\t}\n\t}",
"public function append($data);",
"function appendChild ($a_node)\n\t{\n\t\treturn $this->doc->append_child($a_node);\n\t}",
"public function append($element)\n {\n $this->elements[] = $element;\n $this->iteratorCount = count($this->elements);\n }",
"function add($str) {\n\t $this->xml .= $str;\n\t}",
"public function end()\n {\n # attach internal tree to parent\n $this->parentNode->getNode()->addChild($this->getNode());\n \n return $this->parentNode; \n }",
"function putInTree()\n\t{\n//echo \"st:putInTree\";\n\t\t// chapters should be behind pages in the tree\n\t\t// so if target is first node, the target is substituted with\n\t\t// the last child of type pg\n\t\tif ($_GET[\"target\"] == IL_FIRST_NODE)\n\t\t{\n\t\t\t$tree = new ilTree($this->content_object->getId());\n\t\t\t$tree->setTableNames('lm_tree','lm_data');\n\t\t\t$tree->setTreeTablePK(\"lm_id\");\n\n\t\t\t// determine parent node id\n\t\t\t$parent_id = (!empty($_GET[\"obj_id\"]))\n\t\t\t\t? $_GET[\"obj_id\"]\n\t\t\t\t: $tree->getRootId();\n\t\t\t// determine last child of type pg\n\t\t\t$childs =& $tree->getChildsByType($parent_id, \"pg\");\n\t\t\tif (count($childs) != 0)\n\t\t\t{\n\t\t\t\t$_GET[\"target\"] = $childs[count($childs) - 1][\"obj_id\"];\n\t\t\t}\n\t\t}\n\t\tif (empty($_GET[\"target\"]))\n\t\t{\n\t\t\t$_GET[\"target\"] = IL_LAST_NODE;\n\t\t}\n\n\t\tparent::putInTree();\n\t}",
"public function append($element)\n {\n $this->_data[] = $element;\n return $this;\n }",
"public static function appendChild(\\SimpleXMLElement $to, \\SimpleXMLElement $from)\n {\n $toDom = dom_import_simplexml($to);\n $fromDom = dom_import_simplexml($from);\n $toDom->appendChild($toDom->ownerDocument->importNode($fromDom, true));\n }",
"function &AppendNode($Name)\n {\n //$node =& new XMLNode($Name);\n $node = new XMLNode($Name); // FRC\n $node->SetParent($this);\n\n // Do not use array_push with pass-by-reference any more to avoid\n // allow_call_time_pass_reference warning (Oliver Grahl, 2006-08-31)\n //array_push($this->ChildNodes, &$node);\n $this->ChildNodes[] =& $node;\n\n return $node;\n }",
"function _StartElement($parser, $name, $attrs) {\n $this->_CurrentNode =& $this->_CurrentNode->AppendNode($name);\n }",
"protected function append($child): void\n {\n $this->children[] = $child;\n }",
"function toBuffer()\n {\n foreach ($this->children as $child) {\n $child->toBuffer();\n }\n return $this;\n }",
"public function addElement($tag = '')\n {\n $htmlTag = (\n is_object($tag) && $tag instanceof self ?\n $tag :\n new static($tag)\n );\n $htmlTag->top = $this->getTop();\n $htmlTag->parent = &$this;\n $this->content[] = $htmlTag;\n return $htmlTag;\n }",
"public function start_el(&$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0)\n {\n }",
"public function start_el(&$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0)\n {\n }",
"public function start_el(&$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0)\n {\n }",
"public function load() {\n\t\tforeach ($this->childWidgets as $widget) {\n\t\t\tif ($widget->getElement() == null) {\n\t\t\t\tConsole::error($widget);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tDOM::appendChild($this->getElement(), $widget->getElement());\n\t\t\t$widget->load();\n\t\t}\n\t\tparent::load();\n\t}",
"public function start_el(&$output, $data_object, $depth = 0, $args = \\null, $current_object_id = 0)\n {\n }",
"public function start_el(&$output, $data_object, $depth = 0, $args = \\null, $current_object_id = 0)\n {\n }",
"public function testAppendObject() {\n\t\t\t$obj = new class { public function __toString() { return \"Boots\"; } };\n\t\t\t$builder = new StringBuilder();\n\t\t\t$builder->append(\"Cats\", $obj);\n\n\t\t\t$this->assertEquals(\"CatsBoots\", $builder->__toString());\n\t\t\tunset($builder, $obj);\n\t\t}",
"function build () {\n foreach ( $this->items as $item ) {\n if ( $item->isRoot() ) {\n $this->menu[]=$item;\n $this->appendChildren($item);\n }\n }\n reset ( $this->menu );\n }",
"public function create()\r\n {\r\n // Load only root elements.\r\n $this->loadRoots($this->elements, $this->roots);\r\n\r\n // Make sure that first element isn't child. If child then throw a exception about that.\r\n if ($this->elements[0]->isChild())\r\n TypeRegression::cantBe('child', 'First');\r\n\r\n // Set elements compiled field with relations\r\n $this->makeRelationsToCompiled($this->elements);\r\n \r\n // After append process by root-child then compile all stuffs into 'page' field.\r\n foreach ($this->roots as $key => $element) {\r\n \r\n $this->page .= $element->compiled;\r\n }\r\n }",
"protected function _push($item)\n { \n $node = new Tree_Node($item);\n \n if ($tree = $this->_traverse($this->getRootNode(), $node)) {\n $tree->attach($node);\n }\n }",
"function appendChildren () {\n $this->menu[]=new Marker('start');\n foreach ( $this->items as $item ) {\n if ( $item->parent_id() == $this->current->id() ) {\n $this->menu[]=$item;\n }\n }\n $check=end($this->menu);\n if ( $check->isStart() )\n array_pop($this->menu);\n else\n $this->menu[]=new Marker('end');\n }",
"function appendChild(&$treeItem, $parentItem) {\n\t\t$this->trackItem($treeItem);\n\n\t\tif ($parentItem == null) {\n\t//\t\t$parentItem =& $this->_rootNode;\n\t\t\t$this->rootItem->children[] = $treeItem->getId();\n\t\t} else {\n\t\t\t//get the global reference\n\t\t\t$parentItem =& $this->getItem($parentItem);\n\t\t\tif ($treeItem->_expanded) {\n\t\t\t\t$this->expandBranch($parentItem);\n\t\t\t}\n\t//\t\t$parentItem->appendChild($treeItem);\n\t\t\t$parentItem->children[] = $treeItem->getId();\n\t\t\t$treeItem->_parentPointer = $parentItem->getId();\n\t\t}\n\t}",
"function build () {\n foreach ( $this->items as $item ) {\n if ( $item->id() == $this->current->id() ) {\n $this->menu[]=$item;\n $this->appendChildren();\n } else if ( $item->parent_id() == $this->current->parent_id() ) {\n $this->menu[]=$item;\n }\n }\n reset ( $this->menu );\n }",
"public function addNode(self $node) : self\n {\n $this->append($node);\n return $this;\n }",
"public function add(\\wkhtmltox\\PDF\\Object $object): void {}",
"function addNode($inparms){\n if ($this->_query->sizeof()) {\n $this->_query->append(new queryElement($_SESSION['global_currentOperator'], 'o'));\n }\n $this->_query->append(new queryNode($inparms['title'],$inparms['id']));\n\n return $this->output(NULL);\n }",
"public function addElement(SVGElement $elementObject) {\n\n $this->elementsList[] = $elementObject;\n\n return $this;\n }",
"public function appendTo(PapayaXmlElement $parent) {\n $this->elements()->appendTo($parent);\n return NULL;\n }",
"public function push($el){\r\n\r\n array_push($this->data,$el);\r\n\r\n }",
"function updateDomElement( &$appctx )\n\t\t{\n\t\t$appctx->Indent() ; echo( \"cmsnodes[$this->idx].updateDomElement() ;\\n\" ) ;\n\t\t}",
"public function add($obj) {\n\t}",
"protected function _traverse($window_id, $a, DomDocument $dom, $root_node = null, $is_packed = false) {\n if ( !$root_node ) {\n $root_node = $dom;\n }\n\n if ( isset($a->object) && ($os = $a->object) ) {\n foreach ( $os as $o ) {\n // Create DOM node, apply styles\n list($node, $packed, $class) = $this->_scan($dom, $window_id, $o, $is_packed);\n\n // Check children\n if ( isset($o->child) && ($children = $o->child) ) {\n foreach ( $children as $c ) {\n $this->_traverse($window_id, $c, $dom, $node, $packed);\n }\n }\n\n // Make sure we have valid HTML\n if ( !in_array($class, self::$ShortTags) && !$node->hasChildNodes() ) {\n $node->appendChild(new DomText(\"\"));\n }\n\n // Check if we need a <li> element here\n if ( $node->nodeName != \"li\" && $root_node->nodeName == \"ul\" ) {\n $outer = $dom->createElement(\"li\");\n $outer->appendChild($node);\n $node = $outer;\n }\n\n // Perform packing if needed, insert into parent\n if ( $is_packed ) {\n $root_node->appendChild($this->_pack($dom, $a, $node));\n } else {\n $root_node->appendChild($node);\n }\n }\n }\n }",
"public function appendChild(\\SetaPDF_Core_Document_OutlinesItem $item) {}",
"public function push($obj)\r\n\t{\r\n\t\t$this->isLoaded = true;\r\n\t\t$this->keyAssocation[$obj->get($this->obj->primaryKey)] = $this->count++;\r\n\t\t$this->elements[] = $obj;\r\n\t}",
"public function appendChild(Node $node)\n {\n $this->_children[] = $node;\n }",
"public function appendTo(PapayaXmlElement $parent) {\n $this->items()->clear();\n $this->callbacks()->onBeforeAppend($this->items());\n foreach ($this->elements() as $index => $element) {\n if (isset($this->callbacks()->onCreateItem)) {\n $item = $this->callbacks()->onCreateItem($element, $index);\n } else {\n $itemClass = $this->_itemClass;\n $item = new $itemClass($element, $index);\n }\n if ($item instanceOf PapayaUiNavigationItem) {\n $this->items()->add($item);\n $this->callbacks()->onAfterAppendItem($item, $element, $index);\n }\n }\n $parent->append($this->items());\n $this->callbacks()->onAfterAppend($this->items());\n }",
"private function append ($node) {\n\n if(empty($node->id)) {\n Debug::printMsg('<li><span style=\"color:orange\">No predefined id found, so creating node</span> ('.$node->className.$node->tableName.')</li>');\n }\n\n // if this record is required then make sure it is valid (error==0) and non-empty\n if($this->isRequired($node)) {\n\n Debug::printMsg('<li><span style=\"color:orange\">Property is required</span> ('.$node->classId.$node->tableName.')</li>');\n\n // required but has errors or is empty and has no id\n if(($node->hasErrors() || $node->isEmpty()) && empty($node->id)) {\n\n if($node->hasErrors()) {\n\n $this->errors[] = $node->getErrors();\n Debug::printMsg('<span style=\"color:red\">...but has errors!</span>');\n\n } else if ($node->isEmpty()) {\n\n Debug::printMsg('<span style=\"color:red\">...but is empty!</span>');\n }\n \n\n // required, no errors and non-empty -> accept\n } else {\n\n $this->data[] = $node;\n // mark to template that this was found\n Debug::printMsg('<li><span style=\"color:green\">...and found!</span> </li>');\n $this->markIsRequired($node);\n }\n\n // not required but has errors\n } else if($node->hasErrors()) {\n \n $this->errors[] = $node->errors;\n\n // not required but is non-empty or has id -> accept\n } else if (!$node->isEmpty() || !empty($node->id)) {\n\n $this->data[] = $node;\n }\n\n }",
"private function lazyAppend()\n {\n if (!parent::valid() and $this->iterators->valid()) {\n $this->append($this->iterators->current());\n $this->iterators->next();\n }\n }",
"private function build_tree()\n\t\t{\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul_first\" onkeydown=\"return input_main_key(event,\\''.$this->internal_id.'\\')\">';\n\n\t\t\t//==================================================================\n\t\t\t// Always first this row in tree ( edit mode only )\n\t\t\t//==================================================================\n\t\t\tif ($this->edit_mode)\n\t\t\t{\n\t\t\t\t$this->html_result .= '<div class=\"'.$this->style.'_interow\" id=\"'.$this->internal_id.'INT_0\" OnClick=\"add_new_node(\\''.$this->internal_id.'\\',0)\"></div>';\n\t\t\t}\n\t\t\t//==================================================================\n\t\t\t\n\t\t\t$this->scan_level(0,$this->get_any_child(1));\n\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul\">';\n\t\t}",
"function end_tag() {\r\n\t\t$this->push_nodelist();\r\n\t\t\r\n\t}",
"public function appendChild($child = NULL)\n\t{\n\t\tif ($child instanceof DOMNode) {\n\t\t\tparent::appendChild($child);\n\t\t}\n\t\treturn $this;\n\t}",
"function appendXmlNode($domDocument, $parentNode, $name, $value){\n \t$childNode = $domDocument->createElement($name);\n \t$childNodeValue = $domDocument->createTextNode($value);\n \t$childNode->appendChild($childNodeValue);\n \t$parentNode->appendChild($childNode);\n}",
"function writeHTML()\n\t{\n\t\tglobal $_activeTree;\n\t\t\n\t\t$c = count($this->children);\n\n\t\tif ($this->link)\n\t\t{\n\t\t\t$title = \"<a href='{$this->link}' target='{$this->target}'>{$this->title}</a>{$this->extras}\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$title = \"<a href='#' onclick='\";\n\t\t\t\n\t\t\tif ($_activeTree->onSelect)\n\t\t\t{\n\t\t\t\t$title .= \"{$_activeTree->onSelect}(\\\"{$this->value}\\\");\";\n\t\t\t}\n\t\t\t\n\t\t\t$title .= \"; return false'>{$this->title}</a>{$this->extras}\";\n\t\t}\n\t\t\n\t\tif ($c == 0 && !$this->onDemand)\n\t\t{\n\t\t\t// Leaf node\n\t\t\techo \"<div class='{$this->leafStyle}'>\";\n\n\t\t\tif (isset($this->value) && $this->value !== \"\" && $_activeTree->selectMode != 'navigation')\n\t\t\t{\n?>\n\t\t\t<input type=\"checkbox\" class=\"checkbox\" name=\"<? echo $this->id?>\" value=\"<? echo $this->value?>\"<? \n\t\t\t\tif ($this->checked) echo \" checked\";\n\t\t\t\tif ($this->disabled) echo \" disabled\";\n\t\t\t\tif ($_activeTree->selectMode == \"single\") \n\t\t\t\t{\n\t\t\t\t\techo \" onclick=\\\"Tree.clearCheckBoxes('{$_activeTree->id}', this);\";\n\t\t\t\t\tif ($_activeTree->onSelect)\n\t\t\t\t\t{\n\t\t\t\t\t\techo \" {$_activeTree->onSelect}('{$this->value}');\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"\\\"\";\n\t\t\t\t}\n\t\t\t\telse if ($_activeTree->onSelect)\n\t\t\t\t{\n\t\t\t\t\techo \" onclick=\\\"{$_activeTree->onSelect}('{$this->value}');\\\"\";\n\t\t\t\t}\n\t\t\t\t ?>/>\n<?\n\t\t\t}\n\t\t\n\t\t\techo \"$title</div>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($this->open)\n\t\t\t{\n\t\t\t\t$style = $this->openStyle;\n\t\t\t\t$display = \"block\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$style = $this->closedStyle;\n\t\t\t\t$display = \"none\";\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\tif ($this->onDemand)\n\t\t\t{\n\t\t\t\t$cmd = \"Tree.loadOnDemand('{$this->id}', '{$this->onDemand}');\";\n\t\t\t\t\n\t\t\t\tif ($this->open)\n\t\t\t\t{\n?>\n<script type=\"text/javascript\">\n\twindow.addEvent('domready', function() {Tree.loadOnDemand('<?echo $this->id?>', '<?echo $this->onDemand?>');});\n</script>\n<?\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$cmd = \"\";\n\t\t\t}\n\t\t\t\n\t\t\t$cmd .= \"Tree.toggleFolder('{$this->id}', '{$this->openStyle}', '{$this->closedStyle}');\";\n?>\n\t\t<div id='<?echo $this->id?>' class='<?echo $style?>' onclick=\"<?echo $cmd ?>\">\n<?\n\t\t\tif (isset($this->value) && $this->value !== \"\")\n\t\t\t{\n?>\n\t\t\t<input type=\"checkbox\" class=\"checkbox\" name=\"<? echo $this->id?>\" value=\"<? echo $this->value?>\" <? \n\t\t\t\tif ($this->checked) echo \" checked\";\n\t\t\t\tif ($this->disabled) echo \" disabled\";\n\t\t\t\tif ($_activeTree->selectMode == \"single\") \n\t\t\t\t{\n\t\t\t\t\techo \" onclick=\\\"Tree.clearCheckBoxes('{$_activeTree->id}', this);\";\n\t\t\t\t\tif ($_activeTree->onSelect)\n\t\t\t\t\t{\n\t\t\t\t\t\techo \" {$_activeTree->onSelect}('{$this->value}');\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"\\\"\";\n\t\t\t\t}\n\t\t\t\telse if ($_activeTree->onSelect)\n\t\t\t\t{\n\t\t\t\t\techo \" onclick=\\\"{$_activeTree->onSelect}('{$this->value}');\\\"\";\n\t\t\t\t}\n\t\t\t\t ?>/>\n<?\n\t\t\t}\n?>\n\t\t<?echo $title?></div>\n\t\t<div id='<?echo $this->id?>_contents' style='padding-left: <?echo $_activeTree->indent ?>; display: <? echo $display?>'>\n\t\t\t\n<?\t\t\t\n\t\t\tfor($i = 0; $i < $c; ++$i)\n\t\t\t{\n\t\t\t\t$this->children[$i]->writeHTML();\n\t\t\t}\n?>\n\t\t</div>\n<?\n\t\t}\n\t}",
"public function append(self $item, ?\\SetaPDF_Core_Document $document = null, $mode = null) {}",
"public function add($element);",
"public function add($element);",
"public function add($element);",
"function StartElement($parser, $name, $attrs = array())\n {\n $name = strtolower($name); \n \n //Check to see if tag is root-level\n if (count($this->stack) == 0) \n {\n //If so, set the document as the current tag\n $this->document = new XMLTag($name, $attrs);\n\n //And start out the stack with the document tag\n $this->stack = array('document');\n }\n //If it isn't root level, use the stack to find the parent\n else\n {\n //Get the name which points to the current direct parent, relative to $this\n $parent = $this->GetStackLocation();\n\t\t\t\n\t\t\t$name = str_replace(\"-\", \"_\", $name);\n\t\t\t$name = str_replace(\"_>\", \"->\", $name);\n\t\t\t\n //Add the child\n eval('$this->'.$parent.'->AddChild($name, $attrs, '.count($this->stack).');');\n\n //Update the stack\n eval('$this->stack[] = $name.\\'[\\'.(count($this->'.$parent.'->'.$name.') - 1).\\']\\';');\n }\n }",
"public function build()\n {\n\n if ($this->html)\n return $this->html;\n\n if (count($this->data) == 0) {\n $this->html .= '<ul id=\"'.$this->id.'\" class=\"wgt_tree\" >'.NL;\n $this->html .= '</ul>'.NL;\n\n return $this->html;\n }\n\n $html = '';\n\n $html .= '<ul id=\"'.$this->id.'\" class=\"wgt_tree\" >'.NL;\n\n\n foreach ($this->data as $id => $row) {\n\n $entry = $this->buildTreeNode($row);\n\n $html .= <<<HTML\n<li id=\"{$this->id}_{$id}\" >\n\n {$entry}\n <ul id=\"{$this->id}_{$id}_tree\" ></ul>\n\n</li>\n\nHTML;\n\n\n }\n\n $html .= '</ul>'.NL;\n\n\n $this->html = $html;\n\n return $this->html;\n\n }",
"public function add($object): void;",
"function addChild( $node )\n\t\t{\n\t\t$this->childs[] = $node ;\n\t\t}",
"function &add(& $element)\n {\n if (!is_a($element, 'Image_Graph_Font')) {\n $this->_elements[] = &$element;\n }\n $element->_setParent($this);\n return $element;\n }",
"private function parse()\n {\n $this->parseChildrenNodes($this->_dom, $this->_rootNode);\n }",
"public function buildAjaxNode($parentNode)\n {\n\n if ($this->html)\n return $this->html;\n\n $html = '';\n\n if ($this->ajaxInsert) {\n\n $html .= <<<HTML\n <htmlArea selector=\"ul#{$parentNode}\" action=\"append\" ><![CDATA[\nHTML;\n\n foreach ($this->data as $id => $row) {\n\n $entry = $this->buildTreeNode($row);\n\n $html .= <<<HTML\n <li id=\"{$this->id}_{$id}\" >\n {$entry}\n <ul id=\"{$this->id}_{$id}_tree\" ></ul>\n </li>\nHTML;\n\n }\n\n $html .= <<<HTML\n]]></htmlArea>\nHTML;\n\n\n }//end if\n else {\n $html .= <<<HTML\n <htmlArea selector=\"ul#{$parentNode}\" action=\"replace\" ><![CDATA[\nHTML;\n\n foreach ($this->data as $id => $row) {\n\n $entry = $this->buildTreeNode($row);\n\n $html .= <<<HTML\n <li id=\"{$this->id}_{$id}\" >\n {$entry}\n <ul id=\"{$this->id}_{$id}_tree\" ></ul>\n </li>\nHTML;\n\n }\n\n $html .= <<<HTML\n]]></htmlArea>\nHTML;\n\n }//end else\n\n $this->html = $html;\n\n return $this->html;\n\n }",
"function add()\n\t{\n\t\t$this->_updatedata();\n\t}",
"public function appendChildCopy($originalItem, \\SetaPDF_Core_Document $document) {}",
"public function after(&$obj) {\r\n\t\tif ($parent = $this->getParent()) {\r\n\t\t\t$parent->insert($obj, $this->index() + 1);\r\n\t\t}\r\n\t}",
"public function addObject($object) {\n\t\t$this->_object = $object;\n\t\treturn $this;\n\t}",
"public function addChildElement(HtmlElementInterface $element);",
"public function prepend($obj) {\r\n\t\t$obj->pzkParentId = @$this->id;\r\n\t\tarray_unshift($this->children, $obj);\r\n\t}",
"public function append(Node $node)\n {\n\n if (!is_array($this->_children)) {\n $this->_children = [];\n }\n\n $this->_children[] = $node;\n return $this;\n }",
"function push_nodelist() {\r\n\t\t\r\n\t\tif (!is_null($this->right)) {\r\n\t\t\t$this->nodelists[] = array($this->right, $this->nodelist);\r\n\t\t\t\r\n\t\t} \r\n\t\t\r\n\t}",
"function push_raw_ref ( ) {\n\t\t$this->raw_refs[] = $this->raw_ref;\n\t\t$this->clear_raw_ref();\n\t}",
"public function add($element) {\n //debug('Form->add() ; START');\n //debug('Form->add() : '.get_class($element).' -- '.$element->getName().' -- '.$element->getId());\n if(is_object($element)) {\n if(false == $this->idIsAvailable($element)) {\n throw new Exception('Element name ('.$element->getId().') already exist');\n } else {\n $this->elements[] = $element;\n $this->aIds[] = $element->getId();\n $this->nbElements++;\n\n //debug('Form->add() : fireEvent(\\'addedToParent\\')');\n //debug('Form->add() : $this->errorMethod : '.$this->errorMethod);\n $element->fireEvent('addedToParent', array(\n 'parent' => $this,\n 'showError' => $this->errorMethod\n ));\n\n //~ $element->setParent($this);\n }\n } else {\n throw new Exception('Can\\'t add element : it must be an object');\n }\n\n //debug('Form->add() ; END');\n return $element;\n }",
"private function pushCurrent()\n {\n if (!empty($this->data)) {\n $this->json .= 'dataLayer.push('.json_encode($this->data).');';\n $this->data = array();\n }\n }",
"public function append($stringOrObject)\n {\n array_push($this->content, $stringOrObject);\n\n return $this;\n }",
"public function getAppendBeforeNode();",
"public function apply(\\DOMElement $dom, Scope $scope);",
"public function end() { \r\n\t\t\r\n\t\t$this->xml_query = null; \r\n\t\t$this->root = $this[0]->ownerDocument->firstChild; \r\n\t\t\r\n\t\treturn $this; \r\n\t}",
"public function run($new =Null){\r\n\t\t\tif(!is_null($new)){\r\n\t\t\t\tif(is_a($new,jqmel)){\r\n\t\t\t\t\t$new = $new->get()[0];\r\n\t\t\t\t\tif(!$new)return;\r\n\t\t\t\t}else if(is_a($new,jqmdoc)){\r\n\t\t\t\t$new = $html->__toString();\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t\t$d = $this->__toDomElement();\r\n\t\t\t\t$d->nodeValue = '';\r\n\t\t\t\tif(is_string($new)){\r\n\t\t\t\t$in = $d->ownerDocument->createDocumentFragMent();\r\n\t\t\t\t$in->appendxml($new);\r\n\t\t\t\t}else if(is_a($new,'DOMNode')){\r\n\t\t\t\t$in = $d->ownerDocument->importNode($new,true);\r\n\t\t\t\t}\r\n\t\t\t\t$d->appendChild($in);\r\n\t\t\t\t$this->node->exportNode($d,null,true);\r\n\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t$dom = ($this->node->__toDomElement());\r\n\t\t\t\t$inner = '';\r\n\t\t\t\tfor($i=0;$dom->childNodes->length > $i;$i++){\r\n\t\t\t\t\tif($this->node->isxml()){\r\n\t\t\t\t\t\t$inner .=$dom->childNodes[$i]->ownerDocument->saveXml($dom->childNodes[$i]);\t\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$inner .=$dom->childNodes[$i]->ownerDocument->saveHtml($dom->childNodes[$i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->node->_innerHtml = $inner;\r\n\t\t\t\tunset($inner);\r\n\t\t\t\treturn $inner;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}",
"public function add($child)\r\n {\r\n if ($child instanceof tag) {\r\n if ($child->id && array_key_exists($child->id,$this->ref)) {\r\n return $this->ref[$child->id]; \r\n }\r\n $child->tagdep = abs($this->tagdep) + 1;\r\n $this->tagdep = abs($this->tagdep) * -1;\r\n }\r\n //Append child to childs repo\r\n $this->childs[] = $child;\r\n //If child isn't object return $this tag\r\n if (!is_object($child)) {\r\n return $this;\r\n }\r\n if ($child->id) {\r\n $this->ref[$child->id] =& $child;\r\n }\r\n $child->parent =& $this;\r\n return $child;\r\n }",
"public function add (DOMElement $node) {\r\n\t \r\n\t if (array_push($this->list, $node)) {\r\n\t\t\t$this->length++;\r\n\t\t\treturn true;\r\n\t\t} else return false;\r\n\t}",
"function append(string $data): self {\n $this->buffer .= $data;\n return $this;\n }",
"public function add($elem) {\n\t\t$this->elems[] = $elem;\n\t}"
] | [
"0.66123956",
"0.63129944",
"0.5977673",
"0.5959699",
"0.59286904",
"0.5761757",
"0.5724819",
"0.5631971",
"0.56247795",
"0.5595119",
"0.556561",
"0.55213046",
"0.54681176",
"0.5395284",
"0.53675395",
"0.5355754",
"0.5335939",
"0.5292196",
"0.5278819",
"0.5248101",
"0.5243194",
"0.5236409",
"0.5179027",
"0.51669323",
"0.51653445",
"0.51646423",
"0.51595503",
"0.51562387",
"0.5153553",
"0.5145568",
"0.51297486",
"0.5112238",
"0.5084067",
"0.5058885",
"0.5056164",
"0.50301623",
"0.50149775",
"0.499993",
"0.49993962",
"0.49993962",
"0.4993923",
"0.49810168",
"0.49810168",
"0.497692",
"0.49533126",
"0.49426305",
"0.49364656",
"0.4918354",
"0.4913176",
"0.49025184",
"0.49023852",
"0.4886343",
"0.48726156",
"0.48569435",
"0.48495737",
"0.48446518",
"0.4843587",
"0.48299536",
"0.48257545",
"0.4822475",
"0.48167887",
"0.481484",
"0.4790123",
"0.47885394",
"0.47882178",
"0.47786158",
"0.47772256",
"0.47688738",
"0.4757368",
"0.47337562",
"0.47290736",
"0.47266766",
"0.47266766",
"0.47266766",
"0.47236028",
"0.4709813",
"0.4700998",
"0.46979824",
"0.46913114",
"0.46714237",
"0.46684143",
"0.4661329",
"0.46574387",
"0.4650978",
"0.46447828",
"0.46440864",
"0.46399274",
"0.4638231",
"0.4634985",
"0.4620249",
"0.4615141",
"0.46142316",
"0.46124494",
"0.46100572",
"0.46049145",
"0.46026412",
"0.46020705",
"0.4596907",
"0.45953995",
"0.4586944",
"0.45725298"
] | 0.0 | -1 |
!!!! // TODO Get the information of a user(s) corresponding to the given ID(s) | public function getInfoByIDs($IDs){
if(count($IDs)>20){
throw new MaxIDListException('This request can only support a maximum of 20 entities, '. count($IDs) . ' were given!');
}
// foreach($IDs as $id){
// $this->setEndpoint("/lol/summoner/" . self::RESOURCE_SUMMONER_VERSION . "/summoners/{$id}");
// }
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUserById($id) {\n\t\t\n\t}",
"public function getUser($id);",
"public function getAllUserById($id);",
"function paces_get_users_all_details( $user_id ){\n return get_metadata( 'user', $user_id );\n}",
"public function getUserInfo($id)\n {\n $qry = \"SELECT users.* FROM `users` WHERE users.id = \".$id;\n// JOIN `subscription` ON users.id = subscription.user_id\n// JOIN `packages` ON subscription.p_id = packages.id\n\n\n $dbcon = new DatabaseClass();\n $result = mysqli_query($dbcon->conn, $qry);\n if (mysqli_num_rows($result) > 0) {\n return mysqli_fetch_assoc($result);\n }\n }",
"function getUserInfoById($id) {\n\t$result = mysql_query(\"SELECT * FROM users where userId = $id\");\n\t$row = mysql_fetch_array($result, MYSQL_ASSOC);\n\n\tmysql_free_result($result);\n\treturn $row;\n}",
"private function get_userInfo() {\n $params = [ 'user_ids' => $this->user_id ];\n $result = $this->api->users->get($params);\n $params['fields'] = '';\n $result2 = $this->api2->users->get($params);\n $result['hidden'] = (int)array_has($result2, 'hidden');\n return $result;\n }",
"public function getUserFromId(int $id) {\n \n // Call getUserById method in userDataService and set to variable\n $user = $this->getUserById($id);\n \n // Return the user information array\n return $user;\n }",
"public function users_get($id = \"0\")\n {\n $sutil = new CILServiceUtil();\n $from = 0;\n $size = 10;\n \n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp))\n {\n $from = intval($temp);\n }\n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp))\n {\n $size = intval($temp);\n }\n $search = $this->input->get('search', TRUE);\n if(is_null($search))\n $result = $sutil->getUser($id,$from,$size);\n else \n {\n $result = $sutil->searchUsers($search,$from,$size);\n }\n $this->response($result);\n }",
"function getuserdetails($u_id)\n{\n\t$sql=\"select * from user_table where u_id=$u_id\";\n\tforeach($GLOBALS['db']->query($sql) as $row);\n\treturn $row;\n}",
"function plexIDToUsername($id, $data) {\n\t foreach ($data->User as $usr){\n\t\tif ($usr->attributes()['id'] == $id) {\n\t\t\treturn $usr->attributes()['username'];\n\t\t\tbreak;\n\t\t}\n\t }\n }",
"function get_users_info_by_id($users_id) {\n return $this->read_data_by_id($users_id);\n }",
"function fetch_user_info($id){\n\t\t$id = (int)$id;\n\t\t\n\t\t$sql = \"SELECT * FROM users WHERE id = {$id}\";\n\t\t$result = mysql_query($sql);\n\t\t\n\t\t$info = mysql_fetch_assoc($result);\n\t\t$info['avatar'] = (file_exists(\"{$GLOBALS['path']}/user_avatars/{$info['id']}.jpg\")) ? \"core/user_avatars/{$info['id']}.jpg\" : \"core/user_avatars/default.jpg\";\n\t\t\n\t\treturn $info;\n\t}",
"public function getUserById($id){\n $sql=\"SELECT * FROM users WHERE (id = ?)\";\n $select=parent::connect_db()->prepare($sql);\n $select->bindValue(1, $id);\n $select->execute();\n if($select->rowCount() > 0):\n return $select->fetchAll(\\PDO::FETCH_ASSOC);\n //return $results;\n else:\n return [];\n endif;\n }",
"function getUserInfo($id, $name) {\n if (!userExists($id)) { makeNewUser($id, $name); } \n $result = queryUsersTable(\"SELECT * FROM users WHERE id = $id\");\n $data = mysql_fetch_assoc($result);\n return $data;\n}",
"public function user_get($id=0)\n\t{\n\n\t\t\t$data=$this->um->getData('users',$id);\n\t\t\tif (!empty($data)) {\n\t\t\t\t\n\t\t\t$this->response($data,RestController::HTTP_OK);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->response(['status'=>false,'message'=>'no data found'],RestController::HTTP_NOT_FOUND);\n\t\t\t}\n\t}",
"public function getUser($id = null);",
"abstract public function fetchUserById($id);",
"function getUserById($id) {\n\t$result = mysql_query(\"SELECT userId, email, password FROM users where userId = $id\");\n\t$row = mysql_fetch_array($result, MYSQL_ASSOC);\n\tmysql_free_result($result);\n\treturn $row;\n}",
"function getUser($id){\n\t\t\tif($this->rest->getRequestMethod() != \"GET\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t}\n\n\t\t\t//Validate the user\n\t\t\t$validUser = $this->validateUser(\"admin\", \"basic\");\n\t\t\tif ($validUser) {\n\t\t\t\t$user_data = $this->model->getUser('*',\"_id = \".\"'\".$id.\"'\");\n\t\t\t\tif(count($user_data)>0) {\n\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t$response_array['message']='Total '.count($user_data).' record(s) found.';\n\t\t\t\t\t$response_array['total_record']= count($user_data);\n\t\t\t\t\t$response_array['data']=$user_data;\n\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t} else {\n\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t$response_array['message']='Record not found.';\n\t\t\t\t\t$response_array['data']='';\n\t\t\t\t\t$this->rest->response($response_array, 204);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\n\t\t\t}\n\n\t\t}",
"public static function get_user($user_id);",
"public function getUserByID($id)\n {\n return $this->db->get_where('inm_user', array('id' => $id));\n }",
"protected function GetUserDetails($id)\r\n {\r\n $sql = \"SELECT * FROM users WHERE id = $id\";\r\n $result = $this->connect()->query($sql);\r\n $rows = $result->num_rows;\r\n\r\n if ($rows > 0) {\r\n $row = $result->fetch_assoc();\r\n $data[] = $row;\r\n\r\n return $data;\r\n } else {\r\n echo \"No results found!\";\r\n }\r\n }",
"function getUserID($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from users where userid='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['userid'];\n\t}\n\n\t$crud->disconnect();\n}",
"function get_user_by_id($id) {\r\n\t\t$query = $this->db->query('SELECT user_fname, user_lname, user_email\r\n\t\t\t\t\t\t\t\t\tFROM user\r\n\t\t\t\t\t\t\t\t\tWHERE user_id = '.$id.'');\r\n\t\treturn $query->result();\r\n\t}",
"public function getUserInfo($id)\n {\n return $this->_dbTable->getUserInfo($id);\n }",
"function get_user($id)\n {\n return $this->db->get_where('users',array('id'=>$id))->row_array();\n }",
"function get_user($id)\n {\n return $this->db->get_where('users',array('id'=>$id))->row_array();\n }",
"function get_user($id)\n {\n return $this->db->get_where('users',array('id'=>$id))->row_array();\n }",
"function cicleinscription_get_user_by_id($userid){\n\tglobal $DB;\n\treturn $DB->get_record('user', array('id'=>$userid));\n}",
"function getUserInfo($id){\n\t\n\t$usr_info = mysql_fetch_object(listAll(\"user\", \"WHERE id = '$id'\"));\n\t$descripcion = getUserData($id, \"2\");\n\t$user_img = getUserData($id, \"1\");\n\t$direccion = getUserData($id, \"3\");\n\t$ciudad = getUserData($id, \"10\");\n\t$cp = getUserData($id, \"4\");\n\t$pais = getUserData($id, \"5\");\n\t$telefono = getUserData($id, \"6\");\n\t$movil =getUserData($id, \"7\");\n\t$exp = getUserData($id, \"14\");\n\t$cam = getUserData($id, \"11\");\n\t$lentes = getUserData($id, \"12\");\n\t$equip = getUserData($id, \"13\");\n\t$cover = getUserData($id, \"16\");\n\t$user_pago = getUserData($id, \"17\");\n $escuelaFotografia = getUserData($id, \"18\");\n $masEducacion = getUserData($id, \"19\");\n $experienciaLaboral = getRecentUserData($id, \"20\");\n $idiomas = getUserData($id, \"22\");\n $habilidades = getUserData($id, \"21\");\n $rut = getUserData($id, \"23\");\n\t\n\tif($usr_info->gender == \"H\"){\n\t\t$gender = \"Hombre\";\n\t}else{\n\t\t$gender = \"Mujer\";\n\t}\n\n\t$paisf = listAll(\"paises\",\"WHERE iso = '$pais->description'\");\n\t$rs_paisf = mysql_fetch_object($paisf);\n\t\n\t$user['id'] = $usr_info->id;\n\t$user['user_type'] = $usr_info->user_type;\n\t$user['email'] = $usr_info->user;\n $user['new_email'] = $usr_info->new_email;\n $user['new_email_code'] = $usr_info->new_email_code;\n\t$user['descripcion'] = $descripcion->description;\n\t$user['user_img']= $user_img->description;\n\t$user[\"name\"] = $usr_info->name;\n\t$user['lastname'] = $usr_info->lastname;\n\t$user['dob']= DateHelper::getLongDate($usr_info->dob);\n $user['user_dob'] = DateHelper::getShortDate($usr_info->dob, 'd/m/Y');\n\t$user['sex']= $gender;\n\t$user['act']= $usr_info->act;\n\t$dob = explode(\"-\",$usr_info->dob);\n\t$user['ano'] = $dob[0];\n\t$user['mes'] = $dob[1];\n\t$user['dia'] = $dob[2];\n\t$user['direccion'] = $direccion->description;\n\t$user['ciudad'] = $ciudad->description;\n\t$user['cp'] = $cp->description;\n\t$user['pais'] = utf8_encode($rs_paisf->nombre);\n\t$user['pais_ab'] = utf8_encode($rs_paisf->iso);\n\t$user['telefono'] = $telefono->description;\n\t$user['movil'] = $movil->description;\n\t$user['exp'] = $exp->description;\n $user['escuela-fotografia'] = $escuelaFotografia->description;\n $user['mas-educacion'] = $masEducacion->description;\n $user['experiencia-laboral'] = json_decode($experienciaLaboral->description);\n $user['idiomas'] = json_decode($idiomas->description);\n $user['habilidades'] = json_decode($habilidades->description);\n $user['rut'] = $rut->description;\n\t$user['cam'] = json_decode($cam->description);\n\t$user['lentes'] = json_decode($lentes->description);\n\t$user['equip'] = json_decode($equip->description);\n\t$user[\"act_code\"] = $usr_info->act_code;\n $user[\"profile_completed\"] = $usr_info->profile_completed;\n $user[\"wizard_completed\"] = $usr_info->wizard_completed;\n $user[\"wizard_contact_creative_completed\"] = $usr_info->wizard_contact_creative_completed;\n\t$user['user_cover'] = $cover->description;\n\t$user['user_pago'] = $user_pago->description;\n\t$user['full_name'] = ucwords($user[\"name\"] . \" \" . $user['lastname']);\n //TODO make it an external function\n //TODO set a default image if file does not exists\n if (file_exists(FConfig::getBasePath().\"/profiles/\".sha1($usr_info->id).\"/profile.jpg\")){\n $user['profile_image_url'] = \"profiles/\".sha1($usr_info->id).\"/profile.jpg\";\n } else {\n if ($user['user_type'] == User::USER_TYPE_PHOTOGRAPHER) {\n $user['profile_image_url'] = \"images/profile_default_photographer.jpg\";\n } else {\n $user['profile_image_url'] = \"images/profile_default_client.jpg\";\n }\n }\n\n if (file_exists(FConfig::getBasePath().\"/profiles/\".sha1($usr_info->id).\"/cover.jpg\")){\n $user['cover_image_url'] = \"profiles/\".sha1($usr_info->id).\"/cover.jpg\";\n } else {\n $user['cover_image_url'] = \"images/cover_default.jpg\";\n }\n\n return $user;\n}",
"public function getUserDetails() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n $username = $this->request->input(\"username\");\n if ($username) {\n $where[] = [\"username\", \"=\", $username];\n }\n\n $userIdEqual = $this->request->input(\"user_id_equal\");\n if ($userIdEqual) {\n $where[] = [\"user_id\", \"=\", $userIdEqual];\n }\n\n $userIdNotEqual = $this->request->input(\"user_id_not_equal\");\n if ($userIdNotEqual) {\n $where[] = [\"user_id\", \"!=\", $userIdNotEqual];\n }\n\n\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getData();\n\n return $users;\n }",
"public function getUserIdWithUsername($id);",
"public function getuserbyID( $id )\n\t{\n\t\t$users = array();\n\n\t\tif( is_array( $id ) )\n\t\t{\n\t\t\t$result = $this->db->query( \" SELECT userid, username, first_name, last_name FROM \" . $this->db_prefix . \"_users WHERE userid IN(\" . implode( \",\", $id ) . \")\" );\n\n\t\t\twhile( $row = $result->fetch() )\n\t\t\t{\n\t\t\t\t$row['full_name'] = nv_show_name_user( $row['first_name'], $row['last_name'], $row['username']);\n\t\t\t\t$users[$row['userid']] = $row;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $this->db->query( \" SELECT userid, username, full_name FROM \" . $this->db_prefix . \"_users WHERE userid=\" . $id );\n\t\t\t$users = $result->fetch();\n\t\t\t$users['full_name'] = $users['full_name'] == '' ? $users['username'] : $users['full_name'];\n\t\t}\n\n\t\treturn $users;\n\t}",
"public function user_get_info($id)\n\t{\n\t\t$sql = \"SELECT * FROM \".$this->table.\" WHERE id = ? LIMIT 1\";\n\t\t$data = array($id);\n\t\t$query = $this->db->query($sql, $data);\n\t\tif( $query->row() )\n\t\t\treturn $query->row();\n\t\telse\n\t\t\treturn 0;\n\t}",
"function get_to_be_displayed_user_data($user_id)\r\n{\r\n\t//fix deze query nog\r\n\t//get username\r\n\t$displayed_user_name_query = \"select username from User_accounts\";\r\n\t$displayed_user_name = execute_sql_extract_data($displayed_user_name_query);\r\n\t\r\n\t//fix deze query nog\r\n\t//get last login\r\n\t$displayed_last_login_query = \"select last_login from User_accounts where id is blablabla\";\r\n\t$displayed_last_login = execute_sql_extract_data($last_login_query);\r\n\t\r\n\treturn $displayed_user_name, $displayed_last_login;\r\n}",
"static public function getDetails($id) {\n $db = Database::connect();\n\n $sql = $db->query(\"SELECT * FROM \". self::DB_USER. \" WHERE md5(id) = '$id'\");\n\n return $sql->fetch_object();\n }",
"public function get_user_info($key, $id) {\r\n $connection = DB::connect();\r\n $stmt = \"SELECT $key FROM users WHERE `id` = '$id'\";\r\n $result = $connection->query($stmt);\r\n\r\n return $result->fetch_assoc()[$key];\r\n }",
"function getUserInfo($user_id) {\n jincimport('utility.servicelocator');\n $servicelocator = ServiceLocator::getInstance();\n $logger = $servicelocator->getLogger();\n \n $query = 'SELECT id, username, name, email FROM #__users ' .\n 'WHERE id = ' . (int) $user_id;\n $dbo =& JFactory::getDBO();\n $dbo->setQuery($query);\n $logger->debug('JINCJoomlaHelper: executing query: ' . $query);\n $infos = array();\n if ($user_info = $dbo->loadObjectList()) {\n if (! empty ($user_info)) {\n $user = $user_info[0]; \n $infos['user_id'] = $user->id;\n $infos['username'] = $user->username;\n $infos['name'] = $user->name;\n $infos['email'] = $user->email;\n }\n return $infos;\n }\n return $infos;\n }",
"function getUserById($id){\n\t\tglobal $db;\n\t\t$query = \"SELECT * FROM t_attendees WHERE id=\" . $id;\n\t\t$result = mysqli_query($db, $query);\n\t\t$user = mysqli_fetch_assoc($result);\n\t\treturn $user;\n\t}",
"function find_user_by_id($id)\r\n{\r\n global $db;\r\n\r\n $q = $db->prepare('SELECT name, pseudo, email, city, country, twitter, github, \r\nfacebook, sex, available_for_hiring, bio FROM users WHERE id=?');\r\n $q->execute([$id]);\r\n\r\n $data = $q->fetch(PDO::FETCH_OBJ);\r\n\r\n $q->closeCursor();\r\n return $data;\r\n}",
"public function getUserById($id){\n $query = $this->db->get_where('user', array('k_id_user' => $id));\n return $query->row();\n }",
"public function user_get()\n\t{\n\t\t$id = $this->get('id');\n\t\tif ($id == null) {\n\t\t\t$data = $this->User->showUser();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data = $this->User->showUser($id);\n\t\t}\n\n\t\tif ($data) {\n\t\t\t$this->response($data,200);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response([\n\t\t\t\t'error'=>true,\n\t\t\t\t'message'=>'Id tidak ada'\n\t\t\t],200);\n\t\t}\n\n\t}",
"function user_get()\n {\n $id = $this->get('id');\n if ($id == '') {\n $user = $this->db->get('auth_user')->result();\n } else {\n $this->db->where('id', $id);\n $user = $this->db->get('auth_user')->result();\n }\n $this->response($user, 200);\n }",
"public function getUserById(int $id) :array{\n\t\treturn $this->db->select(\"SELECT * FROM users WHERE id = :id\", [\"id\" => \"$id\"]);\n\t}",
"function getUsers ($walkId, $userId)\n {\n $getUsersQuery = $this->db->query(\"SELECT id,nickName,profilePicture, \n (select id from walkparticipants w \n WHERE w.walkId = '\".$walkId.\"' and \n w.participantId = u.id ) isInvited, \n (select status from walkparticipants w \n WHERE w.walkId = '\".$walkId.\"' and \n w.participantId = u.id ) status\n FROM user u where id != '\".$userId.\"'\");\n\n return $getUsersQuery->result();\n }",
"public function get_user($id)\n\t{\n\t\tif($id>0)\n\t\t{\t\n\t\t\t$sql=\"SELECT * FROM waf_users WHERE id=\".$this->db->Q($id);\n\t\t\t$result=$this->db->ROW_Q($sql);\n\t\t}else{\n\t\t\t$result=Array('id'=>0,'email'=>'','editor'=>0,'status'=>1);\n\t\t}\n\t\treturn $result;\n\t}",
"public function selectUserbyId($id){\r\n\r\n $query = 'SELECT * FROM user_tbl WHERE id = ?';\r\n $stmt = $this->_db->prepare($query);\r\n $stmt->execute([$id]);\r\n $users = $stmt->fetchAll(PDO::FETCH_OBJ);\r\n if ($stmt->rowCount()){\r\n return $users;\r\n }\r\n\r\n }",
"function user($id){\n\n $sql = \"SELECT * FROM users WHERE id=$id\";\n return fetch($sql);\n }",
"function getUserInfo() {\n\t$page = $this -> get('http://vk.com/al_profile.php') -> body;\n\n\t$pattern = '/\"user_id\":([0-9]*),\"loc\":([\"a-z0-9_-]*),\"back\":\"([\\W ]*|[\\w ]*)\",.*,\"post_hash\":\"([a-z0-9]*)\",.*,\"info_hash\":\"([a-z0-9]*)\"/';\n\tpreg_match($pattern, $page, $matches);\n\tarray_shift($matches);\n\t\n\t$this -> user['id'] = $matches[0];\n\t$this -> user['alias'] = $matches[1];\n\t$this -> user['name'] = $matches[2];\n\t$this -> user['post_hash'] = $matches[3];\n\t$this -> user['info_hash'] = $matches[4];\n\n\treturn $this -> user;\n\t}",
"function user() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['id']; \n if ($id > 0) {\n $query = \"select * from users where id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error . __LINE__);\n if($r->num_rows > 0) {\n $result = $r->fetch_assoc(); \n $this->response(json_encode($result), 200);\n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('',406);\n }\n }",
"public function getUserById($id){\n try{\n $query = \"SELECT fname, lname, fullname, email, role_id FROM users WHERE ID = ?\"; //Select users.fname, users.lname, roles.title, roles.id, users.email, users.created_at, users.status From roles Join users On roles.id = users.role_id Where users.id = ? Limit 1\n $stmt = $this->getConnection($query);\n $stmt -> bind_param('i', $id);\n $stmt -> execute();\n $stmt -> bind_result($fname, $sname, $fullname, $email, $role);\n $stmt->fetch();\n $user[] = array(\n 'fname' => $fname,\n 'sname' => $sname,\n 'fullname' => $fullname,\n 'email' => $email,\n 'role' => $role\n );\n $stmt -> close();\n\n return $user;\n }catch (Exception $e){\n die('Error - cannot get user by id: ' . $e -> getMessage());\n }\n }",
"function admin_get_user($id)\n{\n global $app;\n\n // parameter checking\n if (!is_numeric($id)) {\n $app->getLog()->warn('admin_get_user: invalid user id ' . $id);\n $app->halt(400, \"Bad parameter\");\n }\n\n $user = $app->bbs->user($id);\n $languages = $app->calibre->languages();\n foreach ($languages as $language) {\n $language->key = $language->lang_code;\n }\n $nl = new Language();\n $nl->lang_code = getMessageString('admin_no_selection');\n $nl->key = '';\n array_unshift($languages, $nl);\n $tags = $app->calibre->tags();\n foreach ($tags as $tag) {\n $tag->key = $tag->name;\n }\n $nt = new Tag();\n $nt->name = getMessageString('admin_no_selection');\n $nt->key = '';\n array_unshift($tags, $nt);\n $app->getLog()->debug('admin_get_user: ' . var_export($user, true));\n $app->render('admin_user.html', [\n 'page' => mkPage(getMessageString('admin_users'), 0, 3),\n 'user' => $user,\n 'languages' => $languages,\n 'tags' => $tags,\n 'isadmin' => is_admin()]);\n}",
"public function findByUser($id) {\n\t $this->db->select('*')\n\t ->from($this->getSource())\n\t ->where(\"userId = ?\");\n\t \n\t $this->db->execute([$id]);\n\t return $this->db->fetchAll();\n\t}",
"function extract_user($userID) {\n\t\t$db = connect_to_db();\n\t\t\n\t\t$select_statement = \n\t\t\t\"select id, username from users where id = ?\";\n\t\t;\n\n\t\t$stmt = $db->prepare($select_statement);\n\n\t\t// Bind the parameter to the query\n\t\t$stmt->bind_param(\"i\", $userID);\n\n\t\tif ( !($stmt->execute()) ) {\n\t\t\techo \"Error: Could not find user. Please try again later.\";\n\t\t\t$db->close();\n\t\t\texit;\n\t\t}\n\n\t\t$stmt->bind_result($id, $username);\n\n\t\tif ( $stmt->fetch() ) {\n\t\t\t$info = array('id' => $id, 'username' => $username);\n\t\t\techo json_encode($info);\n\t\t}\n\n\t\t$db->close();\n\t}",
"public function getUserWithId($id){\r\n\r\n\t\t$sql = \"Select * from users where id = ?\";\r\n\t\t$query = $this->db->prepare($sql);\r\n\t\t$query->execute([$id]);\r\n\r\n\t\t$postOwner = $query->fetch(PDO::FETCH_OBJ);\r\n\t\treturn $postOwner;\r\n\t}",
"function getUsers() {\n\n\tglobal $db;\n\treturn $db->getUsersByGroup ( $GLOBALS [\"targetId\"] );\n\n}",
"public function getuser($id)\n {\n return $this->db->get_where(\"master_user\", array(\"employee_id\" => $id))->row_array();\n }",
"public function getUserByID($id)\n {\n return $this->db->get_where('temp_user', array('id' => $id));\n }",
"static function GetWithId(int $id)\n\t{\n\t\t$arr = [\n\t\t\t':id' => $id\n\t\t];\n\n\t\t$sql = 'SELECT * FROM user_info WHERE rf_user_id = :id LIMIT 1';\n\n\t\treturn Db::Query($sql,$arr)->FetchObj();\n\t}",
"public static function getUserInfos($id = null)\n\t{\n\t\tif ($id != null)\n\t\t{\n\t\t\t// Retrieve specific user informations\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$user = DB::table('assigned_roles')\n\t\t\t\t\t->join('users', 'users.id', '=', 'assigned_roles.user_id')\n\t\t\t\t\t->join('roles', 'roles.id', '=', 'assigned_roles.role_id')\n \t\t\t\t\t->select(\n\t\t\t\t\t\t'users.id AS id',\n\t\t\t\t\t\t'users.username AS username',\n\t\t\t\t\t\t'users.email AS email',\n\t\t\t\t\t\t'users.first_name AS first_name',\n\t\t\t\t\t\t'users.last_name AS last_name',\n\t\t\t\t\t\t'users.address AS address',\n\t\t\t\t\t\t'users.city AS city',\n\t\t\t\t\t\t'users.phone AS phone',\n\t\t\t\t\t\t'users.region AS region', \n\t\t\t\t\t\t'users.image AS image',\n\t\t\t\t\t\t'users.remember_token AS remember_token',\n\t\t\t\t\t\t'users.verify_code AS verify_code',\n\t\t\t\t\t\t'users.company_name AS company_name',\n\t\t\t\t\t\t'users.client_type AS client_type',\n\t\t\t\t\t\t'users.oib AS oib',\n\t\t\t\t\t\t'users.mjesto AS mjesto',\n\t\t\t\t\t\t'users.zip AS zip',\n\t\t\t\t\t\t'users.country AS country',\n\t\t\t\t\t\t'users.phone AS phone',\n\t\t\t\t\t\t'users.fax AS fax',\n\t\t\t\t\t\t'users.mobile AS mobile',\n\t\t\t\t\t\t'users.web AS web',\n\t\t\t\t\t\t'users.iban AS iban',\n\t\t\t\t\t\t'users.note AS note',\n\t\t\t\t\t\t'roles.id AS role_id',\n\t\t\t\t\t\t'roles.name AS role_name',\n\t\t\t\t\t\t'users.created_at AS created_at',\n\t\t\t\t\t\t'users.updated_at AS updated_at'\n\t\t\t\t\t\t)\n \t\t\t\t\t->orderBy('id', 'DESC')\n\t\t\t\t\t->where('users.id', '=', $id)\n\t\t\t\t\t->first();\n\n\t\t\t\treturn array('status' => 1, 'user' => $user);\n\t\t\t}\n\t\t\tcatch (Exception $exp)\n\t\t\t{\n\t\t\t\treturn array('status' => 0, 'reason' => $exp->getMessage());\n\t\t\t}\n\t\t}\n\n\t}",
"public function getUserData($id){\n\n \t\t\n \t\t$q = \"SELECT * FROM user_table WHERE id='$id' \";\n\n \t\t$result = $this->connection->query($q);\n\n \t\tif($result->num_rows > 0){\n\n \t\t\t$row = mysqli_fetch_assoc($result);\n\n \t\t}\n\n \t\treturn $row;\n\n \t}",
"private function get_users_by_id( $meta ) {\n\n\t\t$names = array();\n\n\t\t// display username\n\t\tif ( $ids = $this->get_ids_from_meta( $meta ) ) {\n\t\t\tforeach ( (array) $ids as $id ) {\n\t\t\t\tif ( ! is_numeric( $id ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$userdata = get_userdata( $id );\n\t\t\t\tif ( is_object( $userdata ) && ! empty( $userdata->display_name ) ) {\n\n\t\t\t\t\t// link\n\t\t\t\t\t$link = get_edit_user_link( $id );\n\n\t\t\t\t\t$names[] = $link ? \"<a href='{$link}'>{$userdata->display_name}</a>\" : $userdata->display_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn implode( '<span class=\"cpac-divider\"></span>', $names );\n\t}",
"function getUserById($uid)\n {\n $stmt = self::$_db->prepare(\"SELECT u.id_user AS id_user, u.username AS username, u.firstname AS firstname, u.lastname AS lastname,u.image AS image FROM user AS u\n WHERE u.id_user=:uid\");\n $stmt->bindParam(\":uid\", $uid);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function getFullUserDetailsIdWise($id)\n{\n\tif(!empty($id)){\n\t$this->sql = \"SELECT * FROM \".USER.\" AS U\n\t\t\t\tLEFT JOIN \".USER_DETAILS.\" AS D ON (U.user_id = D.user_id)\n\t\t\t\tLEFT JOIN \".ADDRESS.\" AS A ON (U.user_id = A.user_id)\n\t\t\t\tWHERE U.user_id = '\".$id.\"'\";\n\t$this->exe = $this->db->query($this->sql);\n\treturn $this->exe->result_array();\n\t}\n}",
"function all_users($id){\n try{\n $get_users = $this->db->prepare(\"SELECT id, username, user_image FROM `users` WHERE id != ?\");\n $get_users->execute([$id]);\n if($get_users->rowCount() > 0){\n return $get_users->fetchAll(PDO::FETCH_OBJ);\n }\n else{\n return false;\n }\n }\n catch (PDOException $e) {\n die($e->getMessage());\n }\n }",
"function getUserById(){\n\t \n\t $sql = \"SELECT * FROM users WHERE User_id=\" . $User_id;\n\t $req = Database::getBdd()->prepare($sql);\n\t \n\t return $req->execute($sql);\n}",
"public function user_detail($id, $what='*'){\n\t\treturn $this->get_detail_user($id, $what);\n\t}",
"function User_Info($UserIDorUsername)\n\t{\n\t\t$UserID=$this->GetUserID($UserIDorUsername);\n\t\t$R=j::SQL(\"SELECT * FROM jfp_xuser AS XU JOIN jf_users AS U ON (U.ID=XU.ID) WHERE XU.ID=?\",$UserID);\n\t\tif ($R) return $R[0];\n\t\telse return null;\n\t}",
"abstract protected function getUserId() ;",
"static function get_list_of_users_who_have_added_user($id) {\n global $con;\n $sql = \"\n\t\tSELECT `user`.`id`, `user`.`firstname`, `user`.`lastname`, `user`.`email`\n\t\tFROM `user`, `relationship`\n\t\tWHERE `user`.`id` = `relationship`.`user1` AND `relationship`.`user2` = \".$id.\" AND `relationship`.`type` = 1\n ORDER BY `user`.`firstname`, `user`.`lastname`;\";\n $query = mysqli_query($con, $sql);\n $result = array();\n while ($row = mysqli_fetch_assoc($query)) {\n $user = new SimpleUser($row['id'], $row['firstname'], $row['lastname'], $row['email']);\n $user->bidirectional = self::users_have_added_them_both($id, $row['id']);\n array_push($result, $user);\n }\n return $result;\n }",
"function get_user_by_ID($id){\n global $database;\n $query = \"SELECT * FROM \".TABLE_PREFIX.\"users WHERE ID = \" . $id;\n return $database->query( $query );\n}",
"public function users_get()\n\t{\n\t\t$users = [\n\t\t\t['id' => 0, 'name' => 'John', 'email' => '[email protected]'],\n\t\t\t['id' => 1, 'name' => 'Jim', 'email' => '[email protected]'],\n\t\t];\n\n\t\t$id = $this->get('id');\n\n\t\tif ($id === null) {\n\t\t\t// Check if the users data store contains users\n\t\t\tif ($users) {\n\t\t\t\t// Set the response and exit\n\t\t\t\t$this->response($users, 200);\n\t\t\t} else {\n\t\t\t\t// Set the response and exit\n\t\t\t\t$this->response([\n\t\t\t\t\t'status' => false,\n\t\t\t\t\t'message' => 'No users were found'\n\t\t\t\t], 404);\n\t\t\t}\n\t\t} else {\n\t\t\tif (array_key_exists($id, $users)) {\n\t\t\t\t$this->response($users[$id], 200);\n\t\t\t} else {\n\t\t\t\t$this->response([\n\t\t\t\t\t'status' => false,\n\t\t\t\t\t'message' => 'No such user found'\n\t\t\t\t], 404);\n\t\t\t}\n\t\t}\n\t}",
"public function getInfo($id){\n $query = $this->pdo->prepare('SELECT * FROM usuarios WHERE usuario_id=?');\n $query->execute([$id]);\n return $query->fetchall(PDO::FETCH_ASSOC)[0];\n }",
"public function userbyid($id)\n {\n $sql=\"SELECT * FROM users where id='$id'\";\n\t $result = $this->db->query($sql);\n\t return $result->row();\n \n }",
"public function userdetails($id){\n $sql = \"SELECT * FROM user WHERE user_id = '\".$id.\"' \";\n $values = $this->con->query($sql);\n $values = $values->fetch_assoc();\n return $array = Array(\n \"user_name\" => $values['user_name'],\n \"email\" => $values['email'],\n \"plan\" => $values['plan'],\n \"total\" => $values['total_earning'],\n \"withdrawn\" => $values[\"withdrawn_earning\"],\n \"question\" => $values['question']\n );\n }",
"function fetch_user_by_id($id) {\n if(!cache_isset('taxi_!uid_'.$id)) {\n if(cache_isset('taxi_uid_'.$id)) {\n return cache_get('taxi_uid_'.$id);\n } else {\n global $DB;\n connect_db();\n $result=$DB->users->findOne(['id'=>$id]);\n if(is_array($result)) {\n cache_set('taxi_uid_'.$id,$result);\n } else {\n cache_set('taxi_!uid_'.$id,true)\n }\n return $result;\n }\n }\n}",
"function extract_all_users() {\n\t\t$db = connect_to_db();\n\n\t\t$select_statement = \n\t\t\t\"select users.id, users.username from users\";\n\t\t;\n\n\t\t$stmt = $db->prepare($select_statement);\n\n\t\tif ( !($stmt->execute()) ) {\n\t\t\techo \"Error: Could not get users.\";\n\t\t\t$db->close();\n\t\t\texit;\n\t\t}\n\n\t\t$json = \"[\";\n\n\t\t$stmt->bind_result($id, $username);\n\n\t\twhile ( $stmt->fetch() ) {\n\t\t\t$info = array('id' => $id, 'username' => $username);\n\t\t\t$json = $json . json_encode($info) . \",\";\n\t\t}\n\n\t\techo substr_replace($json, \"]\", -1);\n\n\t\t$db->close();\n\t}",
"public function nameUser($id){\r\n\t\t$stmt = $this->db->prepare(\"SELECT * FROM users WHERE id=?\");\r\n\t\t$stmt->execute(array($id));\r\n\t\t$names = $stmt->fetchALL(PDO::FETCH_ASSOC);\r\n\r\n\t\t$users = array();\r\n\t\tforeach($names as $name){\r\n\t\t\tarray_push($users, new User($name[\"id\"],$name[\"username\"]));\r\n\t\t}\r\n\t\treturn $users;\r\n\t}",
"public function getUser($id)\n {\n $pack = pack(\"N*\", -1, $id, 1, 1);\n $data = $this->gamed->cuint($this->data['code']['getUser']).$this->gamed->cuint(strlen($pack)).$pack;\n $send = $this->gamed->SendToGamedBD($data);\n $strlarge = unpack(\"H\", substr($send, 2, 1 ));\n if(substr($strlarge[1], 0, 1) == 8)\n {\n $tmp =\t12;\n }\n else\n {\n $tmp = 11;\n }\n $send = substr($send, $tmp);\n $user = $this->gamed->unmarshal($send, $this->data['user']['info']);\n $user['login_ip'] = $this->gamed->getIp($this->gamed->reverseOctet(substr($user['login_record'], 8, 8)));\n $user['login_time'] = $this->gamed->getTime(substr($user['login_record'], 0, 8));\n\n return $user;\n }",
"function getUser($id)\n{\n\tif (in_array($_SESSION['user']['role'], ['admin'])) {\n\t\tglobal $conn, $roles;\n\t\t$sql = \"SELECT * FROM users WHERE role = 'seeker' and u_name=$id limit 1\"; //WHERE role IS NOT NULL\n\t\t$result = mysqli_query($conn, $sql);\n\t\t$users = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\n\t\treturn $users;\n\t} else {\n\t\treturn null;\n\t}\n}",
"function getUserName($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from users where userid='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['username'].\" \".$rs['usertype'];\n\t}\n\t$crud->disconnect();\n}",
"public function getUser($id) {\n $sql = \"select * from infos_contributeur where id_user = $id\";\n $result = $this->db->fetchAll($sql);\n\n return $result;\n }",
"public function getById($id)\n {\n return $this->user->find($id)->toArray();\n }",
"public function getUserDataById($id){\r\n $sql = \"SELECT * FROM tbl_user WHERE id=:id\";\r\n $stmt = Database::prepare($sql);\r\n $stmt->bindParam(':id', $id);\r\n $stmt->execute();\r\n $result = $stmt->fetch(PDO::FETCH_OBJ);\r\n return $result;\r\n }",
"function get_user_name_by_id($id = 0) {\r\n\r\n\t\t$field = 'name';\r\n\r\n\t\t$users = $this->users_model->get_users_by_id($id, $field);\r\n\r\n\t\t$result = $users['name'];\r\n\r\n\t\treturn $result;\r\n\r\n\t}",
"public function find_user_with_id($id)\n {\n $result = array(\n \"status\" => \"\",\n \"body\" => array(\n \"user\" => array()\n ),\n \"error\" => array(\n \"query_error\" => \"\"\n )\n );\n $stmt = $this->db->prepare(\"SELECT * FROM users WHERE id LIKE ?\");\n if (!($stmt))\n {\n trigger_error(\"Prepare failed: (\" . $this->db->errno . \") \" . $this->db->error,\n E_USER_ERROR);\n }\n if (!$stmt->bind_param('i', $id)){\n trigger_error(\"Binding parameters failed: (\" . $stmt->errno . \") \" . $stmt->error,\n E_ERROR);\n }\n if (!$stmt->execute()) {\n trigger_error(\"Execute failed: (\" . $stmt->errno . \") \" . $stmt->error,\n E_CORE_ERROR);\n $result[\"error\"] = $stmt->error;\n }\n $res = $stmt->get_result();\n $row = $res->fetch_assoc();\n if ($row[\"id\"] != null){\n $result[\"status\"] = \"Query successful\";\n $result[\"body\"] = array(\n \"user\" => array(\n \"id\" => $row[\"id\"],\n \"url\" => $row[\"url\"],\n \"username\" => $row[\"username\"],\n \"email\" => $row[\"email\"],\n \"first_name\" => $row[\"firstName\"],\n \"last_name\" => $row[\"lastName\"],\n \"full_name\" => $row[\"fullName\"],\n \"bio\" => $row[\"bio\"],\n \"is_admin\" => $row[\"isAdmin\"],\n \"password\" => $row[\"password\"],\n \"created\" => $row[\"created\"],\n \"last_updated\" => $row[\"lastUpdated\"]\n )\n );\n return $result;\n } else {\n $result['status'] = \"No user with that id exists\";\n $result[\"error\"]['query_error'] = \"invalid id in query passed.\";\n }\n return $result;\n }",
"function getUser($userId) {\r\n $results = $this->querySimpleExecute(\"select * from t_user where idUser=$userId\");\r\n return $results = $this->formatData($results)[0];\r\n }",
"function getUserName($id)\n{\n\t$mysqli = makeSqlConnection();\n\t$sql = \"SELECT user_name FROM users WHERE id = '$id'\";\n\t$res = $mysqli->query($sql);\n\t\n\t$rows = array();\n\t\n\twhile($r = mysqli_fetch_assoc($res))\n\t{\n\t\t$obj = (object) $r;\t\n\t\treturn $obj->user_name;\n\t}\n}",
"function get_user_details($id)\n {\n $this->db->where('id', $id);\n\n $result = $this->db->get('member');\n\n if($result->num_rows() == 1){\n return $result->row(0);\n } else {\n return false;\n }\n }",
"function getProfileUser($id) {\n $this->load->model('Usermodel');\n print_r(json_encode($this->Usermodel->fetchProfileUser($id)));\n }",
"public function getUserData($userId);",
"function getUser()\n {\n $stmt = self::$_db->prepare(\"SELECT u.id_user AS id_user, u.username AS username, u.mail AS mail, u.description AS description, u.image AS image FROM user AS u\n WHERE u.id_user=:uid\");\n $uid = self::getUserID();\n $stmt->bindParam(\":uid\", $uid);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC)[0];\n }",
"public static function getInfo($id) {\n try {\n $info = DB::select(\"SELECT * FROM lss_users WHERE id=:id\", [ \"id\" => $id ]);\n \n if (count($info) < 1) return (object)[ \"success\" => false, \"message\" => \"Wprowadzony identyfikator konta jest błędny\" ];\n elseif (count($info) > 1) return (object)[ \"success\" => false, \"message\" => \"Znaleziono więcej niż jedno konto o podanym identyfikatorze\" ]; // Nie powinno się zdarzyć\n else return (object)[ \"success\" => true, \"data\" => $info[0] ];\n } catch (Exception $e) {\n return (object)[ \"success\" => false, \"message\" => \"Wystąpił nieoczekiwany błąd, podczas pobierania danych\" ];\n }\n }",
"function getUser($user, $id) {\n return $user->readByID($id);\n}",
"public function getUsername($id);",
"function get_user($id = NULL)\n{\n $select_query = 'SELECT user_id, username, email\n FROM ' . TBL_USERS;\n\n if ($id !== NULL)\n {\n $select_query .= ' WHERE `user_id`=' . (int)$id;\n }\n\n $select_query .= ' ORDER BY `user_id` ASC';\n\n $result = mysql_query($select_query);\n\n $users = array();\n while ($row = mysql_fetch_assoc($result))\n {\n $users[] = $row;\n }\n\n return $users;\n}",
"function get_info_usuario($id_usuario){\n\n return $this->db->query(\"SELECT*\n FROM usuarios\n WHERE usuarios.usuario_id = $id_usuario\")->result_array();\n }",
"public function details($id)\n {\n $details_sql = \"SELECT * FROM dbUsers WHERE id = $id\";\n $result = mysqli_query($this->db, $details_sql);\n $user_data = mysqli_fetch_array($result);\n return $user_data;\n }",
"public function getDetail($id_user){\n\t\t$db = new Database();\n\t\t$dbConnect = $db->connect();\n\t\t$sql = \"SELECT * FROM user where id_user = '{$id_user}'\";\n\t\t$data = $dbConnect->query($sql);\n\t\t$dbConnect = $db->close();\n\t\treturn $data->fetch_array();\n\t}",
"public function get_user($id) {\r\n $conn = $this->conn();\r\n $sql = \"SELECT * FROM register WHERE id = ?\";\r\n $stmt = $conn->prepare($sql);\r\n $stmt->execute([$id]);\r\n $user = $stmt->fetch();\r\n $result = $stmt->rowCount();\r\n\r\n if($result > 0 ){\r\n \r\n return $user;\r\n }\r\n\r\n \r\n }"
] | [
"0.76061076",
"0.7561389",
"0.74436426",
"0.7429781",
"0.7367548",
"0.73539114",
"0.7291457",
"0.7131601",
"0.71288174",
"0.71243906",
"0.7091585",
"0.7084685",
"0.7081399",
"0.70579255",
"0.70577055",
"0.7054409",
"0.70436084",
"0.703211",
"0.7031884",
"0.7015767",
"0.70123875",
"0.70061326",
"0.69969624",
"0.6988933",
"0.6975874",
"0.6969012",
"0.6950298",
"0.6950298",
"0.6950298",
"0.6945528",
"0.6938618",
"0.6930458",
"0.69211936",
"0.6916156",
"0.6911119",
"0.6890212",
"0.688659",
"0.6885752",
"0.68847615",
"0.68811226",
"0.6875774",
"0.6868964",
"0.68666667",
"0.6863917",
"0.6837983",
"0.68274254",
"0.682346",
"0.6823259",
"0.6818255",
"0.6810052",
"0.6807382",
"0.6798755",
"0.6785857",
"0.6776612",
"0.6774503",
"0.6773053",
"0.677099",
"0.6762647",
"0.6756739",
"0.67514473",
"0.6746631",
"0.6746398",
"0.6745616",
"0.67228436",
"0.6721946",
"0.6711844",
"0.67107147",
"0.67095083",
"0.6705972",
"0.67058575",
"0.6702768",
"0.6697235",
"0.6694031",
"0.6687362",
"0.6680851",
"0.6662418",
"0.664195",
"0.66405207",
"0.6638056",
"0.66333765",
"0.66313237",
"0.66307664",
"0.6628782",
"0.6627971",
"0.6626687",
"0.66255796",
"0.6624924",
"0.6622654",
"0.66220665",
"0.6618579",
"0.66052026",
"0.6601488",
"0.6599058",
"0.65978295",
"0.65964645",
"0.65941143",
"0.65916026",
"0.6590301",
"0.6589064",
"0.65883327",
"0.6588071"
] | 0.0 | -1 |
Get the information of a user(s) corresponding to the given Summoner name(s) | public function getInfoByNames($names){
if(count($names)>20){
throw new MaxIDListException('This request can only support a maximum of 20 entities, '. count($names) . ' were given!');
}
$summoners = [];
foreach($names as $name){
$name = rawurlencode($name);
$this->setEndpoint("/lol/summoner/" . self::RESOURCE_SUMMONER_VERSION . "/summoners/by-name/{$name}");
array_push($summoners,(object)$this->makeRequest()); //Turn array to object. Look at DTO for better res!
}
return $summoners;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getUserInfo() {\n\t$page = $this -> get('http://vk.com/al_profile.php') -> body;\n\n\t$pattern = '/\"user_id\":([0-9]*),\"loc\":([\"a-z0-9_-]*),\"back\":\"([\\W ]*|[\\w ]*)\",.*,\"post_hash\":\"([a-z0-9]*)\",.*,\"info_hash\":\"([a-z0-9]*)\"/';\n\tpreg_match($pattern, $page, $matches);\n\tarray_shift($matches);\n\t\n\t$this -> user['id'] = $matches[0];\n\t$this -> user['alias'] = $matches[1];\n\t$this -> user['name'] = $matches[2];\n\t$this -> user['post_hash'] = $matches[3];\n\t$this -> user['info_hash'] = $matches[4];\n\n\treturn $this -> user;\n\t}",
"public function getUserInformation( $username )\n\t{\n\t\t$username = $this->database->real_escape_string( $username );\n\n\t\t$query = <<<QUERY\nSELECT\n\t*\nFROM\n\tplayer\nWHERE\n\tusername = '$username'\nQUERY;\n\n\t\treturn $this->database->query( $query, 'Get user information by username #' . $username );\n\t}",
"function getSummonerByName($var){\n\t\t$var = htmlentities($var);\n\t\t$url = BASE . \"/v1.4/summoner/by-name/\" . $var . KEY;\n\t\treturn getIt($url);\n\t}",
"public function getUsersName(){\n //Get the Id\n $userId = $_GET[\"userId\"];\n //Gets the users name \n $usersName = $this->individualGroupModel->getTheUsersName($userId); \n //echos out a created users name given the first and last name\n echo $usersName->User_First_Name . \" \" . $usersName->User_Last_Name;\n }",
"public function get_member_from_username($name)\n {\n return $this->connection->query_select_value_if_there('users', 'uid', array('username' => $name));\n }",
"public function getMe()\n {\n return $this->players[$this->myId];\n }",
"abstract protected function getUserInfo($username);",
"function getUserInfo(){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$user = $this->askFlickr('people.getinfo','user_id='.$this->user);\n\n\t\t/* Return User info */\n\t\treturn $user;\n\t}",
"function getUserInfo($id, $name) {\n if (!userExists($id)) { makeNewUser($id, $name); } \n $result = queryUsersTable(\"SELECT * FROM users WHERE id = $id\");\n $data = mysql_fetch_assoc($result);\n return $data;\n}",
"public function getUserInfo() {\n $endpoint = '/users';\n $client = $this->_constructClient($endpoint . '/self');\n try {\n $response = $client->request();\n } catch (Zend_Http_Client_Exception $e) { // timeout or host not accessible\n return;\n }\n\n // error in response\n if ($response->isError()) return;\n\n $result = Zend_Json::decode($response->getBody());\n\n // foursquare returned an error\n if ($result['meta']['code'] != 200) return;\n\n $entry = $result['response']['user'];\n $user = array(\n 'name' => $entry['firstName'] . ' ' . $entry['lastName'],\n 'id' => $entry['id'],\n 'avatar' => $entry['photo']\n );\n return $user;\n }",
"public function getPlayerDetails(Request $request){\n $user1 = $request->input('user_id');\n // get user details\n $u1 = User::find($user1);\n \n // get user ranks\n return $u1->name;\n }",
"function getUserInformationByUsername($username)\n\t{\n\t\t$response = '';\n\n\t\tif( $this->token != '' )\n\t\t{\n\t\t\t$filter_arguments = array(\n\t\t\t\t\"filter\" => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t\"portal_name\" => array(\n\t\t\t\t\t\t\t'$equals' => $username,\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t\"offset\" => 0,\n\t\t\t\t\"fields\" => \"id,portal_name,portal_password,email,treat_hematology_patients_c,specialty_c\",\n\t\t\t);\n\t\t\t$url = $this->url . \"/Contacts/filter\";\n\t\t\t$response = self::call($url, $this->token, 'GET', $filter_arguments);\n\t\t}\n\n\t\t$isUser = $response->records[0]->portal_name;\n\n\t\tif( $isUser == $username )\n\t\t{\n\t\t\treturn $response;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"function get_user_details($username)\n {\n }",
"function getInfoById($username){\n $db=new connect();\n $select=\"select * from users where Username='$username'\";\n $result=$db->getList($select);\n $quest=$result->fetch();\n return $quest;\n }",
"public function getData() {\n\t\t$id = $this->user;\n\t\t$this->db->query( 'SELECT * FROM users WHERE crsid = :id' );\n\t\t$this->db->bind( ':id', $id );\n\t\t$row = $this->db->single();\n\n\t\tif ( ! $row[\"name\"] ) {\n\t\t\t$ds = ldap_connect( \"ldap.lookup.cam.ac.uk\" );\n\t\t\t$lsearch = ldap_search( $ds, \"ou=people,o=University of Cambridge,dc=cam,dc=ac,dc=uk\", \"uid=\" . $id . \"\" );\n\t\t\t$info = ldap_get_entries( $ds, $lsearch );\n\t\t\t$name = $info[0][\"cn\"][0];\n\t\t\t$this->db->query( 'UPDATE users SET name=:name WHERE crsid=:id' );\n\t\t\t$this->db->bind( ':id', $id );\n\t\t\t$this->db->bind( ':name', $name );\n\t\t\t$this->db->execute();\n\t\t\t$row[\"name\"] = $name;\n\t\t}\n\n\t\treturn $row;\n\t}",
"public function get_user() {\r\n return $this->util_model->get_data(\r\n 'schools', \r\n array('unitname') \r\n );\r\n }",
"private function getUserInfo()\n\t{\n\t\t$user = Sentry::user();\n\t\t$result = array(\n\t\t\t'username' => $user->get('username'),\n\t\t\t'isAdmin' => $user->in_group('admin'),\n\t\t);\n\t\treturn $result;\n\t}",
"public function getInfoProfile(){\n return $this->get_user_by_id($this->getAccountID());\n }",
"protected function getUser($name){\r\n\t\t\r\n\t\t$sql = \"SELECT * FROM users WHERE users_firstname = ?\";\r\n\t\t\r\n\t\t//asking to prepare the statement inside the database instead of query\r\n\t\t$stmt = $this->connect()->prepare($sql);\r\n\t\t\r\n\t\t//filling the blanks left by the ?\r\n\t\t//using the execute method to actually run the data\r\n\t\t$stmt->execute([$name]);\r\n\t\t\r\n\t\t$results = $stmt->fetchALL();\r\n\t\treturn $results;\r\n\t}",
"abstract public function getUserInfo();",
"function get_member_with_username($username)\r\n\t{\r\n\t\tglobal $dbCon;\r\n\r\n\t\t$sql = \"SELECT id, username, firstname, lastname, email, password, salt, permission FROM student WHERE username = ?;\";\r\n\t\t$stmt = $dbCon->prepare($sql); //Prepare Statement\r\n\t\tif ($stmt === false)\r\n\t\t{\r\n\t\t\ttrigger_error('SQL Error: ' . $dbCon->error, E_USER_ERROR);\r\n\t\t}\r\n\t\t$stmt->bind_param('s', $username);\r\n\t\t$stmt->execute(); //Execute\r\n\t\t$stmt->bind_result($id, $username, $firstname, $lastname, $email, $password, $salt, $permission); //Get ResultSet\r\n\t\t$stmt->fetch();\r\n\t\t$stmt->close();\r\n\r\n\t\tif ($id > 0)\r\n\t\t{\r\n\t\t\t$user_array = array(\"id\" => $id, \"username\" => $username, \"firstname\" => $firstname, \"lastname\" => $lastname, \"email\" => $email, \"password\" => $password, \"salt\" => $salt, \"permission\" => $permission);\r\n\t\t\treturn $user_array;\r\n\t\t}\r\n\t\treturn TRUE;\r\n\t}",
"function getUserInfo($memberName){\r\n $q = \"SELECT * FROM \".TBL_USERS.\" WHERE memberName = '$memberName'\";\r\n $result = mysql_query($q, $this->connection);\r\n /* Error occurred, return given name by default */\r\n if(!$result || (mysql_numrows($result) < 1)){\r\n return NULL;\r\n }\r\n /* Return result array */\r\n $dbarray = mysql_fetch_array($result);\r\n return $dbarray;\r\n }",
"public function getSummonerByName($summonerName){\n\t\t$summonerName = str_replace(' ', '%20', $summonerName);\n\t\treturn $this->_makeCall($this->_lolServer . '/summoner/' . $summonerName . '?');\n\t}",
"public function getUserDetails() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n $username = $this->request->input(\"username\");\n if ($username) {\n $where[] = [\"username\", \"=\", $username];\n }\n\n $userIdEqual = $this->request->input(\"user_id_equal\");\n if ($userIdEqual) {\n $where[] = [\"user_id\", \"=\", $userIdEqual];\n }\n\n $userIdNotEqual = $this->request->input(\"user_id_not_equal\");\n if ($userIdNotEqual) {\n $where[] = [\"user_id\", \"!=\", $userIdNotEqual];\n }\n\n\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getData();\n\n return $users;\n }",
"function xarbb_userapi_getuserinfo($args)\r\n{\r\n static $users = array();\r\n extract $args;\r\n\r\n // uid is mandatory\r\n if (!isset($uid) || !is_numeric($uid) || $uid < 0) return;\r\n\r\n // If the user is cached, then return it.\r\n // Returning all details for now.\r\n if (isset($users[$uid])) return $users[$uid];\r\n\r\n // Get the details.\r\n $name = xarUserGetVar('name', $uid);\r\n\r\n // The url is set only if we have read permission.\r\n // TODO: these URLs, fetched from this central place, could be directed to some other place.\r\n if (xarSecurityCheck('ReadRole', 0, 'Roles', $uid)) {\r\n $display = xarModUrl('roles', 'user', 'display', array('uid' => $uid));\r\n $mailto = xarModUrl('roles', 'user', 'email', array('uid' => $item['xar_uid']));\r\n } else {\r\n $display = NULL;\r\n $mailto = NULL;\r\n }\r\n\r\n // TODO: detect and handle anonymous users appropriately.\r\n}",
"public function getUserInfo($user_name) {\n $query = \"SELECT * FROM users WHERE user_name = '%s'\";\n $vals = Array();\n $vals[] = $user_name;\n $user_info = $this->read_one($query, $vals);\n return $user_info;\n }",
"public function users() {\n $matches = array();\n if ($name = $this->input->get('q')) {\n $users = ORM::factory('user')->where('site_id', $this->site->id)->like('searchname', text::searchable($name))->where('status', 1)->find_all();\n foreach ($users as $user) {\n if ($user->id != $this->user->id) { // Can't send a message to yourself.\n $matches[] = (object) array('id' => $user->id, 'name' => $user->name());\n }\n }\n }\n print json_encode($matches);\n die();\n }",
"public function getUserData()\n {\n $data = array();\n\n $identity = $this->openid->identity;\n\n if ($identity) {\n $steamId = str_replace('http://steamcommunity.com/openid/id/', '', $identity);\n\n $query = http_build_query(array(\n 'key' => $this->getOption('apiKey'),\n 'steamids' => $steamId\n ));\n\n $url = $this->getOption('profileUrl') . '?' . $query;\n\n $json = json_decode(file_get_contents($url));\n\n if (count($json->response->players)) {\n $data = (array) $json->response->players[0];\n }\n }\n\n return $data;\n }",
"private static function get_user_data($username)\n {\n }",
"public function getUserByName($name) {\n\t\treturn $this->executeMethod('twitter.users.getUserByName', array(\n\t\t\t'name' => $name,\n\t\t))->getUser();\n\t}",
"public function getUserId($name){\n $names = explode(\",\", $name);\n // Search each Name Field for any specified Name\n return User::where(function ($query) use ($names) {\n $query->whereIn('first_name', $names);\n\n $query->orWhere(function ($query) use ($names) {\n $query->whereIn('middle_name', $names);\n });\n $query->orWhere(function ($query) use ($names) {\n $query->whereIn('last_name', $names);\n });\n })->get();\n }",
"public function user_information($user_name)\n {\n $url = preg_replace('/set/i', 'user:' . $user_name, $this->public_url);\n return $this->curl($url)->user;\n }",
"function getUserInfo($username){\r\n $q = \"SELECT * FROM \".TBL_USERS.\" WHERE username = '$username'\";\r\n $result = mysql_query($q, $this->connection);\r\n /* Error occurred, return given name by default */\r\n if(!$result || (mysql_numrows($result) < 1)){\r\n return NULL;\r\n }\r\n /* Return result array */\r\n $dbarray = mysql_fetch_array($result);\r\n return $dbarray;\r\n }",
"function getUserInfoByUsername($username) {\n jincimport('utility.servicelocator');\n $servicelocator = ServiceLocator::getInstance();\n $logger = $servicelocator->getLogger();\n \n $dbo =& JFactory::getDBO();\n $query = 'SELECT id, username, name, email FROM #__users WHERE username = ' . $dbo->quote($username);\n $dbo->setQuery($query);\n $logger->debug('JINCJoomlaHelper: executing query: ' . $query);\n $infos = array();\n if ($user_info = $dbo->loadObjectList()) {\n if (! empty ($user_info)) {\n $user = $user_info[0];\n $infos['id'] = $user->id;\n $infos['username'] = $user->username;\n $infos['name'] = $user->name;\n $infos['email'] = $user->email;\n }\n }\n return $infos;\n }",
"public function getUserWithUsername($username);",
"public function recherche_user() {\n\t\t$this->onDebug ( __METHOD__, 1 );\n\t\t$userdata = $this->creer_definition_user_get_ws ();\n\t\t$this->onDebug ( $userdata, 1 );\n\t\treturn $this->getObjetZabbixWsclient ()\n\t\t\t->userGet ( $userdata );\n\t}",
"public static function get_lookup_players()\r\n {\r\n $result = db::sql(\"SELECT player_id, firstname, lastname FROM `super_rugby_lookup_names` ORDER BY firstname;\", DB_NAME);\r\n $player_reference = null;\r\n if (mysqli_num_rows($result)){\r\n while(list($player_id, $firstname, $lastname)=mysqli_fetch_array($result)){\r\n $player_reference[] = array('id'=>$player_id, 'firstname'=>$firstname, 'lastname'=>$lastname);\r\n }\r\n }\r\n return $player_reference;\r\n }",
"function getSpecificMember($name, $email) {\r\n try {\r\n $mam = getAllMembers();\r\n var_dump($mam);\r\n $user = searchUsers($mam, $email);\r\n print_r($user);\r\n if ($user) {\r\n \r\n }\r\n } catch (Exception $exc) {\r\n echo $exc->getTraceAsString();\r\n }\r\n}",
"public function userinfo($username=null) {\r\n\t\tif (!is_null($username)) {\r\n\t\t\t$field = ($this->validEmail($idin)) ? 'email' : 'username';\r\n\t\t\t$user = $this->db\r\n\t\t\t\t->where($field, $username)\r\n\t\t\t\t->get($this->user_table)\r\n\t\t\t\t->row();\r\n\t\t\treturn $user;\r\n\t\t}\r\n\t}",
"function get_user_by_username($username) {\n $read_json = file_get_contents(__DIR__ . '/data_users.json');\n $data = json_decode($read_json, JSON_OBJECT_AS_ARRAY);\n\n // iterate over db, if username is found, return user\n foreach ($data as $user){\n if ($user[\"username\"] == $username){\n return $user;\n }\n }\n return false;\n}",
"function paces_get_users_all_details( $user_id ){\n return get_metadata( 'user', $user_id );\n}",
"protected function getAllUsers() {\n\t\t\t$query = \"SELECT username, f_name, l_name, phone, email FROM Stomper\";\n\t\t\treturn $this->EndpointResponse($query, true);\n\t\t}",
"public function getUserInfo()\n {\n $request = new Resource('GET', 'https://api.dropbox.com/1/account/info', array(\n 'oauth_consumer_key' => $this->consumer->client_id,\n 'oauth_token' => $this->token->access_token,\n ));\n\n // Sign the request using the consumer and token\n $request->sign($this->signature, $this->consumer, $this->token);\n\n $user = json_decode($request->execute());\n\n // Create a response from the request\n return array(\n 'uid' => $this->token->uid,\n 'name' => $user->display_name,\n 'email' => $user->email,\n 'location' => $user->country,\n );\n }",
"public function getUser($username){\r\n $stmt = $this->DB->prepare(\"SELECT * FROM users WHERE User_Name = :username\");\r\n $stmt->bindParam( 'username', $username );\r\n $stmt->execute();\r\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n }",
"private function getUser($name) {\n\t\t$i = 0;\n\t\t\n\t\tforeach ( $this->configuration->getElement ( \"system\" )->users [0] as $user ) {\n\t\t\tif ($user->getName () == 'user' && strcasecmp ( $user ['name'], $name ) == 0) {\n\t\t\t\treturn $user;\n\t\t\t} elseif ($user->getName () == 'user') {\n\t\t\t\t$i ++; // count the users.\n\t\t\t}\n\t\t}\n\t\t\n\t\t//If no users exist, get the default user\n\t\tif ($i == 0) {\n\t\t\t$user = $this->configuration->getElement ( \"system\" )->users [0]->{'default-user'} [0];\n\t\t\tif (strcasecmp ( $user ['name'], $name ) == 0) {\n\t\t\t\treturn $user;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null; // user not found.\n\t}",
"private function get_userInfo() {\n $params = [ 'user_ids' => $this->user_id ];\n $result = $this->api->users->get($params);\n $params['fields'] = '';\n $result2 = $this->api2->users->get($params);\n $result['hidden'] = (int)array_has($result2, 'hidden');\n return $result;\n }",
"public function user_info(){\n $_username = '';\n $_email = '';\n $_level = '';\n\n if($_SESSION['login']){\n $userID = filter_var($_SESSION['userid'], FILTER_SANITIZE_STRING);\n $session_key = filter_var($_SESSION['session_key'], FILTER_SANITIZE_STRING);\n $query = \"SELECT * FROM users WHERE username='$userID' AND session_key='$session_key'\";\n $info_result = $this->connect()->query($query);\n $user_info = $info_result->fetch_array();\n\n $_username = $user_info['username'];\n $_email = $user_info['email'];\n $_level = $user_info['level'];\n }\n\n return array(\"username\"=>$_username, \"email\"=>$_email, \"level\"=>$_level);\n }",
"protected function getUser() {\r\n\t\t$session = $this->getSession ();\r\n\t\tif (isset ( $session ['uid'] ) && isset ( $session ['uname'] )) {\r\n\t\t\treturn array ('uid' => $session ['uid'], 'uname' => $session ['uname'] );\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public static function getUser(string $name)\n\t{\n\t\tif (isset(self::$userNames[$name]))\n\t\t{\n\t\t\treturn self::$userCache[self::$userNames[$name]];\n\t\t}\n\n\t\tif ($stmt = self::db()->prepare('SELECT id, accessToken, refreshToken, isAdmin FROM users WHERE name = ?;'))\n\t\t{\n\t\t\t$stmt->bind_param('s', $name);\n\t\t\t$stmt->execute();\n\t\t\t$stmt->bind_result($id, $accessToken, $refreshToken, $isAdmin);\n\t\t\t$stmt->fetch();\n\t\t\t$stmt->close();\n\n\t\t\tif (isset($id))\n\t\t\t{\n\t\t\t\t$data = compact('id', 'name', 'accessToken', 'refreshToken', 'isAdmin');\n\t\t\t\tself::$userCache[$name] = $data;\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}",
"function extract_all_users() {\n\t\t$db = connect_to_db();\n\n\t\t$select_statement = \n\t\t\t\"select users.id, users.username from users\";\n\t\t;\n\n\t\t$stmt = $db->prepare($select_statement);\n\n\t\tif ( !($stmt->execute()) ) {\n\t\t\techo \"Error: Could not get users.\";\n\t\t\t$db->close();\n\t\t\texit;\n\t\t}\n\n\t\t$json = \"[\";\n\n\t\t$stmt->bind_result($id, $username);\n\n\t\twhile ( $stmt->fetch() ) {\n\t\t\t$info = array('id' => $id, 'username' => $username);\n\t\t\t$json = $json . json_encode($info) . \",\";\n\t\t}\n\n\t\techo substr_replace($json, \"]\", -1);\n\n\t\t$db->close();\n\t}",
"public function getUserByUserName($usr_name_in) {\n $stmt = $this->conn->prepare(\"SELECT usr_name, usr_full_name, usr_email, usr_phone_number, usr_api_key, ou_status,ou_recode_added_at,ucat_name,ucat_description FROM operational_user_view_release WHERE usr_name = ? and (ou_status = 1 or ou_status = 2)\");\n $stmt->bind_param(\"s\", $usr_name_in);\n if ($stmt->execute()) {\n // $user = $stmt->get_result()->fetch_assoc();\n $stmt->bind_result($usr_name, $usr_full_name, $usr_email, $usr_phone_number, $usr_api_key, $ou_status, $ou_recode_added_at, $ucat_name, $ucat_description);\n $stmt->fetch();\n $user = array();\n $user[\"usr_name\"] = $usr_name;\n $user[\"usr_full_name\"] = $usr_full_name;\n $user[\"usr_email\"] = $usr_email;\n $user[\"usr_phone_number\"] = $usr_phone_number;\n\t\t\t$user[\"usr_api_key\"] = $usr_api_key;\n $user[\"ou_status\"] = $ou_status;\n\t\t\t$user[\"ou_recode_added_at\"] = $ou_recode_added_at;\n $user[\"ucat_name\"] = $ucat_name;\n $user[\"ucat_description\"] = $ucat_description;\n\n $stmt->close();\n return $user;\n } else {\n return NULL;\n }\n }",
"function memberByUsername($username)\r\n {\r\n $select = 'SELECT member_id, username, firstname, lastname, email, password, image FROM atlas_members WHERE username=:username';\r\n \r\n $statement = $this->_pdo->prepare($select);\r\n $statement->bindValue(':username', $username, PDO::PARAM_INT);\r\n \r\n \r\n $statement->execute();\r\n \r\n return $statement->fetch(PDO::FETCH_ASSOC);\r\n }",
"function getUser(){\n\t\t\tglobal $db;\n\t\t\tglobal $json;\n\n\t\t\tif($this->id != 0){\n\t\t\t\t$query = $db->prepare('SELECT * FROM user WHERE Id= :id');\n\t\t\t\t$query->bindParam(':id', $this->id);\n\t\t\t}\n\t\t\telse if($this->username != null){\n\t\t\t\t$query = $db->prepare('SELECT * FROM user WHERE Username= :id');\n\t\t\t\t$query->bindParam(':id', $this->username);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$json->invalidRequest();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$query->execute();\n\t\t\t\t\n\t\t\t\n\t\t\tif($query->rowCount() > 0){\n\t\t\t\n\t\t\t\tforeach($query as $row) {\n\t\t\t\t\t$this->id = $row['Id'];\n\t\t\t\t\t$this->username = $row['Username'];\n\t\t\t\t\t$this->subject = $row['Subject'];\n\t\t\t\t\t$this->admin = $row['Admin'];\n\t\t\t\t\t$this->key = $row['ApiKey'];\n\t\t\t\t\t\n\t\t\t\t\t$result = '{ \"User\" : { \"Id\" : ' . $row['Id'] . ', \"Username\" : \"' . $row['Username'] . '\", \"Subject\" : '.$row['Subject'].', \"Admin\" : ' . $row['Admin'] . ', \"ApiKey\" : \"' . $row['ApiKey'] . '\", '; \n\t\t\t\t\n\t\t\t\t\t$result = $result . \"\" . $this->getAssignedSurveys() . \"} }\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$json->notFound(\"User\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"public function get_user_info()\n {\n try {\n $user_info = self::api(\"me\");\n } catch (Exception $e) {\n // TODO: Handle the error\n // Set the return value to be an empty array\n $user_info = array();\n }\n\n return $this->convert_array_to_object($user_info);\n }",
"function get_ScreenName($find)\n{\n \n $pdo = Database::connect();\n $sql= \"SELECT * FROM userimagedetails\"; \n\n global $nameArray;\n\t\tforeach($pdo->query($sql) as $row)\n\t\t{\n\t\t\n\t\t $nameArray= array( $row['userName']=>$row['shortID']);\n\t\t\n\t\t}\n\t\t\n\t\tDatabase::disconnect();\n //get a return\n foreach($nameArray as $name =>$userID)\n {\n if($name==$find)\n\t {\n\t return $userID;\n\t\t break;\n\t \n\t }\n }\n}",
"function cicleinscription_get_user_by_username($username){\n\tglobal $DB;\n\treturn $DB->get_record('user', array('username'=>$username));\n}",
"public function getUserInfo() {\n\t\t$userInfo = $this->HttpSocket->get(FLICKR_API_URL,\n\t\t\tarray(\n\t\t\t\t'method' => USERINFO,\n\t\t\t\t'format' => DATAFORMAT,\n\t\t\t\t'api_key' => $this->api_key,\n\t\t\t\t'user_id' => $this->photo['owner'],\n\t\t\t));\n\t\treturn unserialize($userInfo->body);\n\t}",
"public function getUserInfo() {}",
"function getUserInfo($user='',$field='')\r\n\t{\r\n\t\tif($user != '')\r\n\t\t{\r\n\t\t\t$sql = $GLOBALS['db']->Query(\"SELECT $field FROM \" . PREFIX . \"_users WHERE Status = '1' AND Id = '$user'\");\r\n\t\t\t$row = $sql->fetchrow();\r\n\t\t\t$sql->close();\r\n\t\t\treturn $row->$field;\r\n\t\t}\r\n\t}",
"public function get_user_info()\n\t{\n\t\tif ( function_exists('wp_remote_get') ) {\n\t\t\t$json = wp_remote_get($this->API_URL . '?username='. $this->user);\n\t\t\t$user_info = @json_decode($json['body'], true);\n\t\t} else {\n\t\t\t$json = @file_get_contents($this->API_URL . '?username='. $this->user);\n\t\t\t$user_info = @json_decode($json, true);\n\t\t}\n\t\t\n\t\treturn $user_info['resp'];\n\t}",
"public function bySummoner($ids)\n {\n return $this->call('team/by-summoner/' . $this->makeList($ids));\n }",
"function getUserName($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from users where userid='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['username'].\" \".$rs['usertype'];\n\t}\n\t$crud->disconnect();\n}",
"function fetch_userinfo_from_username($username, $option=0, $languageid=0)\n\t{\n\t $result = $this->db->query(\"SELECT * FROM \"\n\t\t . TABLE_PREFIX . \"user WHERE username = '\".$username.\"'\");\n\t\t$useridq = $this->db->fetch_array($result); \n\t if (!$useridq) return $useridq;\n\t $userid = $useridq['userid'];\n\t return fetch_userinfo($userid, $option, $languageid);\n\t}",
"public function getUserInfo ()\n\t{\n\t\t$info[\"id\"]\t\t\t\t\t\t= $this->id;\t\t\t\t\t//The unique id of the user in the database\n\t\t$info[\"user_id\"] \t\t\t\t= $this->userId;\t\t\t\t//The id of the user includes API id's\n\t\t$info[\"email\"]\t\t\t\t\t= $this->email;\t\t\t\t\t//The email of the user\n\t\t$info[\"description\"]\t\t\t= $this->description;\t\t\t//The description of the user\n\t\t$info[\"location\"]\t\t\t\t= $this->location;\t\t\t\t//The location of the user\n\t\t$info[\"first_name\"]\t\t\t\t= $this->firstName;\t\t\t\t//The first name of the user\n\t\t$info[\"last_name\"]\t\t\t\t= $this->lastName;\t\t\t\t//The last name of the user\n\t\t$info[\"name\"]\t\t\t\t\t= $this->fullName;\t\t\t\t//The full name of the user\n\t\t$info[\"username\"]\t\t\t\t= $this->username;\t\t\t\t//The username of the user\n\t\t$info[\"type\"]\t\t\t\t\t= $this->type;\t\t\t\t\t//The type of user registration\n\t\t$info[\"thumbnail\"]\t\t\t\t= $this->thumbnail;\t\t\t\t//The user's image thumbnail\n\t\t$info[\"gender\"]\t\t\t\t\t= $this->gender;\t\t\t\t//The gender of the user\n\t\t$info[\"num_calendars\"]\t\t\t= $this->numCalendarsCreated;\t//The number of calendars the user has created\n\t\t$info[\"num_followed_calendars\"]\t= $this->numCalendarsFollowed;\t//The number of calendars the user is following\n\t\t$info[\"primary_calendar\"]\t\t= $this->primaryCalendar;\t\t//The primary calendar that a user is using\n\t\t\n\t\treturn $info;\n\t}",
"public function get_user_info($info)\n {\n Session::_start();\n return Session::_get(\"user\", $info);\n }",
"function User_Info($UserIDorUsername)\n\t{\n\t\t$UserID=$this->GetUserID($UserIDorUsername);\n\t\t$R=j::SQL(\"SELECT * FROM jfp_xuser AS XU JOIN jf_users AS U ON (U.ID=XU.ID) WHERE XU.ID=?\",$UserID);\n\t\tif ($R) return $R[0];\n\t\telse return null;\n\t}",
"public function getmemberAction() {\n\n $data = array();\n\n $usersTable = Engine_Api::_()->getDbtable('users', 'user');\n $usersTableName = $usersTable->info('name');\n\n $select = $usersTable->select();\n\n $select->where('displayname LIKE ? ', '%' . $this->_getParam('text') . '%')\n ->order('displayname ASC')->limit('40');\n $users = $usersTable->fetchAll($select);\n\n foreach ($users as $user) {\n $user_photo = $this->view->itemPhoto($user, 'thumb.icon');\n $data[] = array(\n 'id' => $user->user_id,\n 'label' => $user->displayname,\n 'photo' => $user_photo\n );\n }\n\n return $this->_helper->json($data);\n }",
"function get_user($user_id){\n\tglobal $connection;\n\t$get_user= mysqli_query($connection,\"SELECT * FROM kp_users WHERE user_id='$user_id'\");\n\t$row = mysqli_fetch_assoc($get_user);\n\t$name = strtoupper($row['username']);\n\treturn $name;\n}",
"function lookupUser($username)\n { \n try {\n $connection = Doctrine_Manager::connection();\n $query = \"SELECT username, access_token FROM constant_contact WHERE username='\".$username.\"' ORDER BY id DESC LIMIT 1\";\n $statement = $connection->execute($query);\n $statement->execute();\n\n $resultset = $statement->fetch(PDO::FETCH_OBJ);\n \n if (empty($resultset)) {\n $returnUser = false;\n throw new Exception('Username '.$username.' not found in datastore');\n }\n else {\n $fields = array();\n foreach ($resultset as $k => $v) $fields[$k] = $v;\n $returnUser = $fields;\n }\n\n }\n catch(Exception $e) {\n echo 'OAuth Exception: '.$e->getMessage();\n }\n return $returnUser;\n }",
"public function get_other_user($data){\n $query = $this->db->query('SELECT * FROM users INNER JOIN swap_reqs ON swap_reqs.sent_by_username=users.username WHERE `swap_reqs`.`swap_UID`=\"'.$data['swap_UID'].'\" ');\n return $query->result();\n }",
"function getUserByName($username)\n {\n return $this->data->getUserByName($username);\n }",
"function getUserNames(){\n global $db;\n \n $stmt=$db->prepare(\"SELECT username FROM login_inventory\");\n \n if($stmt->execute() && $stmt->rowCount()>0){\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return ($results);\n }\n else{\n return false;\n }\n }",
"public function read_single_user() {\n //Create query\n $query = 'SELECT vendor_id, latitude, longitude, time, type FROM ' . $this->table_name . ' WHERE vendor_id = ?';\n\n //Prepare statement\n $stmt = $this->conn->prepare($query);\n //Clean lowercase.\n //Bind UID\n $stmt->bindParam(1, $this->vendor_id);\n\n //Execute query\n $stmt->execute();\n\n return $stmt;\n }",
"public function getUser($username)\n {\n $stmt = $this->con->prepare(\"SELECT id_usuario,nome,userlogin,email,instituicao,api_key FROM tbl_usuario WHERE (userlogin=? or email=?)\");\n $stmt->bind_param(\"ss\", $username, $username);\n $stmt->execute();\n\n $stmt->bind_result($id, $name, $username, $email, $school, $apikey);\n $stmt->fetch();\n $user = array();\n $user['id'] = $id;\n $user['username'] = $username;\n $user['name'] = $name;\n $user['email'] = $email;\n $user['school'] = $school;\n $user['apikey'] = $apikey;\n\n //returning the user\n return $user;\n }",
"function get_user_by_user_name($user_name)\n{\n global $conn;\n $q['query'] = \"SELECT * FROM `user_master` WHERE `user_name`='$user_name'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n\n return $q['result'];\n}",
"function getUserInfo($userName)\n {\n $data = [$userName];\n $output = $this->queryData(\"//QuerygetUserInfo\", \"//columnGetUserInfo\", $data);\n $user = [];\n foreach($output as $tuple) {\n $user = $tuple;\n break;\n }\n return $user;\n }",
"function get_user_info(){\t\t\n\t\t// Fetch user data from database\n\t\t$user_data_array=$this->UserModel->get_user_data(array('member_id'=>$this->session->userdata('member_id')));\n\t\techo $user_data_array[0]['company'].\"|\".$user_data_array[0]['address_line_1'].\"|\".$user_data_array[0]['city'].\"|\".$user_data_array[0]['state'].\"|\".$user_data_array[0]['zipcode'].\"|\".$user_data_array[0]['country_id'].\"|\".$user_data_array[0]['country_name'];\n\t}",
"function getUserDetails(){\n if(empty($this->userid)){\n return null;\n } \n $userDetailsQuery = \"SELECT * FROM da_userMaster WHERE da_userMaster.username = '$this->userid'\"; \n $dbqry = new dbquery($userDetailsQuery, $this->connid);\n $user = $dbqry->getrowassocarray();\n return $user;\n }",
"function getUsersByRank()\n\t{\n\t $resource = $this->DB->database_select('users', '*', array(), 0, array('value' => 'points', 'option' => 'desc'));\n\t return $resource;\n\t}",
"public function getUser($username)\n {\n $apiEndpoint = '/1/user?username='.$username.'&expand=attributes';\n $apiReturn = $this->runCrowdAPI($apiEndpoint, \"GET\", array());\n if ($apiReturn['status'] == '200') {\n $userAttributes = array();\n for ($i = 0; $i < count($apiReturn['data']['attributes']['attributes']); $i++) {\n $currentAttribute = $apiReturn['data']['attributes']['attributes'][$i];\n $userAttributes[$currentAttribute['name']] = $currentAttribute['values'][0];\n }\n $userData = array(\n 'key' => $apiReturn['data']['key'],\n 'user-name' => $apiReturn['data']['name'],\n 'first-name' => $apiReturn['data']['first-name'],\n 'last-name' => $apiReturn['data']['last-name'],\n 'display-name' => $apiReturn['data']['display-name'],\n 'email' => $apiReturn['data']['email'],\n 'attributes' => $userAttributes,\n 'groups' => $this->getUserGroups($apiReturn['data']['name']),\n );\n return $userData;\n }\n return null;\n }",
"public function get_user_data() {\n\t\t$email = '';\n\t\t$name = '';\n\n\t\tif ( ! empty( $this->current_user->user_email ) ) {\n\t\t\t$email = $this->current_user->user_email;\n\t\t}\n\n\t\tif ( ! empty( $this->current_user->user_firstname ) && ! empty( $this->current_user->user_lastname ) ) {\n\t\t\t$name = $this->current_user->user_firstname . ' ' . $this->current_user->user_lastname;\n\t\t} else {\n\t\t\t$name = $this->current_user->user_login;\n\t\t}\n\n\t\treturn array(\n\t\t\t'name' => $name,\n\t\t\t'email' => $email,\n\t\t);\n\t}",
"function get_user_name() {\n return $this->call('get_user_name', array(), TRUE);\n }",
"public function getUserByUsername($username)\n {\n $stmt = $this->conn->prepare(\"SELECT id, username, email, phone FROM users WHERE username = ?\");\n $stmt->bind_param(\"s\", $username);\n $stmt->execute();\n $stmt->bind_result($id, $uname, $email, $phone);\n $stmt->fetch();\n $user = array();\n $user['id'] = $id;\n $user['username'] = $uname;\n $user['email'] = $email;\n $user['phone'] = $phone;\n return $user;\n }",
"public function getUserNameInfo($username) {\n $sql = \"SELECT * FROM usertable WHERE username = '$username'\";\n foreach (parent::$this->db_connect->query($sql) as $row) {\n return $row;\n }\n }",
"public function getUser() {\n\t\t$urlUser = \"{$this->apiHost}/me.json\";\n\t\treturn $this->runCurl ( $urlUser );\n\t}",
"public static function getUser();",
"public function getUserInfo()\n {\n return $this->_process('user/info')->user;\n }",
"private function getUserInfo()\n {\n // TODO This could be cached\n return $this->userInfoApi->getUserInfo();\n }",
"function getUserByUsername($username, $users)\n {\n foreach ($users as $user)\n {\n if ($user['username'] == $username)\n {\n return $user;\n }\n }\n return NULL;\n }",
"public function public_user_data($user_name)\n {\n $url = preg_replace('/set/i', 'user:' . $user_name, $this->public_url);\n return $this->curl($url)->user;\n }",
"function getUser($id)\n{\n\tif (in_array($_SESSION['user']['role'], ['admin'])) {\n\t\tglobal $conn, $roles;\n\t\t$sql = \"SELECT * FROM users WHERE role = 'seeker' and u_name=$id limit 1\"; //WHERE role IS NOT NULL\n\t\t$result = mysqli_query($conn, $sql);\n\t\t$users = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\n\t\treturn $users;\n\t} else {\n\t\treturn null;\n\t}\n}",
"public function getUserDetails($username)\n {\n $user = static::findByUsername($username);\n return ['user_id' => $user->getId()];\n }",
"public function getInfos($fields)\n {\n $users_infos = sfFacebook::getFacebookApi()->users_getInfo(array($this->getCurrentFacebookUid()),$fields);\n\n return reset($users_infos);\n }",
"public function getMe()\n {\n return $this->_execute('/user/', self::METHOD_GET);\n }",
"public function getUserInfo(): array;",
"function listOfUsers(){\n\t\n\t\t$users = [];\n\t\tforeach ($this->members as $obj){\n\t\t\t$user = array('name'=> $obj->getUserFullName(),'id'=>$obj->getUserID());\n\t\t\tarray_push($users, $user);\n\t\t}\n\t\treturn $users;\n\t}",
"function getUserInfo($username){\r\n\t$query = \"SELECT * FROM \".TBL_USERS.\" WHERE username = :username\";\r\n\t$stmt = $this->connection->prepare($query);\r\n\t$stmt->execute(array(':username' => $username));\r\n\t$dbarray = $stmt->fetch(); \r\n /* Error occurred, return given name by default */\r\n $count = $stmt->rowCount();\r\n if(!$dbarray || $count < 1){\r\n return NULL;\r\n }\r\n /* Return result array */\r\n return $dbarray;\r\n }",
"public function creer_definition_user_get_ws() {\n\t\t$this->onDebug ( __METHOD__, 1 );\n\t\t$filter = array (\n\t\t\t\t\"alias\" => $this->getAlias () \n\t\t);\n\t\tif ($this->getName () != \"\") {\n\t\t\t$filter [\"name\"] = $this->getName ();\n\t\t}\n\t\t\n\t\treturn array (\n\t\t\t\t\"output\" => \"userid\",\n\t\t\t\t\"filter\" => $filter \n\t\t);\n\t}",
"function getUsername()\n\t{\n\t\treturn $this->Info['Username'];\n\t}",
"public function getProfileDetails($user_name){\n $user_details = array();\n $query = \"SELECT * FROM appuser WHERE username = $1\";\n $query_result = pg_prepare($this->con, \"myquery14\", $query);\n $query_result = pg_execute($this->con, \"myquery14\", array($user_name));\n if (!$query_result) {\n echo \"An error occurred.\\n\";\n exit;\n }\n $row = pg_fetch_row($query_result);\n array_push($user_details, $row[2]);\n array_push($user_details, $row[3]);\n array_push($user_details, $row[4]);\n return $user_details;\n\n }",
"public function lookupFriends() {\n\t\t\n\t\t//if id is integer\n\t\tif(is_int($this->_query['user_id'])) {\n\t\t\t$id = explode(',', $this->_query['user_id']);\n\t\t\t//at this point id will be an array\n\t\t\t$id = array();\n\t\t\t//lets put it in query\n\t\t\t$this->_query['user_id'] = $id;\n\t\t}\n\t\t\n\t\t//if name is string\n\t\tif(is_string($this->_query['screen_name'])) {\n\t\t\t$name = explode(',', $this->_query['screen_name']);\n\t\t\t//at this point id will be an array\n\t\t\t$name = array();\n\t\t\t$this->_query['screen_name'] = $name;\n\t\t}\n\t\t\n\t\treturn $this->_getResponse(self::URL_LOOK_UP, $this->_query);\n\t}"
] | [
"0.6706619",
"0.64005727",
"0.6345621",
"0.63291687",
"0.6287345",
"0.62399346",
"0.6227805",
"0.6218873",
"0.6139884",
"0.6122469",
"0.60727835",
"0.60460776",
"0.6041386",
"0.60404205",
"0.6008225",
"0.5994547",
"0.59903413",
"0.5987017",
"0.59780294",
"0.5966316",
"0.5963747",
"0.59524506",
"0.59433293",
"0.59277105",
"0.5920542",
"0.59072995",
"0.5904723",
"0.58710104",
"0.5853317",
"0.58531415",
"0.58446497",
"0.58267015",
"0.5815983",
"0.5814685",
"0.5814311",
"0.58018506",
"0.579347",
"0.57918525",
"0.5784342",
"0.5783208",
"0.5768417",
"0.5765829",
"0.57645226",
"0.5764101",
"0.5759156",
"0.5754996",
"0.57366925",
"0.57338643",
"0.57294595",
"0.5717026",
"0.5708228",
"0.57057226",
"0.56995106",
"0.56956583",
"0.56935066",
"0.5690713",
"0.5690417",
"0.5684961",
"0.5679908",
"0.5676089",
"0.56727856",
"0.56644714",
"0.566374",
"0.56604266",
"0.56596124",
"0.56527114",
"0.56498325",
"0.5640803",
"0.5631906",
"0.5623694",
"0.5620822",
"0.56178105",
"0.56131077",
"0.56107306",
"0.560951",
"0.5604931",
"0.5600731",
"0.5597198",
"0.5595352",
"0.5589103",
"0.55845463",
"0.55826694",
"0.5582419",
"0.55809975",
"0.55785435",
"0.55760145",
"0.5573753",
"0.5569496",
"0.55650234",
"0.5560837",
"0.555852",
"0.5555111",
"0.55465746",
"0.5542889",
"0.5540645",
"0.5537777",
"0.55295116",
"0.55247015",
"0.55232537",
"0.55182433",
"0.5515222"
] | 0.0 | -1 |
Get the information of a user(s) corresponding to the given ID(s) which can be an either integer or a name. | public function getInfo($IDs){
$idArray = array();
$namesArray = array();
if(is_array($IDs)){
foreach($IDs as $identity){
if(preg_match('/^\d+$/',$identity)){ //If it's an integer (summoner ID)
array_push($idArray, $identity);
}else{
array_push($namesArray,$identity);
}
}
}else{
if(preg_match('/^\d+$/',$IDs)){
//Singe summoner ID
array_push($idArray, $IDs);
}else{
//Singe summoner name
array_push($namesArray,$IDs);
}
}
if(count($idArray)>0){
$idArray = $this->getInfoByIDs($idArray);
}
if(count($namesArray)>0){
$namesArray = $this->getInfoByNames($namesArray);
}
//var_dump($namesArray);
return $namesArray;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getuserbyID( $id )\n\t{\n\t\t$users = array();\n\n\t\tif( is_array( $id ) )\n\t\t{\n\t\t\t$result = $this->db->query( \" SELECT userid, username, first_name, last_name FROM \" . $this->db_prefix . \"_users WHERE userid IN(\" . implode( \",\", $id ) . \")\" );\n\n\t\t\twhile( $row = $result->fetch() )\n\t\t\t{\n\t\t\t\t$row['full_name'] = nv_show_name_user( $row['first_name'], $row['last_name'], $row['username']);\n\t\t\t\t$users[$row['userid']] = $row;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $this->db->query( \" SELECT userid, username, full_name FROM \" . $this->db_prefix . \"_users WHERE userid=\" . $id );\n\t\t\t$users = $result->fetch();\n\t\t\t$users['full_name'] = $users['full_name'] == '' ? $users['username'] : $users['full_name'];\n\t\t}\n\n\t\treturn $users;\n\t}",
"public function getUserFromId(int $id) {\n \n // Call getUserById method in userDataService and set to variable\n $user = $this->getUserById($id);\n \n // Return the user information array\n return $user;\n }",
"function get_users_info_by_id($users_id) {\n return $this->read_data_by_id($users_id);\n }",
"public function getUser($id);",
"protected function GetUserDetails($id)\r\n {\r\n $sql = \"SELECT * FROM users WHERE id = $id\";\r\n $result = $this->connect()->query($sql);\r\n $rows = $result->num_rows;\r\n\r\n if ($rows > 0) {\r\n $row = $result->fetch_assoc();\r\n $data[] = $row;\r\n\r\n return $data;\r\n } else {\r\n echo \"No results found!\";\r\n }\r\n }",
"public function getAllUserById($id);",
"public function getUserById($id) {\n\t\t\n\t}",
"public function getUserInfo($id)\n {\n $qry = \"SELECT users.* FROM `users` WHERE users.id = \".$id;\n// JOIN `subscription` ON users.id = subscription.user_id\n// JOIN `packages` ON subscription.p_id = packages.id\n\n\n $dbcon = new DatabaseClass();\n $result = mysqli_query($dbcon->conn, $qry);\n if (mysqli_num_rows($result) > 0) {\n return mysqli_fetch_assoc($result);\n }\n }",
"function getUserInfoById($id) {\n\t$result = mysql_query(\"SELECT * FROM users where userId = $id\");\n\t$row = mysql_fetch_array($result, MYSQL_ASSOC);\n\n\tmysql_free_result($result);\n\treturn $row;\n}",
"public function getUserInfo($id)\n {\n return $this->_dbTable->getUserInfo($id);\n }",
"public function users_get($id = \"0\")\n {\n $sutil = new CILServiceUtil();\n $from = 0;\n $size = 10;\n \n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp))\n {\n $from = intval($temp);\n }\n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp))\n {\n $size = intval($temp);\n }\n $search = $this->input->get('search', TRUE);\n if(is_null($search))\n $result = $sutil->getUser($id,$from,$size);\n else \n {\n $result = $sutil->searchUsers($search,$from,$size);\n }\n $this->response($result);\n }",
"public static function GetUser($id)\n\t{\n\t\treturn userRepository::GetUsers(array($id));\n\t}",
"function getUserInfo($id, $name) {\n if (!userExists($id)) { makeNewUser($id, $name); } \n $result = queryUsersTable(\"SELECT * FROM users WHERE id = $id\");\n $data = mysql_fetch_assoc($result);\n return $data;\n}",
"public function getUserById($id){\n $sql=\"SELECT * FROM users WHERE (id = ?)\";\n $select=parent::connect_db()->prepare($sql);\n $select->bindValue(1, $id);\n $select->execute();\n if($select->rowCount() > 0):\n return $select->fetchAll(\\PDO::FETCH_ASSOC);\n //return $results;\n else:\n return [];\n endif;\n }",
"public function details($id)\n {\n $details_sql = \"SELECT * FROM dbUsers WHERE id = $id\";\n $result = mysqli_query($this->db, $details_sql);\n $user_data = mysqli_fetch_array($result);\n return $user_data;\n }",
"public function getById($id)\n {\n return $this->user->find($id)->toArray();\n }",
"function get_user_name_by_id($id = 0) {\r\n\r\n\t\t$field = 'name';\r\n\r\n\t\t$users = $this->users_model->get_users_by_id($id, $field);\r\n\r\n\t\t$result = $users['name'];\r\n\r\n\t\treturn $result;\r\n\r\n\t}",
"public function getUser($id = null);",
"function get_user_by_id($id) {\r\n\t\t$query = $this->db->query('SELECT user_fname, user_lname, user_email\r\n\t\t\t\t\t\t\t\t\tFROM user\r\n\t\t\t\t\t\t\t\t\tWHERE user_id = '.$id.'');\r\n\t\treturn $query->result();\r\n\t}",
"public function getUserById($id){\n try{\n $query = \"SELECT fname, lname, fullname, email, role_id FROM users WHERE ID = ?\"; //Select users.fname, users.lname, roles.title, roles.id, users.email, users.created_at, users.status From roles Join users On roles.id = users.role_id Where users.id = ? Limit 1\n $stmt = $this->getConnection($query);\n $stmt -> bind_param('i', $id);\n $stmt -> execute();\n $stmt -> bind_result($fname, $sname, $fullname, $email, $role);\n $stmt->fetch();\n $user[] = array(\n 'fname' => $fname,\n 'sname' => $sname,\n 'fullname' => $fullname,\n 'email' => $email,\n 'role' => $role\n );\n $stmt -> close();\n\n return $user;\n }catch (Exception $e){\n die('Error - cannot get user by id: ' . $e -> getMessage());\n }\n }",
"public static function getUserInfos($id = null)\n\t{\n\t\tif ($id != null)\n\t\t{\n\t\t\t// Retrieve specific user informations\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$user = DB::table('assigned_roles')\n\t\t\t\t\t->join('users', 'users.id', '=', 'assigned_roles.user_id')\n\t\t\t\t\t->join('roles', 'roles.id', '=', 'assigned_roles.role_id')\n \t\t\t\t\t->select(\n\t\t\t\t\t\t'users.id AS id',\n\t\t\t\t\t\t'users.username AS username',\n\t\t\t\t\t\t'users.email AS email',\n\t\t\t\t\t\t'users.first_name AS first_name',\n\t\t\t\t\t\t'users.last_name AS last_name',\n\t\t\t\t\t\t'users.address AS address',\n\t\t\t\t\t\t'users.city AS city',\n\t\t\t\t\t\t'users.phone AS phone',\n\t\t\t\t\t\t'users.region AS region', \n\t\t\t\t\t\t'users.image AS image',\n\t\t\t\t\t\t'users.remember_token AS remember_token',\n\t\t\t\t\t\t'users.verify_code AS verify_code',\n\t\t\t\t\t\t'users.company_name AS company_name',\n\t\t\t\t\t\t'users.client_type AS client_type',\n\t\t\t\t\t\t'users.oib AS oib',\n\t\t\t\t\t\t'users.mjesto AS mjesto',\n\t\t\t\t\t\t'users.zip AS zip',\n\t\t\t\t\t\t'users.country AS country',\n\t\t\t\t\t\t'users.phone AS phone',\n\t\t\t\t\t\t'users.fax AS fax',\n\t\t\t\t\t\t'users.mobile AS mobile',\n\t\t\t\t\t\t'users.web AS web',\n\t\t\t\t\t\t'users.iban AS iban',\n\t\t\t\t\t\t'users.note AS note',\n\t\t\t\t\t\t'roles.id AS role_id',\n\t\t\t\t\t\t'roles.name AS role_name',\n\t\t\t\t\t\t'users.created_at AS created_at',\n\t\t\t\t\t\t'users.updated_at AS updated_at'\n\t\t\t\t\t\t)\n \t\t\t\t\t->orderBy('id', 'DESC')\n\t\t\t\t\t->where('users.id', '=', $id)\n\t\t\t\t\t->first();\n\n\t\t\t\treturn array('status' => 1, 'user' => $user);\n\t\t\t}\n\t\t\tcatch (Exception $exp)\n\t\t\t{\n\t\t\t\treturn array('status' => 0, 'reason' => $exp->getMessage());\n\t\t\t}\n\t\t}\n\n\t}",
"public function user_get($id=0)\n\t{\n\n\t\t\t$data=$this->um->getData('users',$id);\n\t\t\tif (!empty($data)) {\n\t\t\t\t\n\t\t\t$this->response($data,RestController::HTTP_OK);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->response(['status'=>false,'message'=>'no data found'],RestController::HTTP_NOT_FOUND);\n\t\t\t}\n\t}",
"static function GetWithId(int $id)\n\t{\n\t\t$arr = [\n\t\t\t':id' => $id\n\t\t];\n\n\t\t$sql = 'SELECT * FROM user_info WHERE rf_user_id = :id LIMIT 1';\n\n\t\treturn Db::Query($sql,$arr)->FetchObj();\n\t}",
"public function selectUserbyId($id){\r\n\r\n $query = 'SELECT * FROM user_tbl WHERE id = ?';\r\n $stmt = $this->_db->prepare($query);\r\n $stmt->execute([$id]);\r\n $users = $stmt->fetchAll(PDO::FETCH_OBJ);\r\n if ($stmt->rowCount()){\r\n return $users;\r\n }\r\n\r\n }",
"function fetch_user_info($id){\n\t\t$id = (int)$id;\n\t\t\n\t\t$sql = \"SELECT * FROM users WHERE id = {$id}\";\n\t\t$result = mysql_query($sql);\n\t\t\n\t\t$info = mysql_fetch_assoc($result);\n\t\t$info['avatar'] = (file_exists(\"{$GLOBALS['path']}/user_avatars/{$info['id']}.jpg\")) ? \"core/user_avatars/{$info['id']}.jpg\" : \"core/user_avatars/default.jpg\";\n\t\t\n\t\treturn $info;\n\t}",
"public function getById($id) {\n\n $sql = \"SELECT * FROM user WHERE id = {$id}\";\n\n return $this->query($sql);\n }",
"public function user_get_info($id)\n\t{\n\t\t$sql = \"SELECT * FROM \".$this->table.\" WHERE id = ? LIMIT 1\";\n\t\t$data = array($id);\n\t\t$query = $this->db->query($sql, $data);\n\t\tif( $query->row() )\n\t\t\treturn $query->row();\n\t\telse\n\t\t\treturn 0;\n\t}",
"public static function getUserInfo(int $id)\n {\n $userProfil = User::where('id', $id)->first();\n return $userProfil;\n }",
"public function nameUser($id){\r\n\t\t$stmt = $this->db->prepare(\"SELECT * FROM users WHERE id=?\");\r\n\t\t$stmt->execute(array($id));\r\n\t\t$names = $stmt->fetchALL(PDO::FETCH_ASSOC);\r\n\r\n\t\t$users = array();\r\n\t\tforeach($names as $name){\r\n\t\t\tarray_push($users, new User($name[\"id\"],$name[\"username\"]));\r\n\t\t}\r\n\t\treturn $users;\r\n\t}",
"public function getUserIdWithUsername($id);",
"public function getUserByID($id)\n {\n return $this->db->get_where('inm_user', array('id' => $id));\n }",
"function get_user($id)\n {\n return $this->db->get_where('users',array('id'=>$id))->row_array();\n }",
"function get_user($id)\n {\n return $this->db->get_where('users',array('id'=>$id))->row_array();\n }",
"function get_user($id)\n {\n return $this->db->get_where('users',array('id'=>$id))->row_array();\n }",
"public function getUserById(int $id) :array{\n\t\treturn $this->db->select(\"SELECT * FROM users WHERE id = :id\", [\"id\" => \"$id\"]);\n\t}",
"static public function getDetails($id) {\n $db = Database::connect();\n\n $sql = $db->query(\"SELECT * FROM \". self::DB_USER. \" WHERE md5(id) = '$id'\");\n\n return $sql->fetch_object();\n }",
"public function getUser(?string $id): Users\n {\n foreach ($this->users as $user) {\n if ($user->id == $id) {\n sendlog(\"User \". $user->id, \"common.log\");\n return $user;\n }\n }\n return $this->users[0];\n }",
"public static function getUserById($id)\r\n {\r\n // Connect to DB\r\n $db = Db::getConnection();\r\n\r\n // Test \r\n $sql = 'SELECT * FROM user WHERE id = :id';\r\n\r\n // Receiving and returning results. A prepared query is used\r\n $result = $db->prepare($sql);\r\n $result->bindParam(':id', $id, PDO::PARAM_INT);\r\n\r\n // We indicate that we want to get data in the form of an array\r\n $result->setFetchMode(PDO::FETCH_ASSOC);\r\n $result->execute();\r\n\r\n return $result->fetch();\r\n }",
"public static function getInfo($id) {\n try {\n $info = DB::select(\"SELECT * FROM lss_users WHERE id=:id\", [ \"id\" => $id ]);\n \n if (count($info) < 1) return (object)[ \"success\" => false, \"message\" => \"Wprowadzony identyfikator konta jest błędny\" ];\n elseif (count($info) > 1) return (object)[ \"success\" => false, \"message\" => \"Znaleziono więcej niż jedno konto o podanym identyfikatorze\" ]; // Nie powinno się zdarzyć\n else return (object)[ \"success\" => true, \"data\" => $info[0] ];\n } catch (Exception $e) {\n return (object)[ \"success\" => false, \"message\" => \"Wystąpił nieoczekiwany błąd, podczas pobierania danych\" ];\n }\n }",
"public function getUserByID($id)\n {\n return $this->db->get_where('temp_user', array('id' => $id));\n }",
"public function getUserData($id){\n\n \t\t\n \t\t$q = \"SELECT * FROM user_table WHERE id='$id' \";\n\n \t\t$result = $this->connection->query($q);\n\n \t\tif($result->num_rows > 0){\n\n \t\t\t$row = mysqli_fetch_assoc($result);\n\n \t\t}\n\n \t\treturn $row;\n\n \t}",
"public function getUserDataById($id){\r\n $sql = \"SELECT * FROM tbl_user WHERE id=:id\";\r\n $stmt = Database::prepare($sql);\r\n $stmt->bindParam(':id', $id);\r\n $stmt->execute();\r\n $result = $stmt->fetch(PDO::FETCH_OBJ);\r\n return $result;\r\n }",
"abstract public function fetchUserById($id);",
"function user($id){\n\n $sql = \"SELECT * FROM users WHERE id=$id\";\n return fetch($sql);\n }",
"public function userbyid($id)\n {\n $sql=\"SELECT * FROM users where id='$id'\";\n\t $result = $this->db->query($sql);\n\t return $result->row();\n \n }",
"public function getInfo($id){\n $query = $this->pdo->prepare('SELECT * FROM usuarios WHERE usuario_id=?');\n $query->execute([$id]);\n return $query->fetchall(PDO::FETCH_ASSOC)[0];\n }",
"public function getuser($id)\n {\n return $this->db->get_where(\"master_user\", array(\"employee_id\" => $id))->row_array();\n }",
"public function show($id)\n {\n return response()->responseUtil(User::where('id', $id)->with('authorities.types')->first(['id', 'name', 'realName', 'openId', 'nickName', 'avatarUrl', 'cellphone', 'officephone', 'regTime', 'email']));\n }",
"public function users_get()\n\t{\n\t\t$users = [\n\t\t\t['id' => 0, 'name' => 'John', 'email' => '[email protected]'],\n\t\t\t['id' => 1, 'name' => 'Jim', 'email' => '[email protected]'],\n\t\t];\n\n\t\t$id = $this->get('id');\n\n\t\tif ($id === null) {\n\t\t\t// Check if the users data store contains users\n\t\t\tif ($users) {\n\t\t\t\t// Set the response and exit\n\t\t\t\t$this->response($users, 200);\n\t\t\t} else {\n\t\t\t\t// Set the response and exit\n\t\t\t\t$this->response([\n\t\t\t\t\t'status' => false,\n\t\t\t\t\t'message' => 'No users were found'\n\t\t\t\t], 404);\n\t\t\t}\n\t\t} else {\n\t\t\tif (array_key_exists($id, $users)) {\n\t\t\t\t$this->response($users[$id], 200);\n\t\t\t} else {\n\t\t\t\t$this->response([\n\t\t\t\t\t'status' => false,\n\t\t\t\t\t'message' => 'No such user found'\n\t\t\t\t], 404);\n\t\t\t}\n\t\t}\n\t}",
"public function get_user($id)\n\t{\n\t\tif($id>0)\n\t\t{\t\n\t\t\t$sql=\"SELECT * FROM waf_users WHERE id=\".$this->db->Q($id);\n\t\t\t$result=$this->db->ROW_Q($sql);\n\t\t}else{\n\t\t\t$result=Array('id'=>0,'email'=>'','editor'=>0,'status'=>1);\n\t\t}\n\t\treturn $result;\n\t}",
"public function getUserById($id){\n $query = $this->db->get_where('user', array('k_id_user' => $id));\n return $query->row();\n }",
"public function getUserById($id)\n {\n $connection = Db::getConnection();\n\n $userData = $connection->fetchAssoc(\n \"SELECT id, email, create_date\n FROM {$this->tableName}\n WHERE id = ?\", \n [$id]\n );\n\n return $this->initializeObject($userData);\n }",
"public function findById($id){\n $user = $this->DB->query(\"SELECT u.* FROM user u WHERE u.id = $id\")->fetch(PDO::FETCH_ASSOC);\n return $user;\n }",
"public function getUser($id)\n {\n $pack = pack(\"N*\", -1, $id, 1, 1);\n $data = $this->gamed->cuint($this->data['code']['getUser']).$this->gamed->cuint(strlen($pack)).$pack;\n $send = $this->gamed->SendToGamedBD($data);\n $strlarge = unpack(\"H\", substr($send, 2, 1 ));\n if(substr($strlarge[1], 0, 1) == 8)\n {\n $tmp =\t12;\n }\n else\n {\n $tmp = 11;\n }\n $send = substr($send, $tmp);\n $user = $this->gamed->unmarshal($send, $this->data['user']['info']);\n $user['login_ip'] = $this->gamed->getIp($this->gamed->reverseOctet(substr($user['login_record'], 8, 8)));\n $user['login_time'] = $this->gamed->getTime(substr($user['login_record'], 0, 8));\n\n return $user;\n }",
"public function get_user_info($key, $id) {\r\n $connection = DB::connect();\r\n $stmt = \"SELECT $key FROM users WHERE `id` = '$id'\";\r\n $result = $connection->query($stmt);\r\n\r\n return $result->fetch_assoc()[$key];\r\n }",
"public function user_by_id($id) {\n $this->db->where('id_user', $id);\n $consulta = $this->db->get('user');\n $resultado = $consulta->row_array();\n return $resultado;\n }",
"public function list($id){\n try{\n $sql = 'select * from user where id_user = ? limit 1';\n $stm = $this->pdo->prepare($sql);\n $stm->execute([$id]);\n $result = $stm->fetch();\n\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), get_class($this).'|'.__FUNCTION__);\n $result = [];\n }\n return $result;\n }",
"public static function getUserById($id)\n\t{\n\t\t$user = self::where('ID',$id)->first();\n\t\treturn $user;\n\t}",
"function getUser($id){\n\t\t\tif($this->rest->getRequestMethod() != \"GET\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t}\n\n\t\t\t//Validate the user\n\t\t\t$validUser = $this->validateUser(\"admin\", \"basic\");\n\t\t\tif ($validUser) {\n\t\t\t\t$user_data = $this->model->getUser('*',\"_id = \".\"'\".$id.\"'\");\n\t\t\t\tif(count($user_data)>0) {\n\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t$response_array['message']='Total '.count($user_data).' record(s) found.';\n\t\t\t\t\t$response_array['total_record']= count($user_data);\n\t\t\t\t\t$response_array['data']=$user_data;\n\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t} else {\n\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t$response_array['message']='Record not found.';\n\t\t\t\t\t$response_array['data']='';\n\t\t\t\t\t$this->rest->response($response_array, 204);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\n\t\t\t}\n\n\t\t}",
"function getUserById($id) {\n\t$result = mysql_query(\"SELECT userId, email, password FROM users where userId = $id\");\n\t$row = mysql_fetch_array($result, MYSQL_ASSOC);\n\tmysql_free_result($result);\n\treturn $row;\n}",
"public function user_detail($id, $what='*'){\n\t\treturn $this->get_detail_user($id, $what);\n\t}",
"public function actionGet($id) {\n\t\treturn $this->txget ( $id, \"app\\models\\User\" );\n\t}",
"public function show($id)\n {\n //\n $users = User::find($id);\n return $users;\n }",
"function find_user_by_id($id)\r\n{\r\n global $db;\r\n\r\n $q = $db->prepare('SELECT name, pseudo, email, city, country, twitter, github, \r\nfacebook, sex, available_for_hiring, bio FROM users WHERE id=?');\r\n $q->execute([$id]);\r\n\r\n $data = $q->fetch(PDO::FETCH_OBJ);\r\n\r\n $q->closeCursor();\r\n return $data;\r\n}",
"public function getUser($id)\n {\n return $this->dbService->getById($id, $this->userClass);\n }",
"public function getUser($id){\n $user = Api::get($this->getSlug());\n \n if($user){\n return $user;\n }\n\n return 'error';\n\n }",
"public function show($id)\n {\n return user::find($id);\n }",
"function paces_get_users_all_details( $user_id ){\n return get_metadata( 'user', $user_id );\n}",
"private function get_users_by_id( $meta ) {\n\n\t\t$names = array();\n\n\t\t// display username\n\t\tif ( $ids = $this->get_ids_from_meta( $meta ) ) {\n\t\t\tforeach ( (array) $ids as $id ) {\n\t\t\t\tif ( ! is_numeric( $id ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$userdata = get_userdata( $id );\n\t\t\t\tif ( is_object( $userdata ) && ! empty( $userdata->display_name ) ) {\n\n\t\t\t\t\t// link\n\t\t\t\t\t$link = get_edit_user_link( $id );\n\n\t\t\t\t\t$names[] = $link ? \"<a href='{$link}'>{$userdata->display_name}</a>\" : $userdata->display_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn implode( '<span class=\"cpac-divider\"></span>', $names );\n\t}",
"public function show($id)\n {\n return $this->users->getById($id, true);\n }",
"public function user_get_by_id($id)\n {\n $query = \"SELECT *\n \t FROM \" . $this->db_table_prefix . \"users\n \t WHERE id = $id\";\n \n $result = $this->commonDatabaseAction($query);\n \n// if (mysql_num_rows($result) > 0)\n if ($this->rowCount > 0)\n {\n// return mysql_fetch_assoc($result);\n return $this->sqlAssoc;\n }\n else\n {\n return null;\n }\n }",
"public function getUserById($id) {\n $response = $this->client->request('GET', 'user/' . $id);\n \n return $response;\n }",
"public function getUsername($id);",
"public function getUser($id) {\n\n $database = new Database();\n\n $query = 'SELECT * FROM user WHERE id=:id';\n\n return $database->prepareQuery($query, 'id', $id, TRUE);\n }",
"public function getUserById($id)\n {\n\t $result = $this->getUserDbTable()->select()\n \t\t\t\t\t\t\t\t\t ->where('user_id = ?', (int)$id, 'INT')\n \t\t\t\t\t\t\t\t\t ->query()->fetch();\n \tif($result) return $result;\n }",
"function getUserName($id)\n{\n\t$mysqli = makeSqlConnection();\n\t$sql = \"SELECT user_name FROM users WHERE id = '$id'\";\n\t$res = $mysqli->query($sql);\n\t\n\t$rows = array();\n\t\n\twhile($r = mysqli_fetch_assoc($res))\n\t{\n\t\t$obj = (object) $r;\t\n\t\treturn $obj->user_name;\n\t}\n}",
"public function findUserById($id)\n {\n $sql = \"SELECT rowid, * FROM USER WHERE rowid=?\";\n $row = $this->getDb()->fetchAssoc($sql, array($id));\n if ($row){\n return $this->buildDomainObject($row);\n }else{\n throw new UsernameNotFoundException('User not found.');\n }\n }",
"private function get_userInfo() {\n $params = [ 'user_ids' => $this->user_id ];\n $result = $this->api->users->get($params);\n $params['fields'] = '';\n $result2 = $this->api2->users->get($params);\n $result['hidden'] = (int)array_has($result2, 'hidden');\n return $result;\n }",
"public static function get_user($user_id);",
"public function get($id = null)\n {\n return $id === null ? $this['user'] : $this->getUserRepository()->find($id);\n }",
"public function getUserDetails() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n $username = $this->request->input(\"username\");\n if ($username) {\n $where[] = [\"username\", \"=\", $username];\n }\n\n $userIdEqual = $this->request->input(\"user_id_equal\");\n if ($userIdEqual) {\n $where[] = [\"user_id\", \"=\", $userIdEqual];\n }\n\n $userIdNotEqual = $this->request->input(\"user_id_not_equal\");\n if ($userIdNotEqual) {\n $where[] = [\"user_id\", \"!=\", $userIdNotEqual];\n }\n\n\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getData();\n\n return $users;\n }",
"function getUserName($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from users where userid='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['username'].\" \".$rs['usertype'];\n\t}\n\t$crud->disconnect();\n}",
"public function show($id)\n\t{\n\t\t$user = User::find($id);\n\n\t\treturn ['user'=>$user];\n\t}",
"public function user($id)\n {\n return $this->where('user_id', $id);\n }",
"public function getUserDetail(string $id): array\n {\n //Define output\n $outputs = [\n 'success' => true,\n 'message' => '',\n ];\n\n try {\n //create filter\n $user = $this->getDataById($id);\n\n if (empty($user)){\n $outputs['success'] = false;\n $outputs['message'] = 'dataNotFound';\n return $outputs;\n }\n\n $outputs['data'] = $user;\n\n } catch (\\Exception $e) {\n $outputs['success'] = false;\n $outputs['message'] = 'missionFail';\n }\n \n\n return $outputs;\n }",
"public function sGetUserNameById($id)\n {\n return $this->db->fetchRow('SELECT firstname, lastname FROM s_user WHERE id = ?', [$id]) ?: [];\n }",
"public function user_get()\n\t{\n\t\t$id = $this->get('id');\n\t\tif ($id == null) {\n\t\t\t$data = $this->User->showUser();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data = $this->User->showUser($id);\n\t\t}\n\n\t\tif ($data) {\n\t\t\t$this->response($data,200);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response([\n\t\t\t\t'error'=>true,\n\t\t\t\t'message'=>'Id tidak ada'\n\t\t\t],200);\n\t\t}\n\n\t}",
"public function show($id)\n\t{\n\t\treturn User::find($id);\n\t}",
"function plexIDToUsername($id, $data) {\n\t foreach ($data->User as $usr){\n\t\tif ($usr->attributes()['id'] == $id) {\n\t\t\treturn $usr->attributes()['username'];\n\t\t\tbreak;\n\t\t}\n\t }\n }",
"public function getUser($id) {\n $sql = \"select * from infos_contributeur where id_user = $id\";\n $result = $this->db->fetchAll($sql);\n\n return $result;\n }",
"public function getUserInfo($id) {\n $id = $this->escapeStr($id);\n\n if ($result = $this->query('SELECT * FROM users WHERE id = ' . $id)) {\n if ($result->num_rows == 1) {\n $row = $result->fetch_assoc();\n return new UserInfo($row['name'], $row['email'], $row['md5'], $row['money'], $row['is_manager'] ? true : false);\n } else {\n return false;\n }\n } else {\n return false;\n }\n }",
"function getUserBasicInfo($id = null) {\n\t\tif( empty($id) || is_null($id) ){\n\t\t\treturn false;\n\t\t}\n\t\tApp::import('Model','User');\n\t\t$this->User = & new User();\n\t\t$userArr = $this->User->find('first',array('conditions'=>array(\"User .id\"=>$id),'fields' =>array( 'User.firstname','User.lastname','User.email')));\n\t\treturn $userArr;\n\t}",
"public function find_user_with_id($id)\n {\n $result = array(\n \"status\" => \"\",\n \"body\" => array(\n \"user\" => array()\n ),\n \"error\" => array(\n \"query_error\" => \"\"\n )\n );\n $stmt = $this->db->prepare(\"SELECT * FROM users WHERE id LIKE ?\");\n if (!($stmt))\n {\n trigger_error(\"Prepare failed: (\" . $this->db->errno . \") \" . $this->db->error,\n E_USER_ERROR);\n }\n if (!$stmt->bind_param('i', $id)){\n trigger_error(\"Binding parameters failed: (\" . $stmt->errno . \") \" . $stmt->error,\n E_ERROR);\n }\n if (!$stmt->execute()) {\n trigger_error(\"Execute failed: (\" . $stmt->errno . \") \" . $stmt->error,\n E_CORE_ERROR);\n $result[\"error\"] = $stmt->error;\n }\n $res = $stmt->get_result();\n $row = $res->fetch_assoc();\n if ($row[\"id\"] != null){\n $result[\"status\"] = \"Query successful\";\n $result[\"body\"] = array(\n \"user\" => array(\n \"id\" => $row[\"id\"],\n \"url\" => $row[\"url\"],\n \"username\" => $row[\"username\"],\n \"email\" => $row[\"email\"],\n \"first_name\" => $row[\"firstName\"],\n \"last_name\" => $row[\"lastName\"],\n \"full_name\" => $row[\"fullName\"],\n \"bio\" => $row[\"bio\"],\n \"is_admin\" => $row[\"isAdmin\"],\n \"password\" => $row[\"password\"],\n \"created\" => $row[\"created\"],\n \"last_updated\" => $row[\"lastUpdated\"]\n )\n );\n return $result;\n } else {\n $result['status'] = \"No user with that id exists\";\n $result[\"error\"]['query_error'] = \"invalid id in query passed.\";\n }\n return $result;\n }",
"public static function getUserById($id)\n {\n\n if ($id) {\n\n $db = Db::getConnection();\n $sql = \"SELECT * FROM user WHERE id = :id\";\n\n $result = $db->prepare($sql);\n $result->bindParam(':id', $id, PDO::PARAM_INT);\n // Get assoc array mode\n $result->setFetchMode(PDO::FETCH_ASSOC);\n $result->execute();\n\n return $result->fetch();\n }\n }",
"function getUserInfo($user_id) {\n jincimport('utility.servicelocator');\n $servicelocator = ServiceLocator::getInstance();\n $logger = $servicelocator->getLogger();\n \n $query = 'SELECT id, username, name, email FROM #__users ' .\n 'WHERE id = ' . (int) $user_id;\n $dbo =& JFactory::getDBO();\n $dbo->setQuery($query);\n $logger->debug('JINCJoomlaHelper: executing query: ' . $query);\n $infos = array();\n if ($user_info = $dbo->loadObjectList()) {\n if (! empty ($user_info)) {\n $user = $user_info[0]; \n $infos['user_id'] = $user->id;\n $infos['username'] = $user->username;\n $infos['name'] = $user->name;\n $infos['email'] = $user->email;\n }\n return $infos;\n }\n return $infos;\n }",
"public function show($id)\n {\n return User::find($id);\n }",
"public function show($id)\n {\n return User::find($id);\n }",
"public function show($id)\n {\n return User::find($id);\n }",
"public function show($id)\n {\n return User::find($id);\n }",
"public function show($id)\n {\n return User::find($id);\n }",
"public function show($id)\n {\n return User::find($id);\n }"
] | [
"0.76047117",
"0.75758195",
"0.7548854",
"0.7490298",
"0.7480704",
"0.74390286",
"0.73446137",
"0.733832",
"0.73349774",
"0.73293066",
"0.7328",
"0.7324234",
"0.73090434",
"0.72205716",
"0.71900403",
"0.7179397",
"0.71608984",
"0.7152718",
"0.71509457",
"0.71468246",
"0.7131922",
"0.7096031",
"0.70862865",
"0.7085601",
"0.708449",
"0.7081528",
"0.70771265",
"0.7059143",
"0.7054279",
"0.70400304",
"0.70327604",
"0.70120126",
"0.70120126",
"0.70120126",
"0.7011683",
"0.6989862",
"0.69794136",
"0.6958144",
"0.69578713",
"0.6933875",
"0.69338286",
"0.6932741",
"0.6920143",
"0.6918372",
"0.69163924",
"0.6915481",
"0.69132346",
"0.69101936",
"0.690721",
"0.68968517",
"0.6894289",
"0.6890376",
"0.6889275",
"0.6884915",
"0.68824613",
"0.68746465",
"0.6874172",
"0.6872684",
"0.68710077",
"0.68623686",
"0.68583816",
"0.68543226",
"0.6853037",
"0.6850453",
"0.68492013",
"0.68433553",
"0.6836495",
"0.68317527",
"0.68260384",
"0.682491",
"0.6824677",
"0.68159336",
"0.68141997",
"0.6807949",
"0.68072766",
"0.68060946",
"0.6802721",
"0.67932063",
"0.67931545",
"0.6792147",
"0.67919886",
"0.67845976",
"0.6784562",
"0.67747796",
"0.67693156",
"0.67563903",
"0.6755635",
"0.67508334",
"0.6748625",
"0.6744426",
"0.6741154",
"0.6733007",
"0.6727205",
"0.67193997",
"0.67144185",
"0.6713529",
"0.6713529",
"0.6713529",
"0.6713529",
"0.6713529",
"0.6713529"
] | 0.0 | -1 |
Select Random Question for create random quizz | public function randomQuestion() {
return
$this->createQueryBuilder('qb')
->orderBy('RAND()')
->setMaxResults($this->maxResult)
->getQuery()
->getResult()
;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function generateQuestion()\n\t{\n\t\t//get random question type\n\t\t$type = $this->questionTypes[array_rand($this->questionTypes)];\n\n\t\t//get random section\n\t\t$section = $this->getRandomSection();\n\n\t\t//get random function (within the above section)\n\t\t$function = $this->getRandomFunction($section);\n\n\t\t$question = [];\n\t\t$question['type'] = $type;\n\t\t$question['section'] = $section;\n\t\t$question['function'] = $function;\n\t\t$question['text'] = \"{$section} now, {$this->questionTextPerType[$type]}\";\n\t\t$question['choices'] = [];\n\t\t$question['answer_text'] = '';\n\t\t$question['answer_index'] = '';\t//in ['choices'] array\n\n\n\t\treturn $this->fillQuestion($question);\n\t}",
"function get_question_random_simple() {\n global $default_terms_array;\n $session = new Session();\n $questions = get_questions($default_terms_array);\n\n for ($i = 0; $i < sizeof($questions); $i++) {\n\n $question = $questions[array_rand($questions) ];\n\n // if the question hasn't already been asked recently OR we're not remembering things in the session, return it\n if ((!$session->get('random_questions_asked') || ($session->get('random_questions_asked') && !in_array($question->get_ID(), $session->get('random_questions_asked'))))) {\n return $question;\n }\n }\n\n return $questions[array_rand($questions) ];\n}",
"public function test_quizp_with_random_question_attempt_walkthrough() {\n global $SITE;\n\n $this->resetAfterTest(true);\n question_bank::get_qtype('random')->clear_caches_before_testing();\n\n $this->setAdminUser();\n\n // Make a quizp.\n $quizpgenerator = $this->getDataGenerator()->get_plugin_generator('mod_quizp');\n\n $quizp = $quizpgenerator->create_instance(array('course' => $SITE->id, 'questionsperpage' => 2, 'grade' => 100.0,\n 'sumgrades' => 4));\n\n $questiongenerator = $this->getDataGenerator()->get_plugin_generator('core_question');\n\n // Add two questions to question category.\n $cat = $questiongenerator->create_question_category();\n $saq = $questiongenerator->create_question('shortanswer', null, array('category' => $cat->id));\n $numq = $questiongenerator->create_question('numerical', null, array('category' => $cat->id));\n\n // Add random question to the quizp.\n quizp_add_random_questions($quizp, 0, $cat->id, 1, false);\n\n // Make another category.\n $cat2 = $questiongenerator->create_question_category();\n $match = $questiongenerator->create_question('match', null, array('category' => $cat->id));\n\n quizp_add_quizp_question($match->id, $quizp, 0);\n\n $multichoicemulti = $questiongenerator->create_question('multichoice', 'two_of_four', array('category' => $cat->id));\n\n quizp_add_quizp_question($multichoicemulti->id, $quizp, 0);\n\n $multichoicesingle = $questiongenerator->create_question('multichoice', 'one_of_four', array('category' => $cat->id));\n\n quizp_add_quizp_question($multichoicesingle->id, $quizp, 0);\n\n foreach (array($saq->id => 'frog', $numq->id => '3.14') as $randomqidtoselect => $randqanswer) {\n // Make a new user to do the quizp each loop.\n $user1 = $this->getDataGenerator()->create_user();\n $this->setUser($user1);\n\n $quizpobj = quizp::create($quizp->id, $user1->id);\n\n // Start the attempt.\n $quba = question_engine::make_questions_usage_by_activity('mod_quizp', $quizpobj->get_context());\n $quba->set_preferred_behaviour($quizpobj->get_quizp()->preferredbehaviour);\n\n $timenow = time();\n $attempt = quizp_create_attempt($quizpobj, 1, false, $timenow);\n\n quizp_start_new_attempt($quizpobj, $quba, $attempt, 1, $timenow, array(1 => $randomqidtoselect));\n $this->assertEquals('1,2,0,3,4,0', $attempt->layout);\n\n quizp_attempt_save_started($quizpobj, $quba, $attempt);\n\n // Process some responses from the student.\n $attemptobj = quizp_attempt::create($attempt->id);\n $this->assertFalse($attemptobj->has_response_to_at_least_one_graded_question());\n\n $tosubmit = array();\n $selectedquestionid = $quba->get_question_attempt(1)->get_question()->id;\n $tosubmit[1] = array('answer' => $randqanswer);\n $tosubmit[2] = array(\n 'frog' => 'amphibian',\n 'cat' => 'mammal',\n 'newt' => 'amphibian');\n $tosubmit[3] = array('One' => '1', 'Two' => '0', 'Three' => '1', 'Four' => '0'); // First and third choice.\n $tosubmit[4] = array('answer' => 'One'); // The first choice.\n\n $attemptobj->process_submitted_actions($timenow, false, $tosubmit);\n\n // Finish the attempt.\n $attemptobj = quizp_attempt::create($attempt->id);\n $this->assertTrue($attemptobj->has_response_to_at_least_one_graded_question());\n $attemptobj->process_finish($timenow, false);\n\n // Re-load quizp attempt data.\n $attemptobj = quizp_attempt::create($attempt->id);\n\n // Check that results are stored as expected.\n $this->assertEquals(1, $attemptobj->get_attempt_number());\n $this->assertEquals(4, $attemptobj->get_sum_marks());\n $this->assertEquals(true, $attemptobj->is_finished());\n $this->assertEquals($timenow, $attemptobj->get_submitted_date());\n $this->assertEquals($user1->id, $attemptobj->get_userid());\n $this->assertTrue($attemptobj->has_response_to_at_least_one_graded_question());\n\n // Check quizp grades.\n $grades = quizp_get_user_grades($quizp, $user1->id);\n $grade = array_shift($grades);\n $this->assertEquals(100.0, $grade->rawgrade);\n\n // Check grade book.\n $gradebookgrades = grade_get_grades($SITE->id, 'mod', 'quizp', $quizp->id, $user1->id);\n $gradebookitem = array_shift($gradebookgrades->items);\n $gradebookgrade = array_shift($gradebookitem->grades);\n $this->assertEquals(100, $gradebookgrade->grade);\n }\n }",
"public static function generateQuestion()\n {\n $lhOperand = rand(0,10); //randomises left hand operand\n $rhOperand = rand(0,10); //randomises right hand operand\n $operator = rand(0,2); //randomises operator\n switch($operator)\n {\n case 0: self::$answer=($lhOperand+$rhOperand);\n $question = \"$lhOperand+$rhOperand\";\n break;\n case 1: self::$answer=($lhOperand-$rhOperand);\n $question = \"$lhOperand-$rhOperand\";\n break;\n case 2: self::$answer=($lhOperand*$rhOperand);\n $question = \"$lhOperand*$rhOperand\";\n break;\n }\n //var_dump($question);\n var_dump(self::$answer);\n return $question;\n }",
"public function newMathQuestion(): void {\n\t\t$this->rndNumber1 = random_int(1, 10);\n\t\t$this->rndNumber2 = random_int(1, 10);\n\t\t$this->rndOperator = random_int(0, 2);\n\t\t$this->calcResult();\n\t}",
"public function randomQuestion(): void\n {\n $expectedQuestion = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n $randomQuestions = $this->user->randomUserQuestion();\n\n $this->assertTrue($randomQuestions->contains($expectedQuestion));\n }",
"private function generateQuestion(){\n\t\t\t$questions = array(\n\t\t\t\t\tarray('name' => 'chevrolet', 'logo' => 'chevrolet.png'),\n\t\t\t\t\tarray('name' => 'playboy', 'logo' => 'playboy.png'),\n\t\t\t\t\tarray('name' => 'shell', 'logo' => 'shell.png'),\n\t\t\t\t\tarray('name' => 'java', 'logo' => 'java.png'),\n\t\t\t\t\tarray('name' => 'mysql', 'logo' => 'mysql.png'),\n\t\t\t\t\tarray('name' => 'postgresql', 'logo' => 'postgresql.png'),\n\t\t\t\t\tarray('name' => 'chrome', 'logo' => 'chrome.png'),\n\t\t\t\t\tarray('name' => 'firefox', 'logo' => 'firefox.png'),\n\t\t\t\t\tarray('name' => 'bluetooth', 'logo' => 'bluetooth.png'),\n\t\t\t\t\tarray('name' => 'twitter', 'logo' => 'twitter.png')\n\t\t\t\t);\n\t\t\t\t\n\t\t\t$index = rand(0, count($questions) - 1);\n\t\t\t\n\t\t\t$this->session->set('gl_answer', $questions[$index]['name']);\n\t\t\t\n\t\t\treturn array(\n\t\t\t\t\t\t\t'type' => 'image',\n\t\t\t\t\t\t\t'originalContentUrl' => $this->image_url . $questions[$index]['logo'],\n\t\t\t\t\t\t\t'previewImageUrl' => $this->image_url . $questions[$index]['logo']\n\t\t\t\t\t\t);\n\t\t}",
"public static function random_victory_quote(){\n $temp_text_options = array('Awesome work!', 'Nice work!', 'Fantastic work!', 'Great work!', 'Super work!', 'Amazing work!', 'Fabulous work!');\n $temp_text = $temp_text_options[array_rand($temp_text_options)];\n return $temp_text;\n }",
"private function generateNextQuestion(){\n while(true) {\n $id = rand($this->minId, /*$this->maxId*/20);\n\n if (!in_array($id, $this->answeredQuestions)) {\n array_push($this->answeredQuestions,$id);\n return $id;\n }\n }\n }",
"private function generate_question() {\n\n require_once(__DIR__ . '/csv_gd.class.php');\n $csv_filename = $this->configuration['base_data_dir'] . '/csv/' . $this->configuration['csv_input'];\n\n $data_quiz_src_obj = new csv_gd($csv_filename);\n $data_quiz_src_orig = $data_quiz_src_obj->csv_to_array();\n\n\n\n // filter unwanted question (tags, diff level, void )\n $data_quiz_src_filtered = $this->quiz_filter($data_quiz_src_orig, $this->configuration['tags'], $this->configuration['min_diffucult_level'], $this->configuration['max_diffucult_level']);\n\n\n // reverse question with_answer\n if ($this->configuration['reverse_question'] == TRUE) {\n $data_quiz_src_filtered = $this->quiz_switch_question_with_answer($data_quiz_src_filtered);\n }\n\n\n // generate question and answer\n $data_quiz_src = $this->quiz_generate($data_quiz_src_filtered);\n\n\n // randomize quiz \n if ($this->configuration['randomize_question'] == TRUE) {\n shuffle($data_quiz_src);\n }\n\n\n // restrict the maxium number of question\n if ($this->configuration['max_question_total'] > 0) {\n $this->configuration['max_question_total'] = min(count($data_quiz_src), $this->configuration['max_question_total']);\n } else {\n $this->configuration['max_question_total'] = count($data_quiz_src);\n }\n $this->question = array_slice($data_quiz_src, 0, $this->configuration['max_question_total']);\n\n $this->configuration['debug']=$this->debug;\n\n // return $this->quiz_questions;\n }",
"public function getRandomQuiz(){\n // dd('here');\n $quiz = Quiz::inRandomOrder()->first();\n return $quiz;\n }",
"function generateQuestion(){\n $rangeLow = 1;\n $rangeHigh = 100;\n $incorrectNumberHigh = 10;\n\n $leftAdder = random_int($rangeLow, $rangeHigh);\n $rightAdder = random_int($rangeLow, $rangeHigh);\n $correctAnswer = $leftAdder + $rightAdder;\n //generate init values for envaluation\n $incorrectAnswerFirst = random_int($correctAnswer-$incorrectNumberHigh, $correctAnswer+$incorrectNumberHigh);\n $incorrectAnswerSecond = random_int($correctAnswer-$incorrectNumberHigh , $correctAnswer+$incorrectNumberHigh);\n\n //if the condition not met, keep generated\n while(\n ($incorrectAnswerFirst == $correctAnswer) \n || \n ($incorrectAnswerFirst == $incorrectAnswerSecond)\n ||\n ($incorrectAnswerSecond == $correctAnswer)\n ){\n $incorrectAnswerFirst = random_int($correctAnswer-$incorrectNumberHigh, $correctAnswer+$incorrectNumberHigh);\n $incorrectAnswerSecond = random_int($correctAnswer-$incorrectNumberHigh , $correctAnswer+$incorrectNumberHigh);\n }\n $questions =\n [\n \"leftAdder\" => $leftAdder,\n \"rightAdder\" => $rightAdder,\n \"correctAnswer\" => $correctAnswer,\n \"firstIncorrectAnswer\" => $incorrectAnswerFirst,\n \"secondIncorrectAnswer\" => $incorrectAnswerSecond\n ];\n\n\n return $questions;\n}",
"public function random(Request $request)\n {\n // return response($request->all());\n $topic = Topic::whereId($request->topic)->withCount('questions')->first();\n $q = $topic->questions()->inRandomOrder()->where('difficulty', $request->difficulty)->limit(10)->get();\n\n $quiz = Quiz::create([\n 'name' => 'Random '. $topic->name,\n 'time_limit' => null,\n 'desc' =>\n '<ul class=\"list-disc list-inside\">\n <li>\n You should complete this quiz in one session — However you can leaveand start from where you left.\n </li>\n <li>\n This is a random quiz generated with AI.\n </li>\n <li>\n You can find your progress and results in \"My Quizes\" section. \n </li>\n </ul>',\n 'user_id' => Auth::user()->id,\n 'quiz_type' => 'Random',\n 'difficulty' => $request->difficulty\n ]);\n $quiz->questions()->sync($q);\n $quiz->users()->attach(Auth::user()->id);\n return redirect('/quiz/'.$quiz->id);\n }",
"public function randomQuestionWithSelfsameBag(): void\n {\n $unexpectedQuestion1 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n $unexpectedQuestion2 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n\n $questionsList = $this->user->randomUserQuestion('soft', [$unexpectedQuestion1->id, $unexpectedQuestion2->id]);\n\n $this->assertFalse($questionsList->contains($questionsList));\n $this->assertEmpty($questionsList);\n }",
"function set_up_question($question_ID)\r\n{\r\n\tglobal $mydb, $question, $answers, $correct_answer, $is_question, $is_random_question;\r\n\t\r\n\t// set the is question global variable\r\n\t$is_question = true;\r\n\r\n\tif (($question_ID == \"random\") || !$question_ID)\r\n\t{\r\n\t\t$is_random_question = true;\r\n\t\t$question = get_question_random();\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$is_random_question = false;\r\n\t\t$question = get_question_from_ID($question_ID);\r\n\r\n\t}\r\n\t\r\n\t// get random answers\r\n\t$answers = $question->get_Answers();\r\n\t\r\n\t// get the correct answer and remember it\r\n\tforeach ($answers as $answer)\r\n\t{\r\n\t\tif ($answer->is_correct())\r\n\t\t{\r\n\t\t\t$correct_answer = $answer;\r\n\t\t}\r\n\t}\r\n}",
"public function generateChoices(array $question)\n\t{\n\t\t[$inputMode, $inputExpectation, $notUseful, $from] = explode('_', $question['type']);\n\n\t\tif($this->config['cross_sections_for_possible_answers'])\n\t\t{\n\t\t\t//TODO\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\t//leave space for the correct answer to be slotted in!\n\t\t\t//(not done in this method BTW)\n\t\t\t//UPDATE: actually, no, we'll just clobber one to put the correct answer in\n\t\t\t//$count = $this->config['choices_per_question'] - 1;\n\t\t\t$count = $this->config['choices_per_question'];\n\n\t\t\t$randomKeys = array_rand($this->functionData[$question['section']], $count);\n\n\t\t\t$choices = [];\n\n\t\t\tforeach($randomKeys as $key)\n\t\t\t{\n\t\t\t\t$choices[] = $this->functionData[$question['section']][$key][$inputExpectation];\n\t\t\t}\n\n\t\t\treturn $choices;\n\n\t\t}\n\t}",
"public function showQuestion(){\n $query = \"SELECT * FROM posts ORDER BY rand() limit 12\";\n if ($result = $this->dbobj->dbcon->query($query)) {\n $row = $result->fetch_all(MYSQLI_ASSOC);\n \n }\n else{\n echo \"Error\" .$this->dbobj->dbcon->error;\n }\n return $row;\n }",
"function getGeneratedQuestions() {\n $generatedQuestions = [];\n\n // for the generated questions, let's make the total 12\n for ($i = 0; $i < 12; $i++) {\n\n // create the queston attributes\n $leftAdder = mt_rand(0 , 100);\n\n $rightAdder;\n do {\n $rightAdder = mt_rand(0 , 100);\n } while ($rightAdder === $leftAdder);\n\n $correctAnswer = $leftAdder + $rightAdder;\n\n $firstIncorrectAnswer;\n do {\n $firstIncorrectAnswer = mt_rand($correctAnswer - 10, $correctAnswer + 10);\n } while ($firstIncorrectAnswer === $correctAnswer);\n\n $secondIncorrectAnswer;\n do {\n $secondIncorrectAnswer = mt_rand($correctAnswer - 10, $correctAnswer + 10);\n } while (\n $secondIncorrectAnswer === $correctAnswer || \n $secondIncorrectAnswer === $firstIncorrectAnswer\n );\n\n // cast to object to mimic json file\n $generatedQuestions[] = (object)[\n \"leftAdder\" => $leftAdder,\n \"rightAdder\" => $rightAdder,\n \"correctAnswer\" => $correctAnswer,\n \"firstIncorrectAnswer\" => $firstIncorrectAnswer,\n \"secondIncorrectAnswer\" => $secondIncorrectAnswer \n ];\n }\n\n return $generatedQuestions;\n}",
"private function _askQuestion()\n {\n // Grab the question\n $question = str_replace(\"!question \", \"\", $this->_data->message);\n\n // Create the yql\n $yql = 'select * from answers.search where query=\"'. $question .'\" and type=\"resolved\"';\n \n $array = $this->grabData($yql);\n \n $stuff = $array['query']['results']['Question'];\n if (is_array($stuff)) {\n $answer = $stuff[array_rand($stuff)]['ChosenAnswer'];\n $link = $stuff[array_rand($stuff)]['Link'];\n }\n $this->_message($this->_data->nick.': You asked: '. $question);\n if (!$answer) {\n $this->_message($this->_data->nick.': Sorry, I cannot answer that one! Try asking a simpler question.'); \n }\n else {\n $this->_message($this->_data->nick.': Yahoo! answers says: '. $answer .' ('. $link .')');\n }\n }",
"public static function random_defeat_quote(){\n $temp_text_options = array('Maybe try again?', 'Bad luck maybe?', 'Maybe try another stage?', 'Better luck next time?', 'At least you tried... right?');\n $temp_text = $temp_text_options[array_rand($temp_text_options)];\n return $temp_text;\n }",
"function shuffleAnswers($answer1, $answer2, $answer3, $answer4)\n{\n\n\t$i = rand(0,3);\n\n\t//Puts the correct answer on a random position\n\tswitch($i)\n\t{\n\t\tcase 0:\n\t\t\t$antwort1 = $answer1;\n\t\t\t$antwort2 = $answer2;\n\t\t\t$antwort3 = $answer3;\n\t\t\t$antwort4 = $answer4;\n $position1 = 1;\n $position2 = 2;\n $position3 = 3;\n $position4 = 4;\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t$antwort1 = $answer2;\n\t\t\t$antwort2 = $answer1;\n\t\t\t$antwort3 = $answer3;\n\t\t\t$antwort4 = $answer4;\n\t\t\t$position1 = 2;\n $position2 = 1;\n $position3 = 3;\n $position4 = 4;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t$antwort1 = $answer2;\n\t\t\t$antwort2 = $answer3;\n\t\t\t$antwort3 = $answer1;\n\t\t\t$antwort4 = $answer4;\n $position1 = 2;\n $position2 = 3;\n $position3 = 1;\n $position4 = 4;\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\t$antwort1 = $answer2;\n\t\t\t$antwort2 = $answer3;\n\t\t\t$antwort3 = $answer4;\n\t\t\t$antwort4 = $answer1;\n $position1 = 2;\n $position2 = 3;\n $position3 = 4;\n $position4 = 1;\n\t\t\tbreak;\n\t}\n\n $res = [\"casename\"=>$questionData['casename'], \"antwort1\"=>$antwort1, \"antwort2\"=>$antwort2, \"antwort3\"=>$antwort3, \"antwort4\"=>$antwort4, \"positionAnswer1\"=>$position1, \"positionAnswer2\"=>$position2 , \"positionAnswer3\"=>$position3, \"positionAnswer4\"=>$position4];\n return $res;\n}",
"private static function genNRand($q) {\n\t $i=$rac='';\n\t for ($i=0; $i<$q ;$i++) {\n\t $er=rand(0,2);\n\t switch ($er) {\n\t case 0: $rac.=rand(0,9); break;\n\t case 1: $rac.=chr(rand(65,90)); break;\n\t case 2: $rac.=chr(rand(98,122)); break;\n\t }\n\t }\n\t return ($rac);\n\t}",
"public function generateWrongOptions($quiz_id,$question_id=-1){\n\n //for all questions-wrong options with limit\n// SELECT quiz_id, question_id, question, answer_id,answer FROM (SELECT quiz_question.quiz_id, quiz_question.question_id, question.question, answer_id,answer ,@rn := IF(@prev = quiz_question.question_id, @rn + 1, 1) as rn, @prev := quiz_question.question_id FROM quiz INNER JOIN quiz_question ON quiz.quiz_id = quiz_question.quiz_id AND quiz.deleted = 0 AND quiz.quiz_id = 1 INNER JOIN question ON quiz_question.question_id = question.question_id INNER JOIN (SELECT * FROM answer WHERE answer.answer_id NOT IN (SELECT answer_id FROM correct_question_answer) ORDER BY RAND()) as answers ON answers.question_id = quiz_question.question_id JOIN (SELECT @prev := NULL, @rn := 0) AS vars) as final WHERE rn <= 3\n\n\n\n //it means u have to generate wrong options for all questions with limit of NoOfWrongOptionsWithMostFrequency\n if($question_id==-1){\n $resultSet = $this->getNoOfWrongOptionsWithMostFrequency($quiz_id);\n $noOfWrongOptions = ($resultSet->fetchAll());\n//print_r($ans);\n $this->noOfWrongOption = $noOfWrongOptions[0]->no_of_wrong;\n// return Connection::connectToDB()->query(\"SELECT quiz_id, question_id, question, answer_id,answer FROM (SELECT quiz_question.quiz_id, quiz_question.question_id, question.question, answer_id,answer ,@rn := IF(@prev = quiz_question.question_id, @rn + 1, 1) as rn, @prev := quiz_question.question_id FROM quiz INNER JOIN quiz_question ON quiz.quiz_id = quiz_question.quiz_id AND quiz.deleted = 0 AND quiz.quiz_id = $quiz_id and question_id INNER JOIN question ON quiz_question.question_id = question.question_id INNER JOIN (SELECT * FROM answer WHERE answer.answer_id NOT IN (SELECT answer_id FROM correct_question_answer) ORDER BY RAND()) as answers ON answers.question_id = quiz_question.question_id JOIN (SELECT @prev := NULL, @rn := 0) AS vars) as final WHERE rn <= $this->noOfWrongOption\");\n\n return Connection::connectToDB()->query(\"SELECT quiz_id, question_id, question, answer_id,answer FROM (SELECT quiz_question.quiz_id, quiz_question.question_id, question.question, answer_id,answer ,@rn := IF(@prev = quiz_question.question_id, @rn + 1, 1) as rn, @prev := quiz_question.question_id FROM quiz INNER JOIN quiz_question ON quiz.quiz_id = quiz_question.quiz_id AND quiz.deleted = 0 AND quiz.quiz_id = $quiz_id and question_id not in (SELECT question_id FROM (SELECT a.question_id,a.no_of_options,b.no_of_correct,a.no_of_options-b.no_of_correct as no_of_wrong FROM (SELECT no_of_options,question_id FROM quiz_question WHERE quiz_id=$quiz_id GROUP by question_id) as a LEFT OUTER JOIN (SELECT COUNT(*) as no_of_correct,question_id FROM correct_question_answer GROUP by question_id) as b on a.question_id=b.question_id) as t WHERE no_of_wrong!=$this->noOfWrongOption) INNER JOIN question ON quiz_question.question_id = question.question_id INNER JOIN (SELECT * FROM answer WHERE answer.answer_id NOT IN (SELECT answer_id FROM correct_question_answer) ORDER BY RAND()) as answers ON answers.question_id = quiz_question.question_id JOIN (SELECT @prev := NULL, @rn := 0) AS vars) as final WHERE rn <=$this->noOfWrongOption\");\n }\n\n //else u have to generate wrong option for particular question\n $resultSet = $this->getNoOfWrongOptions($quiz_id,$question_id);\n $noOfWrongOptions = ($resultSet->fetchAll());\n//print_r($ans);\n $noOfWrongOption = $noOfWrongOptions[0]->noOfWrongOption;\n return Connection::connectToDB()->query(\"SELECT\n quiz_question.quiz_id,quiz_question.question_id,question,answer.answer_id,answer\nFROM\n answer\nJOIN quiz_question ON quiz_question.question_id = answer.question_id\nJOIN question ON quiz_question.question_id = question.question_id\nWHERE\n quiz_question.quiz_id =$quiz_id AND quiz_question.question_id=$question_id AND answer.answer_id NOT IN(\n SELECT\n answer_id\n FROM\n correct_question_answer\n JOIN quiz_question ON quiz_question.question_id = correct_question_answer.question_id\n WHERE\n quiz_id = $quiz_id\n GROUP BY\n quiz_question.question_id\n\n) ORDER BY RAND() LIMIT $noOfWrongOption\");\n }",
"private function generateChallenge()\n {\n //store two random numbers in an array\n $numbers = array(mt_rand(1,4),mt_rand(1,4));\n //store the correct answer in a session\n $_SESSION['challenge'] = $numbers[0] + $numbers[1];\n //convert the numbers to their ASCII\n $converted = array_map('ord', $numbers);\n //generate a math question as HTML markup\n return \"\n <label>What is \n &#$converted[0]; + &#$converted[1];?\n <input type=\\\"text\\\" name=\\\"s_q\\\" />\n </label>\";\n }",
"function getNRandomQuestions($n)\n {\n $user = get_current_user();\n $myCnf = parse_ini_file(\"/home/$user/.my.cnf\");\n\n $host = $myCnf['host'];\n $user = $myCnf['user'];\n $password = $myCnf['password'];\n $database = $myCnf['database'];\n $connection = new mysqli($host, $user, $password, $database);\n\n $statement = $connection->prepare(\"SELECT * FROM questions ORDER BY RAND() LIMIT ?\");\n $statement->bind_param(\"i\", $n);\n $statement->execute();\n $statement->bind_result($id, $question, $answer0, $answer1, $answer2, $solution);\n while ($statement->fetch()){\n $result[] = array(\"question\" => $question,\n array(\n \"answer0\" => $answer0,\n \"answer1\" => $answer1,\n \"answer2\" => $answer2),\n \"solution\" => $solution,\n );\n }\n return $result;\n}",
"public function easy()\n {\n $questions = Question::all(); // Returns all question\n $counts = count($questions);\n $id = rand(1,$counts);\n $question = $questions[$id]; // To select second question\n return view('easy', compact('question'));\n }",
"public function run()\n {\n $maxrate = 5;\n \n Question::create([\n 'name' => 'Clarity',\n 'label_left' => 'Low clear', \n 'label_right' => 'Very clear',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]);\n \n Question::create([\n 'name' => 'Effervenscence',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate,\n 'correct_answer' => rand(1,$maxrate),\n ]);\n \n Question::create([\n 'name' => 'Fluidity',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]);\n \n Question::create([\n 'name' => 'Balsamic',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]);\n \n Question::create([\n 'name' => 'Fruity',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]);\n \n Question::create([\n 'name' => 'Floral',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]);\n \n Question::create([\n 'name' => 'Woody',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]);\n \n Question::create([\n 'name' => 'Spiced',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]);\n \n Question::create([\n 'name' => 'Sugar content',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]);\n \n Question::create([\n 'name' => 'Alcohol content',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]);\n \n Question::create([\n 'name' => 'Texture',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]);\n \n Question::create([\n 'name' => 'Acidity',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]);\n \n \n Question::create([\n 'name' => 'Structure',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]);\n \n \n Question::create([\n 'name' => 'Persistance',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]);\n \n Question::create([\n 'name' => 'Development',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]);\n \n Question::create([\n 'name' => 'Yellowness',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]); \n \n Question::create([\n 'name' => 'Frankness',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]); \n \n Question::create([\n 'name' => 'Harmony',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]); \n \n Question::create([\n 'name' => 'Intensity',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]); \n \n Question::create([\n 'name' => 'Quality',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]); \n \n Question::create([\n 'name' => 'Intensity of color',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]); \n \n Question::create([\n 'name' => 'Creemy odour',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]); \n \n Question::create([\n 'name' => 'Buttery',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]); \n \n Question::create([\n 'name' => 'Salty',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]); \n \n Question::create([\n 'name' => 'Acid',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]); \n \n Question::create([\n 'name' => 'Grainy',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]); \n \n Question::create([\n 'name' => 'Hardness',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]); \n \n Question::create([\n 'name' => 'Softness',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]); \n \n Question::create([\n 'name' => 'Springiness',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]); \n \n Question::create([\n 'name' => 'Padding',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]); \n \n Question::create([\n 'name' => 'Lining',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]); \n \n Question::create([\n 'name' => 'Wear',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]); \n \n Question::create([\n 'name' => 'Melody',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]); \n \n Question::create([\n 'name' => 'Harmony',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]); \n \n Question::create([\n 'name' => 'Rhythm',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]); \n \n Question::create([\n 'name' => 'Stamp',\n 'label_left' => 'Low', \n 'label_right' => 'High',\n 'max_rate' => $maxrate, \n 'correct_answer' => rand(1,$maxrate),\n ]); \n }",
"function game_question_selectrandom( $game, $table, $select, $id_fields='id', $use_repetitions=true)\n{\n global $DB, $USER; \n\n $count = $DB->get_field_sql( \"SELECT COUNT(*) FROM $table WHERE $select\");\n $min_num = 0;\n $min_id = 0;\n for($i=1; $i <= CONST_GAME_TRIES_REPETITION; $i++){\n $sel = mt_rand(0, $count-1);\n\t \n $sql = \"SELECT $id_fields,$id_fields FROM \".$table.\" WHERE $select\";\n \tif( ($recs = $DB->get_records_sql( $sql, null, $sel, 1)) == false){\n return false;\n }\n\n $id = 0;\n foreach( $recs as $rec){\n $id = $rec->id;\n }\n if( $min_id == 0){\n $min_id = $id;\n }\n \n if( $use_repetitions == false){\n return $id;\n }\n \n if( $count == 1){\n break;\n }\n \n $questionid = $glossaryentryid = 0;\n if( $game->sourcemodule == 'glossary')\n $glossaryentryid = $id;\n else\n $questionid = $id;\n \n $a = array( 'gameid' => $game->id, 'userid' => $USER->id, 'questionid' => $questionid, 'glossaryentryid' => $glossaryentryid);\n if( ($rec = $DB->get_record( 'game_repetitions', $a, 'id,repetitions r')) != false){\n if( ($rec->r < $min_num) or ($min_num == 0)){\n $min_num = $rec->r;\n $min_id = $id;\n }\n }else\n {\n $min_id = $questionid;\n break;\n }\n \n }\n\n if( $game->sourcemodule == 'glossary')\n game_update_repetitions( $game->id, $USER->id, 0, $min_id);\n else\n game_update_repetitions( $game->id, $USER->id, $min_id, 0);\n \n return $min_id;\n}",
"public function showRandom()\n {\n $question = Question::inRandomOrder()->first();\n if ($question) {\n return $this->show($question->id);\n } else {\n return redirect(route('questions.index'));\n }\n }",
"public function randomQuestionWithUserInStormMode(): void\n {\n QuestionUserHelper::removeAllQuestionsForUser($this->user);\n QuestionHelper::newQuestion();\n\n $questionsList = User::randomQuestions('storm', [], Question_user::DEFAULT_BAG_LIMIT ,$this->user);\n\n $this->assertFalse($this->user->questions()->get()->contains($questionsList));\n }",
"public function pick_random_questionid(): int {\n // Get the list of all sharable questions in this category.\n $questionids = utils::get_sharable_question_ids($this->category->id);\n if (empty($questionids)) {\n // Error, there aren't any.\n $this->problem = 'invalidemptycategory';\n $this->problemdetails = [\n 'catname' => format_string($this->category->name),\n 'contextname' => $this->embedlocation->context_name_for_errors(),\n ];\n return 0;\n }\n\n // Count how many times each one has been used. We build an array qustionid => count of times used.\n $timesused = array_fill_keys(array_keys($questionids), 0);\n foreach ($this->quba->get_attempt_iterator() as $qa) {\n $timesused[$qa->get_question()->id] += 1;\n }\n\n // How many times have the least-used questions been used?\n $leastused = min($timesused);\n\n // Find all the questions that have been used that many times.\n $leastusedquestionids = [];\n foreach ($timesused as $questionid => $count) {\n if ($count == $leastused) {\n $leastusedquestionids[$questionid] = 1;\n }\n }\n\n return array_rand($leastusedquestionids);\n }",
"public function hard()\n {\n $questions = Question::all(); // Returns all question\n $counts = count($questions);\n $id = rand(0,$count);\n $question = $questions[$id]; // To select second question\n return view('hard', compact('question'));\n }",
"function play( $num_quest, $shuffle_answer = false, $id_track = 0, $freeze = false ) {\n\t\t\n\t\t$lang =& DoceboLanguage::createInstance('test');\n\t\t\n\t\tlist($id_quest, $title_quest) = sql_fetch_row(sql_query(\"\n\t\tSELECT idQuest, title_quest \n\t\tFROM \".$GLOBALS['prefix_lms']\t.\"_testquest \n\t\tWHERE idQuest = '\".$this->id.\"'\"));\n\t\t\n\t\t$find_prev = false;\n\t\t$id_answer_do = 0;\n\t\tif($id_track != 0) {\n\t\t\t\n\t\t\t//recover previous information\n\t\t\t$recover_answer = \"\n\t\t\tSELECT more_info \n\t\t\tFROM \".$GLOBALS['prefix_lms']\t.\"_testtrack_answer \n\t\t\tWHERE idQuest = '\".(int)$this->id.\"' AND \n\t\t\t\tidTrack = '\".(int)$id_track.\"'\";\n\t\t\t$re_answer_do = sql_query($recover_answer);\n\t\t\tif(mysql_num_rows($re_answer_do)) {\n\t\t\t\t\n\t\t\t\t//find previous answer\n\t\t\t\t$find_prev = true;\n\t\t\t\tlist($answer_do) = sql_fetch_row($re_answer_do);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn '<div class=\"play_question\">'\n .'<div>'.$lang->def('_QUEST_'.strtoupper($this->getQuestionType())).'</div>'\n\t\t\t.'<div class=\"title_question\"><label for=\"quest_'.$id_quest.'\">'.$num_quest.') '\n\t\t\t.$title_quest.'</label></div>'\n\t\t\t.'<div class=\"answer_question\">'\n\t\t\t.'<textarea cols=\"50\" rows=\"7\" id=\"quest_'.$id_quest.'\" name=\"quest['.$id_quest.']\"'\n\t\t\t.( $find_prev && $freeze ? ' disabled=\"disabled\"' : '' ).'>'\n\t\t\t.( $find_prev ? $answer_do : $lang->def('_QUEST_FREEANSWER') ).'</textarea>'\n\t\t\t.'</div>'\n\t\t\t.'</div>';\n\t}",
"function buildQuiz() {\n for ($i = 0; $i <= 9; $i++) {\n $randomNumbers = getRandomNumbers();\n $correctAnswer = getCorrectAnswer($randomNumbers);\n $answers = getRandomAnswers($correctAnswer);\n $quiz[] = [\n \"leftAdder\" => $randomNumbers[0],\n \"rightAdder\" => $randomNumbers[1],\n \"correctAnswer\" => $correctAnswer,\n \"firstIncorrectAnswer\" => $answers[0],\n \"secondIncorrectAnswer\" => $answers[1],\n ];\n }\n return $quiz;\n}",
"protected function getQuestion()\n\t{\n\t\t$int1 = rand(1, 9);\n\t\t$int2 = rand(1, 9);\n\n\t\t$question = $GLOBALS['TL_LANG']['SEC']['question' . rand(1, 3)];\n\t\t$question = sprintf($question, $int1, $int2);\n\n\t\t$this->Session->set('captcha_' . $this->strId, array\n\t\t(\n\t\t\t'sum' => $int1 + $int2,\n\t\t\t'key' => $this->strCaptchaKey,\n\t\t\t'time' => time()\n\t\t));\n\n\t\t$strEncoded = '';\n\t\t$arrCharacters = utf8_str_split($question);\n\n\t\tforeach ($arrCharacters as $strCharacter)\n\t\t{\n\t\t\t$strEncoded .= sprintf('&#%s;', utf8_ord($strCharacter));\n\t\t}\n\n\t\treturn $strEncoded;\n\t}",
"public function randomQuestionWithNoUser(): void\n {\n QuestionUserHelper::removeAllQuestionsForUser($this->user);\n QuestionHelper::newQuestion();\n\n $questionsList = User::randomQuestions();\n\n $this->assertFalse($this->user->questions()->get()->contains($questionsList));\n }",
"private function quiz_generate($data_quiz_src) {\n // extract all possible answer\n $all_possible_answer = array();\n foreach ($data_quiz_src as $single_quiz) {\n $all_correct_answer = explode('|', $single_quiz['correct_answer']);\n $all_possible_answer[] = $all_correct_answer[0];\n }\n\n $out = array();\n $index = 0;\n foreach ($data_quiz_src as $single_quiz) {\n shuffle($all_possible_answer);\n\n $single_quiz['all_correct_answer'] = explode('|', $single_quiz['correct_answer']);\n\n $single_quiz['possible_answer'] = array($single_quiz['all_correct_answer'][0]);\n\n $single_quiz['response_type'] = !empty($single_quiz['response_type']) ? $single_quiz['response_type'] : $this->configuration['default_response_type'];\n\n // add wrong answer to $possible_answer from input data\n if (isset($single_quiz[\"wrong_answer\"])) {\n $possible_wrong_answer = explode('|', $single_quiz[\"wrong_answer\"]);\n\n //remove eventually emtpy element\n $single_quiz['possible_answer'] = array_filter($single_quiz['possible_answer']);\n\n\n $single_quiz['possible_answer'] = array_merge($single_quiz['possible_answer'], $possible_wrong_answer);\n }\n\n // add random wrong answer to $possible_answer\n $single_quiz['possible_answer'] = array_merge($single_quiz['possible_answer'], $all_possible_answer);\n\n // eliminate duplicates\n $single_quiz['possible_answer'] = array_unique($single_quiz['possible_answer']);\n\n //remove eventually emtpy element\n $single_quiz['possible_answer'] = array_filter($single_quiz['possible_answer']);\n\n //get only the correct number of elements:\n $single_quiz['response_type'] = strtolower($single_quiz['response_type']);\n $option_array = explode('_', $single_quiz['response_type']);\n if (isset($option_array[1])) {\n $max_option = $option_array[1];\n $single_quiz['response_type'] = $option_array[0];\n } else {\n $max_option = $this->configuration['num_options'];\n }\n\n $single_quiz['possible_answer'] = array_slice($single_quiz['possible_answer'], 0, $max_option);\n\n // shuffle all data:\n shuffle($single_quiz['possible_answer']);\n\n $single_quiz['all_question'] = explode('|', $single_quiz['question']);\n\n // remove all empty values \n $single_quiz['all_question'] = array_filter($single_quiz['all_question']);\n\n shuffle($single_quiz['all_question']);\n\n $single_quiz['question'] = $single_quiz['all_question'][0];\n\n\n // add id of the correct_answer to correct answer if the answer_type is 'options' \n if ($single_quiz['response_type'] == \"options\") {\n $key = array_search($single_quiz['all_correct_answer'][0], $single_quiz['possible_answer']);\n $single_quiz['all_correct_answer'][] = $key;\n }\n\n\n $output_keys = array(\n 'id',\n 'question',\n 'all_correct_answer',\n 'possible_answer',\n 'response_type',\n 'if_correct',\n 'if_wrong'\n );\n\n\n $out[$index] = array();\n foreach ($output_keys as $single_key) {\n\n $out[$index][$single_key] = isset($single_quiz[$single_key]) ? $single_quiz[$single_key] : \"\";\n }\n\n $index ++;\n }\n return $out;\n }",
"public function fillQuestion(array $question)\n\t{\n\t\t[$inputMode, $inputExpectation, $notUseful, $from] = explode('_', $question['type']);\n\n\t\tvar_dump($inputMode, $inputExpectation, $notUseful, $from);\n\t\t//var_dump($question['function']['name']);\n\n\t\tif($inputMode == 'type')\n\t\t{\n\t\t\t$question['text'] .= $question['function'][$from] . ' ?';\n\t\t\t$question['answer_text'] = $question['function'][$inputExpectation];\n\t\t}\n\n\t\telseif($inputMode == 'choose')\n\t\t{\n\t\t\t$question['answer_text'] = $question['function'][$inputExpectation];\n\n\t\t\tif($from == 'name')\n\t\t\t{\n\t\t\t\t$question['text'] .= $question['function']['name'] . '() ?';\n\t\t\t}\n\n\t\t\telse\n\t\t\t{\n\t\t\t\t$question['text'] .= $question['function'][$from] . ' ?';\n\t\t\t}\n\n\t\t\t$question['choices'] = $this->generateChoices($question);\n\n\t\t\t//put correct answer in (by clobbering one of generated choices)\n\t\t\t$randomChoice = array_rand($question['choices']);\n\n\t\t\t$question['choices'][$randomChoice] = $question['answer_text'];\n\t\t\t$question['answer_index'] = $randomChoice;\n\t\t}\n\n\t\t\n\n\t\treturn $question;\n\t}",
"protected function calculeQuizzMisEnAvant(){\n $quizzRandom = $this->getDoctrine()->getEntityManager()->getRepository('MetinetFacebookBundle:Quizz')->findOneByIsPromoted(1);\n return $quizzRandom ;\n }",
"public function testCreateSurveyQuestionChoice0()\n {\n }",
"public function testCreateSurveyQuestionChoice0()\n {\n }",
"public function run()\n {\n DB::table('quizzes')->truncate();\n\n Quiz::create(['category_id' => 3, 'question'=> \"What’s 3 times 8?\"]);\n Quiz::create(['category_id' => 2, 'question'=> \"What is the difference between 20 and 8?\"]);\n Quiz::create(['category_id' => 1, 'question'=> \"What is the sum of 4 and 6?\"]);\n Quiz::create(['category_id' => 4, 'question'=> \"What is 20 divided by 4?\"]);\n\n Quiz::create(['category_id' => 1, 'question'=> \"What is sum of 10 and 5\"]);\n Quiz::create(['category_id' => 4, 'question'=> \"What is 30 divided by 5?\"]);\n Quiz::create(['category_id' => 2, 'question'=> \"What is difference between 10 and 2?\"]);\n Quiz::create(['category_id' => 3, 'question'=> \"What’s 2 times 9?\"]);\n\n Quiz::create(['category_id' => 2, 'question'=> \"What’s difference between 40 and 25\"]);\n Quiz::create(['category_id' => 1, 'question'=> \"What’s sum of 12 and 7?\"]);\n Quiz::create(['category_id' => 3, 'question'=> \"What’s 7 times 8?\"]);\n Quiz::create(['category_id' => 4, 'question'=> \"What’s 25 divided by 5?\"]);\n\n Quiz::create(['category_id' => 3, 'question'=> \"What is 10 times 6?\"]);\n Quiz::create(['category_id' => 2, 'question'=> \"What’s difference between 35 and 23?\"]);\n Quiz::create(['category_id' => 1, 'question'=> \"What’s sum of 9 and 12?\"]);\n Quiz::create(['category_id' => 4, 'question'=> \"What’s 28 divided by 7?\"]);\n\n Quiz::create(['category_id' => 3, 'question'=> \"What’s 15 times 3?\"]);\n Quiz::create(['category_id' => 2, 'question'=> \"What’s difference between 34 and 18?\"]);\n Quiz::create(['category_id' => 1, 'question'=> \"What is sum of 6, 2 and 8?\"]);\n Quiz::create(['category_id' => 4, 'question'=> \"What’s result of 40 divided by 4?\"]);\n\n Quiz::create(['category_id' => 3, 'question'=> \"How many 6 are in 48?\"]);\n Quiz::create(['category_id' => 2, 'question'=> \"What’s difference between 56 and 39?\"]);\n Quiz::create(['category_id' => 1, 'question'=> \"What is sum of 12, 3, 7 and 5?\"]);\n Quiz::create(['category_id' => 4, 'question'=> \"What is result of 45 divided by 9?\"]);\n\n Quiz::create(['category_id' => 3, 'question'=> \"What’s 9 times 4?\"]);\n Quiz::create(['category_id' => 2, 'question'=> \"What is difference between 9 and 4?\"]);\n Quiz::create(['category_id' => 1, 'question'=> \"What is sum of 23 and 6 ?\"]);\n Quiz::create(['category_id' => 4, 'question'=> \"What’s 51 divided by 17?\"]);\n\n Quiz::create(['category_id' => 3, 'question'=> \"What’s 12 times 5?\"]);\n Quiz::create(['category_id' => 2, 'question'=> \"What’s difference of 32 and 17?\"]);\n Quiz::create(['category_id' => 1, 'question'=> \"What is sum of 3, 8 and 9?\"]);\n Quiz::create(['category_id' => 4, 'question'=> \"What’s result of 9 divided by 3?\"]);\n\n Quiz::create(['category_id' => 3, 'question'=> \"What’s 13 times 5?\"]);\n Quiz::create(['category_id' => 2, 'question'=> \"What’s result of subtraction between 12 and 3?\"]);\n Quiz::create(['category_id' => 1, 'question'=> \"What’s sum of 5, 7 and 6?\"]);\n Quiz::create(['category_id' => 4, 'question'=> \"What’s result of 56 divided by 7?\"]);\n\n Quiz::create(['category_id' => 3, 'question'=> \"What’s 9 times 6?\"]);\n Quiz::create(['category_id' => 2, 'question'=> \"What is difference between 19 and 4?\"]);\n Quiz::create(['category_id' => 1, 'question'=> \"What is sum of 8 and 3?\"]);\n Quiz::create(['category_id' => 4, 'question'=> \"What’s result of 45 divided by 3?\"]);\n }",
"public function display($quiz, $cm, $course) {\n global $DB, $OUTPUT;\n\n list($currentgroup, $students, $groupstudents, $allowed) =\n $this->init('randomsummary', 'quiz_randomsummary_settings_form', $quiz, $cm, $course);\n $options = new quiz_randomsummary_options('randomsummary', $quiz, $cm, $course);\n\n if ($fromform = $this->form->get_data()) {\n $options->process_settings_from_form($fromform);\n\n } else {\n $options->process_settings_from_params();\n }\n\n $this->form->set_data($options->get_initial_form_data());\n\n if ($options->attempts == self::ALL_WITH) {\n // This option is only available to users who can access all groups in\n // groups mode, so setting allowed to empty (which means all quiz attempts\n // are accessible, is not a security porblem.\n $allowed = array();\n }\n\n // Load the required questions.\n // First get all Random questions within this quiz.\n $idfield = $DB->sql_concat('q2.id', 'slot.slot');\n $questionsraw = $DB->get_records_sql(\"\n SELECT $idfield as id, q2.id as q2id, q.id as qid, slot.slot, q2.length, slot.maxmark, q2.name\n FROM {question} q\n JOIN {quiz_slots} slot ON slot.questionid = q.id\n JOIN {question} q2 on q.category = q2.category\n WHERE slot.quizid = ?\n AND q.length > 0\n AND q.qtype = 'random'\n AND q2.qtype <> 'random'\n ORDER BY slot.slot\", array($quiz->id));\n $number = 1;\n $questions = array();\n foreach ($questionsraw as $question) {\n if (!isset($questions[$question->q2id])) {\n $questions[$question->q2id] = $question;\n $questions[$question->q2id]->slots = array();\n }\n $questions[$question->q2id]->slots[] = $question->slot;\n $questions[$question->q2id]->number = $number;\n $number += $questions[$question->q2id]->length;\n }\n\n // Prepare for downloading, if applicable.\n $courseshortname = format_string($course->shortname, true,\n array('context' => context_course::instance($course->id)));\n $table = new quiz_randomsummary_table($quiz, $this->context, $this->qmsubselect,\n $options, $groupstudents, $students, $questions, $options->get_url());\n $filename = quiz_report_download_filename(get_string('randomsummaryfilename', 'quiz_randomsummary'),\n $courseshortname, $quiz->name);\n $table->is_downloading($options->download, $filename,\n $courseshortname . ' ' . format_string($quiz->name, true));\n if ($table->is_downloading()) {\n raise_memory_limit(MEMORY_EXTRA);\n }\n\n $this->course = $course; // Hack to make this available in process_actions.\n $this->process_actions($quiz, $cm, $currentgroup, $groupstudents, $allowed, $options->get_url());\n\n // Start output.\n if (!$table->is_downloading()) {\n // Only print headers if not asked to download data.\n $this->print_header_and_tabs($cm, $course, $quiz, $this->mode);\n }\n\n if ($groupmode = groups_get_activity_groupmode($cm)) {\n // Groups are being used, so output the group selector if we are not downloading.\n if (!$table->is_downloading()) {\n groups_print_activity_menu($cm, $options->get_url());\n }\n }\n\n // Print information on the number of existing attempts.\n if (!$table->is_downloading()) {\n // Do not print notices when downloading.\n if ($strattemptnum = quiz_num_attempt_summary($quiz, $cm, true, $currentgroup)) {\n echo '<div class=\"quizattemptcounts\">' . $strattemptnum . '</div>';\n }\n }\n\n $hasquestions = quiz_has_questions($quiz->id);\n if (!$table->is_downloading()) {\n if (!$hasquestions) {\n echo quiz_no_questions_message($quiz, $cm, $this->context);\n } else if (!$students) {\n echo $OUTPUT->notification(get_string('nostudentsyet'));\n } else if ($currentgroup && !$groupstudents) {\n echo $OUTPUT->notification(get_string('nostudentsingroup'));\n }\n\n // Print the display options.\n $this->form->display();\n }\n\n $hasstudents = $students && (!$currentgroup || $groupstudents);\n if ($hasquestions && ($hasstudents || $options->attempts == self::ALL_WITH)) {\n // Construct the SQL.\n $fields = $DB->sql_concat('u.id', \"'#'\", 'COALESCE(quiza.attempt, 0)') .\n ' AS uniqueid, ';\n\n list($fields, $from, $where, $params) = $table->base_sql($allowed);\n\n $table->set_count_sql(\"SELECT COUNT(1) FROM $from WHERE $where\", $params);\n\n // Test to see if there are any regraded attempts to be listed.\n $fields .= \", COALESCE((\n SELECT MAX(qqr.regraded)\n FROM {quiz_overview_regrades} qqr\n WHERE qqr.questionusageid = quiza.uniqueid\n ), -1) AS regraded\";\n $table->set_sql($fields, $from, $where, $params);\n\n if (!$table->is_downloading()) {\n // Print information on the grading method.\n if ($strattempthighlight = quiz_report_highlighting_grading_method(\n $quiz, $this->qmsubselect, $options->onlygraded)) {\n echo '<div class=\"quizattemptcounts\">' . $strattempthighlight . '</div>';\n }\n }\n\n // Define table columns.\n $columns = array();\n $headers = array();\n\n if (!$table->is_downloading() && $options->checkboxcolumn) {\n $columns[] = 'checkbox';\n $headers[] = null;\n }\n\n $this->add_user_columns($table, $columns, $headers);\n $this->add_state_column($columns, $headers);\n $this->add_time_columns($columns, $headers);\n\n $this->add_grade_columns($quiz, $options->usercanseegrades, $columns, $headers, false);\n\n foreach ($questions as $slot => $question) {\n // Ignore questions of zero length.\n $columns[] = 'qsgrade' . $slot;\n $header = get_string('qbrief', 'quiz', implode($question->slots, ', '));\n if (!$table->is_downloading()) {\n $header .= '<br />';\n } else {\n $header .= ' ';\n }\n $header .= '/' . $question->name;\n $headers[] = $header;\n }\n\n // Check to see if we need to add columns for the student responses.\n $responsecolumnconfig = get_config('quiz_randomsummary', 'showstudentresponse');\n if (!empty($responsecolumnconfig)) {\n $responsecolumns = array_filter(explode(',', $responsecolumnconfig));\n // Get the question names for these columns to display in the header.\n list($sql, $params) = $DB->get_in_or_equal($responsecolumns, SQL_PARAMS_NAMED);\n $params['quizid'] = $quiz->id;\n\n $responseqs = $DB->get_records_sql(\"\n SELECT slot.slot, q.name\n FROM {question} q\n JOIN {quiz_slots} slot ON slot.questionid = q.id\n WHERE slot.quizid = :quizid AND q.length > 0\n AND slot.slot \".$sql.\" ORDER BY slot.slot\", $params);\n\n foreach ($responseqs as $rq) {\n $columns[] = 'qsresponse'.$rq->slot;\n if (!empty($rq->name)) {\n $headers[] = format_string($rq->name);\n } else {\n $headers[] = '';\n }\n }\n }\n\n $this->set_up_table_columns($table, $columns, $headers, $this->get_base_url(), $options, false);\n $table->set_attribute('class', 'generaltable generalbox grades');\n\n $table->out($options->pagesize, true);\n }\n\n return true;\n }",
"private function getRandomQuote()\n {\n $quotes = [\n [\n \"quote\" => \"If you don't make mistakes, you're not working on hard enough problems. And that's a big mistake.\",\n \"author\" => \"Frank Wilczek\"\n ],\n [\n \"quote\" => \"I cannot think well of a man who sports with any woman's feelings; and there may often be a great deal more suffered than a stander-by can judge of.\",\n \"author\" => \"Jane Austen\"\n ],\n [\n \"quote\" => \"When life seems chaotic, you don't need people giving you easy answers or cheap promises. There might not be any answers to your problems. What you need is a safe place where you can bounce with people who have taken some bad hops of their own.\",\n \"author\" => \"Real Live Preacher\"\n ]\n ];\n\n return $quotes[array_rand($quotes)];\n }",
"public function randomQuestionWithNonEmptyBag(): void\n {\n $expectedQuestion1 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n $expectedQuestion2 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n $unexpectedQuestion = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n\n $questionsList = $this->user->randomUserQuestion('soft', [$unexpectedQuestion->id]);\n\n $this->assertTrue($questionsList->contains($expectedQuestion1));\n $this->assertTrue($questionsList->contains($expectedQuestion2));\n\n $this->assertFalse($questionsList->contains($unexpectedQuestion));\n }",
"public function orderRandom();",
"public function randomQuestionWithEmptyBag(): void\n {\n $expectedQuestion1 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n $expectedQuestion2 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n\n $questionsList = $this->user->randomUserQuestion('soft', []);\n\n $this->assertTrue($questionsList->contains($expectedQuestion1));\n $this->assertTrue($questionsList->contains($expectedQuestion2));\n }",
"function learn_press_single_quiz_question() {\n\t\tlearn_press_get_template( 'content-quiz/content-question.php' );\n\t}",
"function getRandomAnswers($correctAnswer) {\n $answersArray = [];\n do {\n $random = random_int($correctAnswer - 10, $correctAnswer + 10);\n if ($random != $correctAnswer && !in_array($random, $answersArray)) {\n $answersArray[] = $random;\n }\n } while (count($answersArray) <= 2);\n return $answersArray;\n}",
"public function generateQuestion()\n\t{\n\t\treturn sprintf('<span class=\"captcha_text%s\">%s</span>',\n\t\t\t\t\t\t(($this->strClass != '') ? ' ' . $this->strClass : ''),\n\t\t\t\t\t\t$this->getQuestion());\n\t}",
"function learn_press_single_quiz_questions() {\n\t\tlearn_press_get_template( 'content-quiz/questions.php' );\n\t}",
"public function add_question_random(&$restoreids, $question) {\n global $DB;\n\n // set parent field, if necessary\n if ($question->parent==0) {\n $question->parent = $restoreids->get_oldid('question', $question->id);\n }\n\n // set question name depending on whether we include subcategories or not\n // (Note: $question->questiontext is used as \"include subcategories\" flag)\n if (empty($question->questiontext)) {\n $strname = 'randomqname';\n } else {\n $strname = 'randomqplusname';\n }\n $question->name = $DB->get_field('question_categories', 'name', array('id' => $question->category));\n $question->name = get_string($strname, 'qtype_random', shorten_text($question->name, 100));\n\n // update record with new \"parent\" and \"name\"\n $DB->update_record('question', $question);\n }",
"public function getPreDefinedQuestions()\n {\n return [\n \"1\" => \"Select a Security Question\",\n \"2\" => \"What was your childhood nickname?\",\n \"3\" => \"What is the name of your favorite childhood friend?\",\n \"4\" => \"What was the name of your first stuffed animal?\",\n \"5\" => \"Where were you when you had your first kiss?\",\n \"6\" => \"What is the name of the company of your first job?\",\n \"7\" => \"What was your favorite place to visit as a child?\",\n \"8\" => \"What was your dream job as a child?\",\n \"9\" => \"What is your preferred musical genre?\",\n \"10\" => \"What is your favorite team?\",\n \"11\" => \"What is your father\\\"s middle name?\"\n ];\n }",
"public function run()\n {\n DB::table('questions')->insert([\n \t'quiz_id' => str_random(1),\n \t'question_text' => str_random(10)\n ]);\n }",
"function module_specific_controls($totalnumber, $recurse, $category, $cmid, $cmoptions) {\n global $OUTPUT;\n $out = '';\n $catcontext = context::instance_by_id($category->contextid);\n if (has_capability('moodle/question:useall', $catcontext)) {\n $cmoptions->hasattempts = false;\n if ($cmoptions->hasattempts) {// Prior attempts donít matter with IPAL.\n $disabled = ' disabled=\"disabled\"';\n } else {\n $disabled = '';\n }\n $randomusablequestions = question_bank::get_qtype('random')->get_available_questions_from_category(\n $category->id, $recurse);\n $maxrand = count($randomusablequestions);$maxrand = 0;// Adding random questions is not an IPAL option.\n if ($maxrand > 0) {\n for ($i = 1; $i <= min(10, $maxrand); $i++) {\n $randomcount[$i] = $i;\n }\n for ($i = 20; $i <= min(100, $maxrand); $i += 10) {\n $randomcount[$i] = $i;\n }\n } else {\n $randomcount[0] = 0;\n $disabled = ' disabled=\"disabled\"';\n }\n\n $out = '<strong><label for=\"menurandomcount\">'.get_string('addrandomfromcategory', 'quiz').\n '</label></strong><br />';\n $attributes = array();\n $attributes['disabled'] = $disabled ? 'disabled' : null;\n $select = html_writer::select($randomcount, 'randomcount', '1', null, $attributes);\n $out .= get_string('addrandom', 'quiz', $select);\n $out .= '<input type=\"hidden\" name=\"recurse\" value=\"'.$recurse.'\" />';\n $out .= '<input type=\"hidden\" name=\"categoryid\" value=\"' . $category->id . '\" />';\n $out .= ' <input type=\"submit\" name=\"addrandom\" value=\"'.\n get_string('addtoquiz', 'quiz').'\"' . $disabled . ' />';\n $out .= $OUTPUT->help_icon('addarandomquestion', 'quiz');\n }\n return $out;\n}",
"public function quizz()\n {\n $question = $this->form_validation->set_rules('add_question', 'Question', 'required');\n $answers = $this->form_validation->set_rules('add_answers', 'Réponse', 'required');\n\n if ($this->form_validation->run() === FALSE) // si formulaire non rempli OU rempli mais incomplet\n {\n $get_quizzQuestions = $this->admin_model->get_quizzQuestions();\n $get_quizzAnswers = $this->admin_model->get_quizzAnswers();\n $get_quizz = $this->admin_model->get_quizz();\n \n $data['get_quizz'] = $get_quizz;\n $data['get_quizzQuestions'] = $get_quizzQuestions;\n $data['get_quizzAnswers'] = $get_quizzAnswers;\n $data['title'] = 'Quizz';\n $this->load->view('layouts/header');\n $this->load->view('admin/quizz', $data);\n $this->load->view('layouts/footer');\n }\n else\n {\n $this->admin_model->insertQuestion();\n $this->admin_model->insertAnswers();\n\n $data['title'] = 'Quizz'; \n\n $this->load->view('layouts/header');\n $this->load->view('admin/quizz', $data);\n $this->load->view('layouts/footer');\n }\n }",
"function target_add_poll_question($q)\n{\n\t$qid = db_qid('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'poll_opt (poll_id, name)\n\t\tVALUES('. (int)$q['id'] .', '. _esc($q['name']) .')');\n\treturn $qid;\n}",
"function challangeRandom() {\r\n // random number between 10 and 99\r\n $random = rand(10,99);\r\n $say = \"<Say voice='gcloud.en-GB-Standard-F' loop='2'>Please type the following number, $random, then press pound.</Say>\";\r\n return [$random, $say];\r\n}",
"function getRandomQuote($array){ \n return $array[rand(0,4)];\n }",
"function generate_test($name, $courseid = null) {\n global $DB;\n list($form, $question) = parent::generate_test($name, $courseid);\n $form->feedback = 1;\n $form->multiplier = array(1, 1);\n $form->shuffleanswers = 1;\n $form->noanswers = 1;\n $form->qtype ='calculated';\n $question->qtype ='calculated';\n $form->answers = array('{a} + {b}');\n $form->fraction = array(1);\n $form->tolerance = array(0.01);\n $form->tolerancetype = array(1);\n $form->correctanswerlength = array(2);\n $form->correctanswerformat = array(1);\n $form->questiontext = \"What is {a} + {b}?\";\n\n if ($courseid) {\n $course = $DB->get_record('course', array('id'=> $courseid));\n }\n\n $new_question = $this->save_question($question, $form, $course);\n\n $dataset_form = new stdClass();\n $dataset_form->nextpageparam[\"forceregeneration\"]= 1;\n $dataset_form->calcmin = array(1 => 1.0, 2 => 1.0);\n $dataset_form->calcmax = array(1 => 10.0, 2 => 10.0);\n $dataset_form->calclength = array(1 => 1, 2 => 1);\n $dataset_form->number = array(1 => 5.4 , 2 => 4.9);\n $dataset_form->itemid = array(1 => '' , 2 => '');\n $dataset_form->calcdistribution = array(1 => 'uniform', 2 => 'uniform');\n $dataset_form->definition = array(1 => \"1-0-a\",\n 2 => \"1-0-b\");\n $dataset_form->nextpageparam = array('forceregeneration' => false);\n $dataset_form->addbutton = 1;\n $dataset_form->selectadd = 1;\n $dataset_form->courseid = $courseid;\n $dataset_form->cmid = 0;\n $dataset_form->id = $new_question->id;\n $this->save_dataset_items($new_question, $dataset_form);\n\n return $new_question;\n }",
"public function pick_random_variant(\\question_definition $question): int {\n if (is_numeric($this->quba->get_id())) {\n // Usage already exists, so we need to consider already used variants from it.\n $qubaids = [$this->quba->get_id()];\n } else {\n // Usage just started, so there are previous questions to consider\n // (but trying to pass in the qubaid gives an error).\n $qubaids = [];\n }\n $variantstrategy = new \\core_question\\engine\\variants\\least_used_strategy(\n $this->quba, new \\qubaid_list($qubaids));\n return $variantstrategy->choose_variant($question->get_num_variants(),\n $question->get_variants_selection_seed());\n }",
"function multiplechoice($subject) { \n \n\n\n$con = new mysqli(\"localhost\", \"root\", \"\", \"diligent\");\n\n//uncommment the line of code below to see if connection to the database is a success\n\n//echo \"\\nSuccess... \" . mysqli_get_host_info($con) . \"\\n\";\n\nif(mysqli_connect_errno()){\n \n echo 'Failed to connect to database' . mysqli_connect_error();\n}\n\n$query = \"SELECT * FROM questions join diligent.categories on questions.category_id = categories.category_id WHERE categories.category = '$subject' ORDER BY RAND() limit 1\"; //the query to be passed the mysqli_query function\n$result = mysqli_query($con, $query);\n\n////uncommment the line of code below to see if the query worked\n//var_dump($result);\n\n//echo '<table>;\nwhile($row = mysqli_fetch_array($result))\n { //Creates a loop to loop through results\n\t\treturn \"<tr><td>\" . $row['question'] \n . \"</td></tr><tr><td><form action='correct.php'>\" \n .\"<input type='radio' name='answer' value=\" .$row['answer_1'] .\"/>\". $row['answer_1'] .\"<br />\" \n .\"<input type='radio' name='answer' value=\" .$row['answer_2'] .\"/>\". $row['answer_2'] .\"<br />\" \n .\"<input type='radio' name='answer' value=\" .$row['answer_3'] .\"/>\". $row['answer_3'] .\"<br />\" \n .\"<input type='radio' name='answer' value=\" .$row['answer_4'] .\"/>\". $row['answer_4'] .\"<br /><br />\"\n //.\"<input type='submit' value='Submit' />\"\n .\"<small>Answer</small>:\".$row['correct_answer']\n .\"</td></tr></td></tr>\"; //$row['index'] the index here is a field name\n \n }\n \n // echo '</table>'; // end the table\n\n \n mysqli_close($con);// make sure the database connection is closed\n \n\n}",
"function rand_option($min,$max,$amount){\r\n\r\n $num = range($min,$max);\r\n shuffle($num);\r\n return array_slice($num,0,$amount);\r\n\r\n}",
"private function createAnswers($f, $p) {\n\n // Simulate each qeustion answering\n foreach ($f->questions as $q) {\n if ($q->isAspect()) {\n // If the question is about each aspect, answer like..\n\n // Each aspects has 3 level: normal, high-risk, very-high-risk\n // random to choose between those\n $c = $this->getRandomChoice($q->choices, null, true);\n if ($c->value == 0) {\n // Choose it and continue to next question\n $this->chooseChoice($f, $q, $c, $p);\n\n // next loop\n } else {\n // Choose the choice\n $this->chooseChoice($f, $q, $c, $p);\n $this->chooseRandomSubchoices($f, $q, $c, $p);\n\n // and random again\n // Since high & very-high can be their simultaneously\n $nc = $this->getRandomChoice($q->choices, null, true);\n\n if ($nc->value > 0 && $nc->value != $c->value) {\n // Not the 'normal' and not the same choice, choose it\n $this->chooseChoice($f, $q, $nc, $p);\n $this->chooseRandomSubchoices($f, $q, $nc, $p);\n } else {\n // next loop\n }\n }\n } else if ($q->isAboutTalent()) {\n // If the question is about talent answer like...\n\n // Talent has only 2 choice, random between the two\n $c = $this->getRandomChoice($q->choices, null);\n $a = $this->chooseChoice($f, $q, $c, $p);\n $ci = $c->inputs()->first();\n if ($ci) {\n $this->createRandomTalent($a, $ci, $p);\n }\n\n // next loop\n\n } else if ($q->isAboutDisability()) {\n // If the question is about disability answer like...\n\n // Non uniform random, low rate of having disability\n $probHaveDis = rand(0, 100);\n\n // Only 30% chance that a participant will have disability\n if ($probHaveDis > 70) {\n\n $numDis = $this->randomNumberOfDisabilities();\n\n $choosenChoices = [];\n $numChoice = count($q->choices);\n for ($i=0; $i < $numDis; $i++) { \n $c = $this->getRandomChoice($q->choices, $numChoice);\n \n if (Choice::choiceExistsInAnswers($c, $choosenChoices)) {\n // Allow no duplicates disabilities\n continue;\n } else {\n $a = $this->chooseChoice($f, $q, $c, $p);\n $ci = $c->inputs()->first();\n if ($ci) {\n $this->createRandomDisability($a, $ci);\n }\n }\n\n $choosenChoices[] = $a;\n }\n }\n }\n }\n }",
"public static function answer_question(array $question);",
"public function getRandomQuestionByCourseId($id = false) {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Query set up\n\t\t\t$return\t\t\t= ($id) ? $db->getRow('tb_question_course', 'id_question', \"id_course = {$id} ORDER BY RAND() LIMIT 1\") : false;\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}",
"public static function random_positive_word(){\n $temp_text_options = array('Awesome!', 'Nice!', 'Fantastic!', 'Yeah!', 'Yay!', 'Yes!', 'Great!', 'Super!', 'Rock on!', 'Amazing!', 'Fabulous!', 'Wild!', 'Sweet!', 'Wow!', 'Oh my!', 'Excellent!', 'Wonderful!');\n $temp_text = $temp_text_options[array_rand($temp_text_options)];\n return $temp_text;\n }",
"function addQuestion() {\n //SELECT QuestionNumber FROM BoothQuestions ORDER BY QuestionNumber DESC LIMIT 1\n $dbConnection = new mysqli('student.cs.appstate.edu', 'haithcockce', '900431409', 'QQuizzer');\n $result = mysqli_query($dbConnection, 'SELECT QuestionNumber FROM BoothQuestions \n ORDER BY QuestionNumber DESC LIMIT 1');\n $questionNumber = (mysqli_num_rows($result) == 0 ? 0 : mysqli_fetch_row($result));\n if ($questionNumber != 0) $questionNumber = $questionNumber[0];\n $questionNumber++;\n $result = mysqli_query($dbConnection, 'INSERT INTO BoothQuestions (BoothName, QuestionNumber) \n VALUES (\"'.$_POST['booth'].'\", \"'.$questionNumber.'\")');\n if (!$result) {\n echo 'failed to insert into BoothQuestions';\n exit;\n }\n $fromArray = implode('|$|', $_POST['answers']);\n $result = mysqli_query($dbConnection, 'INSERT INTO Questions \n (QuestionNumber, Question, CorrectAnswer, PossibleAnswers, Shuffle) \n VALUES \n (\"'.$questionNumber.'\", \"'.$_POST['question'].'\", \"'.$_POST['correct'].'\", \"'.$fromArray.'\", \"0\")');\n if (!$result) {\n $questionCheck = mysqli_num_rows(mysqli_query($dbConnection, 'SELECT Question FROM Questions\n WHERE Question=\"'.$_POST['question'].'\"')); \n if ($questionCheck == 1) echo 'found question';\n else echo 'failed to insert into Questions';\n exit;\n }\n echo 'success';\n \n }",
"public function startQuiz(){\n if($this->session->get('userId') == null){\n echo \"sorry unauthorized!...\";\n return;\n }\n $this->answeredQuestions =[];\n $this->minId = 1;\n // jel ok da pretpostavim da je sve od 1 do maxa tu - msm da da\n $q = new Question();\n $this->maxId = $q->getMaxId();\n\n return view('quiz.php');\n }",
"public function findRandom();",
"function tep_random_select($query) {\n $random_product = '';\n $random_query = tep_db_query($query);\n $num_rows = tep_db_num_rows($random_query);\n if ($num_rows > 0) {\n $random_row = tep_rand(0, ($num_rows - 1));\n tep_db_data_seek($random_query, $random_row);\n $random_product = tep_db_fetch_array($random_query);\n }\n\n return $random_product;\n }",
"public function run()\n {\n $faker = Faker::create();\n for($i = 0; $i<40; $i++){\n Question::create([\n 'title' =>$faker->name,\n 'desc' => $faker->text,\n 'img' => $faker->name,\n 'visited' => rand(1, 10000),\n 'created' => \\Carbon\\Carbon::now(),\n 'status' => 'open',\n 'cat_id' => rand(1, 5),\n 'user_id' => rand(11, 20)\n ]);\n }\n }",
"public function generateChallenge()\n {\n // Easy\n if (Captcha::$config['complexity'] < 4) {\n $numbers[] = mt_rand(1, 5);\n $numbers[] = mt_rand(1, 4);\n }\n // Normal\n elseif (Captcha::$config['complexity'] < 7) {\n $numbers[] = mt_rand(10, 20);\n $numbers[] = mt_rand(1, 10);\n }\n // Difficult, well, not really ;)\n else {\n $numbers[] = mt_rand(100, 200);\n $numbers[] = mt_rand(10, 20);\n $numbers[] = mt_rand(1, 10);\n }\n\n // Store the question for output\n $this->mathExercise = implode(' + ', $numbers) . ' = ';\n\n // Return the answer\n $this->response = array_sum($numbers);\n\n return $this->response;\n }",
"function randomQuote() {\n\n$quotes[] = '(Organic) machinery';\n$quotes[] = 'A line has two sides';\n$quotes[] = 'A very small object -Its centre';\n$quotes[] = 'Abandon desire';\n$quotes[] = 'Abandon normal instructions';\n$quotes[] = 'Accept advice';\n$quotes[] = 'Accretion';\n$quotes[] = 'Adding on';\n$quotes[] = 'Allow an easement (an easement is the abandonment of a stricture)';\n$quotes[] = 'Always first steps';\n$quotes[] = 'Always give yourself credit for having more than personality';\n$quotes[] = 'Always the first steps';\n$quotes[] = 'Are there sections? Consider transitions';\n$quotes[] = 'Ask people to work against their better judgement';\n$quotes[] = 'Ask your body';\n$quotes[] = 'Assemble some of the elements in a group and treat the group';\n$quotes[] = 'Back up a few steps. What else could you have done?';\n$quotes[] = 'Balance the consistency principle with the inconsistency principle';\n$quotes[] = 'Be dirty';\n$quotes[] = 'Be extravagant';\n$quotes[] = 'Be less critical more often';\n$quotes[] = 'Breathe more deeply';\n$quotes[] = 'Bridges -build -burn';\n$quotes[] = 'Call your mother and ask her what to do.';\n$quotes[] = 'Cascades';\n$quotes[] = 'Change ambiguities to specifics';\n$quotes[] = 'Change instrument roles';\n$quotes[] = 'Change nothing and continue with immaculate consistency';\n$quotes[] = 'Change specifics to ambiguities';\n$quotes[] = 'Children’s voices: -speaking -singing';\n$quotes[] = 'Cluster analysis';\n$quotes[] = 'Consider different fading systems';\n$quotes[] = 'Consider transitions';\n$quotes[] = 'Consult other sources -promising -unpromising';\n$quotes[] = 'Convert a melodic element into a rhythmic element';\n$quotes[] = 'Courage!';\n$quotes[] = 'Cut a vital connection';\n$quotes[] = 'Decorate, decorate';\n$quotes[] = 'Define an area as “safe” and use it as an anchor';\n$quotes[] = 'Describe the landscape in which this belongs. (9 August)';\n$quotes[] = 'Destroy nothing; Destroy the most important thing';\n$quotes[] = 'Discard an axiom';\n$quotes[] = 'Disciplined self-indulgence';\n$quotes[] = 'Disconnect from desire';\n$quotes[] = 'Discover the recipes you are using and abandon them';\n$quotes[] = 'Discover your formulas and abandon them';\n$quotes[] = 'Display your talent';\n$quotes[] = 'Distorting time';\n$quotes[] = 'Do nothing for as long as possible';\n$quotes[] = 'Do something boring';\n$quotes[] = 'Do something sudden, destructive and unpredictable';\n$quotes[] = 'Do the last thing first';\n$quotes[] = 'Do the washing up';\n$quotes[] = 'Do the words need changing?';\n$quotes[] = 'Do we need holes?';\n$quotes[] = 'Don’t avoid what is easy';\n$quotes[] = 'Don’t be afraid of things because they’re easy to do';\n$quotes[] = 'Don’t be frightened of cliches';\n$quotes[] = 'Don’t be frightened to display your talents';\n$quotes[] = 'Don’t break the silence';\n$quotes[] = 'Don’t stress one thing more than another';\n$quotes[] = 'Emphasize differences';\n$quotes[] = 'Emphasize repetitions';\n$quotes[] = 'Emphasize the flaws';\n$quotes[] = 'Faced with a choice, do both';\n$quotes[] = 'Feed the recording back out of the medium';\n$quotes[] = 'Feedback recordings into an acoustic situation';\n$quotes[] = 'Fill every beat with something';\n$quotes[] = 'Find a safe part and use it as an anchor';\n$quotes[] = 'First work alone, then work in unusual pairs.';\n$quotes[] = 'From nothing to more than nothing';\n$quotes[] = 'Get your neck massaged';\n$quotes[] = 'Ghost echoes';\n$quotes[] = 'Give the game away';\n$quotes[] = 'Give way to your worst impulse';\n$quotes[] = 'Go outside. Shut the door.';\n$quotes[] = 'Go slowly all the way round the outside';\n$quotes[] = 'Go to an extreme, move back to a more comfortable place';\n$quotes[] = 'How would someone else do it?';\n$quotes[] = 'How would you explain this to your parents?';\n$quotes[] = 'How would you have done it?';\n$quotes[] = 'Humanize something that is free of error.';\n$quotes[] = 'Idiot glee (?)';\n$quotes[] = 'Imagine the music as a moving chain or caterpillar';\n$quotes[] = 'Imagine the music as a series of disconnected events';\n$quotes[] = 'In total darkness, or in a very large room, very quietly';\n$quotes[] = 'Infinitesimal gradations';\n$quotes[] = 'Instead of changing the thing, change the world around it.';\n$quotes[] = 'Intentions -credibility of -nobility of -humility of';\n$quotes[] = 'Into the impossible';\n$quotes[] = 'Is it finished?';\n$quotes[] = 'Is something missing?';\n$quotes[] = 'Is the intonation correct?';\n$quotes[] = 'Is the style right?';\n$quotes[] = 'Is the tuning appropriate?';\n$quotes[] = 'Is the tuning intonation correct?';\n$quotes[] = 'Is there something missing?';\n$quotes[] = 'It is quite possible (after all)';\n$quotes[] = 'It is simply a matter or work';\n$quotes[] = 'Just carry on';\n$quotes[] = 'Left channel, right channel, centre channel';\n$quotes[] = 'List the qualities it has. List those you’d like.';\n$quotes[] = 'Listen in total darkness, or in a very large room, very quietly';\n$quotes[] = 'Listen to the quiet voice';\n$quotes[] = 'Look at a very small object, look at its centre';\n$quotes[] = 'Look at the order in which you do things';\n$quotes[] = 'Look closely at the most embarrassing details and amplify.';\n$quotes[] = 'Lost in useless territory';\n$quotes[] = 'Lowest common denominator check: -single beat -single note -single riff';\n$quotes[] = 'Magnify the most difficult details';\n$quotes[] = 'Make a blank valuable by putting it in an excquisite frame';\n$quotes[] = 'Make a sudden, destructive unpredictable action; incorporate';\n$quotes[] = 'Make an exhaustive list of everything you might do and do the last thing on the list';\n$quotes[] = 'Make it more sensual';\n$quotes[] = 'Make what’s perfect more human';\n$quotes[] = 'Mechanize something idiosyncratic';\n$quotes[] = 'Move towards the unimportant';\n$quotes[] = 'Mute and continue';\n$quotes[] = 'Not building a wall but making a brick';\n$quotes[] = 'Once the search has begun, something will be found';\n$quotes[] = 'Only a part, not the whole';\n$quotes[] = 'Only one element of each kind';\n$quotes[] = 'Overtly resist change';\n$quotes[] = 'Pae White’s non-blank graphic metacard';\n$quotes[] = 'Pay attention to distractions';\n$quotes[] = 'Picture of a man spotlighted';\n$quotes[] = 'Put in earplugs';\n$quotes[] = 'Question the heroic approach';\n$quotes[] = 'Remember those quiet evenings';\n$quotes[] = 'Remove a restriction';\n$quotes[] = 'Remove ambiguities and convert to specifics';\n$quotes[] = 'Remove specifics and convert to ambiguities';\n$quotes[] = 'Remove the middle, extend the edges';\n$quotes[] = 'Repetition is a form of change';\n$quotes[] = 'Retrace your steps';\n$quotes[] = 'Revaluation (a warm feeling)';\n$quotes[] = 'Reverse';\n$quotes[] = 'Short circuit (example; a man eating peas with the idea that they will improve his virility shovels them straight into his lap)';\n$quotes[] = 'Shut the door and listen from outside';\n$quotes[] = 'Simple subtraction';\n$quotes[] = 'Simply a matter of work';\n$quotes[] = 'Slow preparation, fast execution';\n$quotes[] = 'Spectrum analysis';\n$quotes[] = 'State the problem in words as simply as possible';\n$quotes[] = 'Steal a solution.';\n$quotes[] = 'Take a break';\n$quotes[] = 'Take away as much mystery as possible. What is left?';\n$quotes[] = 'Take away the elements in order of apparent non-importance';\n$quotes[] = 'Take away the important parts';\n$quotes[] = 'Tape your mouth';\n$quotes[] = 'The inconsistency principle';\n$quotes[] = 'The most important thing is the thing most easily forgotten';\n$quotes[] = 'The tape is now the music';\n$quotes[] = 'Think: -inside the work -outside the work';\n$quotes[] = 'Think of the radio';\n$quotes[] = 'Tidy up';\n$quotes[] = 'Towards the insignificant';\n$quotes[] = 'Trust in the you of now';\n$quotes[] = 'Try faking it';\n$quotes[] = 'Turn it upside down';\n$quotes[] = 'Twist the spine';\n$quotes[] = 'Use “unqualified” people.';\n$quotes[] = 'Use an old idea';\n$quotes[] = 'Use an unacceptable color';\n$quotes[] = 'Use cliches';\n$quotes[] = 'Use fewer notes';\n$quotes[] = 'Use filters';\n$quotes[] = 'Use something nearby as a model';\n$quotes[] = 'Use your own ideas';\n$quotes[] = 'Voice your suspicions';\n$quotes[] = 'Water';\n$quotes[] = 'What are the sections sections of? Imagine a caterpillar moving';\n$quotes[] = 'What context would look right?';\n$quotes[] = 'What do you do? Now, what do you do best?';\n$quotes[] = 'What else is this like?';\n$quotes[] = 'What is the reality of the situation?';\n$quotes[] = 'What is the simplest solution?';\n$quotes[] = 'What mistakes did you make last time?';\n$quotes[] = 'What most recently impressed you? How is it similar? What can you learn from it? What could you take from it?';\n$quotes[] = 'What to increase? What to reduce? What to maintain?';\n$quotes[] = 'What were the branch points in the evolution of this entity';\n$quotes[] = 'What were you really thinking about just now? Incorporate';\n$quotes[] = 'What would make this really successful?';\n$quotes[] = 'What would your closest friend do?';\n$quotes[] = 'What wouldn’t you do?';\n$quotes[] = 'When is it for? Who is it for?';\n$quotes[] = 'Where is the edge?';\n$quotes[] = 'Which parts can be grouped?';\n$quotes[] = 'Who would make this really successful?';\n$quotes[] = 'Work at a different speed';\n$quotes[] = 'Would anyone want it?';\n$quotes[] = 'You are an engineer';\n$quotes[] = 'You can only make one dot at a time';\n$quotes[] = 'You don’t have to be ashamed of using your own ideas';\n$quotes[] = 'Your mistake was a hidden intention';\n\nsrand ((double) microtime() * 1000000);\n$random_number = rand(0,count($quotes)-1);\n\necho '<p><a href=\"http://oblique.soundmachinedream.com/\">' . ($quotes[$random_number]) . '</a></p>';\n}",
"public function test_for_quiz_question()\n {\n $this->withOutExceptionHandling();\n\n $user = $this->actingAs(User::factory()->make());\n\n $session = QuizSession::factory()->create();\n $schedule = ClassSchedule::factory()->create();\n\n $response = $this->post('api/v1/quiz/question',\n array_merge($this->data(), [\n 'quiz_session_id' => $session->id,\n 'class_schedule_id' => $schedule->id,\n ]\n )\n );\n\n $response->assertStatus(200);\n }",
"public static function getRandom()\n\t{\n\t\t$randNumPhp = Lottery::getSecureRand( self::getCount() );\n\t\t//$randNumSql = '( SELECT FLOOR( MAX(`id`) * RAND() ) FROM `category_prize` LIMIT 1 )';\n\n\t\treturn self::find()\n ->select(['id', 'name'])\n\t\t ->andWhere(['>=', 'id', $randNumPhp])\n\t\t ->orderBy('id')\n\t\t ->asArray()\n ->one();\n\t}",
"function recycle_quizzes()\n\t{\n\t\tif ($this->course->has_resources(RESOURCE_QUIZ))\n\t\t{\n\t\t\t//$table_qui_que = Database :: get_course_table(TABLE_QUIZ_QUESTION);\n\t\t\t//$table_qui_ans = Database :: get_course_table(TABLE_QUIZ_ANSWER);\n\t\t\t$table_qui = Database :: get_course_table(TABLE_QUIZ_TEST);\n\t\t\t$table_rel = Database :: get_course_table(TABLE_QUIZ_TEST_QUESTION);\n\t\t\t$ids = implode(',', (array_keys($this->course->resources[RESOURCE_QUIZ])));\n\t\t\t$sql = \"DELETE FROM \".$table_qui.\" WHERE id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_rel.\" WHERE exercice_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t}\n\t}",
"public function run()\n {\n DB::table('votables')->where('votable_type','App\\Question')->delete();\n\n $users=\\App\\User::all();\n $numberOfUsers=$users->count();\n $votes=[-1,1];\n\n foreach (\\App\\Question::all() as $question) {\n for ($i=0; $i< rand(0,$numberOfUsers);$i++){\n $user=$users[$i];\n $user->voteQuestion($question,$votes[rand(0,1)]);\n }\n }\n\n }",
"function run()\n\t{\n\t\trequire_code('quiz');\n\n\t\t$questions=array();\n\n\t\t$text=post_param('text');\n\t\t$type=post_param('type');\n\n\t\t$_qs=explode(chr(10).chr(10),$text);\n\t\t$qs=array();\n\t\tforeach ($_qs as $q)\n\t\t{\n\t\t\t$q=trim($q);\n\t\t\tif ($q!='') $qs[]=$q;\n\t\t}\n\t\t$num_q=0;\n\n\t\t$qs2=array();\n\t\tforeach ($qs as $i=>$q)\n\t\t{\n\t\t\t$_as=explode(chr(10),$q);\n\t\t\t$as=array();\n\t\t\tforeach ($_as as $a)\n\t\t\t{\n\t\t\t\tif ($a!='') $as[]=$a;\n\t\t\t}\n\t\t\t$q=array_shift($as);\n\t\t\t$matches=array();\n\t\t\t//if (preg_match('#^(\\d+)\\)?(.*)#',$q,$matches)===false) continue;\n\t\t\tif (preg_match('#^(.*)#',$q,$matches)===false) continue;\n\t\t\tif (count($matches)==0) continue;\n\n\t\t\t$implicit_question_number=$i;//$matches[1];\n\n\t\t\t$qs2[$implicit_question_number]=$q.chr(10).implode(chr(10),$as);\n\t\t}\n\t\tksort($qs2);\n\n\t\tforeach (array_values($qs2) as $i=>$q)\n\t\t{\n\t\t\t$_as=explode(chr(10),$q);\n\t\t\t$as=array();\n\t\t\tforeach ($_as as $a)\n\t\t\t{\n\t\t\t\tif ($a!='') $as[]=$a;\n\t\t\t}\n\t\t\t$q=array_shift($as);\n\t\t\t$matches=array();\n\t\t\t//if (preg_match('#^(\\d+)\\)?(.*)#',$q,$matches)===false) continue;\n\t\t\tif (preg_match('#^(.*)#',$q,$matches)===false) continue;\n\t\t\tif (count($matches)==0) continue;\n\t\t\t$question=trim($matches[count($matches)-1]);\n\t\t\t$long_input_field=(strpos($question,' [LONG]')!==false)?1:0;\n\t\t\t$question=str_replace(' [LONG]','',$question);\n\t\t\t$num_choosable_answers=(strpos($question,' [*]')!==false)?count($as):((count($as)>0)?1:0);\n\t\t\t$question=str_replace(' [*]','',$question);\n\t\t\t$required=(strpos($question,' [REQUIRED]')!==false)?1:0;\n\t\t\t$question=str_replace(' [REQUIRED]','',$question);\n\n\t\t\t// Now we add the answers\n\t\t\t$answers=array();\n\t\t\tforeach ($as as $x=>$a)\n\t\t\t{\n\t\t\t\t$is_correct=((($x==0) && (strpos($qs2[$i],' [*]')===false) && ($type!='SURVEY')) || (strpos($a,' [*]')!==false))?1:0;\n\t\t\t\t$a=str_replace(' [*]','',$a);\n\n\t\t\t\tif (substr($a,0,1)==':') continue;\n\n\t\t\t\t$answers[]=array(\n\t\t\t\t\t'id'=>$x,\n\t\t\t\t\t'q_answer_text'=>$a,\n\t\t\t\t\t'q_is_correct'=>$is_correct,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$questions[]=array(\n\t\t\t\t'id'=>$i,\n\t\t\t\t'q_long_input_field'=>$long_input_field,\n\t\t\t\t'q_num_choosable_answers'=>$num_choosable_answers,\n\t\t\t\t'q_question_text'=>$question,\n\t\t\t\t'answers'=>$answers,\n\t\t\t\t'q_required'=>$required,\n\t\t\t);\n\n\t\t\t$num_q++;\n\t\t}\n\n\t\t$preview=render_quiz($questions);\n\n\t\treturn array(do_template('FORM',array('SUBMIT_NAME'=>'','TEXT'=>'','URL'=>'','HIDDEN'=>'','FIELDS'=>$preview)),NULL);\n\t}",
"function getRandomGames() {\n return DBcommand(\"SELECT * FROM games WHERE suggestion = 0 ORDER BY RAND() LIMIT 5\", [])['output'];\n}",
"function get_all_quizes(){\n $str_query=\"select * from mwc_quizzine_quiz\";\n if(!$this->query($str_query)){\n return false;\n }\n return $this->fetch();\n }",
"protected function GetNewLvlQAs()\n {\n $level = $this->GetLevel();\n $languageID = $this->GetLanguage()->GetId();\n $idsToExclude = $this->GetPreviousQuestionIDs();\n $limit = $this->GetParameters()->GetQuestionCount();\n \n $newQuesIDs = GetRandomQuestionIDs($languageID, $level, $limit, $idsToExclude);\n \n $lvlQAs = array();\n \n foreach ($newQuesIDs as $questionID)\n {\n $lvlQAs[] = new QuestionAnswer($questionID);\n }\n \n $this->SetLvlQAs($lvlQAs);\n }",
"public function run()\n {\n // Insertion dans la table CHOICES\n DB::table('questions')->insert([\n\n //QCM 1 : 15 questions : Niveau première\n [ \n 'content' => 'Isaac Newton était un savant anglais.',\n 'answer' => 'yes',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Isaac Newton était un homme politique américain.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Isaac Newton était un musicien de jazz.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Isaac Newton était un premier ministre israélien.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Pendant ses deux septennats, François Mitterrand a nommé 3 premiers ministres.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Pendant ses deux septennats, François Mitterrand a nommé 5 premiers ministres.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Pendant ses deux septennats, François Mitterrand a nommé 7 premiers ministres.',\n 'answer' => 'yes',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Le 6 juin 1944 s\\'est produit : L\\'appel du général de Gaulle à ne pas capituler.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Le 6 juin 1944 s\\'est produit : Le débarquement allié en Normandie.',\n 'answer' => 'yes',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Le 6 juin 1944 s\\'est produit : L\\'armistice de la Seconde Guerre mondiale.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => '« C\\'est un petit pas pour l\\'homme, mais un bond de géant pour l\\' humanité ». Cette phrase célèbre a été prononcée en 1968 par John Kennedy.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => '« C\\'est un petit pas pour l\\'homme, mais un bond de géant pour l\\' humanité ». Cette phrase célèbre a été prononcée en 1969 par Neil Amstrong.',\n 'answer' => 'yes',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => '« C\\'est un petit pas pour l\\'homme, mais un bond de géant pour l\\' humanité ». Cette phrase célèbre a été prononcée en 1971 par Martin Luther King.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Le président des États-Unis John Kennedy a été mêlé à l\\'affaire dite du Watergate.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Le président des États-Unis Richard Nixon a été mêlé à l\\'affaire dite du Watergate.',\n 'answer' => 'yes',\n 'qcm_id' => '1'\n ],\n //QCM 2 : 12 questions : Niveau première\n [ \n 'content' => 'La première République française a été proclamée en 1792.',\n 'answer' => 'yes',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'La première République française a été proclamée en 1789.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'La première République française a été proclamée en 1794.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'Louis XVI s\\'est fait arrêter à Versailles par les sans-culotte.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'Sous la Quatrième République, le chef de l\\'État était élu par les députés et sénateurs.',\n 'answer' => 'yes',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'Sous la Quatrième République, le chef de l\\'État était élu au suffrage universel.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'Sous la Quatrième République, le chef de l\\'État était nommé par le Conseil d\\'État.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'L\\'Académie française a été créée sous Louis XIII.',\n 'answer' => 'yes',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'L\\'Académie française a été créée sous Louis XIV.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'L\\'Académie française a été créée sous Napoléon 1er.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [\n 'content' => 'Christophe Colomb a découvert l\\'Amérique en 1492.',\n 'answer' => 'yes',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'Christophe Colomb a découvert l\\'Amérique en 1515.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n //QCM 3 : 15 questions : Niveau terminale\n [ \n 'content' => 'Le procès de Nuremberg a eu lieu en 1945.',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Le procès de Nuremberg a eu lieu en 1948.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'La révocation de l\\'Édit de Nantes a instauré le rattachement de la Vendée à la France.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'La révocation de l\\'Édit de Nantes a instauré l\\'interdiction du protestantisme.',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Le conflit des Malouines a opposé le Royaume-Uni au Chili.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Le conflit des Malouines a opposé le Royaume-Uni à l\\'Argentine.',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Alexandrie, la ville fondée par Alexandre le Grand se trouvait en Macédoine.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Alexandrie, la ville fondée par Alexandre le Grand se trouvait en Egypte.',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Alexandrie, la ville fondée par Alexandre le Grand se trouvait en Grèce.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Henri IV était issu de la famille des Bourbons.',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Henri IV était issu de la famille des Artois.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Mohandas Gandhi, était surnommé Mahatma. Ce surnom signifie \"L\\'éveillé\".',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Mohandas Gandhi, était surnommé Mahatma. Ce surnom signifie \"Grande âme\".',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Mohandas Gandhi, était surnommé Mahatma. Ce surnom signifie \"Indépendant\".',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Mohandas Gandhi, était surnommé Mahatma. Ce surnom signifie \"Sage dans ses paroles\".',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n //QCM 4 : 12 questions : Niveau terminale\n [ \n 'content' => 'Louis XVI a été arrêté à Varennes alors qu\\'il tentait de fuir la France en 1791.',\n 'answer' => 'yes',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'Louis XVI a été arrêté à Varennes alors qu\\'il tentait de fuir la France en 1789.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'Louis XVI a été arrêté à Varennes alors qu\\'il tentait de fuir la France en 1790.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'L\\'État du Suriname se trouve en Afrique.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'L\\'État du Suriname se trouve en Amérique du Sud.',\n 'answer' => 'yes',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'L\\'État du Suriname se trouve en Asie.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La bataille de Marignan s\\'est déroulé en 1515.',\n 'answer' => 'yes',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La bataille de Marignan s\\'est déroulé en 1615.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La bataille de Marignan s\\'est déroulé en 1415.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La couleur du cheval Blanc d\\'henri IV était : Noir et Blanc.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La couleur du cheval Blanc d\\'henri IV était : Marron.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La couleur du cheval Blanc d\\'henri IV était : Blanc.',\n 'answer' => 'yes',\n 'qcm_id' => '4'\n ],\n \t]);\n }",
"public function make_multianswer_question_fourmc() {\n question_bank::load_question_definition_classes('multianswer');\n $q = new qtype_multianswer_question();\n test_question_maker::initialise_a_question($q);\n $q->name = 'Multianswer four multi-choice';\n $q->questiontext = '<p>Match the following cities with the correct state:</p>\n <ul>\n <li>San Francisco: {#1}</li>\n <li>Tucson: {#2}</li>\n <li>Los Angeles: {#3}</li>\n <li>Phoenix: {#4}</li>\n </ul>';\n $q->questiontextformat = FORMAT_HTML;\n $q->generalfeedback = '';\n $q->qtype = question_bank::get_qtype('multianswer');\n\n $q->textfragments = array('<p>Match the following cities with the correct state:</p>\n <ul>\n <li>San Francisco: ', '</li>\n <li>Tucson: ', '</li>\n <li>Los Angeles: ', '</li>\n <li>Phoenix: ', '</li>\n </ul>');\n $q->places = array('1' => '1', '2' => '2', '3' => '3', '4' => '4');\n\n $subqdata = array(\n 1 => array('qt' => '{1:MULTICHOICE:=California#OK~Arizona#Wrong}', 'California' => 'OK', 'Arizona' => 'Wrong'),\n 2 => array('qt' => '{1:MULTICHOICE:%0%California#Wrong~=Arizona#OK}', 'California' => 'Wrong', 'Arizona' => 'OK'),\n 3 => array('qt' => '{1:MULTICHOICE:=California#OK~Arizona#Wrong}', 'California' => 'OK', 'Arizona' => 'Wrong'),\n 4 => array('qt' => '{1:MULTICHOICE:%0%California#Wrong~=Arizona#OK}', 'California' => 'Wrong', 'Arizona' => 'OK'),\n );\n foreach ($subqdata as $i => $data) {\n // Multiple-choice subquestion.\n question_bank::load_question_definition_classes('multichoice');\n $mc = new qtype_multichoice_single_question();\n test_question_maker::initialise_a_question($mc);\n $mc->name = 'Multianswer four multi-choice';\n $mc->questiontext = $data['qt'];\n $mc->questiontextformat = FORMAT_HTML;\n $mc->generalfeedback = '';\n $mc->generalfeedbackformat = FORMAT_HTML;\n\n $mc->shuffleanswers = 0; // TODO this is a cheat to make the unit tests easier to write.\n // In reality, multianswer questions always shuffle.\n $mc->answernumbering = 'none';\n $mc->layout = qtype_multichoice_base::LAYOUT_DROPDOWN;\n\n $mc->answers = array(\n 10 * $i => new question_answer(13, 'California', (float) ($data['California'] == 'OK'),\n $data['California'], FORMAT_HTML),\n 10 * $i + 1 => new question_answer(14, 'Arizona', (float) ($data['Arizona'] == 'OK'),\n $data['Arizona'], FORMAT_HTML),\n );\n $mc->qtype = question_bank::get_qtype('multichoice');\n $mc->maxmark = 1;\n\n $q->subquestions[$i] = $mc;\n }\n\n return $q;\n }",
"function ipal_create_genericq($courseid){\r\n global $DB;\r\n global $USER;\r\n global $COURSE;\r\n $contextid = $DB->get_record('context', array('instanceid'=>\"$courseid\",'contextlevel'=>'50'));\r\n $contextID = $contextid->id;\r\n $categories = $DB->get_records_menu('question_categories',array('contextid'=>\"$contextID\"));\r\n $categoryid = 0;\r\n foreach ($categories as $key => $value){\r\n if(preg_match(\"/Default\\ for/\",$value)){\r\n if(($value == \"Default for \".$COURSE->shortname) or ($categoryid == 0)){$categoryid = $key;}\r\n }\r\n }\r\n if(!($categoryid > 0)){\r\n echo \"\\n<br />Error obtaining categoryid\\n<br />\";\r\n return false;\r\n }\r\n $qmultichoicecheckid = $DB->count_records('question', array('category'=>\"$categoryid\",'name'=>'Generic multichoice question (1-8)'));\r\n $qessaycheckid = $DB->count_records('question', array('category'=>\"$categoryid\",'name'=>'Generic essay question'));\r\n if(($qmultichoicecheckid>0) and ($qessaycheckid > 0)){\r\n return true;\r\n }\r\n $hostname = 'unknownhost';\r\n if (!empty($_SERVER['HTTP_HOST'])) {\r\n $hostname = $_SERVER['HTTP_HOST'];\r\n } else if (!empty($_ENV['HTTP_HOST'])) {\r\n $hostname = $_ENV['HTTP_HOST'];\r\n } else if (!empty($_SERVER['SERVER_NAME'])) {\r\n $hostname = $_SERVER['SERVER_NAME'];\r\n } else if (!empty($_ENV['SERVER_NAME'])) {\r\n $hostname = $_ENV['SERVER_NAME'];\r\n }\r\n $date = gmdate(\"ymdHis\");\r\n $stamp = $hostname .'+'. $date .'+'.ipal_random_string(6);\r\n $version = $hostname .'+'. $date .'+'.ipal_random_string(6);\r\n $questionFieldArray=array('category','parent','name','questiontext','questiontextformat','generalfeedback','generalfeedbackformat','defaultgrade','penalty','qtype','length','stamp','version','hidden','timecreated','timemodified','createdby','modifiedby');\r\n $questionNotNullArray=array('name','questiontext','generalfeedback');\r\n\t$questioninsert = new stdClass();\r\n\t$date = gmdate(\"ymdHis\");\r\n\t$stamp = $hostname .'+'. $date .'+'.ipal_random_string(6);\r\n\t$version = $hostname .'+'. $date .'+'.ipal_random_string(6);\r\n\t$questioninsert -> category = $categoryid;\r\n\t$questioninsert -> parent = 0;\r\n\t$questioninsert ->questiontextformat = 1;\r\n\t$questioninsert ->generalfeedback = ' ';\r\n\t$questioninsert ->generalfeedbackformat = 1;\r\n\t$questioninsert ->defaultgrade = 1;\r\n\t$questioninsert ->penalty = 0;\r\n\t$questioninsert ->length = 1;\r\n\t$questioninsert->stamp = $stamp;\r\n\t$questioninsert->version = $version;\r\n\t$questioninsert ->hidden = 0;\r\n\t$questioninsert->timecreated = time();\r\n\t$questioninsert->timemodified = time();\r\n\t$questioninsert->createdby = $USER -> id;\r\n\t$questioninsert->modifiedby =$USER -> id;\r\n if ($qmultichoicecheckid == 0){\r\n \t$questioninsert ->name = 'Generic multichoice question (1-8)';//$title;\r\n \t$questioninsert ->questiontext = 'Please select an answer.';//.$text;\r\n \t$questioninsert ->qtype = 'multichoice';\r\n \t$lastinsertid = $DB->insert_record('question', $questioninsert);\r\n $answerFieldArray=array('answer','answerformat','fraction','feedback','feedbackformat');\r\n $answerNotNullArray =array('answer','feedback');\r\n if(!($lastinsertid > 0)){\r\n echo \"\\n<br />Error creating Generic multichoice question\\n<br />\";\r\n return false;\r\n }\r\n\t\tfor($n=1;$n<9;$n++){\r\n\t\t\t$answerInsert = new stdClass();\r\n\t\t\t$answerInsert->answer = $n;\r\n\t\t\t$answerInsert->question = $lastinsertid;\r\n\t\t\t$answerInsert ->format = 1;\r\n\t\t\t$answerInsert ->fraction = 1;\r\n\t\t\t$answerInsert ->feedback = ' ';\r\n\t\t\t$answerInsert ->feedbackformat = 1;\r\n\t\t\t$lastAnswerinsertid[$n] = $DB->insert_record('question_answers',$answerInsert);\r\n\t\t\tif(!($lastAnswerinsertid[$n] > 0)){\r\n\t\t\t\techo \"\\n<br />Error inserting answer $n for Generic multichoice question (1-8)\\n<br />\";\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$multichoiceFieldArray = array('question','layout','answers','single','shuffleanswers','correctfeedback','correctfeedbackformat','partiallycorrectfeedback','partiallycorrectfeedbackformat','incorrectfeedback','incorrectfeedbackformat','answernumbering');\r\n\t\t$multichoiceNotNullArray = array('correctfeedback','partiallycorrectfeedback','incorrectfeedback');\r\n\t\t$qtypeInsert = new stdClass();\r\n\t\t$qtypeInsert->answers = join(',',$lastAnswerinsertid);\r\n\t\t$qtypeInsert->single = 1;\r\n\t\t$qtypeInsert->correctfeedbackformat = 1;\r\n\t\t$qtypeInsert->partiallycorrectfeedbackformat = 1;\r\n\t\t$qtypeInsert->incorrectfeedbackformat = 1;\r\n\t\t$qtypeInsert->correctfeedback = ' ';\r\n\t\t$qtypeInsert->partiallycorrectfeedback = ' ';\r\n\t\t$qtypeInsert->incorrectfeedback = ' ';\r\n\t\t$qtypeInsert->answernumbering = '123';\r\n\t\t$qtypeInsert->question = $lastinsertid;\r\n\t\t$qtypeTable = 'question_'.$questioninsert->qtype;\r\n\t\t$qtypeInsert->shuffleanswers = '0';\r\n\t\t$qtypeinsertid = $DB->insert_record($qtypeTable, $qtypeInsert);\r\n\t}\r\n\tif ($qessaycheckid == 0){\r\n \t$questioninsert ->name = 'Generic essay question';//$title;\r\n \t$questioninsert ->questiontext = 'Please answer the question in the space provided.';//.$text;\r\n \t$questioninsert ->qtype = 'essay';\r\n \t$lastinsertid = $DB->insert_record('question', $questioninsert);\r\n\t\t$essayoptions = new stdClass;\r\n\t\t$essayoptions->questionid = $lastinsertid;\r\n\t\t$essayoptions->responsefieldlines = 3;\r\n\t\t$essayoptionsid = $DB->insert_record('qtype_essay_options',$essayoptions);\r\n }\r\n return true; \r\n}",
"public function randomQuote()\n {\n $quotes = [\n 'Complexity is your enemy. Any fool can make something complicated. It is hard to make something simple.#Richard Branson',\n 'It takes a lot of effort to make things look effortless.#Mark Pilgrim',\n 'Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.#Antoine de Saint-Exupéry',\n 'Everything should be made as simple as possible, but not simpler.#Albert Einstein',\n 'Three Rules of Work: Out of clutter find simplicity; From discord find harmony; In the middle of difficulty lies opportunity.#Albert Einstein',\n 'There is no greatness where there is not simplicity, goodness, and truth.#Leo Tolstoy',\n 'Think simple as my old master used to say - meaning reduce the whole of its parts into the simplest terms, getting back to first principles.#Frank Lloyd Wright',\n 'Simplicity is indeed often the sign of truth and a criterion of beauty.#Mahlon Hoagland',\n 'Simplicity and repose are the qualities that measure the true value of any work of art.#Frank Lloyd Wright',\n 'Nothing is true, but that which is simple.#Johann Wolfgang von Goethe',\n 'There is a simplicity that exists on the far side of complexity, and there is a communication of sentiment and attitude not to be discovered by careful exegesis of a text.#Patrick Buchanan',\n 'The simplest things are often the truest.#Richard Bach',\n \"If you can't explain it to a six year old, you don't understand it yourself.#Albert Einstein\",\n 'One day I will find the right words, and they will be simple.#Jack Kerouac',\n 'Simplicity is the ultimate sophistication.#Leonardo da Vinci',\n 'Our life is frittered away by detail. Simplify, simplify.#Henry David Thoreau',\n 'The simplest explanation is always the most likely.#Agatha Christie',\n 'Truth is ever to be found in the simplicity, and not in the multiplicity and confusion of things.#Isaac Newton',\n 'Simplicity is a great virtue but it requires hard work to achieve it and education to appreciate it. And to make matters worse: complexity sells better.#Edsger Wybe Dijkstra',\n \"Focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains.#Steve Jobs\",\n 'The ability to simplify means to eliminate the unnecessary so that the necessary may speak.#Hans Hofmann',\n \"I've learned to keep things simple. Look at your choices, pick the best one, then go to work with all your heart.#Pat Riley\",\n 'A little simplification would be the first step toward rational living, I think.#Eleanor Roosevelt',\n \"Making the simple complicated is commonplace; making the complicated simple, awesomely simple, that's creativity.#Charles Mingus\",\n 'Keep it simple, stupid.#Kelly Johnson',\n \"There's a big difference between making a simple product and making a product simple.#Des Traynor\",\n ];\n\n $randomquote = explode('#', $quotes[array_rand($quotes, 1)]);\n\n $quote = sprintf(\"“%s”\\n<cite>— %s</cite>\", $randomquote[0], $randomquote[1]);\n\n return $quote;\n }",
"public function run()\n {\n //answers for question1\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 1\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 1\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 1\n ]);\n //answers for question2\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 2\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 2\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 2\n ]);\n //answers for question3\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 3\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 3\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 3\n ]);\n //answers for question4\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 4\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 4\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 4\n ]);\n //answers for question5\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 5\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 5\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 5\n ]);\n //answers for question6\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 6\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 6\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 6\n ]);\n //answers for question7\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 7\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 7\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 7\n ]);\n //answers for question8\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 8\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 8\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 8\n ]);\n //answers for question9\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 9\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 9\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 9\n ]);\n //answers for question10\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 10\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 10\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 10\n ]);\n //answers for question11\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 11\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 11\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 11\n ]);\n //answers for question12\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 12\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 12\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 12\n ]);\n //answers for question13\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 13\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 13\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 13\n ]);\n //answers for question14\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 14\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 14\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 14\n ]);\n //answers for question15\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 15\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 15\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 15\n ]);\n //answers for question16\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 16\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 16\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 16\n ]);\n //answers for question17\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 17\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 17\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 17\n ]);\n //answers for question18\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 18\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 18\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 18\n ]);\n //answers for question19\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 19\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 19\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 19\n ]);\n //answers for question20\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 20\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 20\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 20\n ]);\n //answers for question21\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 21\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 21\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 21\n ]);\n //answers for question22\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 22\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 22\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 22\n ]);\n //answers for question23\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 23\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 23\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 23\n ]);\n //answers for question24\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 24\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 24\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 24\n ]);\n //answers for question25\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 25\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 25\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 25\n ]);\n //answers for question26\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 26\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 26\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 26\n ]);\n //answers for question27\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 27\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 27\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 27\n ]);\n }",
"private function question()\n\t{\n\t\t$this->qns['questionnaire']['questionnairecategories_id'] = $this->allinputs['questioncat'];\n\t\t$this->qns['questionnaire']['questionnairesubcategories_id'] = $this->allinputs['questionsubcat'];\n\t\t$this->qns['questionnaire']['label'] = $this->allinputs['question_label'];\n\n\n\t\t$this->qns['questionnaire']['question'] = $this->allinputs['question'];\n\t\t$this->qns['questionnaire']['has_sub_question'] = $this->allinputs['subquestion'];\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 )\n\t\t{\n\t\t\t$this->qns['answers']['answer_type'] = $this->allinputs['optiontype'];\n\t\t}\n\n\t\t$this->qns['questionnaire']['active'] = 1;\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 ){\n\t\t\t//This code must be skipped if sub_question is 1\n\t\t\t$optionCounter = 0;\n\t\t\tforeach ($this->allinputs as $key => $value) {\n\n\t\t\t\tif( str_is('option_*', $key) ){\n\t\t\t\t\t$optionCounter++;\n\t\t\t\t\t$this->qns['answers'][$optionCounter] = ( $this->qns['answers']['answer_type'] == 'opentext' ) ? 'Offered answer text' : $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function run()\n {\n $fakerQuestion= factory(App\\Question::class)->make([\n 'description' => 'How do you find our service ?'\n ]);\n $fakerQuestion->save();\n\n // $rates=[Quiz::STATUS_GOOD, Quiz::STATUS_FAIR, Quiz::STATUS_NEUTRAL, Quiz::STATUS_BAD];\n\n factory(App\\Quiz::class, 4)->make(['question_id' => $fakerQuestion->first()->id])->each(\n function ($quiz ,$index) {\n $quiz->rate = ++$index;\n $quiz->save();\n });\n }",
"public function run(Faker\\Generator $faker)\n\t{\n\t\t$userJSON = File::get(storage_path('data/choices.json'));\n\t\t$datas = json_decode($userJSON);\n\n\t\tfor ($i = 0; $i < 10; $i++)\n\t\t{\n\t\t\t$date = $faker->dateTimeBetween('-1 year');\n\t\t\t$question = App\\Question::create([\n\t\t\t\t'title'\t\t\t=> 'Exo-'.$i,\n\t\t\t\t'content'\t\t=> $faker->realText(50),\n\t\t\t\t'class_level'\t=> array_rand(['first_class' => '0', 'final_class' => '0']),\n\t\t\t\t'published'\t\t=> 1,\n\t\t\t\t'created_at' \t=> $date\n\t\t\t]);\n\n\t\t\tfor ($j=0; $j < rand(3,7); $j++) { \n\t\t\t\t$choice = array_rand($datas);\n\t\t\t\tApp\\Choice::create([\n\t\t\t\t\t'question_id' \t=> $question->id,\n\t\t\t\t\t'content' \t\t=> $datas[$choice]->content,\n\t\t\t\t\t'answer' \t\t=> $datas[$choice]->answer,\n\t\t\t\t\t'created_at' \t=> $date\n\t\t\t\t]);\n\t\t\t}\n\n\t\t\t$students = App\\User::select('id')->where('level', $question->class_level)->get();\n\t\t\tif (count($students) > 0) \n\t\t\t{\n\t\t\t\tforeach ($students as $student)\n\t\t\t\t{ \n\t\t\t\t\t# Insère les données de score pour chaque étudiant\n\t\t\t\t\tApp\\Score::create([\n\t\t\t\t\t\t'user_id' => $student->id,\n\t\t\t\t\t\t'question_id' => $question->id,\n\t\t\t\t\t\t'done' => false,\n\t\t\t\t\t\t'created_at' => $date\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function howAre() {\n return $this->randomItem(\n \"Super, thanks for asking.\",\n 'Pretty good.',\n 'Just fine.',\n 'Never better.',\n 'Great!'\n );\n }",
"public function testCreateSurveyQuestion0()\n {\n }",
"public function testCreateSurveyQuestion0()\n {\n }",
"public function repeat($question = '')\n {\n $conversation = $this->bot->getStoredConversation();\n\n if (! $question instanceof Question && ! $question) {\n $question = unserialize($conversation['question']);\n }\n\n $next = $conversation['next'];\n $additionalParameters = unserialize($conversation['additionalParameters']);\n\n if (is_string($next)) {\n $next = unserialize($next)->getClosure();\n } elseif (is_array($next)) {\n $next = Collection::make($next)->map(function ($callback) {\n if ($this->bot->getDriver()->serializesCallbacks() && ! $this->bot->runsOnSocket()) {\n $callback['callback'] = unserialize($callback['callback'])->getClosure();\n }\n\n return $callback;\n })->toArray();\n }\n $this->ask($question, $next, $additionalParameters);\n }",
"public function getRandom() {\n\t\t$quote = $this->get('random', array('limit'=>1));\n\t\treturn $quote[0];\n\t}",
"private function chooseQuestionToAnswer() : void\n {\n $questionId = $this->console->choice(__('Please select question to answer:'), $this->options);\n $this->handleAnswer($questionId ? array_search($questionId, $this->options) : null);\n }",
"public function run()\n {\n //\n DB::table('quests')->delete();\n $faker = Faker\\Factory::create();\n for($i=0;$i<25;$i++){\n \t$quest = new Quest;\n \t$quest->name = $faker->sentence();\n \t$quest->creator = $faker->name;\n \t$quest->apply_start_at = $faker->date;\n \t$quest->apply_end_at = $faker->date;\n \t$quest->execute_start_at = $faker->date;\n \t$quest->execute_end_at = $faker->date;\n \t$quest->place = $faker->country;\n \t$quest->description = $faker->realText;\n \t$quest->salary = $faker->numberBetween(100,1000);\n \t$quest->salary_type = $faker->numberBetween(0,2);\n \t$quest->point = $faker->numberBetween(10,100);\n \t$quest->verification = $faker->boolean;\n \t$quest->people_require = $faker->numberBetween(10,100);\n \t$quest->max_apply_people = $faker->numberBetween(10,100);\n \t$quest->now_apply_people = 0;\n \t$quest->actual_accepted_people = 0;\n \t$quest->actual_completed_people = 0;\n \t$quest->other_description = $faker->realText;\n \t$quest->status = $faker->numberBetween(0,3);\n \t$quest->save();\n }\n\n }",
"public function getQuestions()\n {\n return DB::table('questionbank_quizzes')\n ->where('quize_id','=',$this->id)\n ->orderBy('subject_id')\n ->get();\n }",
"function newSeq7($num, $post = false)\n{\n\n $hp = new Http();\n\n\n for ($t_num = 0; $t_num < $num; $t_num++) {\n $a0 = intval(rand(-8, 8));\n while ($a0 == 0) {\n $a0 = intval(rand(-8, 8));\n }\n\n $b = $a0 > 0 ? intval(rand(-50, -30))\n : intval(rand(1, 60));\n\n\n $p = intval(rand(1, 2));\n\n $m = intval(rand(1, 2));\n\n $a = [$a0];\n\n for ($i = 1; $i <= 3; $i++) {\n $a[] = pow($a[$i - 1], $p) + $b;\n }\n\n $title = '';\n //An = (An-1)^p + B\n for ($i = 0; $i < 3; $i++) {//miss 7\n if ($i == 0) {\n $title = \"$a[$i]\";\n continue;\n }\n// 填中间\n// if ($i == $m) {\n// $title = $title . \",?\";\n// continue;\n// }\n\n $title = $title . \",$a[$i]\";\n\n }\n\n// 填末尾\n $title = $title . \",?\";\n $res = $a[3];\n// An = (An-1)^p + B 填中间\n// $res = $a[$m];\n\n $ar = [$res, $res + intval(rand(-5, -3)), $res + intval(rand(-2, -1)), $res + intval(rand(1, 4))];\n shuffle($ar);\n $optionAr = [\n 'a' => $ar[0],\n 'b' => $ar[1],\n 'c' => $ar[2],\n 'd' => $ar[3],\n ];\n //find correct answer\n for ($i = 0; $i < 4; $i++) {\n if ($ar[$i] == $res) {\n break;\n }\n }\n\n $ks = ['a', 'b', 'c', 'd'];\n $answers = [$ks[$i]];\n $language = 'en';\n $classification = 'sequence';\n $pro_type = 'exclusive choice';\n $pro_source = 'new-test-seq';\n\n //An = (An-1)^p + B\n\n $hint = \"A[n]=A[n-1]^$p\";\n\n if ($b > 0) {\n $hint = $hint . \"+$b\";\n } else {\n $hint = $hint . \"$b\";\n }\n\n\n $problem_info = compact('title', 'optionAr', 'answers', 'language', 'classification', 'pro_type', 'pro_source', 'hint');\n\n echo $t_num;\n echo PHP_EOL;\n echo json_encode($problem_info);//insert\n echo PHP_EOL;\n\n if ($post) {\n $hp->post('http://exp.szer.me/parry/testlib/problem', $problem_info, false);\n } else {\n echo \"no post\";\n echo PHP_EOL;\n }\n }\n unset($a);\n curl_close($hp->ch);\n\n\n}",
"public function run()\n {\n $questions = [];\n for ($i = 0; $i < 27; $i++) { \n $question = [\n 'name' => Str::random(10),\n 'order' => $i % 3 + 1,\n 'chapter_id' => floor($i / 3) + 1\n ];\n array_push($questions, $question);\n }\n DB::table('questions')->insert($questions);\n }"
] | [
"0.71189064",
"0.6902919",
"0.68481266",
"0.6843635",
"0.6796101",
"0.67782533",
"0.6649818",
"0.66162694",
"0.656714",
"0.6566387",
"0.65618706",
"0.6390598",
"0.63462085",
"0.62936205",
"0.62838244",
"0.6251915",
"0.62392616",
"0.6157968",
"0.6123096",
"0.6100483",
"0.6096736",
"0.60851777",
"0.60680896",
"0.6034646",
"0.601713",
"0.60169744",
"0.6012343",
"0.6006373",
"0.5984228",
"0.59790105",
"0.5954847",
"0.59374076",
"0.5936577",
"0.589128",
"0.58437073",
"0.5842568",
"0.58370024",
"0.58313775",
"0.58186865",
"0.5807636",
"0.5807636",
"0.57899666",
"0.5776974",
"0.575045",
"0.5732863",
"0.57148916",
"0.5708996",
"0.5708897",
"0.56865925",
"0.568571",
"0.5680856",
"0.5678279",
"0.56646574",
"0.5636373",
"0.5607802",
"0.55929077",
"0.5567606",
"0.5556323",
"0.5549457",
"0.5536455",
"0.55289",
"0.5508566",
"0.55025655",
"0.54950553",
"0.5491027",
"0.5481198",
"0.5467414",
"0.54552335",
"0.54532635",
"0.5449776",
"0.5447794",
"0.5436222",
"0.5430803",
"0.54251194",
"0.5380085",
"0.5379107",
"0.53722006",
"0.5364176",
"0.5362201",
"0.53485334",
"0.53479844",
"0.5347713",
"0.5342764",
"0.53400797",
"0.5336904",
"0.53353554",
"0.5332781",
"0.5332192",
"0.5312813",
"0.53096724",
"0.5302956",
"0.52879167",
"0.52879167",
"0.52853644",
"0.5284966",
"0.528303",
"0.5277855",
"0.5267426",
"0.5267062",
"0.5261729"
] | 0.71238166 | 0 |
Lazily append the next iterator to the chain | private function lazyAppend()
{
if (!parent::valid() and $this->iterators->valid()) {
$this->append($this->iterators->current());
$this->iterators->next();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function next()\n {\n do {\n $this->iterated->attach($this->current());\n parent::next();\n } while ($this->valid() && (!$this->passes($this->current()) || $this->iterated->contains($this->current())));\n }",
"public function addNext($next) {}",
"public function next(): void {\n next($this->items);\n }",
"public function next()\n {\n next($this->iterator_data);\n }",
"private function next()\n {\n $clone = clone $this;\n $clone->offset++;\n return $clone;\n }",
"public function next()\n {\n next($this->_items);\n }",
"#[\\ReturnTypeWillChange]\n public function next()\n {\n $this->index++;\n return next($this->items);\n }",
"public function next()\n {\n next($this->entities);\n }",
"public function next ()\n {\n if ( isset($this->iterator) && $this->offset == $this->internalOffset ) {\n $this->internalOffset++;\n $this->iterator->next();\n $this->storeNext();\n }\n\n $this->offset++;\n }",
"public function next()\n {\n $data = $this->dataStore->query($this->getQuery());\n foreach ($data as $datum) {\n $this->current = $datum;\n yield;\n }\n }",
"public function next()\n\t\t{\n\t\t\tnext($this->source);\n\t\t}",
"public function next()\n {\n echo __METHOD__,PHP_EOL;\n next($this->a);\n }",
"public function next() {\n next($this->data);\n }",
"public function next() {\n next($this->data);\n }",
"public function next() {\n next($this->elements);\n $this->pointer++;\n }",
"public function next()\r\n {\r\n next($this->children);\r\n }",
"public function next()\n {\n next($this->data);\n }",
"public function next()\n {\n next($this->data);\n }",
"public function next()\n {\n next($this->data);\n }",
"public function next() {\n\t\tnext($this->_data);\n\t}",
"public function next()\n {\n if ($this->skipNextIteration) {\n $this->skipNextIteration = false;\n return;\n }\n\n next($this->data);\n }",
"public function next()\n {\n if ($this->skipNextIteration) {\n $this->skipNextIteration = false;\n return;\n }\n\n next($this->data);\n }",
"public function next(){\n return next($this->items);\n }",
"public function next(){\n return next($this->items);\n }",
"#[\\ReturnTypeWillChange]\n public function next()\n {\n return next($this->_items);\n }",
"public function next() {\n return next($this->_path);\n }",
"public function next()\n {\n next($this->_object);\n }",
"public function next(): void\n {\n next($this->data);\n }",
"public function next()\n {\n next($this->array);\n }",
"public function next(): void\n {\n if ($this->_skipNextIteration) {\n $this->_skipNextIteration = false;\n return;\n }\n next($this->_data);\n $this->_index++;\n }",
"public function next()\n {\n $current = $this->current();\n\n if ($current) {\n $this->current = $current->getAfter();\n }\n }",
"public function next()\n {\n\t\tnext($this->_data);\n $this->_index++;\n\t}",
"public function next()\n {\n ++$this->iterator;\n }",
"public function next()\r\n {\r\n if ($this->index < $this->aggregate->size()) {\r\n $this->index = $this->index+1;\r\n }\r\n }",
"public function next()\n {\n next($this->requests);\n }",
"public function next(): void\n {\n next($this->array);\n }",
"public function next()\n {\n next($this->values);\n }",
"public function next()\n {\n if ($this->_skipNextIteration) {\n $this->_skipNextIteration = false;\n return;\n }\n next($this->_data);\n $this->_index++;\n }",
"public function next() {\r\n return next($this->collection);\r\n }",
"public function next()\n {\n $this->current = ($result = ldap_next_entry($this->handle, $this->current())) ? $result : null;\n }",
"public function next() {}",
"public function next() {}",
"public function next() {}",
"public function next() {}",
"public function next() {}",
"public function next() {}",
"public function next() {}",
"public function next() {}",
"public function next()\n {\n $method = $this->getMethodForNext();\n call_user_func([$this->result, $method]);\n }",
"public function next()\n {\n $this->iteratorIndex++;\n return next($this->elements);\n }",
"public function next()\n\t{\n\t\t$this->current = $this->runFetch();\n\n\t\tif ($this->current) {\n\t\t\t$this->index++;\n\t\t}\n\t}",
"public function next(): void\n {\n $this->position++;\n if (null === $this->generator || !$this->generator->valid()) {\n return;\n }\n\n if (contains_key($this->entries, $this->position + 1)) {\n return;\n }\n\n $this->progress();\n $this->saved = false;\n if ($this->generator) {\n $this->generator->next();\n }\n\n $this->progress();\n }",
"function next() {\n # Returns the next item in the sequence or NULL if no more items.\n return NULL;\n }",
"public function setNext($next) {}",
"public function next()\n {\n return next($this->data);\n }",
"public function next()\n {\n return next($this->data);\n }",
"public function next() {\n ++$this->iteratorPosition;\n }",
"public function next() {\n\t\t\t$this->index++;\n\t\t\treturn $this;\n\t\t}",
"public function next()\n {\n $this->iteratorPosition++;\n }",
"public function next()\n {\n next($this->revs);\n }",
"public function next()\n {\n $this->pointer++;\n }",
"public function next()\r\n\t{\r\n\t}",
"public function next()\n\t{\n\t\t$this->_idx++;\n\t}",
"public function next()\n {\n // If the current element is the last element, return null\n if ($this->current === ($this->count() - 1)) {\n $this->current = null;\n\n return;\n }\n\n // If the next element is greater than the result count, and this is the last page, return null\n if (($this->current + 1) > count($this->results) && (($this->page + 1) > $this->pages)) {\n $this->current = null;\n\n return;\n }\n\n // Advance to the next page\n $this->request->getQuery()->set(\"page\", ++$this->page);\n\n // Retrieve the next page\n $response = $this->request->send()->json();\n\n // Append the results to the results array\n $this->results = array_merge($this->results, $response[\"results\"]);\n\n // Advance to the next element\n $this->current++;\n\n return;\n }",
"public function next(): mixed;",
"public function next()\n {\n ++$this->offset;\n }",
"public function chain() {\n\t\t\treturn $this->chain;\n\t\t}",
"public function next()\n {\n next($this->drivers);\n }",
"public function next() {\n return $this->_next($this->parent->children(), func_get_args());\n }",
"public function next()\n {\n next($this->zipModel->getEntries());\n }",
"public function next();",
"public function next();",
"public function next();",
"public function next();",
"public function next()\n {\n do {\n ++$this->pointer;\n } while ($this->valid() && !$this->current()->isEnabled());\n }",
"function next() {\n $this->position++;\n }",
"public function next() {\n\t\t++$this->_position;\n\t\treturn $this;\n\t}",
"public function next() {\n\t\t$this->position ++;\n\t}",
"public function next() {\n $this->elementsObtained++;\n $lastElement = $this->current();\n try {\n // DEBUG: Comment In\n //if ($this->elementsObtained > 5 && $this->first)\n // throw new MongoDB\\Driver\\Exception\\RuntimeException(\"cursor id exception simulation\");\n // DEBUG: Comment In\n // We just try to get the next element\n $this->iterator->next();\n } catch (MongoDB\\Driver\\Exception\\RuntimeException $e) {\n if (strpos($e->getMessage(), \"cursor id\") !== FALSE) {\n // cursor id not found exception, let's mitigate\n $options = array();\n // no skip; we already skipped everything in the first iterator\n // limit if we have a limit; we adjust it with the elements obtained\n if ($this->originalLimit !== NULL)\n $options[\"limit\"] = $this->originalLimit - $this->elementsObtained;\n // sort we keep\n if ($this->originalSort !== NULL)\n $options[\"sort\"] = $this->originalSort;\n // Adjust the query so we start after the last obtained element\n $query = $this->queryAfterElement($this->query, $lastElement, $this->originalSort);\n // DEBUG: Comment In\n //var_dump($query);\n // DEBUG: Comment In\n $this->iterator = new IteratorIterator($this->collection->find($query, $options));\n $this->iterator->rewind();\n // We don't call next on the new iterator because it already \"has\" the first element\n // not first anymore\n $this->first = FALSE;\n } else {\n // something else; let's throw this right back at the caller\n throw $e;\n }\n }\n }",
"public function next() {\n $current = current($this->futures);\n\n if ($current && $current instanceof Future && !$current->isResolved()) {\n throw new \\LogicException(sprintf(\n 'Cannot advance FutureStream at index %d; Future value still pending',\n $this->position\n ));\n } else {\n array_shift($this->futures);\n }\n\n $this->position++;\n }",
"public function next()\n {\n return next($this->steps);\n }",
"#[\\ReturnTypeWillChange]\n public function next()\n {\n }",
"#[\\ReturnTypeWillChange]\n public function next()\n {\n }",
"public function next(): void\n {\n if (count($this->data) > 0) {\n array_shift($this->data);\n }\n ++$this->position;\n\n if ($this->position > $this->numberOfRecords()) {\n return;\n }\n\n if (count($this->data) == 0) {\n $this->fetchMore();\n }\n }",
"public function next()\n {\n return next($this->_elements);\n }",
"public function next()\n {\n $newPrevious = $this->_current;\n $this->_current += $this->_previous;\n $this->_previous = $newPrevious;\n $this->_key++;\n }",
"public function next()\n\t{\n\t\t$this->__position++;\n\t}",
"public function next(): void;",
"public function next(): void;",
"public function next()\n {\n $this->index++;\n }",
"public function next() {\n $this->_key++;\n }",
"public function next() {\n ++ $this->_position;\n }",
"public function next()\n {\n $this->currentElement = $this->readNextElement();\n $this->atStart = FALSE;\n }",
"public function next()\n\t{\n\n //Move to the next element\n $this->datasource->next();\n\n //Process the transformers\n if($this->valid())\n {\n $this->transformedData = $this->transform($this->datasource->current(), $this->datasource->key());\n }\n\n\t}",
"public function next()\n {\n $this->position++;\n }",
"public function next()\n {\n $this->position++;\n }",
"public function next(){\n\t\treturn (is_array($this->data) ? next($this->data) : null);\n\t}",
"public function next() {\n\t\t++$this->position;\n\t}",
"public function next(): void\n {\n if ($this->_data instanceof \\Iterator) {\n $this->_data->next();\n } elseif (is_array($this->_data)) {\n next($this->_data);\n }\n }",
"public function next()\n\t{\n\t\t$this->databaseResult->next();\n\t}"
] | [
"0.6881747",
"0.6595135",
"0.6353351",
"0.63301194",
"0.6285945",
"0.6239726",
"0.6239441",
"0.62301123",
"0.61991644",
"0.6193487",
"0.6192673",
"0.61845446",
"0.6175125",
"0.6175125",
"0.6174535",
"0.6172818",
"0.61664975",
"0.61664975",
"0.61664975",
"0.6149026",
"0.61323357",
"0.61323357",
"0.6111734",
"0.6111734",
"0.60898155",
"0.6044128",
"0.6037182",
"0.5992083",
"0.59819293",
"0.5976674",
"0.5965577",
"0.59407014",
"0.59325933",
"0.59316003",
"0.59309876",
"0.59259695",
"0.5912454",
"0.5904431",
"0.5902275",
"0.586459",
"0.5861176",
"0.5861176",
"0.5861176",
"0.5861176",
"0.5861176",
"0.5861176",
"0.5861176",
"0.5861176",
"0.5840479",
"0.5838764",
"0.58318895",
"0.5824341",
"0.578392",
"0.5782696",
"0.57778823",
"0.57778823",
"0.57767594",
"0.5773727",
"0.5769672",
"0.5768424",
"0.5756001",
"0.57492805",
"0.5730526",
"0.57230854",
"0.57018167",
"0.5700154",
"0.5695654",
"0.56912434",
"0.5682619",
"0.5681294",
"0.56731635",
"0.56731635",
"0.56731635",
"0.56731635",
"0.5672897",
"0.5667157",
"0.5666738",
"0.5657132",
"0.5652048",
"0.56209785",
"0.56150603",
"0.56066406",
"0.56066126",
"0.55987877",
"0.55968153",
"0.55876803",
"0.557688",
"0.5574212",
"0.5574212",
"0.55652833",
"0.5557567",
"0.55532473",
"0.55528826",
"0.5547223",
"0.55464137",
"0.55464137",
"0.5546124",
"0.55398893",
"0.5538986",
"0.553838"
] | 0.66689026 | 1 |
Turn this item object into a generic array. | public function transform(Json $json)
{
return [
// attributes
// links
'links' => [
[
'rel' => 'self',
'href' => url('path/to/resource'),
],
]
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function convertItemArray() {}",
"public function toArray(): array\n {\n return (array) $this->items;\n }",
"public function toArray(): array {\n return $this->items;\n }",
"abstract protected function toArray();",
"public function getItemsAsArray()\n {\n $map = function ($item) {\n return $item->toArray();\n };\n return array_map($map, $this['ITEMS']);\n }",
"public function toArray(): array\n {\n return $this->items;\n }",
"public function toArray(): array\n {\n return $this->items;\n }",
"public function toArray()\n {\n $items = array();\n $results = $this->get()->items;\n \n if (!$results) {\n return array();\n }\n\n foreach($results as $key => $item) {\n $items[$key] = $this->isAok($item) ? $item->toArray() : $item;\n }\n\n return (array)$items;\n }",
"public function toArray(){\n return $this->items;\n }",
"public function toArray()\n {\n $itemArray = [];\n foreach ($this->storage as $item) {\n $itemArray[] = $item;\n }\n return [\n 'uid' => $this->getIdentifier(),\n 'title' => $this->getTitle(),\n 'description' => $this->getDescription(),\n 'table_name' => $this->getItemTableName(),\n 'items' => $itemArray\n ];\n }",
"function asArray(){\n\t\t\t$array = $this->toArray( $this );\n\t\t\treturn $array;\n\t\t}",
"abstract public function toArray();",
"abstract public function toArray();",
"abstract public function toArray();",
"abstract public function toArray();",
"abstract public function toArray();",
"public function asArray() {\n return $this->items;\n }",
"public function toArray()\n {\n return array_map(function ($value) {\n return method_exists($value, 'toArray') ? $value->toArray() : $value;\n }, $this->items);\n }",
"public function toArray()\n {\n return $this->cast('array');\n }",
"public function getItemsArray();",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray(): array\n {\n return $this->items->toArray();\n }",
"public function asArray()\n {\n return $this->items();\n }",
"public function toArray() {\n return $this->_items;\n }",
"public function toArray()\n {\n return array_map(\n function ($value) {\n return $value instanceof Entity ? $value->toArray() : $value;\n\n }, $this->items\n );\n }",
"public function toArray()\n {\n return $this->items;\n }",
"public function toArray()\n {\n return $this->items;\n }",
"public function toArray()\n {\n return $this->items;\n }",
"public function toArray() {\n return (array)$this;\n }",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function toArray()\n\t{\n\t\treturn $this->items;\n\t}",
"public function toArray()\n\t{\n\t\treturn $this->items;\n\t}",
"public function getItemArray()\n {\n return $this->itemArray;\n }",
"public function & toArray()\n\t{\n\t\t$x = new ArrayObject($this->data);\n\t\treturn $x;\n\t}",
"public function toArray()\n {\n $_data = array();\n \n foreach ($this->_data as $key=>$val) {\n $_data[$key] = method_exists($val, 'toArray') ? $val->toArray() : $val;\n }\n \n return $_data;\n }",
"abstract public function to_array();",
"public function toArray()\n {\n return array_map(function ($item)\n {\n return $item instanceof ArrayableInterface ? $item->toArray() : $item;\n\n }, $this->items);\n }",
"public function toArray()\n {\n return [\n 'id' => $this->items->first()->getKey(), //eventually change ow this works\n 'ids' => $this->items->pluck('id'),\n 'grocery_list_id' => $this->items->first()->grocery_list_id,\n 'department' => $this->department(),\n 'department_id' => $this->departmentId(),\n 'quantity' => $this->quantity(),\n 'description' => $this->description(),\n 'implicitQty' => $this->hasImplicitQuantity(),\n ];\n }",
"public abstract function toArray(): array;",
"public function toArray()\n {\n return [\n 'id' => $this->getRowId(),\n 'data' => $this->item\n ];\n }",
"public function toArray(): array\n {\n return $this->items->map(function ($item) {\n return $item->toArray();\n })->toArray();\n }",
"public function toArray(){\n $this->buildArray();\n return $this->array;\n }",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();"
] | [
"0.8222962",
"0.7355696",
"0.72963935",
"0.7260664",
"0.72510386",
"0.7125021",
"0.7125021",
"0.7091092",
"0.7072855",
"0.70697504",
"0.7044394",
"0.7040254",
"0.7040254",
"0.7040254",
"0.7040254",
"0.7040254",
"0.70248485",
"0.6975698",
"0.6969919",
"0.6957207",
"0.6947865",
"0.6947865",
"0.6946619",
"0.6946619",
"0.6946619",
"0.6946619",
"0.6946618",
"0.6946618",
"0.6946618",
"0.6946618",
"0.6946618",
"0.6946618",
"0.6946618",
"0.6946618",
"0.6946618",
"0.6946618",
"0.694004",
"0.69370085",
"0.69359565",
"0.6923519",
"0.6890982",
"0.6890982",
"0.6890982",
"0.6882442",
"0.6869836",
"0.6869836",
"0.6869836",
"0.6869836",
"0.6869836",
"0.6869836",
"0.68576914",
"0.68576914",
"0.6851791",
"0.6848194",
"0.68400586",
"0.68352926",
"0.6823493",
"0.68184525",
"0.6808396",
"0.68034875",
"0.67979056",
"0.67897785",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313",
"0.67844313"
] | 0.0 | -1 |
Lists all Posts models. | public function actionIndex()
{
$searchModel = new PostsSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'posts' => $dataProvider->getModels(),
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function allPosts()\n {\n return Post::all();\n }",
"public function index()\n {\n return Posts::all();\n }",
"public function index() {\n $this->posts = Post::all();\n }",
"public function index()\n {\n $posts = $this->postService->getAll();\n\n return $posts;\n }",
"public function index()\n {\n return Post::all();\n }",
"public function index()\n {\n return Post::all();\n }",
"public function index()\n {\n return Post::all();\n\n }",
"public function index()\n {\n $posts = Post::all();\n\n return $this->showAll($posts);\n }",
"public function index()\n {\n $posts = Post::get();\n\n return view('posts.list', compact('posts'));\n }",
"public function index()\n {\n $posts = Post::all();\n return $this->showAll($posts);\n }",
"public function actionIndex()\n {\n\n $searchModel = new PostSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->pagination->pageSize=10;\n $dataProvider->setSort([\n 'defaultOrder' => ['post_id'=>SORT_DESC],]);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function listPosts()\n {\n $PostsRepository = new PostsRepository();\n $posts = $PostsRepository->getAllPosts();\n require 'src/View/postListView.php';\n }",
"public function getAllPost()\n {\n return Post::get();\n }",
"public function actionList() {\n $models = Post::model()->findAll();\n $rows = array();\n foreach($models as $model) \n $rows[] = $model->attributes;\n\t\t$data_response = array(\n\t\t\t'error'=> array('status'=>200, 'message'=>''),\n\t\t\t'datas'=>$rows\n\t\t);\n $this->response($data_response);\n }",
"public function index()\n {\n $posts = $this->post->all();\n\n return view('posts.index',compact('posts'));\n }",
"public function showAllPosts()\n {\n $posts = \\Blog\\Models\\Posts::find();\n $dataPosts = [];\n foreach ($posts as $post) {\n $dataPosts[] = [\n 'id' => $post->getPostId(),\n 'date' => $post->getDate(),\n 'category' => $post->getCategory(),\n 'user_id' => $post->getUserId(),\n 'title' => $post->getTitle(),\n 'status' => $post->getStatus(),\n ];\n }\n return $dataPosts;\n }",
"public function index()\n {\n $posts = $this->postRepository->getAll();\n dd($posts);\n return view('posts.index', compact('posts'));\n }",
"public function index()\n {\n $post = Post::all();\n return PostsCollection::make($post);\n }",
"public function all(){\n\t\t$posts = $this->repository->all();\n SEOMeta::setTitle(\"Blog\");\n SEOMeta::setDescription(\"Blog público com as opiniões de diversos alunos e professores da plataforma\");\n\n\t\treturn view('posts.all', ['posts' => $posts]);\n }",
"public function index()\n {\n return app(Post::class)->select('id', 'title', 'content')->get();\n }",
"public function index()\n {\n //\n $posts = \\App\\Models\\Post::all();\n\n return view('allposts',['posts' => $posts]);\n }",
"public function get_posts()\n {\n $this->Friend_model->get_posts_model();\n }",
"public function index()\n\t{\n\t\treturn view('posts.index')->withPosts($this->post->all());\n\t}",
"public function index()\n {\n return view('admin.posts.index')->with('posts', Post::all());\n }",
"public function index()\n {\n $posts = Post::all();\n return view('admin.listpost', compact('posts'));\n }",
"public function index()\n {\n $posts = Post::all();\n\n return view('admin.posts.index', compact('posts'));\n }",
"public function index()\n {\n $posts = new Post;\n $postsList = $posts->paginate(5);\n return view('posts.posts-list')->with(['posts' => $postsList]);\n }",
"public function index()\n {\n $post = Post::all();\n return view('post.list-post', compact('post'));\n }",
"public function index()\n {\n $posts = Post::paginate(10);\n\n return view('admin.post.index', compact('posts'));\n }",
"public function AllPost()\n {\n $posts = DB::select('select * from posts where status=\"posted\"');\n return view ('home', ['posts' => $posts]);\n }",
"public function index()\n {\n $posts = Post::all();\n\n return view('admin.posts.index', ['posts' => $posts]);\n }",
"public function index()\n {\n $post = Post::paginate(5);\n return postresource::collection($post);\n }",
"public function index()\n {\n $posts = Post::with(['user', 'category', 'tags', 'comments'])->paginate(10);\n\n return view('admin.posts.index', compact('posts'));\n }",
"public function indexAction()\n {\n $limit = \\App\\Config::getConfig('pagination_frontend');\n $page = $this->routeParams['page'];\n $posts = $this->postModel->getAll(true, $limit, $page);\n foreach ($posts as $post) {\n $tagIds = $this->postModel->getPostTagIds($post->id);\n $post->tags = $this->tagModel->getAllBy('id', $tagIds);\n }\n $totalRows = $this->postModel->countBy(['is_active' => 1]);\n $paginator = $this->paginator->init($totalRows, $limit, $page, $this->routeParams);\n View::renderTemplate('Cms::frontend/post/index.html', [\n 'posts' => $posts,\n 'paginator' => $paginator\n ]);\n }",
"public function index()\n {\n $posts = Post::all();\n return view('admin.posts.index', ['posts'=>$posts]);\n }",
"public function index()\n {\n $posts = Post::all();\n\n return view('posts.index', compact('posts'));\n }",
"public function index()\n {\n $posts = Post::paginate(10);\n return view(\"posts.index\", compact(\"posts\"));\n }",
"public function index()\n {\n $posts = Post::paginate(10);\n return view(\"posts.index\", compact(\"posts\"));\n }",
"public function index()\n {\n\n return view('posts.index', ['post'=>$this->postService->getAll()]);\n\n }",
"public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Posts::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index()\n {\n return view('admin.posts.list');\n }",
"public function index()\n {\n $posts = Post::all();\n\n\n return view('posts', compact('posts'));\n }",
"public function index()\n {\n $posts = $this->post->orderBy('id', 'desc')->findAll();\n return view('posts/index', compact('posts'));\n }",
"public function indexAction()\n {\n $currentPage = $this->params()->fromQuery('page', 1);\n $selectQuery = $this->em->getRepository(Post::class)->findAllPosts();\n $paginator = $this->paginatorFilter->filter($selectQuery);\n $paginator->setCurrentPageNumber($currentPage);\n\n return new ViewModel(['posts' => $paginator]);\n }",
"public function index() {\n\t\t$posts = Post::all();\n\n\t\treturn view('posts.index', compact('posts'));\n\t}",
"public function index()\n {\n return $this->post->all();\n }",
"public function index() {\n $data = $this->Post->find('all');\n $this->set('data', $data);\n }",
"public function index()\n {\n $posts = $this->postRepository->getAll();\n\n return view('post.index', compact('posts'));\n }",
"public function index()\n {\n $records = Post::paginate(20);\n\n return view('posts.index', compact('records'));\n }",
"public static function view()\n\t{\n\t\t$posts = Post::all();\n return $posts;\n\t}",
"public function index()\n {\n $posts = Post::with('author', 'category', 'tags', 'comments')\n ->where('published', 1)->latest()->paginate(10);\n\n return view('posts.index')->withPosts($posts);\n }",
"public function indexAction()\n {\n $posts = PostService::readAll();\n\n View::renderTemplate('Posts/index.html', [\n 'posts' => $posts\n ]);\n }",
"public function getAll()\n\t{\n\t\treturn Post::find('all', array('order' => 'date desc'));\n\t}",
"public function index()\n {\n $posts = Post::all();\n\n return view('post.index', compact('posts'));\n }",
"public function index()\n {\n $posts = Post::all();\n\n return view('posts.index', ['posts' => $posts]);\n }",
"public function indexAction()\n {\n $arr = Post::getAll();\n View::renderTemplate('Post/index.html', [\n 'data' => $arr\n ]);\n }",
"public function index()\n {\n $post = Posts::paginate(10);\n return view('admin.post.index', compact('post'));\n }",
"public function index()\n {\n $posts = Post::all();\n\n return view('admin.post.index', compact('posts'));\n }",
"public function index()\n {\n \n $posts = Post::orderBy('created_at', 'desc')->paginate(10);\n \n\n return $posts;\n }",
"public function index()\n {\n $posts = Post::with(['category', 'tags'])->orderBy('id', 'desc')->paginate(10);\n return view('admin.post.index', compact('posts'));\n }",
"public function index()\n\t{\n\t\t$post = $this->repository->all();\n\n\t\treturn View::make('posts.index')->with('posts', $post);\n\t}",
"public function index()\n {\n $data = ['posts' => Post::all()];\n\n return view('admin.posts.index', $data);\n }",
"public function index()\n {\n $post = Post::all();\n\n return view('admin.posts.index', compact('post'));\n }",
"public function actionIndex()\n {\n $searchModel = new PostSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->sort->defaultOrder = ['DateCreated' => SORT_DESC];\n $dataProvider->pagination->pageSize = 15;\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index()\n {\n $posts = Post::all();\n return view('posts.index', compact('posts'));\n \n }",
"public function actionList()\r\n {\r\n $this->_userAutehntication();\r\n switch($_GET['model'])\r\n {\r\n case 'posts': \r\n $models = Post::model()->findAll();\r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Error: Mode <b>list</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n if(is_null($models)) {\r\n $this->_sendResponse(200, sprintf('No Post found for model <b>%s</b>', $_GET['model']) );\r\n } else {\r\n $rows = array();\r\n foreach($models as $model)\r\n $rows[] = $model->attributes;\r\n\r\n $this->_sendResponse(200, CJSON::encode($rows));\r\n }\r\n }",
"public function index()\n {\n //\n $posts = Posts::all();\n\n return response($posts);\n }",
"public function getListPost() {\n\n $postsModel = new Posts();\n $posts = $postsModel->getListPost();\n $this->data['posts'] = $posts;\n\n return view('admin.post_list', $this->data);\n }",
"public function listPosts()\n {\n $query = $this->getPostsQuery();\n\n $this->handlePostFilters($query);\n\n $this->handleOrder($query);\n\n $posts = $query->paginate($this->resultsPerPage, $this->currentPage);\n\n $this->setPostUrls($posts);\n\n $this->posts = $posts;\n }",
"public function index()\n {\n $posts = post::all();\n return view('article.posts.show', compact('posts'));\n }",
"public function index()\n {\n $posts = Post::all();\n return view('post', compact('posts'));\n }",
"public function index()\n {\n $posts = Post::all();\n return view('admin.post.index',compact('posts'));\n }",
"public function index()\n {\n $posts = Post::all();\n return view('admin.post.index',compact('posts'));\n }",
"public function index()\n {\n $posts = Posts::all();\n return response($posts, 200);\n }",
"public function index()\n {\n $posts = Post::with(['comments', 'category'])->get();\n return view('post.index', compact('posts'));\n }",
"public function index()\n {\n return view('manage.posts.index')->withPosts(\n Post::orderBy('id','desc')->paginate(5)\n );\n }",
"public function index()\n {\n $posts = Posts::all();\n return view('post.index-post')->with('posts', $posts);\n }",
"public function index()\n\t{\n\t\t$posts = Posts::all();\n\n\t\treturn view('posts.index', compact('posts',$posts));\n\t}",
"public function actionIndex()\n {\n $searchModel = new SearchPost();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $status = Helpers::getStatus();\n $post_types = ArrayHelper::map(PostType::find()\n ->where(['status' => Yii::$app->params['active']])\n ->all(), 'id', 'name');\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n 'searchModel' => $searchModel,\n 'status' => $status,\n 'post_types' => $post_types,\n ]);\n }",
"public function index()\n\t{\n $posts = Post::all();\n\t\treturn view('posts.index',compact('posts'));\n\t}",
"public function index()\n { \n $posts = Post::all();\n\n return view('admin.post.index', compact('posts'));\n }",
"public function index()\n {\n\n $posts = Post::latest()\n ->paginate(20);\n\n return PostResource::collection($posts);\n }",
"public function index()\n {\n $posts = Post::all();\n return view('admin.post.index', compact('posts'));\n }",
"public function index()\n {\n $posts = Post::paginate(15);\n return $posts;\n }",
"public function index()\n {\n $posts = Post::all();\n return view('post.index', compact('posts'));\n }",
"public function index()\n {\n $posts = Post::all();\n return view('post.index', compact('posts'));\n }",
"public function PostList()\n {\n return view('post_list');\n }",
"public function index()\n {\n $posts = Post::all();\n return view(\"posts.index\")->with(\"posts\", $posts);\n }",
"public function index()\n {\n $posts = Post::orderBy('created_at', 'desc')->get();\n\n return view('posts.index', compact('posts'));\n }",
"public function index()\n {\n $posts = Posts::paginate(10);\n // dd($posts);\n return view('admin.posts.index',compact('posts'));\n }",
"public function index()\n {\n $posts = Post::all();\n\n $data = [\n 'posts' => $posts\n ];\n\n return view('admin.posts.index', $data);\n }",
"public function index()\n {\n $posts = Post::all();\n\n $data = [\n 'posts' => $posts\n ];\n\n return view('admin.posts.index', $data);\n }",
"public function index()\n {\n $posts = Posts::where('deleted_at','=',null)->orderBy('created_at', 'desc')->with('tags')->paginate(10);\n\n return view('admin.posts.post.index',compact('posts'));\n }",
"public function index()\n {\n // El método index debería devolver todo el listado de categorias\n\n $posts = Post::included()\n ->filter()\n ->sort()\n ->getOrPaginate();\n\n return PostResource::collection($posts);\n }",
"public function index() {\n $this->data['posts'] = $this->blog_model->get_many_by(['status' => 1]);\n\n $this->template->build('public/blog/index', $this->data);\n }",
"public function index()\n {\n $posts = Post::latest()->published()->paginate(10);\n return view('posts.index', compact('posts'));\n }",
"public function index()\n {\n\n $posts = Post::latest()->get();\n\n return view('admin.posts.index')->with('posts', $posts);\n// $posts->dump();\n }",
"public function index()\n {\n $posts = Post::simplePaginate(10);\n return(view('posts.index',['posts' => $posts]));\n }",
"public function index()\n {\n $posts = Post::all();\n return view('admin/posts/index' , ['posts'=>$posts]);\n }",
"public function findAllPosts()\n {\n $this->db->query('SELECT * FROM posts ORDER BY created_at ASC');\n $results = $this->db->resultSet();\n return $results;\n }"
] | [
"0.7699751",
"0.7604968",
"0.75467175",
"0.7515651",
"0.74726605",
"0.74726605",
"0.7348359",
"0.7311991",
"0.7240301",
"0.72272587",
"0.7202374",
"0.71859545",
"0.7182898",
"0.7147028",
"0.71326244",
"0.7114842",
"0.70953864",
"0.70888335",
"0.70710516",
"0.70704514",
"0.706146",
"0.7046999",
"0.70035875",
"0.6985725",
"0.697239",
"0.697132",
"0.69647264",
"0.6946628",
"0.6945794",
"0.69443166",
"0.6925732",
"0.69207346",
"0.69161457",
"0.6915111",
"0.69101167",
"0.6898529",
"0.6896661",
"0.6896661",
"0.68957883",
"0.689441",
"0.68931276",
"0.68905807",
"0.6885649",
"0.6877429",
"0.68773353",
"0.6870813",
"0.68695205",
"0.6867982",
"0.6867455",
"0.6865685",
"0.68643445",
"0.6861091",
"0.6840284",
"0.68366104",
"0.68365407",
"0.6836458",
"0.68360555",
"0.6829377",
"0.68284523",
"0.68261546",
"0.6821369",
"0.6820026",
"0.6818771",
"0.6809505",
"0.68082476",
"0.68059456",
"0.68015313",
"0.67974347",
"0.6784023",
"0.67839736",
"0.6783645",
"0.67790735",
"0.67790735",
"0.67776376",
"0.67735994",
"0.67725927",
"0.6771255",
"0.6767414",
"0.67623633",
"0.6759546",
"0.6758574",
"0.67536145",
"0.6753198",
"0.675157",
"0.6751047",
"0.6751047",
"0.67493576",
"0.6740675",
"0.67381716",
"0.67304075",
"0.672467",
"0.672467",
"0.67228156",
"0.6720118",
"0.6718662",
"0.6718535",
"0.67110723",
"0.6710631",
"0.6710366",
"0.6709974"
] | 0.7575858 | 2 |
Displays a single Posts model. | public function actionView($id)
{
$postCommentsModel = new PostComments();
return $this->render('view', [
'post' => $this->findModel($id),
'postCommentsModel' => $postCommentsModel
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(){\n\t $allPosts = [];\n\t $model = new postsModel;\n\t $allPosts = $model->findAll();\n\n $view = new blogView(compact('allPosts'));\n $view->render();\n\t}",
"public function show(Posts $posts)\n {\n //\n }",
"public function show(Posts $posts)\n {\n //\n }",
"public function show(Post $post)\n {\n// POST::create(['body'=>$body, 'title'=>'test', 'excerpt'=>'test']);\n\n // route/model binding. it automatically maps to the matching ppost model entry\n return view('post.index', [\n 'post' => $post // auto mapped without having to do a find::() etc. uses id by default.\n ]);\n//})->where('post', '[A-z_\\-]+');\n }",
"public function show(Post $posts)\n {\n //\n }",
"public function show($id)\n\t{\n $post = $this->repository->find($id);\n\n return View::make('posts.show')->with('post', $post);\n\t\t//return View::make('posts.show')->with('users', $this->repository->getMostPopular());\n\t}",
"public function show($id) {\n return view('posts.post', ['post' => Post::find($id)]);\n }",
"public function show(Post $post){\n \treturn view('singlePost')->with('post', $post);\n }",
"public function show( Post $post )\n {\n //\n }",
"public function show($id)\n\t{\n\t\t$post = Post::find($id);\n if(!$post) {\n Session::flash('errorMessage', \"Post with id of $id is not found\");\n App::abort(404);\n }\n Log::info(\"post of id $id found\");\n return View::make('posts.show')->with(array('post' => $post));\n\t}",
"function show(){\n return view(\"admin.post.list\") ;\n }",
"protected function viewPostById()\n {\n $post = $this->posts->postById($_GET['id']);\n $comments = $this->comments->commentsById($_GET['id']);\n $this->render('postById', compact('post', 'comments'));\n }",
"public function show(Post $post)\n {\n \n }",
"public function show(Post $post)\n {\n //\n }",
"public function show(Post $post)\n {\n //\n }",
"public function show(Post $post)\n {\n //\n }",
"public function show(Post $post)\n {\n //\n }",
"public function show(Post $post)\n {\n //\n }",
"public function show(Post $post)\n {\n //\n }",
"public function show(Post $post)\n {\n //\n }",
"public function show(Post $post)\n {\n //\n }",
"public function show(Post $post)\n {\n //\n }",
"public function show(Post $post)\n {\n //\n }",
"public function show(Post $post)\n {\n //\n }",
"public function show(Post $post)\n {\n //\n }",
"public function show(Post $post)\n {\n //\n }",
"public function show(Post $post)\n {\n //\n }",
"public function show(Post $post)\n {\n //\n }",
"public function show(Post $post)\n {\n //\n }",
"public function show(Post $post)\n {\n //\n }",
"public function show() {\n // without an id we just redirect to the error page as we need the post id to find it in the database\n if (!isset($_GET['id']))\n return call('pages', 'error');\n\n // we use the given id to get the right post\n $post = Post::find($_GET['id']);\n require_once('view/posts/show.php');\n\n }",
"public function show($id)\n {\n $post = post::find($id);\n \n\n return view('posts.show',compact('post'));\n }",
"public function show($id)\n\t{\n $post = $this->post->find($id);\n\n\t\treturn view('posts.show')->withPost($post);\n\n\n\t}",
"public function show($id)\n {\n $post = $this->postRepository->find($id);\n\n if (empty($post)) {\n Flash::error(__('messages.not_found', ['model' => __('models/posts.singular')]));\n\n return redirect(route('posts.index'));\n }\n\n return view('posts.show')->with(['post'=> $post, 'postComments' => $post->postComments]);\n }",
"public function show($id)\n {\n $post = Post::FindOrFail($id);\n\n return view('page.post',compact('post'));\n }",
"public function show($id)\n\t{\n\t\t\n\n\t\t$post = Post::find($id);\n\t\tif(!$post) {\n\t\t\tApp::abort(404);\n\t\t}\n\n\t\treturn View::make('posts.show')->with('post', $post);\n\n\t\t//\n\t\t// return 'The show method is called by /posts/{post} with {posts} being the single variable of the post in question. Show shows a specific post!';\n\n\n\t}",
"public function show($id = null)\n {\n $post = $this->post->find($id);\n if ($post) {\n return view('posts/show', compact('post'));\n } else {\n return redirect()->to('/posts');\n }\n }",
"public function show($id)\n\t{\n\t\t$post = Post::find($id);\n\t\treturn view('posts.show')->with('post', $post);\n\t}",
"public function show(Post $post)\n {\n // qui non ho bisogno di importare category perchè viene specificata la relazione sui modelli\n return view('admin.posts.show', compact('post'));\n }",
"public function show($id)\n {\n $post = Post::published()->findOrFail($id);\n return view('posts.show', compact('post'));\n }",
"public function show($id)\n {\n $Post = Post::findOrFail($id);\n\n return view('admin.posts.show', compact(\"Post\"));\n }",
"public function show_post($id)\n\t{\n\t\trequire_once(MODELS . '/Post.php');\n\t\t$model = new Post();\n\t\t$post = $model->get_post($id);\n\t\treturn_view('view.post.php' , $post);\n\t}",
"public function show($id)\n {\n $post = Post::find($id);\n return view('post_show', compact('post'));\n }",
"public function show($id)\n {\n $data = $this->post->find($id, [\n 'user',\n 'categories',\n 'comments',\n 'rates'\n ]);\n // return view('admin.post.index', compact($data));\n }",
"public function show($id)\n {\n $data = array(\n 'post' => Posts::find($id)\n );\n return view('admin.posts.show')->with($data);\n }",
"public function show($id)\n {\n // Vai no Model buscar o registo de acordo com criterio\n $post = Post::where(\"id\", \"=\", $id)->first();\n\n // Manda o objeto para a View para renderizar para o utilizador\n return view(\"post.show\", [\"post\" => $post]);\n }",
"public function index()\n\t{\n\t\t$post = $this->repository->all();\n\n\t\treturn View::make('posts.index')->with('posts', $post);\n\t}",
"public function show($id)\n {\n $post = Post::find($id);\n\n if (!is_null($post)) {\n return view('LaravelDashboard::post_show', compact('post'));\n }\n }",
"public function show($id)\n\t{\n\t\t$post = Post::find($id);\n\t\treturn View::make('posts.show')->with('post', $post);\n\t}",
"public function show($id)\n {\n $post = $this->postService->getById($id);\n return view('member::posts.fiombonana.show',compact('post'));\n }",
"public function show($id)\n { $post=new Posts();\n return view('admin_panel.blog.details',['post'=>$post->find($id)]);\n }",
"public function show($id)\n {\n //\n $post = \\App\\Models\\Post::find($id);\n\n return view('post',['post' => $post]);\n }",
"public function show($id)\n {\n \n $post= Post::find($id);//get all ids in the db\n return view('posts.show')->with('post', $post);\n }",
"public function show(Post $post)\n {\n\n\n return view('posts.show', ['post' => $post]);\n }",
"public function show($id)\n {\n $current = Post::find($id);\n return view('allposts.post')->with('current',$current);\n }",
"public function show($id)\n {\n $post = $this->postRepository->find($id);\n dd($post);\n\n return view('posts.show', compact('post'));\n }",
"public function show(Post $post): View\n {\n //\n }",
"public function show($id)\n {\n $post = $this->post->find($id);\n\n return view('post.show',compact('post'));\n }",
"public function show($id)\n {\n $post = Post::findOrFail($id);\n\n return view('admin/post.posts.show', compact('post'));\n }",
"public function show($id)\n {\n $post = Post::findOrFail($id);\n\n $this->notificationService->setPostNotificationsIsRead($id);\n\n return view('pages.post.index', compact('post'));\n }",
"public function show($id)\n {\n //\n $post = Post::find($id);\n $this->notFound($post);\n return view('admin.post.show')->with('post',$post);\n }",
"public function show($id)\n {\n $posts = Post::find($id);\n return view('posts.show')->with('posts',$posts);\n }",
"public function show($id)\n {\n //\n\t\t$post= Post::find($id); \n\t\treturn view('posts.show')->with('post',$post);\n }",
"public function show($id)\n {\n $post = Post::find($id);\n return view('posts.show',compact('post'));\n }",
"public function show($id)\n {\n $post = Post::find($id); //Find a post by a value\n //$post = Post::where('title', 'Post 2')->get(); //Find a post by an attribute\n //$post = DB::select('SELECT * FROM posts'); //use SQL query\n\n return view('posts.show')->with('post', $post);\n }",
"public function show(Post $post) {\n\n /*$post = Posts::with('author', 'category')->find($id);*/\n\n return view('posts.singlePost', compact('post'));\n }",
"public function show($id)\n {\n $post = $this->post->get($id);\n $this->authorize('update', $post);\n return view('posts.show', [\n 'post' => $post\n ]);\n }",
"public function show($id)\n\t{\n\t\t$post = Post::findOrFail($id);\n\n\t\treturn View::make('posts.show', compact('post'));\n\t}",
"public function show($id)\n {\n $post = Post::findOrFail($id);\n return view('backend.posts.show', [\n 'title' => trans('main.show') .' ' . trans('main.post') . ' : ' . $post->title,\n 'show' => $post,\n ]);\n }",
"public function show($id)\n {\n //\n $post = Post::findOrFail($id);\n return view('posts.show', compact('post'));\n }",
"public function show(Posts $posts)\n {\n return view('articles.postDetails',['posts'=>$posts]);\n }",
"public function show($id)\n {\n $post=Post::find($id);\n return view('admin-panel.post-show',compact('post'));\n }",
"public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('RudakBlogBundle:Post')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Post entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('RudakBlogBundle:Post:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function show($id)\n {\n $post = Post::find($id);\n return view('posts.show')->with('post',$post);\n }",
"public function show($id)\n {\n $post = blog_post::findOrFail($id);\n return view('post.show', compact('post','post'));\n }",
"public function show($id)\n\t{\n\t\t$posts=Post::find($id);\n\n\t\treturn View::make(\"admin.show\", ['posts'=>$posts]);\n\t}",
"public function show($id)\n {\n $post = Post::find($id);\n\n return view('posts.show')->withPost($post);\n }",
"public function show($id)\n {\n $post = Post::find($id);\n return view('posts.show', compact('post'));\n }",
"public function show($id)\n {\n $post = Post::findOrFail($id);\n return view(\"posts.show\", compact('post'));\n }",
"public function show($id)\n {\n return view('manage.posts.show')->withPost(\n Post::findOrFail($id)\n );\n }",
"public function show(post $post)\n {\n //\n }",
"public function show(post $post)\n {\n //\n }",
"public function show($id)\n {\n return Posts::find($id);\n }",
"public function show($id)\n {\n $post = Post::findOrFail($id);\n return view('posts.show', ['post' => $post]);\n }",
"public function show($id)\n {\n //show a single post\n \n $post = Post::Find($id);\n $categories = Category::all();\n $tags = Tag::all();\n $team = Team::all();\n $users = User::all()->where('type','default')->count();\n\t return view('admin.posts.single')->withPost($post)->withTags($tags)->withUsers($users)->withCategories($categories)->withTeam($team);\n }",
"public function show($id)\n {\n $post= Post::find($id);\n return view('posts.show',compact('post'));\n }",
"public function show($id)\n {\n\n if (!\\auth()->user()->ability('admin', 'display_posts')) {\n return redirect('admin/index');\n }\n $post = Post::with(['media', 'category', 'user', 'comments'])->whereId($id)->wherePostType('post')->first();\n return view('backend.posts.show', compact('post'));\n }",
"public function show($id)\n {\n $post = Post::find($id);\n return view('posts.show')->with(compact('post'));\n }",
"public function show(Post $postModel, $id) {\n $posts = $postModel->ShowPost($id);\n if(!$posts->count()){\n abort(404);\n }\n return view('post.show', ['posts' => $posts]);\n }",
"public function show($id)\n {\n if (!\\auth()->user()->ability('admin', 'display_posts')) {\n return redirect('admin/index');\n }\n $post = Post::with(['media', 'user', 'category', 'comments'])->whereId($id)->wherePostType('post')->first();\n return view('backend.posts.show', compact('post'));\n }",
"public function show($id)\n {\n $this->middleware('auth');\n $post = Post::find($id);\n $post->load('user');\n return view('post.show' , compact('post'));\n }",
"public function show($id)\n {\n $post = Post::findOrFail($id);\n return view('post.show_post')->with('post', $post);\n }",
"public function show($id)\n\t{\n\t\treturn Post::find($id);\n\t}",
"public function show($id)\n {\n $post = BlogPost::find($id);\n\n return view('posts.show', ['post' => $post]);\n }",
"public function show($id)\n { \n // return single post, assign to variable\n $post = Post::find($id);\n\n // returns template and passes variable to the template\n return view ('posts.show')->with('post', $post);\n }",
"public function show($id)\n {\n $post = Post::find($id);\n\n if($post) {\n return view('admin.posts.show', compact('post'));\n } else {\n return abort('404');\n }\n }",
"public function show($id)\n {\n $post = BlogPost::find($id);\n return view('post.show', ['post' => $post]);\n }",
"public function show($id)\n {\n $post = Post::find($id);\n\n \n return view('posts.show')->withPost($post);\n \n }",
"public function index()\n {\n $posts = $this->post->all();\n\n return view('posts.index',compact('posts'));\n }",
"public function actionView($id)\n\t{\n Yii::app()->createController('Post');\n $this->render('view',array(\n 'model'=>$this->loadModel($id),\n 'dataProvider'=>PostController::selectPosts($id),\n ));\n/*\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));*/\n\t}",
"public function show($id)\n {\n $singlepost = Post::find($id);\n return view('posts.show',compact('singlepost'));//)->with('singlepost',$singlepost);\n }"
] | [
"0.8150391",
"0.77420413",
"0.77420413",
"0.7736321",
"0.7679842",
"0.7665538",
"0.7659337",
"0.76523393",
"0.76206124",
"0.76152897",
"0.76051635",
"0.7599846",
"0.7586195",
"0.75855076",
"0.75855076",
"0.75855076",
"0.75855076",
"0.75855076",
"0.75855076",
"0.75855076",
"0.75855076",
"0.75855076",
"0.75855076",
"0.75855076",
"0.75855076",
"0.75855076",
"0.75855076",
"0.75855076",
"0.75855076",
"0.75855076",
"0.7583611",
"0.7561343",
"0.7541924",
"0.7541433",
"0.75122565",
"0.75099593",
"0.75080717",
"0.75012195",
"0.7497469",
"0.7494382",
"0.74861556",
"0.746103",
"0.7454449",
"0.745185",
"0.74461704",
"0.7438177",
"0.7436956",
"0.74365234",
"0.74328226",
"0.74304765",
"0.742972",
"0.7428641",
"0.7427478",
"0.7420707",
"0.74176234",
"0.741107",
"0.74073124",
"0.74029535",
"0.7401348",
"0.74009305",
"0.73978436",
"0.7396874",
"0.7396531",
"0.7396378",
"0.7385342",
"0.7381166",
"0.7378237",
"0.7373258",
"0.73708826",
"0.7369659",
"0.73669666",
"0.7364038",
"0.736027",
"0.73589426",
"0.7355379",
"0.7354184",
"0.73539567",
"0.7350259",
"0.73494756",
"0.7349184",
"0.73468953",
"0.73468953",
"0.7344519",
"0.73429275",
"0.7342843",
"0.7337643",
"0.733448",
"0.73335844",
"0.7332791",
"0.73321134",
"0.7331756",
"0.7330075",
"0.73292196",
"0.7324323",
"0.73223853",
"0.7314633",
"0.7312982",
"0.7310591",
"0.72996086",
"0.7292841",
"0.7285532"
] | 0.0 | -1 |
Finds the Posts model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown. | protected function findModel($id)
{
if (($model = Posts::findOne($id)) !== null) {
return $model;
}
throw new NotFoundHttpException('The requested page does not exist.');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function findModel($id)\n {\n if (($model = PostKey::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function find(int $post_id);",
"protected function findModel($id)\n {\n if (($model = Post::findOne($id)) !== null)\n {\n return $model;\n }\n else\n {\n throw new NotFoundHttpException('Запрашиваемая страница не существует.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = Posts::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel($id) {\n $post = Post::model()->findByPk($id);\n if ($post === null)\n throw new CHttpException(404, Yii::t('default', 'notExistWeb'));\n return $post;\n }",
"protected function findModel($id)\n {\n if (($model = Post ::findOne($id)) !== null) {\n return $model;\n }\n \n throw new NotFoundHttpException('请求的页面不存在', 404);\n }",
"protected function findModel($id)\n {\n if (($model = CoachPosts::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel($id)\n\t{\n\t\t$model=Post::model()->findByPk((int)$id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t\n\t\t$model=Post::model()->findByPk($id);\n\t\tif ($model===null) {\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $model;\n\t}",
"protected function findModel($id)\n {\n if (($model = CmsPosts::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public abstract function find($primary_key, $model);",
"protected function findModel($id)\n {\n if (($model = Post::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = Post::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = Post::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = Post::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public static function find( $primaryKey )\n\t{\n\t\tself::init();\n\t\t\n\t\t// Select one item by primary key in Database\n\t\t$result = Database::selectOne(\"SELECT * FROM `\" . static::$table . \"` WHERE `\" . static::$primaryKey . \"` = ?\", $primaryKey);\t\t\n\t\tif( $result == null )\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Create & return new object of Model\n\t\treturn self::newItem($result);\n\t}",
"public function loadModel($id)\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t{\n\t\t\t\tif(Yii::app()->user->isGuest)\n\t\t\t\t\t$condition='status='.Post::STATUS_PUBLISHED.' OR status='.Post::STATUS_ARCHIVED;\n\t\t\t\telse\n\t\t\t\t\t$condition='';\n\t\t\t\t$this->_model=Post::model()->findByPk($_GET['id'], $condition);\n\t\t\t}\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}",
"protected function findModel($id)\n {\n if (($model = Post::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id)\n {\n if (($model = Post::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"public function loadModel($id)\n\t{\n\t\t$model=MentorPost::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"protected function findModel($id)\n {\n if (($model = Post::findOne(['PostID'=>$id])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel($id)\n\t{\n\t\t$model=Posting::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"protected function findModel($id)\r\n {\r\n if (($model = Post::findOne(['id' => $id, 'active' => 1])) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException(\"Object not found: $id\");\r\n }\r\n }",
"protected function findModel($id)\n {\n if (($model = PostAd::findOne($id)) !== null) {\n return $model;\n }\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }",
"public function loadModel()\n {\n if ($this->_model === null) {\n if (isset($_GET['id'])) {\n if (Yii::app()->user->isGuest)\n //$condition='status='.Post::STATUS_PUBLISHED.' OR status='.Post::STATUS_ARCHIVED;\n $condition = '';\n else\n $condition = '';\n $this->_model = Object::model()->with(array('author','files'))->findByPk($_GET['id']);\n }\n if ($this->_model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n }\n return $this->_model;\n }",
"private function findModel($key)\n {\n if (null === $key) {\n throw new BadRequestHttpException('Key parameter is not defined in findModel method.');\n }\n\n $modelObject = $this->getNewModel();\n\n if (!method_exists($modelObject, 'findOne')) {\n $class = (new\\ReflectionClass($modelObject));\n throw new UnknownMethodException('Method findOne does not exists in ' . $class->getNamespaceName() . '\\\\' .\n $class->getShortName().' class.');\n }\n\n $result = call_user_func([\n $modelObject,\n 'findOne',\n ], $key);\n\n if ($result !== null) {\n return $result;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"public function show($pk)\n {\n return $this->model->findOrFail($pk);\n }",
"public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}",
"protected function findModel($id)\n {\n if (($model = Post::find()->with('tags')->where(['id' => $id])->one()) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"public function find($id){\n return $this->model->query()->findOrFail($id);\n }",
"public function find(int $id): ?Model;",
"public function find(int $id): ?Model;",
"protected function findModel($id)\n {\n if (($model = PostsCategory::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel($id) {\n $model = Blog::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"public function getById(int $id): ?Post;",
"public function loadModel($id) {\n $model = Blog::model()->findByPk($id);\n if ($model === null) {\n throw new CHttpException(404, 'The requested page does not exist.');\n }\n return $model;\n }",
"protected function findModel($id)\n {\n\t\t$p = $this->primaryModel;\n if (($model = $p::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id, $url_text=null)\n {\n $model = ($url_text === null) ? \n Post::findOne($id) : Post::findOne(['url_text' => $url_text]);\n \n if ($model === null)\n throw new NotFoundHttpException('The requested page does not exist.');\n \n return $model;\n }",
"function find($id)\n{\n\t$model = $this->newModel(null);\n\treturn $model->find($id);\n}",
"public function find($id)\n\t{\n\t\treturn $this->model->where(\"id\", \"=\", $id)->first();\n\t}",
"protected function findModel($id) {\n\n\n if (($model = page::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function findById() {\n // TODO: Implement findById() method.\n }",
"protected function findModel($id)\n\t{\n\t\tif (($model = Trailer::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Entry::model()->with('entryAnswers')->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function find($pk)\r\n {\r\n $row = $this->getTable()->find($pk);\r\n if(!$row){\r\n return false;\r\n }\r\n $sampleModel = new SampleModel();\r\n $this->_map($sampleModel, $row);\r\n return $sampleModel;\r\n }",
"public static function find($slug)\n {\n return static::all()->firstWhere('slug', $slug);\n\n\n // if (!file_exists($path = resource_path(\"/posts/{$slug}.html\"))) {\n // throw new ModelNotFoundException();\n // }\n\n // return cache()->remember(\"posts.{$slug}\", 1200, fn () => file_get_contents($path));\n\n }",
"public function show($id)\n {\n return Post::findOrfail($id);\n }",
"public function find($id)\n\t{\n\t\treturn Model::where('id', $id)->first();\n\t}",
"public function findModel($id)\n {\n if (($model = Page::findOne($id)) !== null) \n {\n return $model;\n } \n else \n {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function find($id)\n {\n return $this->model->findOrFail($id);\n }",
"public function find($id)\n {\n return $this->model->findOrFail($id);\n }",
"public function find($id = null) {\n $argument = $id?? $this->request->fetch('id')?? null;\n return $this->model->find($argument);\n }",
"public function getArticle($id)\n{\n if (\n ($model = Article::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested post does not exist.');\n }\n}",
"protected function findModel($id)\n {\n if (($model = PaidEmployment::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404);\n }\n }",
"protected function findModel($key)\n {\n if (($model = NotificationsTemplate::find()->andWhere(['key'=>$key])->one()) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = Picture::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, \\Yii::t('The requested object does not exist or has been already deleted.'));\n }\n }",
"public function findOne(array $where) {\n\t\tif ($postId = $this->extractPostId($where)) {\n\t\t\treturn Post::forgeObject(get_post($postId));\n\t\t}\n\t\t$posts = get_posts($where);\n\t\treturn empty($posts) ? null : Post::forgeObject(reset($posts));\n\t}",
"protected function findModel($id)\n {\n if (($model = Offer::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = Template::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function find($model, $id);",
"public function loadModel($id)\n {\n if (($model = Reviews::model()->findByPk($id)) === null) {\n throw new CHttpException(\n 404,\n Yii::t($this->aliasModule, 'Requested page was not found!')\n );\n }\n \n return $model;\n }",
"protected function findModel($id)\n {\n if (($model = postComment::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel($id) {\n $model = Pago::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"public static function findModel($id='')\n {\n $model = static::find()->where(['id' => $id])->one();\n if ($model == null) {\n throw new \\yii\\web\\NotFoundHttpException(Yii::t('app',\"Page not found!\"));\n }\n return $model;\n }",
"protected function findModel($id)\n {\n if (($model = Content::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id, $del_status = '0') {\n $class = get_class($this->getPrimaryModel());\n if (($model = $class::findOne(['id' => $id])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = Page::findOne($id)) !== null)\n {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"public function find(int $id)\n {\n return $this->model->findOrFail($id);\n }",
"public static function getOne($id)\n\t{\n\t\t$db = DBConnection::getConnection();\n\t\t$query = \"SELECT * FROM POSTS WHERE id = ?\";\n\n\t\t$stmt = $db->prepare($query);\n\n\t\t$stmt->execute([$id]);\n\n\t\tif($fila = $stmt->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$post = new Posts;\n\t\t\t$post->loadDataFromRow($fila);\n\t\t\treturn $post;\n\t\t} else {\n\t\t\tthrow new Exception(\"El post que estas buscando no existe.\");\n\t\t}\n\t}",
"public function find($primary)\n {\n if (isset($this->models[$primary])) {\n return $this->models[$primary];\n }\n\n return;\n }",
"public function loadModel($id)\n {\n $model = IdeaHeap::model()->findByPk($id);\n\n if ($model === null)\n throw new CHttpException(404);\n return $model;\n }",
"protected function findModel($id)\n {\n if (($model = Page::findOne(['content_id'=>$id])) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }",
"protected function findModel($id)\n\t\t{\n\t\t\tif (($model = PhoneRecord::findOne($id)) !== null) {\n\t\t\t\treturn $model;\n\t\t\t}\n\t\t\t\n\t\t\tthrow new NotFoundHttpException(Yii::t('app', 'Запрашиваемая страница не существует.'));\n\t\t}",
"protected function findModel($id) {\n\t\tif (($model = Menu::findOne ( $id )) !== null) {\n\t\t\treturn $model;\n\t\t}\n\t\t\n\t\tthrow new NotFoundHttpException ( 'The requested page does not exist.' );\n\t}",
"protected function findModel($id)\n\t{\n\t\tif (($model = Route::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t}\n\t}",
"public function find($id);",
"public function find($id);",
"public function find($id);",
"public function find($id);",
"public function find($id);",
"public function find($id);",
"public function find($id);",
"public function find($id);",
"public function find($id);",
"public function find($id);",
"public function find($id);",
"public function find($id);",
"public function find($id);",
"public function find($id);",
"public function find($id);",
"public function find($id);",
"public function find($id);",
"public function find($id);",
"public function find($id);",
"public function find($id);",
"public function find($id);",
"public function find($id);",
"public function find($id);",
"public static function findById($id){\n \t$data = self::find($id);\n \tif (!$data) {\n \t\tabort(404);\n \t}\n \treturn $data;\n }"
] | [
"0.7001217",
"0.69570386",
"0.6659849",
"0.66561747",
"0.6654603",
"0.66450477",
"0.6614273",
"0.6589339",
"0.6586148",
"0.65813583",
"0.65043",
"0.64518917",
"0.64518917",
"0.64518917",
"0.64518917",
"0.64438796",
"0.64381087",
"0.6405883",
"0.6405883",
"0.6388475",
"0.63728964",
"0.6364413",
"0.6343958",
"0.6341775",
"0.6298031",
"0.6294427",
"0.62918526",
"0.6238395",
"0.61772424",
"0.6169771",
"0.6166562",
"0.61619365",
"0.61619365",
"0.61564016",
"0.61560273",
"0.6140771",
"0.61288893",
"0.61228037",
"0.61033857",
"0.6097087",
"0.6085073",
"0.6079688",
"0.60749125",
"0.60665363",
"0.6056296",
"0.6049053",
"0.60410976",
"0.6005116",
"0.59859896",
"0.5984404",
"0.59809726",
"0.59809726",
"0.59718806",
"0.59669733",
"0.5943069",
"0.5921346",
"0.59117615",
"0.5909513",
"0.5898141",
"0.58866006",
"0.5878011",
"0.58732694",
"0.58686835",
"0.5867156",
"0.58520937",
"0.58440435",
"0.5838866",
"0.5834343",
"0.58332205",
"0.5829909",
"0.58289427",
"0.5828103",
"0.5825814",
"0.582136",
"0.5821004",
"0.58137167",
"0.5810982",
"0.5810982",
"0.5810982",
"0.5810982",
"0.5810982",
"0.5810982",
"0.5810982",
"0.5810982",
"0.5810982",
"0.5810982",
"0.5810982",
"0.5810982",
"0.5810982",
"0.5810982",
"0.5810982",
"0.5810982",
"0.5810982",
"0.5810982",
"0.5810982",
"0.5810982",
"0.5810982",
"0.5810982",
"0.5810982",
"0.58033705"
] | 0.6583118 | 9 |
Determine whether the user can view the article. | public function view(User $user, Article $article = null)
{
if ($article === null) {
return $user->hasPermission('articles.view');
}
$standardUser = $article->isPublished();
$elevatedUser = $user->hasPermission('articles.view');
return $standardUser || $elevatedUser;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }",
"public function authorize()\n {\n $article = Article::find($this->route('article'));\n return $article && $this->user()->can('update', $article);\n }",
"public function authorize()\n {\n return $this->user()->can('view', Assignment::class);\n }",
"public function authorize()\n {\n return access()->hasPermission('manage-articles');\n }",
"private function canView(): bool\n {\n return true;\n }",
"function userCanViewPage()\n\t{\n\t\t// use Yawp::authUsername() instead of $this->username because\n\t\t// we need to know if the user is authenticated or not.\n\t\treturn $this->acl->pageView(Yawp::authUsername(), $this->area, \n\t\t\t$this->page);\n\t}",
"public function canView()\n {\n return !$this->is_private ||\n ( Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() ) );\n }",
"public function canView()\n {\n return true;\n }",
"public function view(User $user, Article $article) {\n return ($user->hasPermission('articles.view.any') || $article->isOwner($user));\n }",
"public function authorize()\n {\n if ($this->user && ($this->user->hasPermission('manage_pages_contents') ) ) {\n return true;\n }\n\n return false;\n }",
"public function isViewAllowed()\n {\n return $this->isAllowedAction('view');\n }",
"public function canUserManageUsage()\n {\n return $this->getUser()->hasAccess('manage', 'newsUsage');\n }",
"public function canBeViewed() {}",
"public function authorize()\n {\n return $this->user()->can('manage-drafts');\n }",
"public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }",
"public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }",
"public function authorize()\n {\n return $this->user() != null;\n }",
"public function authorize()\n {\n $tag = $this->route()->parameter('tag');\n return Auth::user()->can('view', [Tag::class, $tag]);\n }",
"public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }",
"public function authorize()\n {\n return $this->user() !== null;\n }",
"public function authorize()\n {\n return $this->user() !== null;\n }",
"public function authorize()\n {\n $user = Auth::user();\n $lecture = Lecture::findOrFail($this->route('lecture'));\n return $user->can('lecture-update') || $user->id == $lecture->user_id;\n }",
"public function isViewable()\n {\n return ($this->isPublished() && $this->isActive());\n }",
"public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }",
"public function isAuthorized($user)\n {\n // Prior to 3.4.0 $this->request->param('action') was used.\n if ($this->request->getParam('action') === 'add') {\n return true;\n }\n\n // The owner of an article can edit and delete it\n // Prior to 3.4.0 $this->request->param('action') was used.\n if (in_array($this->request->getParam('action'), ['view', 'edit', 'delete'])) {\n // Prior to 3.4.0 $this->request->params('pass.0')\n $roomPlanId = (int)$this->request->getParam('pass.0');\n $roomPlan = $this->RoomPlans->findById($roomPlanId)->first();\n if($roomPlan){\n return $roomPlan->user_id === $user['id'];\n } else {\n return false;\n }\n }\n\n return parent::isAuthorized($user);\n }",
"public function authorize()\n {\n if(session('contact_key'))\n return true;\n\n if (! $this->user()->hasFeature(FEATURE_DOCUMENTS))\n return false;\n\n \n if ($this->invoice && $this->user()->cannot('edit', $this->invoice))\n return false;\n\n\n if ($this->expense && $this->user()->cannot('edit', $this->expense))\n return false;\n\n\n if($this->ticket && $this->user()->cannot('edit', $this->ticket))\n return false;\n\n\n return true;\n //return $this->user()->can('create');\n }",
"public function authorize()\n {\n if (Auth::user()->can('update-assignment')) return true;\n if (Auth::user()->hasRole('student'))\n if ($this->owns('assignment')) return true;\n return false;\n }",
"public function authorize()\n {\n if ( ! $this->getRelease()->belongsToYou()) {\n return false;\n }\n return true;\n }",
"public function isAuthorized($user)\n {\n if ($this->request->action === 'add') {\n return true;\n }\n \n // The owner of an article can edit and delete it\n if (in_array($this->request->action, ['edit', 'delete'])) {\n $articleId = (int)$this->request->params['pass'][0];\n if ($this->Articles->isOwnedBy($articleId, $user['id'])) {\n return true;\n }\n }\n \n return parent::isAuthorized($user);\n }",
"public function authorize()\n {\n return $this->route('address')->userCanView($this->user());\n }",
"public function canUserAssignUsage()\n {\n $user = $this->getUser();\n\n return $user->isAdmin || \\in_array('tl_news::usage', $user->alexf, true);\n }",
"private function canDisplay()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }",
"public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }",
"public function canView()\n\t{\n\t\treturn \\IPS\\Member::loggedIn()->hasAcpRestriction( 'nexus' , 'transactions', 'transactions_manage' );\n\t}",
"public function isViewable(): bool\n\t{\n\t\treturn self::STATUS_ACTIVE === $this->get('status') && self::USER_VISIBLE === $this->get('visible');\n\t}",
"public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }",
"public function authorize()\n {\n return !is_null($this->user());\n }",
"public function view(User $user, Article $article)\n {\n\n if ($user->articles->find($article->id))\n {\n return true;\n }\n else\n {\n return false;\n }\n }",
"public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }",
"public function authorize()\n {\n return request()->user() != null;\n }",
"public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }",
"public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}",
"public function isAuthorized($user)\n {\n // All registered users can add articles\n // Prior to 3.4.0 $this->request->param('action') was used.\n if ($this->request->getParam('action') === 'add') {\n return true;\n }\n\n // The owner of an article can edit and delete it\n if (in_array($this->request->getParam('action'), ['edit', 'delete'])) {\n $articleId = (int)$this->request->getParam('pass.0');\n // dd($this->request->getParam('pass.0'));\n if (!$this->Articles->isOwnedBy($articleId, $user['id'])) {\n\n if($user['role'] === 'admin'){\n return true;\n }\n else{\n return false;\n }\n }\n\n // return true;\n }\n return parent::isAuthorized($user);\n }",
"public function authorize()\n {\n return access()->hasPermissions(['view-backend', 'view-referral', 'manage-referral'], true);\n }",
"public function check_access() {\n\n\t\tif (isset($this->current_entity_allowed)) {\n\t\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t\t}\n\n\t\t$this->current_entity_allowed = MKB_Options::option('restrict_on') ?\n\t\t\t(bool) $this->check_entity_access($this->get_current_entity()) :\n\t\t\ttrue; // always allowed if restriction is off\n\n\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t}",
"public function canMycontentLikes() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n\t\treturn true;\n }",
"public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\n }",
"public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }",
"public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }",
"public function isViewable()\n\t{\n\t\treturn true;\n\t}",
"public static function CanUserViewLessonContent ($arParams)\n\t{\n\t\t$options = self::ParseParamsWithUser(\n\t\t\t$arParams,\n\t\t\tarray(\n\t\t\t\t'lesson_id' => array(\n\t\t\t\t\t'type' => 'strictly_castable_to_integer',\n\t\t\t\t\t'mandatory' => true\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\n\t\t$oAccess = CLearnAccess::GetInstance($options['user_id']);\n\n\t\t$isAccessGranted = $oAccess->IsBaseAccess(CLearnAccess::OP_LESSON_READ)\n\t\t\t|| $oAccess->IsLessonAccessible($options['lesson_id'], CLearnAccess::OP_LESSON_READ);\n\n\t\treturn ($isAccessGranted);\n\t}",
"public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }",
"function checkAccess () {\n if ($GLOBALS[\"pagedata\"][\"login\"] == 1) {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n }",
"function checkAccess () {\n if ($GLOBALS[\"pagedata\"][\"login\"] == 1) {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n }",
"public function authorize()\n {\n $feedID = $this->route('feed');\n if (isset($feedID)) {\n return !empty(Feed::find($feedID));\n }\n\n return true;\n }",
"public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }",
"public function authorize()\n\t{\n $subjectId = $this->route('subject');\n\n return Subject::find($subjectId)->user->id == Auth::id();\n\t}",
"public function authorize()\n {\n return is_client_or_staff();\n }",
"public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }",
"public function authorize()\n {\n $id = Auth::id();\n $livro = $this->route('livro');\n if ($livro!=NULL) {\n $author = $livro->user_id;\n return $author == $id ? true : false;\n }\n else\n return true;\n }",
"function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }",
"public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }",
"public function canEdit()\n {\n if(!Auth::check())\n {\n return false;\n }\n //If the user is active/logged in, return true so that we can display user's specific objects\n if(Auth::user()->id===$this->user_id)\n {\n return true;\n }\n //By default\n return false;\n }",
"public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function authorize(): bool\n {\n return $this->user() !== null;\n }",
"public function authorize()\n {\n return auth()->user()->is_author($this->route('board'));\n }",
"public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }",
"public function authorize()\n {\n\n return true;\n\n if ($this->route('self_report')) { // If ID we must be changing an existing record\n return Auth::user()->can('self_report update');\n } else { // If not we must be adding one\n return Auth::user()->can('self_report add');\n }\n\n }",
"public function authorize()\n {\n return Auth()->user()->isAbleTo('school_sections-create');\n }",
"public function authorize()\n {\n $person = $this->findFromUrl('person');\n\n return $this->user()->can('update', $person);\n }",
"public function authorize()\n {\n return \\Auth::user()->canDo('ADD_PORTFOLIOS');\n }",
"public function authorize()\n {\n //Get the 'mark' id\n switch ((int) request()->segment(6)) {\n case 0:\n return access()->allow('deactivate-users');\n break;\n\n case 1:\n return access()->allow('reactivate-users');\n break;\n }\n\n return false;\n }",
"public function isAuthorized($user)\n {\n if (isset($user['V_ROL']) and $user['V_ROL']==='Viewer')\n {\n if (in_array($this->request->action,['home','view','logout']))\n {\n return true;\n }\n }\n return parent::isAuthorized($user);\n }",
"public function authorize()\n {\n return (Auth::user()->type === User::VENDEDOR);\n }",
"public function authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }",
"public function isViewer()\n\t{\n\t\treturn ($this->role == self::ROLE_VIEWER);\n\t}",
"public function authorize()\n {\n if (Auth::user() && Auth::user()->hasPermissionTo('manage categories')) {\n return true;\n } else {\n return false;\n }\n }",
"public function authorize()\n {\n return access()->hasPermissions(['view-backend', 'view-inventory', 'manage-inventory'], true);\n }",
"public function canUserManageAreaOfApplication()\n {\n return $this->getUser()->hasAccess('manage', 'newsAreaOfApplication');\n }",
"abstract protected function canAccess();",
"public function canEdit()\n {\n if (!$this->site) {\n return false;\n }\n\n if (!$this->current_user) {\n return false;\n }\n\n if ($this->site->userIsVerified($this->current_user)) {\n return true;\n }\n\n return false;\n }",
"public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }",
"public function authorize()\n {\n return auth()->user()->can('edit', $this->subscription);\n }",
"public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }",
"public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }",
"public function canMyLikes() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n\t\treturn true;\n }",
"public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }",
"public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess||Auth::user()->allowAdminAccess);\n }",
"public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }",
"public function isAuthorized() {}",
"public function isAuthorized($user) {\r\n\t if (in_array($this->action, array('table'))) {\r\n\t return true;\r\n\t }\r\n\r\n\t // The owner of a post can edit and delete it\r\n\t if (in_array($this->action, array('edit', 'delete', 'index'))) {\r\n\t if (isset($user['role']) && $user['role'] === 'admin') {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t }\r\n\r\n\t return parent::isAuthorized($user);\r\n\t}",
"public function authorize(): bool\n {\n return Auth::check() &&\n $this->user()->tokenCan('view:store');\n }",
"public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }",
"public function authorize()\n {\n// $comment = Comment::find($this->route('comment')); // Get 'comment' route's params.\n// return $comment && $this->user()->can('update', $comment);\n\n return false;\n }",
"public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }",
"public function authorize()\n {\n // return $this->user('canvas')->isAdmin;\n if (auth()->guard('website')->user()) {\n return true;\n }\n\n return false;\n }",
"public function canViewSuggestions(){\n $viewer_id = Engine_Api::_()->user()->getViewer()->getIdentity();\n if(!empty($viewer_id)){\n return true;\n } \n }",
"public function performPermission()\n {\n // User Role flags\n // Admin = 20\n // Editor = 40\n // Author = 60 (deprecated)\n // Webuser = 100 (deprecated)\n //\n // Webuser dont have access to edit node data\n //\n if($this->controllerVar['loggedUserRole'] > 40)\n {\n return false;\n }\n\n return true;\n }",
"public function isAuthorized($user)\n {\n if ($this->request->action === 'add') {\n return true;\n }\n \n // The owner of an article can edit and delete it\n if (in_array($this->request->action, ['edit', 'delete'])) {\n $articleId = (int)$this->request->params['pass'][0];\n if ($this->Alarmas->isOwnedBy($articleId, $user['id'])) {\n return true;\n }\n }\n \n return parent::isAuthorized($user);\n }"
] | [
"0.78972536",
"0.7657808",
"0.7646129",
"0.75201154",
"0.74361575",
"0.73623717",
"0.7349834",
"0.7334045",
"0.73335344",
"0.7285864",
"0.7266527",
"0.7171748",
"0.71371555",
"0.7084933",
"0.7047652",
"0.70421284",
"0.7030047",
"0.7006565",
"0.7000631",
"0.6988967",
"0.6988967",
"0.6976495",
"0.6954877",
"0.6937232",
"0.6924578",
"0.6895944",
"0.6891525",
"0.6884846",
"0.68831694",
"0.6881759",
"0.6869403",
"0.6863953",
"0.68566644",
"0.68491024",
"0.6843324",
"0.6842851",
"0.68391323",
"0.68378174",
"0.68004143",
"0.67980295",
"0.6788955",
"0.6787184",
"0.67870504",
"0.67860675",
"0.67853504",
"0.6782164",
"0.67803144",
"0.6766581",
"0.6765698",
"0.67646205",
"0.6763345",
"0.6758329",
"0.67456937",
"0.67456937",
"0.6745125",
"0.67418665",
"0.67400646",
"0.67343616",
"0.6731092",
"0.67221326",
"0.6720749",
"0.6720019",
"0.67157024",
"0.67126185",
"0.670513",
"0.6704509",
"0.6703663",
"0.67004454",
"0.67003036",
"0.66875845",
"0.66835517",
"0.6683548",
"0.6681108",
"0.66748714",
"0.6672263",
"0.6669861",
"0.66677046",
"0.6666816",
"0.66643244",
"0.66594315",
"0.66574085",
"0.6651173",
"0.66504425",
"0.6648544",
"0.6634523",
"0.6634523",
"0.6631726",
"0.66199046",
"0.6617151",
"0.66128176",
"0.66127336",
"0.66060424",
"0.6605398",
"0.6604648",
"0.6593682",
"0.6589468",
"0.6586134",
"0.65823865",
"0.65774983",
"0.657739"
] | 0.7354493 | 6 |
Determine whether the user can create articles. | public function create(User $user)
{
return $user->hasPermission('articles.create');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function canCreatePage() {\n return ($this->isAdmin() || ($this->userType == 'author'));\n }",
"public function create(User $user) {\n return $user->hasPermission('articles.create');\n }",
"function canCreatePost() {\n return ($this->isAdmin() || ($this->userType == 'author'));\n }",
"private function canCreate()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }",
"public function canCreate();",
"public function canCreate();",
"public function authorize()\n {\n return auth()->user()->can('create', Task::class);\n }",
"public function create_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }",
"public function authorize()\n {\n return $this->user()->can('user.create');\n }",
"public function authorize()\n {\n return $this->user()->can(\"Crear Nómina\");\n }",
"public function authorize()\n {\n return $this->user()->can('create', MarEntry::class);\n }",
"public function create(): bool\n {\n return $this->isAllowed(self::CREATE);\n }",
"protected function canCreate() {}",
"public function authorize()\n {\n $user = Auth::user();\n\n $foodAddition = new FoodAddition();\n\n if((!$user->can('create', $foodAddition)) || (!$user->can('create-food-addition'))) {\n return false;\n }\n\n return true;\n }",
"public function authorize()\n {\n\t\treturn $this->user()->can('create', Collection::class);\n }",
"public function authorize()\n {\n return access()->hasPermission('manage-articles');\n }",
"public function authorize()\n {\n return Auth::user() && Auth::user()->hasPermissionTo('create-users');\n }",
"public function authorizePost()\n {\n return $this->user()->can('acme.create');\n }",
"protected function CanCreate()\n {\n return self::Guard()->Allow(BackendAction::Create(), new Site());\n }",
"public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }",
"public function authorize()\n {\n return $this->user()->can('Crear Departamentos');\n\n }",
"public function authorize()\n {\n return Auth()->user()->isAbleTo('school_sections-create');\n }",
"public function authorize()\n {\n return $this->user()->can('create mindoro transaction');\n }",
"protected function CanCreate()\n {\n return self::Guard()->Allow(BackendAction::Create(), new Container())\n && self::Guard()->Allow(BackendAction::UseIt(), new ContainerForm());\n }",
"public function authorize()\n {\n return $this->permissionGuard()->allowsCreate($this->newModelInstance());\n }",
"public function authorize(): bool\n {\n return $this->user()->can('create', Role::class);\n }",
"public function authorize()\n {\n return $this->user()->can('manage-drafts');\n }",
"public function authorize()\n {\n return auth()->user()->can('create', Pizza::class);\n }",
"public function create()\n {\n return isAdmin();\n }",
"public function authorize() {\n\t\treturn $this->user()->can('create', Pdf::class);\n\t}",
"public function authorize(): bool\n {\n return auth()->user()->can('create academic year unit levels');\n }",
"public function authorize()\n {\n $article = Article::find($this->route('article'));\n return $article && $this->user()->can('update', $article);\n }",
"public function canPost()\n {\n $role = $this->role;\n if($role == 'author' || $role == 'admin')\n {\n return true;\n } else {\n return false;\n }\n }",
"public function authorize()\n {\n // TODO: Check if is authorized to create user\n return true;\n }",
"public function authorize(): bool\n {\n return $this->user()->can('create_contact');\n }",
"public function authorize()\n {\n return auth()->user()->can('create-buildings');\n }",
"public function authorize()\n {\n if(session('contact_key'))\n return true;\n\n if (! $this->user()->hasFeature(FEATURE_DOCUMENTS))\n return false;\n\n \n if ($this->invoice && $this->user()->cannot('edit', $this->invoice))\n return false;\n\n\n if ($this->expense && $this->user()->cannot('edit', $this->expense))\n return false;\n\n\n if($this->ticket && $this->user()->cannot('edit', $this->ticket))\n return false;\n\n\n return true;\n //return $this->user()->can('create');\n }",
"public function canCreatePlaces()\n\t{\n\t\t$viewer = Engine_Api::_()->user()->getViewer();\n\t\tif( !$viewer || !$viewer->getIdentity() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Must be able to create blogs\n\t\t/*\n\t\tif( !Engine_Api::_()->authorization()->isAllowed('blog', $viewer, 'create') ) {\n\t\t\treturn false;\n\t\t}\n\t\t*/\n\t\treturn true;\n\t}",
"public function create(User $user)\n {\n if ($user->can('create_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }",
"public function authorize()\n {\n return \\Auth::user()->canDo('ADD_PORTFOLIOS');\n }",
"public static function userCreationAllowed(): bool\n {\n return self::isConfigured(self::ACTION_ADD_USER);\n }",
"function user_can_create_post($user_id, $blog_id = 1, $category_id = 'None')\n {\n }",
"public function testAllowCreate()\n {\n $createFalse = LogEntry::create()->canCreate(null);\n $this->assertFalse($createFalse);\n $this->logInWithPermission('ADMIN');\n $createFalse = LogEntry::create()->canCreate();\n $this->assertFalse($createFalse);\n }",
"public function create(User $user)\n {\n return $user->can('create user');\n }",
"function canCreate(){\n\t\t\tif(!isset($_POST['action'])) return false;\n\t\t\tif($_POST['action'] !== 'create_profile') return false;\n\t\t\tif($_POST['profile_folder'] === '') return false;\n\t\t\tif($_POST['profile_name'] === '') return false;\n\t\t\treturn true;\n\t\t}",
"public function canUserManageUsage()\n {\n return $this->getUser()->hasAccess('manage', 'newsUsage');\n }",
"function canCreate() {\r\n\t\treturn !DataObject::get_one($this->class);\r\n\t}",
"public function create(User $user) : bool\n {\n return $user->isAdmin() || $user->hasPermission('create_user') || $user->hasPermission('create_all');\n }",
"public function authorize()\n {\n // return auth()->user()->can('create user');\n return true;\n }",
"public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }",
"public function create(User $user)\n {\n // return true;\n return $user->hasPermissionTo('create interview');\n }",
"public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }",
"public function authorize()\n {\n return true;\n // return Gate::allows('create-article'); //via form request\n }",
"public function create()\n {\n $this->authorize('create', Article::class);\n return view('articles.create');\n }",
"public function authorize() : bool\n {\n return auth()->user()->can('create', GroupSetting::class);\n }",
"protected function canCreate(){\n return $this->canUserModify() &&\n $this->isQuestionActive() &&\n $this->socialQuestion->SocialPermissions->isUnlockedOrUserCanChangeLockStatus() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_CREATE, $this->getEmptyComment());\n }",
"public function canCreate(string $name) : bool;",
"public function authorize()\n {\n $user = $this->user();\n return $user->can('add-user');\n }",
"public function canUserManageAreaOfApplication()\n {\n return $this->getUser()->hasAccess('manage', 'newsAreaOfApplication');\n }",
"public function authorize()\n {\n if ( ! $this->getRelease()->belongsToYou()) {\n return false;\n }\n return true;\n }",
"public function canCreateNewPages() {}",
"public function userHasCreatePermission(){\n//\t\tif(\\GO\\Base\\Model\\Acl::hasPermission($this->getPermissionLevel(),\\GO\\Base\\Model\\Acl::CREATE_PERMISSION)){\n//\t\t\treturn true;\n//\t\t}else \n\t\tif(\\GO::modules()->isInstalled('freebusypermissions')){\n\t\t\treturn \\GO\\Freebusypermissions\\FreebusypermissionsModule::hasFreebusyAccess(\\GO::user()->id, $this->user_id);\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}",
"public function create(User $user)\n {\n return Auth()->user()->hasRole('Admin') || Auth()->user()->hasPermissionTo('Create roles');\n }",
"public function authorize()\n {\n return Gate::allows('add_to_dos') ? true : false;\n }",
"public function authorize()\n {\n return request()->user()->tokenCan('user_create');\n }",
"public static function authorizedToCreate(Request $request)\n {\n return false;\n }",
"public function create(User $user)\n {\n return $user->id == $article->user_id;\n }",
"public function authorize()\n {\n if ($this->method() === 'POST') {\n return $this->user()->can('create', Template::class);\n }\n\n return $this->user()->can('update', Template::class);\n }",
"public function canCreate($member = null) {\n\t\treturn DataList::create(\"DOArticlesCategoryHolderPage\")->count() < 1;\n\t}",
"public function authorize()\n {\n if ($this->user()->parent_id == NULL) { //Solo si es Cacique puede agregar indios. Sino, 403!\n return true;\n } else {\n return false;\n }\n }",
"public function authorize()\n {\n return $this->user()->hasPermission('subscription-service-create-plan');\n }",
"function canCreateAccounts() {\r\n\t\treturn true;\r\n\t}",
"public function create(User $user): array|bool\n {\n return $user->ability(roles: 'admin', permissions: 'create_posts');\n }",
"public function authorize()\n {\n return auth()->user()->can('create-product-packages');\n }",
"function userCanCreateUser( $sessionID ) {\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}",
"public function authorize()\n {\n return true;\n //return auth()->user()->can('user-create');\n }",
"public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }",
"public function test_canCreate_Returns_True_If_Personnel_Have_No_Access() {\n\n\t\t$check_returns_false = $this->authorization_service4->canCreate(2,2);\n\n\t\t$this->assertFalse($check_returns_false);\n\t}",
"public function test_canCreate_Returns_True_If_Personnel_Have_Access() {\n\n\t\t$check_returns_true = $this->authorization_service3->canCreate(1,1);\n\n\t\t$this->assertTrue($check_returns_true);\n\t}",
"public function canSetCreatable();",
"function canAdd() {\r\n\t\t$user\t=& JFactory::getUser();\r\n\t\t$permission = FlexicontentHelperPerm::getPerm();\r\n\t\tif(!$permission->CanAdd) return false;\r\n\t\treturn true;\r\n\t}",
"public function authorize()\n {\n if (Auth::user() && Auth::user()->hasPermissionTo('manage categories')) {\n return true;\n } else {\n return false;\n }\n }",
"public function authorize()\n {\n return $this->user()->can('view', Assignment::class);\n }",
"public function authorize()\n { \n if($this->user()->hasRole(['unidadeEnsino', 'articulador', 'superadministrador']))\n {\n return true;\n }else {\n $this->error = 'Desculpe, voce nao possui permissão para adicionar espaços';\n return false;\n }\n }",
"public function create(User $user)\n {\n return $user->isSuper() || $user->isAdmin() || $this->isAllowedFor($user, 'create');\n }",
"public function canCreateAccounts()\n {\n return false;\n }",
"public function create(User $user): bool\n {\n return $user->can('Create Role');\n }",
"protected function check_create_permission($post)\n {\n }",
"public function create($user)\n {\n return $user->hasPermissionTo('create ' . static::$key);\n }",
"public function authorize()\n {\n return auth()->user()->can('role@create') || auth()->user()->can('role@edit');\n }",
"public function can_auto_create_users() {\n return (bool)$this->config['weautocreateusers'];\n }",
"public function canCreate(): bool\n {\n if (!$this->hasData('can_create')) {\n $this->setData('can_create', $this->eraseCustomerChecker->canCreate((int) $this->session->getCustomerId()));\n }\n\n return (bool) $this->_getData('can_create');\n }",
"public function create(User $user)\n {\n return $user->hasPermissionTo('experience_create');\n }",
"public function authorize()\n {\n if($this->path() == 'profile/create')\n {\n return true;\n } else {\n return false;\n }\n }",
"public function isAuthorized($user)\n {\n // All registered users can add articles\n // Prior to 3.4.0 $this->request->param('action') was used.\n if ($this->request->getParam('action') === 'add') {\n return true;\n }\n\n // The owner of an article can edit and delete it\n if (in_array($this->request->getParam('action'), ['edit', 'delete'])) {\n $articleId = (int)$this->request->getParam('pass.0');\n // dd($this->request->getParam('pass.0'));\n if (!$this->Articles->isOwnedBy($articleId, $user['id'])) {\n\n if($user['role'] === 'admin'){\n return true;\n }\n else{\n return false;\n }\n }\n\n // return true;\n }\n return parent::isAuthorized($user);\n }",
"private function canListAndCreate()\n {\n return true;\n }",
"public function authorize()\n {\n if (Auth::user()->can('update-assignment')) return true;\n if (Auth::user()->hasRole('student'))\n if ($this->owns('assignment')) return true;\n return false;\n }",
"public function authorize() {\n\t\t$this->sport = $this->route('sport');\n\t\tif ($this->competitionDay = $this->route('competitionDay')) {\n\t\t\treturn $this->user()->can('update', $this->competitionDay);\n\t\t}\n\n\t\t$this->competitionDay = new CompetitionDay();\n\t\treturn $this->user()->can('create', CompetitionDay::class);\n\t}",
"public function create(User $logged_user)\n {\n return $logged_user->is_root || $logged_user->can('users.create');\n }",
"function get_can_create_user ()\r\n {\r\n return $_SESSION[\"can_create_user\"];\r\n }"
] | [
"0.76768714",
"0.74520206",
"0.7419275",
"0.74183756",
"0.7293732",
"0.7293732",
"0.717355",
"0.7146582",
"0.71388537",
"0.7118589",
"0.7116951",
"0.70942193",
"0.70816094",
"0.7046658",
"0.70405364",
"0.7022979",
"0.6955304",
"0.69058174",
"0.68806285",
"0.6865679",
"0.681144",
"0.6798243",
"0.676873",
"0.67580444",
"0.67574936",
"0.67468923",
"0.6733267",
"0.6721744",
"0.6717922",
"0.6701783",
"0.6689927",
"0.66703343",
"0.6647348",
"0.6587178",
"0.6585047",
"0.65491575",
"0.6525307",
"0.6522198",
"0.6517405",
"0.6514426",
"0.6489385",
"0.6481858",
"0.64763",
"0.6448935",
"0.6436562",
"0.6433952",
"0.64309454",
"0.6427274",
"0.642618",
"0.6421596",
"0.6416692",
"0.6411613",
"0.6410839",
"0.6397928",
"0.63975817",
"0.6389728",
"0.63836884",
"0.63735265",
"0.636488",
"0.6363887",
"0.63463175",
"0.63435054",
"0.63434243",
"0.6314788",
"0.6309438",
"0.62995255",
"0.6298429",
"0.62982833",
"0.6276771",
"0.6276069",
"0.6270245",
"0.62620497",
"0.62556744",
"0.6227144",
"0.62137616",
"0.6199835",
"0.6195613",
"0.6190857",
"0.6186308",
"0.61822253",
"0.6177078",
"0.61740535",
"0.61699086",
"0.6163757",
"0.61600924",
"0.61592066",
"0.61555356",
"0.61517966",
"0.61392397",
"0.6126061",
"0.61252207",
"0.6124598",
"0.611932",
"0.61192197",
"0.61165035",
"0.61146706",
"0.6110407",
"0.6108744",
"0.61050475",
"0.6103032"
] | 0.7395214 | 4 |
Determine whether the user can update the article. | public function update(User $user, Article $article)
{
return $user->hasPermission('articles.update');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function authorize()\n {\n $article = Article::find($this->route('article'));\n return $article && $this->user()->can('update', $article);\n }",
"public function authorize()\n {\n if (auth()->user()->can('update')) {\n return true;\n }\n\t\t\n\t\treturn false;\n }",
"public function update(): bool\n {\n return $this->isAllowed(self::UPDATE);\n }",
"public function authorize()\n {\n return $this->user()->can('update', $this->user());\n }",
"public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }",
"public function authorize()\n {\n return $this->user()->canUpdateSecurity();\n }",
"public function authorize()\n {\n return $this->user()->can('update_users');\n }",
"public function authorize()\n {\n $person = $this->findFromUrl('person');\n\n return $this->user()->can('update', $person);\n }",
"public function authorize()\n {\n // who can update ??\n // 1- admin\n if (auth()->user()->isAdmin()) {\n return true;\n }\n\n // 2- creator\n if ($this->offerItem->created_by == auth()->user()->id) {\n return true;\n }\n\n return false;\n }",
"protected function _isAllowed()\r\n {\r\n return $this->_authorization->isAllowed('AAllen_PriceUpdate::update');\r\n }",
"public function authorize()\n {\n return $this->user()->can('update', $this->route('user'));\n }",
"public function authorizePatch()\n {\n return $this->user()->can('acme.update');\n }",
"public function authorize()\n {\n $user = \\Auth::user();\n \n if($user->can('update', \\App\\Product::class)){\n return true;\n }\n \n return false;\n }",
"static function canUpdate() {\n // as users can update their onw items\n return Session::haveRightsOr(self::$rightname, [\n CREATE,\n UPDATE,\n self::MANAGE_BG_EVENTS\n ]);\n }",
"function updatesAllowed() {\n\t\treturn $this->getupdatable() == 1 ? true : false;\n\t}",
"public function update(User $user, Article $article) {\n return ($user->hasPermission('articles.edit.any')\n || ($user->hasPermission('articles.edit.own') && $user->isOwnerOf($article)));\n }",
"public function canEdit()\n {\n if (!$this->site) {\n return false;\n }\n\n if (!$this->current_user) {\n return false;\n }\n\n if ($this->site->userIsVerified($this->current_user)) {\n return true;\n }\n\n return false;\n }",
"protected function canUpdate()\n {\n return $this->hasStrategy(self::STRATEGY_UPDATE);\n }",
"public function authorize()\n {\n return $this->user()->hasPermission('update-title');\n }",
"public function authorize(): bool\n {\n return Gate::allows('update', $this->product);\n }",
"public function authorize() {\n\t\t$this->competitor = $this->route('competitor');\n\t\treturn $this->user()->can('update', $this->competitor);\n\t}",
"protected function canUpdate(){\n $emptyComment = $this->getEmptyComment();\n\n return $this->canUserModify() &&\n ($this->isActive() || $this->isPending() ||\n ($this->isSuspended() && parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS, $emptyComment))) &&\n !$this->isDeleted() &&\n $this->isQuestionActive() &&\n $this->socialQuestion->SocialPermissions->isUnlockedOrUserCanChangeLockStatus() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE, $emptyComment);\n }",
"public function authorize()\n {\n return $this->user()->can('update', \\App\\Models\\Member::withTrashed()->find($this->id));\n }",
"function check_user() {\n\treturn false; // update allowed\n\treturn true; //no update allowed\n}",
"public function isUpdateSecurityRelevant() {}",
"public function authorize()\n {\n return auth()->user()->can('update online assessment');\n }",
"public function isEditable()\n\t{\n\t\tif(Auth::check())\n\t\t{\n\t\t\tif(Auth::user()->id == $this->author_id)\n\t\t\t{\n\t\t\t\tif ($this->created_at->diffInMinutes(Carbon::now()) < 30)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(Auth::user()->hasRole(['moderator', 'administrator', 'super user'])) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"protected function canUpdateStatus() {\n return $this->canUpdate() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS, $this->getEmptyComment());\n }",
"public function canEdit()\n {\n return $this->is_locked == 0;\n }",
"public function authorize(): bool\n {\n // only allow updates if the user is logged in\n return Auth::check();\n }",
"public function authorize()\n {\n $user = Auth::user();\n\n if(!$user->can('update-role')) {\n return false;\n }\n\n return true;\n }",
"public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\t$this->workFunction = $this->route('workFunction');\n\t\treturn $this->user()->can('update', $this->workplace) && $this->user()->can('update', $this->workFunction);\n\t}",
"public function canEdit()\n {\n if(!Auth::check())\n {\n return false;\n }\n //If the user is active/logged in, return true so that we can display user's specific objects\n if(Auth::user()->id===$this->user_id)\n {\n return true;\n }\n //By default\n return false;\n }",
"public function authorize(): bool\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }",
"public function authorize()\n {\n return auth()->user()->can('update', [Category::class, request('category')]);\n }",
"public function canUpdate($identifier = null);",
"public function getUserCanEditAttribute()\n {\n return AccessControl::check($this, 'edit_post', false);\n }",
"function canUpdateItem() {\n\n $ticket = new Ticket();\n if (!$ticket->getFromDB($this->fields['tickets_id'])) {\n return false;\n }\n\n // you can't change if your answer > 12h\n if (!is_null($this->fields['date_answered'])\n && ((strtotime(\"now\") - strtotime($this->fields['date_answered'])) > (12*HOUR_TIMESTAMP))) {\n return false;\n }\n\n if ($ticket->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID())\n || ($ticket->fields[\"users_id_recipient\"] === Session::getLoginUserID() && Session::haveRight('ticket', Ticket::SURVEY))\n || (isset($_SESSION[\"glpigroups\"])\n && $ticket->haveAGroup(CommonITILActor::REQUESTER, $_SESSION[\"glpigroups\"]))) {\n return true;\n }\n return false;\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }",
"public function authorize(): bool\n {\n return $this->user()->can('update_contact');\n }",
"public function authorize()\n {\n switch ($this->method()) {\n case 'DELETE':\n {\n return true;\n }\n case 'POST':\n {\n return true;\n }\n case 'PUT':\n {\n if (Auth::user()->hasPermissionTo('post_update', 'blog')) {\n return true;\n } else {\n return true;\n }\n }\n default:\n break;\n }\n return true;\n }",
"public function update(User $user)\n {\n if ($user->can('update_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }",
"function canEdit() {\r\n\t\tif($this->owner->ID == Member::currentUserID())\r\n\t\t\treturn true;\r\n\r\n\t\t$member = Member::currentUser();\r\n\t\tif($member)\r\n\t\t\treturn $member->isAdmin();\r\n\r\n\t\treturn false;\r\n\t}",
"function canUpdateUser($userid){\r\n\t\t$permissions = new dkpUserPermissions();\r\n\t\t$permissions->loadUserPermissions($userid);\r\n\r\n\t\t//make sure we are trying to edit a user who really belongs to our guild\r\n\t\tif($permissions->guildid != $this->guild->id || !$this->HasPermission(\"AccountSecondaryUsers\"))\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}",
"private function validateUpdate() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}",
"protected function canEdit() {}",
"public function authorize()\n {\n $user = Auth::user();\n $lecture = Lecture::findOrFail($this->route('lecture'));\n return $user->can('lecture-update') || $user->id == $lecture->user_id;\n }",
"protected function check_update_permission($post)\n {\n }",
"protected function check_update_permission($post)\n {\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return \\Auth::check();\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return \\Auth::check();\n }",
"public function isUpdateRequired();",
"public function canEdit()\n {\n return true;\n }",
"public function authorize()\n {\n if ($this->route()->getName() === 'home.update') {\n $post = Post::findOrFail($this->id);\n return Auth::check() && Auth::user()->isAdminOrOwner($post->user_id);\n }\n return Auth::check();\n }",
"public function can_edit() {\n return true;\n }",
"public function authorize(): bool\n {\n return Auth::check() && Auth::user()->can('web.user.transcripts.update');\n }",
"public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }",
"public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }",
"public function isUpdateResource();",
"public function canBeUpdated()\n {\n return $this->isNotYetSubmitted();\n }",
"abstract public function isUpdatableByUser(User $user);",
"function canEdit() {\r\n\t\t$user\t=& JFactory::getUser();\r\n\r\n\t\tif (!JAccess::check($user->id, 'core.admin', 'root.1')) {\r\n\t\t\t\t$permission = FlexicontentHelperPerm::getPerm();\r\n\t\t\t\t$id = $this->getState($this->getName().'.id');\r\n\t\t\t\tif ($id) {\r\n\t\t\t\t\t$rights \t= FlexicontentHelperPerm::checkAllItemAccess($uid, 'item', $id);\r\n\t\t\t\t\t$canEdit \t= in_array('flexicontent.editall', $rights) || $permission->CanEdit;\r\n\t\t\t\t\t$canEditOwn\t= (in_array('flexicontent.editown', $rights) && ($item->created_by == $user->id));\r\n\t\t\t\t\tif ($canEdit || $canEditOwn) return true;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public function can_edit() {\n\t\t$can_edit = false;\n\t\t\n\t\t// is the user the owner of the package and the package is in edit mode?\n\t\tif ( ($this->get_user_id() == get_current_user_id()) && ($this->status == 1) ) {\n\t\t\t$can_edit = true;\n\t\t} else {\n\t\t\t// is the user an admin (has the right to edit all packages)\n\t\t\tif ( current_user_can( 'pvm_edit_other_packages' ) ) {\n\t\t\t\t$can_edit = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $can_edit;\n\t}",
"public function authorize()\n {\n// $comment = Comment::find($this->route('comment')); // Get 'comment' route's params.\n// return $comment && $this->user()->can('update', $comment);\n\n return false;\n }",
"public function authorize()\n {\n if ($this->isMethod('POST')) {\n return true;\n }\n\n $thePost = Post::find($this->route('id'));\n return Auth::user()->can('update', $thePost) && Auth::user()->can('delete', $thePost);\n }",
"function update_access_allowed() {\n global $update_free_access, $user;\n\n // Allow the global variable in settings.php to override the access check.\n if (!empty($update_free_access)) {\n return TRUE;\n }\n // Calls to user_access() might fail during the Drupal 6 to 7 update process,\n // so we fall back on requiring that the user be logged in as user #1.\n try {\n require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module';\n return user_access('administer software updates');\n }\n catch (Exception $e) {\n return ($user->uid == 1);\n }\n}",
"function update_access_allowed() {\n global $update_free_access, $user;\n\n // Allow the global variable in settings.php to override the access check.\n if (!empty($update_free_access)) {\n return TRUE;\n }\n // Calls to user_access() might fail during the Drupal 6 to 7 update process,\n // so we fall back on requiring that the user be logged in as user #1.\n try {\n require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module';\n return user_access('administer software updates');\n }\n catch (Exception $e) {\n return ($user->uid == 1);\n }\n}",
"private function _update(){\n\t\tif($this->dao->update($this->user->getID(), $this->ident, $this->datahandler)){\n\t\t\t$this->read();\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function update(User $user, EduDocument $document)\n {\n\n\t\treturn $user->id == $document->user_id || $user->can('Edu-document');\n }",
"private function allowModify()\n { \n if($this->viewVar['loggedUserRole'] <= 40 )\n {\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }",
"public function is_allowed_to_update_feedback($feedback);",
"public function authorize()\n {\n return (\\Auth::user()->hasRole('admin')) || (\\Auth::user()->hasRole('editor')) || \\Auth::user()->canDo('UPDATE_POLLS');\n }",
"public function canEdit() {\n\t\treturn $this->_perms->checkModuleItem ( $this->_tbl_module, 'edit' );\n\t}",
"public function authorize()\n {\n\n $this->note = Note::find($this->route('note'));\n\n return Gate::allows('update', $this->note);\n }",
"public function canEdit($election = null) {\n\t\tif(empty($election)) {\n\t\t\treturn $this->user['isAdmin'];\n\t\t}\n\t\tif($this->user['isSuperAdmin']) {\n\t\t\treturn true;\n\t\t}\n\t\treturn $election['userID'] == $this->user['userID'];\n\t}",
"public function authorize()\n {\n if (Auth::user()->can('update-assignment')) return true;\n if (Auth::user()->hasRole('student'))\n if ($this->owns('assignment')) return true;\n return false;\n }",
"public function update(User $user, Post $post)\n {\n return $user->isAuthorOf($post) || $user->isAdmin();\n }",
"function allowUpdate($allow){\n\t\t$this->canUpdate=$allow;\n\t}",
"public function is_allowed_to_edit_content_object()\n {\n return $this->is_allowed(WeblcmsRights::EDIT_RIGHT, $this->publication) &&\n $this->publication->get_allow_collaboration();\n }",
"public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }",
"public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function canPost()\n {\n $role = $this->role;\n if($role == 'author' || $role == 'admin')\n {\n return true;\n } else {\n return false;\n }\n }",
"function userCanEditPage()\n\t{\n\t\t// use Yawp::authUsername() instead of $this->username because\n\t\t// we need to know if the user is authenticated or not.\n\t\treturn $this->acl->pageEdit(Yawp::authUsername(), $this->area, \n\t\t\t$this->page);\n\t}",
"function canEdit() {\n\t\t\treturn true;\n\t\t}",
"public function authorize()\n {\n $hackedRoute = 'admin.media.update';\n if ( ! is_null($this->segment(4))) {\n $hackedRoute = 'admin.media_category.media.update#####' .$this->segment(3);\n }\n return hasPermission($hackedRoute);\n }",
"public function actionUpdate()\n\t{\n\n\t\t//print_r (Yii::app()->user);\n\t\tif (Yii::app()->user->isAdmin){\n\t\t\t$this->layout = \"admin\";\n\t\t}\n\t\n\t\t$model=$this->loadarticles();\n\t\t$params=array('Articles'=>$model);\n//\t\tif(Yii::app()->user->checkAccess('updateOwnArticle',$params))\n//\t\t{\n//\t\t\t\n\t\t\tif(isset($_POST['Articles']))\n\t\t\t{\n\t\t\t\t$model->attributes=$_POST['Articles'];\n\t\t\t\tif($model->save()){\n\t\t\t\t\t$this->redirect(array('show','id'=>$model->id));\n\t\t\t\t}\n\t\t\t}\n//\t\t}else{\n//\t\t\techo \"no permissions\";\n//\t\t}\n\t\t$this->render('update',array('model'=>$model));\n\t}",
"public function user_can_edit() {\n if (has_capability('mod/swipe:manage', $this->context)) {\n return true;\n }\n }",
"public function update($user, $model)\n {\n if( $user->hasPermissionTo('update ' . static::$key) ) {\n return true;\n }\n\n return false;\n }",
"public function authorize()\n {\n $authorized = auth()->check();\n if ($authorized) {\n $this->rules = $this->getRulesForAction(CrudAction::update());\n }\n return $authorized;\n }",
"public function update(User $user)\n {\n return $user->hasPermissionTo('experience_edit');\n }",
"private function canModify()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }",
"public function authorize()\n {\n if ($this->method() == 'PUT') {\n $categorySlug = $this->route('category');\n $category = $this->categoryRepo->getWithModerator($categorySlug);\n\n return $this->authUserRepo->can('update', $category);\n }\n else {\n return $this->authUserRepo->can('createOrDelete', 'App\\\\Category');\n }\n }"
] | [
"0.8149051",
"0.7787154",
"0.76861846",
"0.7583511",
"0.7497584",
"0.7438157",
"0.74248713",
"0.74098504",
"0.7390987",
"0.73762274",
"0.7354809",
"0.73104364",
"0.73077697",
"0.7235528",
"0.71659136",
"0.7164687",
"0.71121633",
"0.70985013",
"0.7057136",
"0.70555687",
"0.7053193",
"0.704415",
"0.6987088",
"0.69866073",
"0.694455",
"0.68994206",
"0.68759155",
"0.6868264",
"0.6860101",
"0.68409526",
"0.68398225",
"0.6835009",
"0.68204087",
"0.68113863",
"0.6805429",
"0.67915195",
"0.6752875",
"0.67449045",
"0.6727224",
"0.6727224",
"0.6727224",
"0.6727224",
"0.6727224",
"0.6727224",
"0.6727224",
"0.6727224",
"0.6727224",
"0.67247283",
"0.6695737",
"0.6686348",
"0.66857105",
"0.66739744",
"0.66734713",
"0.66600674",
"0.6635606",
"0.6601064",
"0.6601064",
"0.65887266",
"0.65887266",
"0.6587063",
"0.65796864",
"0.6572984",
"0.6564709",
"0.65621996",
"0.65525514",
"0.6539431",
"0.6529222",
"0.6508422",
"0.65048206",
"0.6494741",
"0.6492361",
"0.64795065",
"0.64741755",
"0.64707834",
"0.64707834",
"0.6457469",
"0.6447215",
"0.6440705",
"0.6418676",
"0.6409513",
"0.640302",
"0.63950706",
"0.6370291",
"0.636962",
"0.63695186",
"0.6358915",
"0.63512146",
"0.6343879",
"0.63425475",
"0.63400894",
"0.63399154",
"0.6331867",
"0.6320017",
"0.6309361",
"0.62870866",
"0.62842566",
"0.62828225",
"0.62810814",
"0.62800264",
"0.6255726"
] | 0.72113985 | 14 |
Determine whether the user can delete the article. | public function delete(User $user, Article $article)
{
return $user->hasPermission('articles.delete');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function can_delete () {\r\n\r\n return $this->permissions[\"D\"] ? true : false;\r\n\r\n }",
"public function delete(): bool\n {\n return $this->isAllowed(self::DELETE);\n }",
"function canDelete() {\n return true;\n }",
"function CanDelete()\n\t{\treturn !count($this->subpages) && $this->CanAdminUserDelete();\n\t}",
"public function authorize()\n {\n return $this->can('delete');\n }",
"public function canDelete()\n {\n return in_array('delete', $this->actions);\n }",
"public function canDelete()\n {\n return 1;\n }",
"public function canDelete()\n {\n return Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() );\n }",
"public function isDeleteGranted($entity): bool;",
"private function canDelete()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }",
"public function canDelete()\n {\n return $this->canGet();\n }",
"public function canDelete()\n {\n if ( !SimpleForumTools::checkAccess($this->forumNode(), 'topic', 'remove') )\n {\n \treturn false;\n }\n \t\n return true;\n }",
"function canDelete($user) {\n if($this->getId() == $user->getId()) {\n return false; // user cannot delete himself\n } // if\n\n if($this->isAdministrator() && !$user->isAdministrator()) {\n return false; // only administrators can delete administrators\n } // if\n\n return $user->isPeopleManager();\n }",
"public function canDelete()\n {\n $exist = $this->getModelObj('permission')->where(['resource_code' => $this->code, 'app' => $this->app])->first();\n if ($exist) {\n return false;\n }\n return true;\n }",
"protected function canDelete() {\n return $this->canUpdate() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS_DELETE, $this->getEmptyComment());\n }",
"public function authorize(): bool\n {\n return Gate::allows('admin.genero.delete', $this->genero);\n }",
"function canDelete(User $user) {\n return $user->canManageTrash();\n }",
"public function authorize()\n {\n $represent = $this->getRepresent();\n\n return $represent->can('delete')\n && $represent->exists($this->route('id'));\n }",
"public function authorize()\n {\n $this->translation = Translation::findByUuidOrFail($this->route('id'));\n\n return $this->user()->can('delete', [Translation::class, $this->translation->node->project]);\n }",
"public function canDelete()\n {\n $user = $this->getUser();\n\n if ($user->getData('role') == 'Admin' && $this->getData('status') != Service\\BalanceWithdrawals::STATUS_PENDING) {\n return true;\n }\n\n return false;\n }",
"public function delete(User $user, Article $article) {\n return ($user->hasPermission('articles.delete.any')\n || ($user->hasPermission('articles.delete.own') && $user->isOwnerOf($article)));\n }",
"public function authorize()\n {\n $this->reusablePayment = FetchReusablePayment::run([\n 'encoded_id' => $this->encoded_id,\n ]);\n\n return $this->user()->can('delete', $this->reusablePayment);\n }",
"public function isDelete();",
"public function canDelete($identifier = null);",
"function user_can_delete_post($user_id, $post_id, $blog_id = 1)\n {\n }",
"public function authorize()\n {\n if (env('APP_ENV') == 'testing') {\n return true;\n }\n\n return tenant(auth()->user()->id)->hasPermissionTo('delete fixed asset');\n }",
"protected function canDelete($record) { return false; }",
"public function canDeletePages();",
"public function testAllowDelete()\n {\n $this->logOut();\n $deleteFalse = LogEntry::create()->canDelete(null);\n $this->assertFalse($deleteFalse);\n\n $this->logInWithPermission('ADMIN');\n $deleteTrue = LogEntry::create()->canDelete();\n $this->assertTrue($deleteTrue);\n }",
"function CanDelete()\n\t{\t\n\t\t\n\t\tif ($this->id && !$this->GetLocations() && $this->CanAdminUserDelete())\n\t\t{\n\t\t\t// courses\n\t\t\t$sql = \"SELECT cid FROM courses WHERE city=\" . (int)$this->id;\n\t\t\tif ($result = $this->db->Query($sql))\n\t\t\t{\tif ($this->db->NumRows($result))\n\t\t\t\t{\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t\t\n\t}",
"public function getCanDeleteAttribute()\n {\n // Are you the owner if the note?\n return Auth::id() == $this->user_id;\n }",
"protected function hasActiveUserDeletePermissionForThisUser()\n {\n if (true === $this->bAllowEditByAll) {\n return true;\n }\n if (true === $this->IsOwner()) {\n return false;\n }\n /** @var SecurityHelperAccess $securityHelper */\n $securityHelper = ServiceLocator::get(SecurityHelperAccess::class);\n\n if (false === $securityHelper->isGranted(CmsPermissionAttributeConstants::TABLE_EDITOR_DELETE, $this->oTableConf->fieldName)) {\n return false;\n }\n\n if (true === $securityHelper->isGranted(CmsUserRoleConstants::CMS_ADMIN)) {\n return true;\n }\n\n if ($this->sId === $securityHelper->getUser()?->getId()) {\n // you cannot delete yourself.\n return false;\n }\n\n $oTargetUser = TdbCmsUser::GetNewInstance($this->sId);\n\n // Also, the user may only delete users that have at least one portal in common.\n $userPortals = $securityHelper->getUser()?->getPortals();\n if (null === $userPortals) {\n $userPortals = [];\n }\n $allowedPortals = array_keys($userPortals);\n $portalsOfTargetUser = $oTargetUser->GetFieldCmsPortalIdList();\n\n return 0 === \\count($portalsOfTargetUser) ||\n \\count(array_intersect($allowedPortals, $portalsOfTargetUser)) > 0;\n }",
"public function isDeleteResource();",
"public function canDELETE($collection = null) {\r\n $rights = $this->getRights($collection, 'delete');\r\n return is_bool($rights) ? $rights : true;\r\n }",
"function canDelete($user) {\n if($this->isOwner() || $user->getCompanyId() == $this->getId()) {\n return false; // Owner company cannot be deleted. Also, user cannot delete company he belongs to\n } // if\n return $user->isPeopleManager();\n }",
"public function isDelete(): bool {}",
"abstract function allowDeleteAction();",
"function canDelete(User $user) {\n return $user->isFinancialManager();\n }",
"public function interceptDelete()\n\t{\n\t\t$user = $this->getService('com://admin/ninjaboard.model.people')->getMe();\n\t\t$rows = $this->getModel()->getList();\n\t\tforeach($rows as $row)\n\t\t{\n\t\t\t$topic = $this->getService('com://site/ninjaboard.model.topics')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($row->ninjaboard_topic_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem();\n\t\t\t$forum = $this->getService('com://site/ninjaboard.model.forums')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($topic->forum_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem();\n\n\t\t\t// @TODO we migth want to add an option later, wether or not to allow users to delete their own post.\n\t\t\tif($forum->post_permissions < 3 && $row->created_by != $user->id) {\n\t\t\t\tJError::raiseError(403, JText::_('COM_NINJABOARD_YOU_DONT_HAVE_THE_PERMISSIONS_TO_DELETE_OTHERS_TOPICS'));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}",
"public function delete(User $user)\n {\n if ($user->can('delete_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }",
"public function authorize(): bool\n {\n if (Auth::user()->hasPermissionTo('delete thread')) {\n return true;\n }\n\n $thread = $this->run(GetThreadJob::class, [\n 'thread_id' => $this->request->all()['thread_id']\n ]);\n\n if ($thread != null && $thread->user_id === Auth::user()->id && Auth::user()->hasPermissionTo('delete own thread')) {\n return true;\n }\n\n return false;\n }",
"public function delete(int $articleId, User $user): bool\n {\n $article = (new ArticleManager)->getSingleEntity($articleId);\n if($article){\n if($article->getUser()->getId() === $user->getId() || $user->getRole()->getName() === \"admin\" || $user->getRole()->getName() === \"mode\"){\n (new ArticleManager)->deleteById($articleId);\n return true;\n }\n else{\n return false;\n }\n }\n else{\n return false;\n }\n }",
"public function allowDeletion()\n {\n return $this->allowDeletion;\n }",
"public function canDelete($item)\n {\n return false;\n }",
"public function canDelete($item)\n {\n return false;\n }",
"public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }",
"function canDelete(&$msg, $oid = NULL) {\n\t\t//$tables[] = array( 'label' => 'Users', 'name' => 'users', 'idfield' => 'user_id', 'joinfield' => 'user_company' );\n\t\t//return CDpObject::canDelete( $msg, $oid, $tables );\n\t\treturn true;\n\t}",
"public function authorizedToDelete(Request $request)\n {\n return false;\n }",
"public function delete(User $user)\n {\n return $user->role->can_delete_post == 1;\n }",
"public function authorize()\n {\n abort_if(Gate::denies('comment_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden');\n return false;\n }",
"public function authorize()\n {\n // パラメータのIDからで削除対象のリプライを取得\n $post = Post::find($this->route(\"id\"));\n // if ($reply == null) return false;\n\n return $post && $this->user()->id == $post->user_id ? true : false;\n }",
"protected function _can_delete($delete_id) {\n\t\treturn TRUE;\n\t}",
"protected function _can_delete($delete_id) {\n\t\treturn TRUE;\n\t}",
"protected function _can_delete($delete_id) {\r\n return true;\r\n }",
"protected function canDelete($record)\n\t{\n\t\tif(!empty($record->id))\n\t\t{\n\t\t return Factory::getUser()->authorise(\n\t\t\t\t\"core.delete\",\n\t\t\t\t\"com_dinning_philosophers.dinning_philosophers.\".$record->id\n\t\t\t);\n\t\t}\n\t}",
"public function isDeleteable()\n {\n return $this->_isDeleteable;\n }",
"public function authorize()\n {\n $article = Article::find($this->route('article'));\n return $article && $this->user()->can('update', $article);\n }",
"protected function canDelete($record)\n {\n return true;\n }",
"protected function _can_delete($delete_id)\n\t{\n\t\treturn TRUE;\n\t}",
"protected function _can_delete($delete_id)\n\t{\n\t\treturn TRUE;\n\t}",
"public function isDelete() {\n if($this->method === 'DELETE') {\n return true;\n } else {\n return false;\n }\n }",
"protected function check_delete_permission($post)\n {\n }",
"public function delete()\n {\n // Check P_DELETE\n if (!wcmSession::getInstance()->isAllowed($this, wcmPermission::P_DELETE))\n {\n $this->lastErrorMsg = _INSUFFICIENT_PRIVILEGES;\n return false;\n }\n\n if (!parent::delete())\n return false;\n \n // Erase permissions\n $project = wcmProject::getInstance();\n $sql = 'DELETE FROM #__permission WHERE target=?';\n $params = array($this->getPermissionTarget());\n $project->database->executeStatement($sql, $params);\n \n return true;\n\n }",
"protected function canDelete($record)\n\t{\n\t\tif (!empty($record->id))\n\t\t{\n\t\t\tif ($record->state != -2)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$user = JFactory::getUser();\n\t\t\t\n\t\t\treturn $user->authorise('core.delete', 'com_cooltouraman.course.' . (int) $record->id);\n\t\t}\n\n\t\treturn false;\n\t}",
"public function canBeDeletedBy($editor)\n { return $this->canBeEditedBy($editor) && ( $this->id !== $editor->id );\n }",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webiators_DeleteOrdersFromAdmin::delete_order');\n }",
"public function delete(): bool\n {\n return $this->actionHandler->delete();\n }",
"protected function canDelete($record)\n\t{\n\t\tif(!empty($record->id))\n\t\t{\n\t\t\treturn Factory::getUser()->authorise(\"core.delete\", \"com_bookingmanager.customer.\" . $record->id);\n\t\t}\n\t}",
"abstract public function shouldIDelete();",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Training_Vendor::main_index_delete');\n }",
"public function isDelete()\n\t{\n\t\treturn $this->httpMethod() == self::MethodDelete;\n\t}",
"function permissions_delete()\n{\n // Deletion not allowed\n return false;\n}",
"public function isDelete() {\n return $this->method == self::METHOD_DELETE;\n }",
"function userCanDeleteUser( $sessionID, $username ) {\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}",
"protected function beforeDelete()\n\t{\n\t\tif(parent::beforeDelete()){\n\t\t\t$avaiable = $this->chkAvaiableDelete($this->id);\n\t\t\tif($avaiable!=''){\n\t\t\t\techo $avaiable;\n\t\t\t\treturn false;\n\t\t\t}else\n\t\t\t\treturn true;\n\t\t}else \n\t\t\treturn false;\n\t}",
"public function isDelete() {\n return $this->method == 'DELETE';\n }",
"public function delete(User $user, EduDocument $document)\n {\n\t\treturn $user->id == $document->user_id || $user->can('Edu-document');\n }",
"public function getCanDeleteProperty()\n {\n return $this->deleteConfirm === $this->staff->email;\n }",
"public function isDelete()\n {\n return $this->method === self::METHOD_DELETE;\n }",
"public function canDelete($member = null) {\n\t\treturn Permission::check('CMS_ACCESS_CMSMain');\n\t}",
"protected function canDelete($record)\n\t{\n\t\t$user = JFactory::getUser();\n\n\t\tif (JFactory::getApplication()->isAdmin())\n\t\t{\n\t\t\treturn $user->authorise('core.delete', 'com_solidres.reservationasset.'.(int) $record->id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn SRUtilities::isAssetPartner($user->get('id'), $record->id);\n\t\t}\n\t}",
"public function is_allowed_to_delete_feedback($feedback);",
"public function authorize()\n {\n return $this->user()->can('manage-drafts');\n }",
"protected function isDeleting()\n {\n return $this->option('delete') == 'true';\n }",
"public function isDelete()\n {\n return ($this->getMethod() == 'DELETE') ? true : false;\n }",
"public function isDelete(): bool\n {\n return $this->getMethod() === self::METHOD_DELETE;\n }",
"public function beforeDelete() {\n // Console doesn't have Yii::$app->user, so we skip it for console\n if (php_sapi_name() != 'cli') {\n // Don't let delete yourself\n if (Yii::$app->user->id == $this->id) {\n return false;\n }\n\n // Don't let non-superadmin delete superadmin\n if (!Yii::$app->user->isSuperadmin AND $this->superadmin == 1) {\n return false;\n }\n }\n\n return parent::beforeDelete();\n }",
"public function canDelete($userId = \"\")\n {\n\n if ($userId == \"\")\n $userId = Yii::$app->user->id;\n\n if ($this->user_id == $userId)\n return true;\n\n if (Yii::$app->user->isAdmin()) {\n return true;\n }\n\n if ($this->container instanceof Space && $this->container->isAdmin($userId)) {\n return true;\n }\n\n return false;\n }",
"function canDelete($member = NULL)\n\t{\n\t\treturn true;\n\t}",
"public function isDelete()\n {\n return $this->isMethod('DELETE');\n }",
"public function isDelete()\n {\n return $this->isMethod('DELETE');\n }",
"public function delete_article()\n {\n if($this->categories->isEmpty()){\n return $this->delete();\n }\n else {\n /*\n * Deleting comments\n */\n $this->comments()->delete();\n\n if($this->categories()->detach()){\n $msg = new Article_Reject_Messages;\n if(!is_null($msg->all()->where('article_id', $this->id)->first())) $msg->all()->where('article_id', $this->id)->first()->delete();\n return $this->delete();\n }\n else return false;\n }\n }",
"public function delete(User $user): bool\n {\n return $user->can('Delete Role');\n }",
"public function isDelete() {\n\t\tif ('DELETE' == $this->getMethod())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function isDelete()\n {\n return $this->getMethod() === 'DELETE';\n }",
"public function canDelete()\n {\n $translate = $this->getTranslate();\n\n if ($this->_usedInSales()) {\n return $translate->_('This store location cannot be removed because it is used in an invoice.');\n }\n\n return true;\n }",
"public function delete(Person $user, Publication $publication)\n {\n return $user->isAdmin() || $user->isModerator() || ($user->id == $publication->id_owner);\n }",
"protected function canDelete($record)\n\t{\n\t\t$user = JFactory::getUser();\n\n\t\tif (JFactory::getApplication()->isAdmin())\n\t\t{\n\t\t\treturn $user->authorise('core.delete', 'com_solidres.tariff.'.(int) $record->id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tableRoomType = $this->getTable('RoomType');\n\t\t\t$tableRoomType->load($record->room_type_id);\n\t\t\treturn SRUtilities::isAssetPartner($user->get('id'), $tableRoomType->reservation_asset_id);\n\t\t}\n\t}",
"public function deletePost(User $user)\n {\n return $user->can('forum-moderate-delete-post') ? true : false;\n }",
"public function isDelete(){\n\t\treturn (strtoupper($this->getHeader('REQUEST_METHOD'))=='DELETE')? true : false;\n\t}"
] | [
"0.77066904",
"0.7699743",
"0.76282305",
"0.758512",
"0.7546944",
"0.7545758",
"0.7533051",
"0.75133026",
"0.7505985",
"0.7479245",
"0.74758375",
"0.74161774",
"0.73611665",
"0.7315147",
"0.72193444",
"0.72182953",
"0.72098255",
"0.71430886",
"0.71428394",
"0.71412593",
"0.71214825",
"0.70170546",
"0.69810784",
"0.69798976",
"0.6950504",
"0.6861622",
"0.68606424",
"0.6859808",
"0.68528086",
"0.6844585",
"0.68259746",
"0.68170345",
"0.6810827",
"0.6807235",
"0.68071413",
"0.6799589",
"0.67613757",
"0.6756229",
"0.6740029",
"0.6736717",
"0.6731787",
"0.6709228",
"0.6697152",
"0.66950935",
"0.66950935",
"0.6692808",
"0.66885424",
"0.6685368",
"0.6663751",
"0.6662273",
"0.66512555",
"0.6645069",
"0.6645069",
"0.6642043",
"0.6640427",
"0.66402835",
"0.66347486",
"0.6624153",
"0.66194415",
"0.66194415",
"0.6618468",
"0.659457",
"0.65826666",
"0.65790045",
"0.6576982",
"0.6562245",
"0.6542942",
"0.65414226",
"0.6539685",
"0.6534577",
"0.65344083",
"0.6518798",
"0.65125656",
"0.6505149",
"0.65038115",
"0.64999825",
"0.64998543",
"0.6492156",
"0.6486051",
"0.6475495",
"0.647227",
"0.6466114",
"0.6448143",
"0.643635",
"0.6426185",
"0.64065397",
"0.6385111",
"0.63749284",
"0.63726926",
"0.63679105",
"0.63679105",
"0.6351114",
"0.63503575",
"0.6349672",
"0.633906",
"0.6335294",
"0.633239",
"0.6329634",
"0.63266224",
"0.63223517"
] | 0.7110918 | 21 |
Determine whether the user can add a comment to the article. | public function createComment(User $user, Article $article)
{
return $this->view($user, $article);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function canAddComment() {\n return Mage::getStoreConfigFlag(self::XML_PATH_ADD_COMMENT);\n }",
"protected function canCreate(){\n return $this->canUserModify() &&\n $this->isQuestionActive() &&\n $this->socialQuestion->SocialPermissions->isUnlockedOrUserCanChangeLockStatus() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_CREATE, $this->getEmptyComment());\n }",
"private function canComment(): bool\n {\n return true;\n }",
"function isCommentable(){\n\t\tglobal $gBitSystem;\n\t\treturn $gBitSystem->isFeatureActive( 'blog_posts_comments' );\n\t}",
"public function authorize()\n {\n// $comment = Comment::find($this->route('comment')); // Get 'comment' route's params.\n// return $comment && $this->user()->can('update', $comment);\n\n return false;\n }",
"public function getArticleAllowComment() {\n return $this->article_allow_comment;\n }",
"function user_can_edit_post_comments($user_id, $post_id, $blog_id = 1)\n {\n }",
"function canCreatePost() {\n return ($this->isAdmin() || ($this->userType == 'author'));\n }",
"public function canPost()\n {\n $role = $this->role;\n if($role == 'author' || $role == 'admin')\n {\n return true;\n } else {\n return false;\n }\n }",
"function canAdd() {\r\n\t\t$user\t=& JFactory::getUser();\r\n\t\t$permission = FlexicontentHelperPerm::getPerm();\r\n\t\tif(!$permission->CanAdd) return false;\r\n\t\treturn true;\r\n\t}",
"protected function canDelete() {\n return $this->canUpdate() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS_DELETE, $this->getEmptyComment());\n }",
"public function add_comment(){\r\n\r\n\t\t/* Require user */\r\n\t\tif (!$commenter = $this->_requireUser('Please sign in, or sign up, to post a comment.')) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t/* Build comment arguments from request variables. */\r\n\t\t$arguments = array();\r\n\t\t$this->add_comment_parse_args($arguments);\r\n\t\t$arguments['commentOwner'] = $commenter->userid;\r\n\r\n\t\t/* Do the deed. */\r\n\t\tif ($this->add_comment_call_model_add($arguments)){\r\n\t\t\t$message = $this->add_comment_success_message();\r\n\t\t\t$messageType = 'info';\r\n\t\t} else {\r\n\t\t\t$message = $this->add_comment_failure_message();\r\n\t\t\t$messageType = 'error';\r\n\t\t}\r\n\r\n\t\t/* Tidy up */\r\n\t\tMessages::addMessage($message, $messageType);\r\n\t\treturn $this->_redirect($this->get_redirect_page());\r\n\r\n\t}",
"public function authorize()\n {\n $article = Article::find($this->route('article'));\n return $article && $this->user()->can('update', $article);\n }",
"public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }",
"public function commentsEnabled()\n {\n return $this->getData('isEnabledComments', true) === true;\n }",
"public function isComment() {}",
"public function add_comment_user()\n\t{\n\t\t$data = array(\n\t\t\t\t'post_comment_description'=>$this->input->post('comment'),\n\t\t\t\t'comment_created'=>date('Y-m-d H:i:s'),\n\t\t\t\t'member_id'=>$this->input->post('member_id'),\n\t\t\t\t'post_comment_status'=>1,\n\t\t\t\t'post_id'=>$this->input->post('post_id')\n\t\t\t);\n\t\t\t\n\t\tif($this->db->insert('post_comment', $data))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function only_post_user_can_answered_his_post()\n {\n $comment = factory(\\App\\Comment::class)->create();\n\n $policy = new CommentPolicy();\n\n $policy->accept($comment->post->user,$comment);\n\n $this->assertTrue($policy->accept($comment->post->user,$comment));\n }",
"protected function canAdd()\n {\n return $this->hasStrategy(self::STRATEGY_ADD);\n }",
"function canCreatePage() {\n return ($this->isAdmin() || ($this->userType == 'author'));\n }",
"protected function canReply(){\n return $this->canUserModify() &&\n $this->socialQuestion &&\n $this->isActive() &&\n $this->socialQuestion->SocialPermissions->canComment() &&\n !$this->connectObj->Parent->ID;\n }",
"function user_can_delete_post_comments($user_id, $post_id, $blog_id = 1)\n {\n }",
"protected function check_is_comment_content_allowed($prepared_comment)\n {\n }",
"public function isCommentsEnabled(): bool\n {\n if ($this->appState->getAreaCode() === Area::AREA_FRONTEND\n && !$this->config->getValue(self::CONFIG_PATH_COMMENTS_FRONTEND)\n || $this->appState->getAreaCode() === Area::AREA_ADMINHTML\n && !$this->config->getValue(self::CONFIG_PATH_COMMENTS_ADMINHTML)\n ) {\n return false;\n }\n\n return true;\n }",
"public function authorize()\n {\n $user = $this->user();\n return $user->can('add-user');\n }",
"protected function _commenting_allowed($row)\n\t{\n\t\tif ($row['allow_comments'] == 'n')\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif (isset($row['comment_system_enabled']) && $row['comment_system_enabled'] == 'n')\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif (config_item('comment_moderation_override') === 'y')\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telseif ($row['comment_expiration_date'] > 0 && $row['comment_expiration_date'] < ee()->localize->now)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\t}",
"public function authorize()\n {\n return Gate::allows('add_to_dos') ? true : false;\n }",
"function canAdd($user) {\n return $user->isPeopleManager();\n }",
"protected function mayContribute($a_posting_id = null, $a_author_id = null)\n\t{\n\t\tglobal $ilUser;\n\t\t\n\t\t// single author blog (owner) in personal workspace\n\t\tif($this->id_type == self::WORKSPACE_NODE_ID)\n\t\t{\n\t\t\treturn $this->checkPermissionBool(\"write\");\t\t\t\t\n\t\t}\n\t\t\t\n\t\tif($this->checkPermissionBool(\"contribute\"))\n\t\t{\t\t\n\t\t\t// check owner of posting\n\t\t\tif($a_posting_id)\n\t\t\t{\n\t\t\t\tif(!$a_author_id)\n\t\t\t\t{\n\t\t\t\t\tinclude_once \"Modules/Blog/classes/class.ilBlogPosting.php\";\n\t\t\t\t\t$post = new ilBlogPosting($a_posting_id);\n\t\t\t\t\t$a_author_id = $post->getAuthor();\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t\tif($ilUser->getId() == $a_author_id)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function canComment($user_guid = 0, $default = null) {\n\t\t$result = parent::canComment($user_guid, $default);\n\t\tif ($result == false) {\n\t\t\treturn $result;\n\t\t}\n\n\t\tif ($this->comments_on == 'Off') {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public function addComment()\n {\n $this->isConnect();\n\n $post = $this->token->check($_POST);\n\n $formMessage = $this->commentsValidationForm->checkForm($post);\n\n if(!$formMessage)\n {\n $post['user_id'] = $_SESSION['id'];\n $post['validated'] = ($_SESSION['statut'] === 'admin') ? 1 : null;\n $this->comments->add($post);\n header('Location: index.php?route=front.postById&id=' . $_POST['post_id'] . '&success=' . $_SESSION['statut'] . '#comments');\n exit;\n }\n else\n {\n $postAddUnvalid = $post;\n $post = $this->posts->postById($_GET['id']);\n $comments = $this->comments->commentsById($_GET['id']);\n $this->render('postById', compact('formMessage', 'postAddUnvalid', 'post', 'comments'));\n }\n }",
"public static function canAddTaskComment($task) {\n return Developer::join('team_task', 'team_task.id_team', '=', 'developer.id_team')\n ->where([['team_task.id_task', $task->id], ['developer.id_user', Auth::user()->getAuthIdentifier()]])\n ->exists();\n }",
"public function isComment()\n {\n return isset($this->comment);\n }",
"public function isAuthorized($user) {\n if ($this->action === 'add') {\n return true;\n }\n\n // The owner of a post can edit and delete it\n if (in_array($this->action, array('edit', 'delete'))) {\n $presupuestoId = $this->request->params['pass'][0];\n if ($this->Post->isOwnedBy($presupuestoId, $user['id'])) {\n return true;\n }\n }\n\n return parent::isAuthorized($user);\n}",
"public function authorize()\n {\n abort_if(Gate::denies('comment_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden');\n return false;\n }",
"public function hasAccessToComment($commentID)\n {\n\n $this->isLoggedIn();\n\n $userid = $this->di->get(\"session\")->get(\"userid\");\n $comment = new Comment();\n $comment->setDb($this->di->get(\"db\"));\n $user = new User();\n $user->setDb($this->di->get(\"db\"));\n\n $user->find(\"id\", $userid);\n $comment->find(\"id\", $commentID);\n\n if (($comment->user_id == $userid) || $this->isAdmin()) {\n return true;\n }\n $this->di->get(\"response\")->redirect(\"user\");\n return false;\n }",
"public function addComment(string $content, int $articleId, User $user)\n {\n if((new ArticleManager)->getSingleEntity($articleId)){\n $comment = (new CommentManager)->addComment($content,$articleId,$user->getId());\n if($comment){\n return $comment;\n }\n return false;\n }\n return false;\n }",
"public function authorize()\n {\n switch ($this->method()) {\n case 'DELETE':\n {\n return true;\n }\n case 'POST':\n {\n return true;\n }\n case 'PUT':\n {\n if (Auth::user()->hasPermissionTo('post_update', 'blog')) {\n return true;\n } else {\n return true;\n }\n }\n default:\n break;\n }\n return true;\n }",
"public function canAdd()\n\t{\n\t\t/* If there is no parent/child relationship and no subnode class, you can't add a child */\n\t\tif( static::$databaseColumnParent === NULL AND static::$subnodeClass === NULL )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn static::restrictionCheck( 'add' );\n\t}",
"public function add() {\n $post_id = $this->request->data['Comment']['post_id'];\n $user_id = $this->Auth->user('id');\n \n \n if ($this->request->is('post')) {\n \n //Post id is not numeric (avoid SQL injection)\n if (!is_numeric($post_id)) {\n $this->Flash->setError(__(\"Vous ne pouvez pas commenter ce post\"));\n return $this->redirect($this->referer());\n }\n \n //Everything is ok, create the comment\n $this->Comment->create();\n $this->request->data['Comment']['user_id'] = $user_id;\n if ($this->Comment->save($this->request->data)) {\n return $this->redirect($this->referer());\n }\n \n $this->Flash->error(__('Ajout de commentaire impossible.'));\n }\n }",
"public function authorize()\n {\n if(session('contact_key'))\n return true;\n\n if (! $this->user()->hasFeature(FEATURE_DOCUMENTS))\n return false;\n\n \n if ($this->invoice && $this->user()->cannot('edit', $this->invoice))\n return false;\n\n\n if ($this->expense && $this->user()->cannot('edit', $this->expense))\n return false;\n\n\n if($this->ticket && $this->user()->cannot('edit', $this->ticket))\n return false;\n\n\n return true;\n //return $this->user()->can('create');\n }",
"public function isTheCommentFromTheAuthor(): bool\n {\n if ($this->action->equals(Action::SYNCHRONIZE())) {\n return true;\n }\n\n if (null === $this->comment) {\n return false;\n }\n\n return $this->issueAuthor->id() === $this->comment->author()->id();\n }",
"protected function AllowSendAuthorReviewCommentNotification()\n {\n $bAllowSendAuthorCommentNotification = false;\n if ($this->fieldSendCommentNotification) {\n if (!empty($this->fieldAuthorEmail) || !empty($this->fieldDataExtranetUserId)) {\n $bAllowSendAuthorCommentNotification = true;\n }\n }\n\n return $bAllowSendAuthorCommentNotification;\n }",
"function addComment(){\n\t\t$this->Article->Comment->create();\n\t\tif ($this->Article->Comment->save($this->data)) {\n\t\t\techo __('Your comment has been added successfully, and will be viewed soon after approving.', true);\n\t\t} else {\n\t\t\techo __('Your comment could not be added.', true);\n\t\t\techo '<br />';\n\t\t\tforeach($this->Article->Comment->validationErrors as $key=>$val){\n\t\t\t\techo $val.',<br />';\n\t\t\t}\n\t\t\techo 'and try again.';\n\t\t}\n\t\t$this->autoRender = false;\n\t}",
"public function authorize()\n {\n if ($this->isMethod('POST')) {\n return true;\n }\n\n $thePost = Post::find($this->route('id'));\n return Auth::user()->can('update', $thePost) && Auth::user()->can('delete', $thePost);\n }",
"function insert(Comment $comment): bool;",
"public function addComment(User $user, Comment $comment)\n {\n return $this->authorized();\n }",
"public function can_do_add() {\n return false;\n }",
"public static function canCommentTicket($ticket)\n\t{\n\t\tif (!auth()->check()) return false;\n\n\t\tif (\\PanicHDMember::canManageTicket($ticket->id)\n or \\PanicHDMember::isTicketOwner($ticket->id)\n or $ticket->commentNotifications()->where('member_id', auth()->user()->id)->count() > 0){\n\n return true;\n\t\t}\n\n return false;\n\t}",
"public function authorize()\n {\n return $this->user()->can('create', MarEntry::class);\n }",
"public function isAuthorized($user) {\n if ($this->action === 'add') {\n return true;\n }\n\n // The owner of a post can edit and delete it\n if (in_array($this->action, array('edit', 'delete'))) {\n $postId = $this->request->params['pass'][0];\n if ($this->Post->isOwnedBy($postId, $user['id'])) {\n return true;\n }\n }\n\n return parent::isAuthorized($user);\n\t}",
"public function comment(User $user, Request $request)\n {\n return $user->isAdmin() || $user->id == $request->owner_id;\n }",
"public function addComment(int $postId, string $username, string $content):bool\n {\n $comment=$this->pdo->prepare(\n 'INSERT INTO comments(commented,content,post_id,commented_by)\n VALUES (now(),:content,:post_id,:commented_by)'\n );\n return $comment->execute(\n [\n 'post_id' => $postId,\n 'commented_by' => $username,\n 'content' =>$content\n ]\n );\n }",
"public function hasComments()\n {\n return $this->getComments()->count() > 0;\n }",
"public function isAuthorized($user) {\n\t\tif ($this->action === 'add') {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// The owner of a post can edit and delete it\n\t\tif (in_array ( $this->action, array (\n\t\t\t\t'edit',\n\t\t\t\t'delete' \n\t\t) )) {\n\t\t\t$postId = $this->request->params ['pass'] [0];\n\t\t\tif ($this->Post->isOwnedBy ( $postId, $user ['id'] )) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn parent::isAuthorized ( $user );\n\t}",
"public function authorize()\n {\n return auth()->user()->can('create', Task::class);\n }",
"protected function check_edit_permission($comment)\n {\n }",
"public function authorize(): bool\n {\n return $this->user()->can('create_contact');\n }",
"public function authorize()\n {\n $user = Auth::user();\n\n $foodAddition = new FoodAddition();\n\n if((!$user->can('create', $foodAddition)) || (!$user->can('create-food-addition'))) {\n return false;\n }\n\n return true;\n }",
"public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }",
"public function authorize()\n {\n return \\Auth::user()->canDo('ADD_PORTFOLIOS');\n }",
"public function isAuthorized($user) {\n\t if ($this->action === 'add') {\n\t return true;\n\t }\n\n\t // The owner of a post can edit and delete it\n\t if (in_array($this->action, array('edit', 'delete'))) {\n\t $postId = (int) $this->request->params['pass'][0];\n\n\t if ($this->Post->isOwnedBy($postId, $user['id'])) {\n\t return true;\n\t }\n\t }\n\t return parent::isAuthorized($user);\n\t}",
"public function doCreate(){\n //only logged in users can write comments\n if(Security::isAuthenticated()){\n if($_POST['send']){\n $userid = Security::getUser()->id;\n $postid = $_GET['blogid'];\n //protects from attackers\n $comment = htmlspecialchars($_POST['commentarea']);\n $time = date(\"Y-m-d\");\n $commentRepository = new CommentRepository();\n //call to createComment\n $commentRepository->createComment($userid, $postid, $comment, $time);\n header('Location: /comment/showComments?id='.$postid);\n }\n }else{\n echo'Only logged in users can write comments';\n }\n }",
"public function canView($slug)\n\t{\n\t\t// The user needs to be logged in, make that check please\n\t\tif ( ! Sentry::check())\n\t\t{\n\t\t\treturn Redirect::to(\"can/$slug#comments\")->with('error', 'You need to be logged in to can comments!');\n\t\t}\n\n\t\t// Get this can can data\n\t\t$can = Can::where('slug', $slug)->first();\n\n\t\t// Declare the rules for the form validation\n\t\t$rules = array(\n\t\t\t'comment' => 'required|min:3',\n\t\t);\n\n\t\t// Create a new validator instance from our dynamic rules\n\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\t// If validation fails, we'll exit the operation now\n\t\tif ($validator->fails())\n\t\t{\n\t\t\t// Redirect to this can can page\n\t\t\treturn Redirect::to(\"can/$slug#comments\")->withInput()->withErrors($validator);\n\t\t}\n\n\t\t// Save the comment\n\t\t$comment = new CanComment;\n\t\t$comment->user_id = Sentry::getUser()->id;\n\t\t$comment->content = e(Input::get('comment'));\n\n\t\t// Was the comment saved with success?\n\t\tif($can->comments()->save($comment))\n\t\t{\n\t\t\t// Redirect to this can can page\n\t\t\treturn Redirect::to(\"can/$slug#comments\")->with('success', 'Your comment was successfully added.');\n\t\t}\n\n\t\t// Redirect to this can can page\n\t\treturn Redirect::to(\"can/$slug#comments\")->with('error', 'There was a problem adding your comment, please try again.');\n\t}",
"protected function canRate(){\n //Check if there's even a logged in user to save some cycles doing all the calculations below\n if(!$this->canUserModify()){\n return false;\n }\n $commentRateObject = $this->createEmptyObjectWithAttachedComment('SocialQuestionCommentContentRating', $this->connectObj);\n // add a filler rating value\n $commentRateObject->RatingValue = 100;\n\n return $this->isActive() &&\n $this->isQuestionActive() &&\n !$this->isAuthor() &&\n $this->socialQuestion->SocialPermissions->isUnlockedOrUserCanChangeLockStatus() &&\n $this->cachePerQuestion(PERM_SOCIALQUESTIONCOMMENTCONTENTRATING_CREATE, $commentRateObject);\n }",
"public function create(User $user)\n {\n return $user->hasCapability('comments::create');\n }",
"public function create_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }",
"public function authorize()\n {\n return $this->user()->can(\"Crear Nómina\");\n }",
"public function add(User $user)\n {\n return $user->role->can_add_post == 1;\n }",
"public function ownsComment(Comment $comment)\n {\n return $this->id === $comment->user_id;\n }",
"public function have_comments()\n {\n }",
"public function addComment( $comment )\n\t{\n\t\tif ( Yii::app()->params['commentNeedApproval'] )\n\t\t\t$comment->status = Comment::STATUS_PENDING;\n\t\telse\n\t\t\t$comment->status = Comment::STATUS_APPROVED;\n\t\t$comment->howto_id = $this->id;\n\t\treturn $comment->save();\n\t}",
"public function authorize()\n {\n if ($this->user()->parent_id == NULL) { //Solo si es Cacique puede agregar indios. Sino, 403!\n return true;\n } else {\n return false;\n }\n }",
"public function authorize()\n {\n\t\treturn $this->user()->can('create', Collection::class);\n }",
"public function isAuthorized($user) {\n if ($this->action === 'add') {\n return true;\n }\n\n // The owner of a post can edit and delete it\n if (in_array($this->action, array('edit', 'delete'))) {\n $postId = (int) $this->request->params['pass'][0];\n if ($this->Post->isOwnedBy($postId, $user['id'])) {\n return true;\n }\n }\n\n return parent::isAuthorized($user);\n }",
"public function isAuthorized($user) {\n\t\treturn true;\n\t /* if ($this->action === 'add') {\n\t\t\treturn true;\n\t\t}\n\n\t\t// The owner of a post can edit and delete it\n\t\tif (in_array($this->action, array('edit', 'delete'))) {\n\t\t\t$postId = (int) $this->request->params['pass'][0];\n\t\t\tif ($this->Post->isOwnedBy($postId, $user['id'])) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn parent::isAuthorized($user);*/\n\t}",
"public function beforeSave()\r\n\t{\r\n\t\tif ($this->isNewRecord)\r\n\t\t\t$this->_isNewRecord = true;\r\n\r\n\t\tif (Content::model()->findByPk($this->content_id)->commentable)\r\n\t\t\treturn parent::beforeSave();\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}",
"public function authorize()\n {\n // パラメータのIDからで削除対象のリプライを取得\n $post = Post::find($this->route(\"id\"));\n // if ($reply == null) return false;\n\n return $post && $this->user()->id == $post->user_id ? true : false;\n }",
"public function is_comment_feed()\n {\n }",
"public function authorize()\n {\n return access()->hasPermission('manage-articles');\n }",
"public function is_allowed_to_edit_content_object()\n {\n return $this->is_allowed(WeblcmsRights::EDIT_RIGHT, $this->publication) &&\n $this->publication->get_allow_collaboration();\n }",
"public function canUserManageUsage()\n {\n return $this->getUser()->hasAccess('manage', 'newsUsage');\n }",
"public function create() {\n\n // Validate blog id in $_GET\n $validator = new \\Validator('GET');\n $validator->required()->integer()->validate('id');\n\n // If error occured return false\n if ($validator->hasErrors()) {\n return false;\n }\n\n // Validate comment\n $this->validator->required()->validate('comment');\n\n // If error occured return false\n if ($this->hasErrors()) {\n return false;\n }\n\n // Get blog to assing comment\n $blog = $this->em->find('Alt68\\Entities\\Blog', $_GET['id']);\n\n // If not find blog return false\n if (!$blog) {\n return false;\n }\n\n // Get commenter user to assing comment\n $commenter = $this->em->find('Alt68\\Entities\\User', $_SESSION['user']['id']);\n\n // If not find commenter return false\n if (!$commenter) {\n return false;\n }\n\n // Create new comment\n $newComment = new Comment();\n\n $newComment->setComment($_POST['comment']);\n $newComment->setBlog($blog);\n $newComment->setCommenter($commenter);\n $newComment->setCreated(new \\DateTime(\"now\"));\n\n $this->em->persist($newComment);\n $this->em->flush();\n\n return true;\n }",
"public function canAdd()\n {\n return $this->options->getOption(\"canAdd\");\n }",
"public function isAuthorized($user)\n {\n if ($this->request->action === 'add') {\n return true;\n }\n \n // The owner of an article can edit and delete it\n if (in_array($this->request->action, ['edit', 'delete'])) {\n $articleId = (int)$this->request->params['pass'][0];\n if ($this->Articles->isOwnedBy($articleId, $user['id'])) {\n return true;\n }\n }\n \n return parent::isAuthorized($user);\n }",
"public function authorize()\n {\n\n return true;\n\n if ($this->route('self_report')) { // If ID we must be changing an existing record\n return Auth::user()->can('self_report update');\n } else { // If not we must be adding one\n return Auth::user()->can('self_report add');\n }\n\n }",
"public function no_post_author_cannot_accept_a_comment_as_post_answer()\n {\n $comment = factory(\\App\\Comment::class)->create();\n\n $this->actingAs(factory(\\App\\User::class)->create());\n\n $this->visit($comment->post->url);\n\n $this->post(route('comment.accept',$comment));\n $this->seeInDatabase('posts',[\n 'id' => $comment->post_id,\n 'pending' => true\n ]);\n\n\n }",
"private function add_comment()\n\t{\n\t\tif(!$this->owner->logged_in())\n\t\t\treturn new View('public_forum/login');\n\t\t\n\t\tif(empty($_POST['body']))\n\t\t\treturn 'Reply cannot be empty.';\n\t\t\n\t\t$post_id = $this->filter;\n\t\t$new_comment = ORM::Factory('forum_cat_post_comment');\n\t\t$new_comment->forum_cat_post_id = $post_id;\n\t\t$new_comment->owner_id\t= $this->owner->get_user()->id;\n\t\t$new_comment->body\t\t\t= $_POST['body'];\n\t\t$new_comment->save();\n\t\treturn 'Thank you, your comment has been added!';\t\t\n\t}",
"function user_can_create_post($user_id, $blog_id = 1, $category_id = 'None')\n {\n }",
"public function create()\n {\n // $this->authorize('create', Comment::class);\n\n }",
"public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }",
"public function canCreatePlaces()\n\t{\n\t\t$viewer = Engine_Api::_()->user()->getViewer();\n\t\tif( !$viewer || !$viewer->getIdentity() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Must be able to create blogs\n\t\t/*\n\t\tif( !Engine_Api::_()->authorization()->isAllowed('blog', $viewer, 'create') ) {\n\t\t\treturn false;\n\t\t}\n\t\t*/\n\t\treturn true;\n\t}",
"function is_comment_feed()\n {\n }",
"public function addCommentAction()\n {\n $this->confirmSession();\n\n $this->view->disable();\n if ($this->request->isPost()) {\n $validator = new CommentValidation();\n $errorMessages = $validator->validate($this->request->getPost());\n \n if (count($errorMessages)) {\n $this->redirect('/index/notFound');\n return;\n }\n\n $postId = $this->request->getPost('postId');\n\n $post = News::findFirst([\n 'conditions' => 'id = ?0 AND isDeleted = 0',\n 'bind' => [\n $postId\n ]\n ]);\n \n if (!$post) {\n $this->redirect('/index/notFound');\n return;\n }\n\n $comment = new Comments();\n\n $comment->userId = $this->session->get('user')['id'];\n $comment->newsId = $postId;\n $comment->content = $this->request->getPost('content');\n $comment->createdAt = date('Y-m-d H:i:s');\n\n $comment->save();\n\n $this->redirect(\"/index/postDetails?id={$postId}\");\n }\n }",
"public function authorize(): bool\n {\n return $this->user()->can('update_contact');\n }",
"public function authorizePost()\n {\n return $this->user()->can('acme.create');\n }",
"public function comment(User $user, string $text)\n {\n $comment = new Comment();\n \n $comment->user_id = $user->id;\n $comment->post_id = $this->id;\n $comment->text = $text;\n \n if($comment->validate() && $comment->save()) {\n $redis = Yii::$app->redis;\n $key = 'post:'. $this->id.':comments';\n $redis->incr($key);\n \n return true;\n }\n \n return false; \n }",
"public function authorize()\n {\n // who can update ??\n // 1- admin\n if (auth()->user()->isAdmin()) {\n return true;\n }\n\n // 2- creator\n if ($this->offerItem->created_by == auth()->user()->id) {\n return true;\n }\n\n return false;\n }",
"public function authorize()\n {\n if ( ! $this->getRelease()->belongsToYou()) {\n return false;\n }\n return true;\n }",
"public function authorize()\n {\n return $this->user()->hasPermission('update-title');\n }",
"protected function check_read_permission($comment, $request)\n {\n }"
] | [
"0.7270118",
"0.7141428",
"0.7090252",
"0.68701535",
"0.6714473",
"0.65672123",
"0.65202755",
"0.65047127",
"0.645797",
"0.64296985",
"0.64261204",
"0.63864636",
"0.63629925",
"0.6330154",
"0.62988746",
"0.6276669",
"0.6266314",
"0.62539774",
"0.62496924",
"0.6237075",
"0.6235962",
"0.62264353",
"0.61768955",
"0.614961",
"0.607903",
"0.6070994",
"0.60627204",
"0.60474616",
"0.6045985",
"0.60415447",
"0.603859",
"0.6034427",
"0.6032308",
"0.6030852",
"0.60278547",
"0.60256964",
"0.6024914",
"0.60234785",
"0.6019805",
"0.601499",
"0.6001147",
"0.5986276",
"0.5964396",
"0.596264",
"0.59604406",
"0.59589344",
"0.5957953",
"0.59576744",
"0.59559184",
"0.5951981",
"0.5945344",
"0.5932219",
"0.59295726",
"0.59258026",
"0.5914551",
"0.5908005",
"0.59039825",
"0.5901539",
"0.5894953",
"0.5891893",
"0.5889068",
"0.5887857",
"0.58852965",
"0.5884954",
"0.5879154",
"0.58744377",
"0.5874077",
"0.5849235",
"0.5846282",
"0.5841781",
"0.58402246",
"0.5833973",
"0.58266675",
"0.58211654",
"0.5818771",
"0.5814591",
"0.58105683",
"0.5808415",
"0.5804792",
"0.5803447",
"0.5800621",
"0.5799009",
"0.5792853",
"0.579218",
"0.57855695",
"0.5781703",
"0.57647145",
"0.5764508",
"0.57605076",
"0.57543457",
"0.5748012",
"0.5738834",
"0.5725373",
"0.5723492",
"0.5721681",
"0.5707738",
"0.570486",
"0.5704369",
"0.5704064",
"0.5702636",
"0.56998336"
] | 0.0 | -1 |
before action is excututed | function __construct(){
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function before(){}",
"protected function beforeAction () {\n\t}",
"protected abstract function before();",
"protected function beforeAction() {\n\n }",
"abstract protected function before();",
"protected function _before()\n\t{\n\t\t\n\t}",
"public function before_run(){}",
"abstract function before();",
"public function preAction()\n {\n // Nothing to do\n }",
"public function pre_action()\n\t{\n\t\tparent::pre_action();\n\t}",
"public function preAction()\n {\n }",
"public function before_run() {}",
"private function before_execute()\n {\n }",
"protected function _before()\n {\n }",
"public function before() {}",
"public function before() {}",
"public function preAction() {\n\n }",
"public function before()\n\t{\n\t}",
"protected function before()\n {\n }",
"public function _before()\n {\n }",
"public function take_action()\n {\n }",
"public function take_action()\n {\n }",
"public static function _before() : void {\n\t}",
"protected function beforeProcess() {\n }",
"public static function before() {\n\t\t// Return true for the actions below to execute\n\t\treturn true;\n\t}",
"protected function beforeDoAction() {\n return true;\n }",
"protected function before() {\n }",
"protected function before(): void\n {\n }",
"function before_enable() { }",
"protected function afterAction() {\n\n }",
"protected function before_filter() {\n\t}",
"protected function before(){\n\n }",
"protected function afterAction () {\n\t}",
"public function before()\n {\n parent::before();\n\n // Get the HTTP status code\n $action = $this->request->action();\n\n if ($this->request->is_initial())\n {\n // This controller happens to exist, but lets pretent it does not\n $this->request->action($action = 404);\n }\n else if ( ! method_exists($this, 'action_'.$action))\n {\n // Return headers only\n $this->request->action('empty');\n }\n\n // Set the HTTP status code\n $this->response->status($action);\n }",
"public function beforeAction()\n {\n // do nothing, just disable the login check in parent::beforeAction;\n //\n }",
"public function beforeAction($action){\n\t\treturn parent::beforeAction($action);\n\t}",
"public function before()\n {\n }",
"public function before()\n {\n }",
"public function before()\n {\n }",
"protected function beforeMethod()\n {\n }",
"public function beforeAction( $request )\r\n\t\t{\r\n\r\n\t\t}",
"public function before()\n\t{\n\t\tif ($this->request->action === 'login' OR $this->request->action === 'logout')\n\t\t{\n\t\t\t$this->requires_login = FALSE;\n\t\t}\n\t}",
"public function preExecute()\n {\n if (clsCommon::permissionCheck($this->getModuleName().\"/\".$this->getActionName()) == false){\n $this->getUser()->setFlash(\"errMsg\",sfConfig::get('app_Permission_Message'));\n $this->redirect('default/index');\n }\n }",
"public function before()\n\t{\n\t\tif ($this->request->is_initial())\n\t\t{\n\t\t\t$this->request->action(404);\n\t\t}\n\t\t\n\t\treturn parent::before();\n\t}",
"public function preExecute()\n {\n if (clsCommon::permissionCheck($this->getModuleName().\"/\".$this->getActionName()) == false){\n $this->getUser()->setFlash(\"errMsg\",sfConfig::get('app_Permission_Message'));\n $this->redirect('default/index');\n } \n }",
"public function before()\n {\n }",
"public function afterAction() {\n }",
"public function preExecute(){\n\n\t\n\t}",
"public function beforeStart()\n {\n }",
"public function before()\n\t{\n\t\t// Check method Support\n\t\tif ( ! isset($this->_method_map[$this->request->method()]))\n\t\t\tthrow HTTP_Exception::factory(405)->allowed($this->_method_map);\n\n\t\t// Generate the action name based on the HTTP Method of the request, and a supplied action\n\t\t$action_name = ($this->request->action() === 'index')\n\t\t\t? Arr::get($this->_method_map, $this->request->method())\n\t\t\t: Arr::get($this->_method_map, $this->request->method()).'_'.$this->request->action();\n\n\n\t\t$this->request->action($action_name);\n\t}",
"public function beforeSetup()\n {\n }",
"protected function before() {\n\t\t// Empty default implementation. Should be implemented by descendant classes if needed\n\t}",
"function before() {\n\t\tparent::before();\n\t\t$this->_activity_result[] = $this->request->param(\"id\");\n\t}",
"public function beforeStart () {\n }",
"function charity_before() {\n do_action('charity_before');\n}",
"abstract protected function beforeRun($data);",
"function afterAction()\n {\n }",
"public function preDispatch() { }",
"public function beforeFilter()\n\t{\n\n\t}",
"public function preDispatch();",
"public function before()\n {\n if (in_array($this->request->action(), $this->_no_auth_action))\n {\n $this->_auth_required = FALSE;\n }\n\n parent::before();\n }",
"public function before()\n\t{\n\t\tif (User::is_guest())\n\t\t{\n\t\t\tthrow HTTP_Exception::factory(403, 'Permission denied! You must login!');\n\t\t}\n\n\t\t$id = $this->request->param('id', FALSE);\n\n\t\tif ($id AND 'index' == $this->request->action())\n\t\t{\n\t\t\t$this->request->action('view');\n\t\t}\n\t\tif ( ! $id AND 'index' == $this->request->action())\n\t\t{\n\t\t\t$this->request->action('inbox');\n\t\t}\n\n\t\tAssets::css('user', 'media/css/user.css', array('theme'), array('weight' => 60));\n\n\t\tparent::before();\n\t}",
"public function preDispatch()\n {\n\n }",
"public function preDispatch()\n\t{\n\n\t\t\n\t\t\n\t}",
"public function setup_actions() {}",
"protected function preProcess() {}",
"public function preDispatch()\n {\n //...\n }",
"protected function after(){}",
"protected function after(){}",
"protected function after(){}",
"function test_init_action_is_run() {\n\t}",
"protected function beforeRun(){\n\t\treturn true;\n\t}",
"public function beforeEnd () {\n }",
"public function __before() {\n\t\t// runs after this->data is set up, but before the class methods are run\n\t}",
"public function preDispatch() {\n\t\t\n\t\t}",
"public function beforeFilter() {\n\t}",
"protected function _before(){\n $this->startApplication();\n }",
"public function beforeAction($action)\n {\n \\Yii::trace($action->id, __CLASS__ . \"::\" . __FUNCTION__);\n if (!parent::beforeAction($action)) return false;\n return true;\n }",
"public function beforeFilter(){\n\t\tparent::beforeFilter();\n// debug('test');\n\t\tif (isset($this->Auth)) {\n\t\t\t$this->Auth->allow('process');\n\t\t}\n\t\tif (isset($this->Security) && $this->action == 'process') {\n\t\t $this->Security->validatePost = false;\n\t\t}\n\t}",
"public function beforeAction($action)\n {\n // which are triggered on the [[EVENT_BEFORE_ACTION]] event, e.g. PageCache or AccessControl\n\n if (!parent::beforeAction($action)) {\n return false;\n }\n\n // other custom code here\n\n return true; // or false to not run the action\n }",
"protected function _beforeInit() {\n\t}",
"public function before_render() {}",
"public function beforeRender($action){\r\n\t\tif ($action->get_id() == 10) \r\n\t\t\t$action->set_userdata(\"color\", \"pink\"); //mark event\r\n\t}",
"protected function beforeFlight()\n {\n return parent::beforeFlight();\n }",
"function before_filter(&$action, &$args) {\n }",
"public function _before_init(){}",
"protected function runBeforeResponseSet(&$actionResult) {\n\t\t// Empty default implementation. Should be implemented by descendant classes if needed\n\t}",
"public function beforeFilter(){ \n\t\t$this->check_session();\n\t\t$this->check_role_access(2);\n\t}",
"public function\n\t\tdo_actions()\n\t{\n\t}",
"public function beforeAction($action)\n {\n if (parent::beforeAction($action)) {\n return true; // or false if needed\n } else {\n return false;\n }\n }",
"public function preDispatch()\n {\n $config = Mage::getModel('emailchef/config');\n /* @var $config EMailChef_EMailChefSync_Model_Config */\n\n if (!$config->isTestMode()) {\n die('Access Denied.');\n }\n\n return parent::preDispatch();\n }",
"public function beforeAction($action)\n\t{\n\t\t$x=new ExtraFunctions;\n\t\t$x->beforeActionTimeLanguage();\n\t\treturn parent::beforeAction($action);\n\t}",
"public function after_run(){}",
"public function before()\n {\n\tparent::before();\n\n // 管理者グループのみ許可\n\tif (!Controller_Auth::is_admin())\n {\n\t Response::redirect('auth/invalid');\n }\n }",
"public function beforeFilter()\r\n\t {\r\n\t parent::beforeFilter();\r\n\t }",
"public function beforeRender() {\r\n\t}",
"public function beforeFilter(){\n\t\t$this->check_admin_session();\t\t\n\t}",
"public function preExecute() {\n }",
"public function preTesting() {}",
"public function beforeFilter() { \n\t\t//$this->disable_cache();\n\t\t$this->show_tabs(105);\n\t\t// check module access\n\t\t\n\t}",
"public function beforeFilter() {\n\t\tparent::beforeFilter();\n\t\tif ($this->request->action == 'admin_toggle' || \n\t\t\t$this->request->action == 'admin_add_smart' ||\n\t\t\t$this->request->action == 'admin_save_condition' ) {\n\t\t\t$this->Components->disable('Security');\n\t\t}\n\t}"
] | [
"0.8203585",
"0.8156421",
"0.7905018",
"0.7815645",
"0.7810427",
"0.7769502",
"0.7717171",
"0.76538044",
"0.7554285",
"0.7467489",
"0.7463077",
"0.7419117",
"0.7403275",
"0.74016243",
"0.7383648",
"0.7383648",
"0.738146",
"0.73084766",
"0.72875637",
"0.726406",
"0.7238115",
"0.7238115",
"0.7228776",
"0.7200452",
"0.71769726",
"0.71478033",
"0.71370673",
"0.712662",
"0.7032893",
"0.7009423",
"0.69967437",
"0.6974416",
"0.69536805",
"0.69387794",
"0.69212776",
"0.6918897",
"0.6912674",
"0.6912564",
"0.69117355",
"0.69043267",
"0.685974",
"0.68494767",
"0.6830343",
"0.6825435",
"0.6822983",
"0.68216604",
"0.6782695",
"0.6752343",
"0.67208046",
"0.670285",
"0.66985923",
"0.66921705",
"0.6691652",
"0.66857046",
"0.6651357",
"0.6640737",
"0.66306156",
"0.66212434",
"0.6613813",
"0.6600303",
"0.6590606",
"0.6575451",
"0.6574074",
"0.6569264",
"0.65588367",
"0.6516389",
"0.65051347",
"0.65041643",
"0.65041643",
"0.65041643",
"0.6488522",
"0.6476112",
"0.64704144",
"0.6459697",
"0.64427215",
"0.64395547",
"0.6434256",
"0.64272517",
"0.642355",
"0.6422939",
"0.6395253",
"0.638847",
"0.63857555",
"0.63792974",
"0.6354535",
"0.6345946",
"0.63371885",
"0.6332514",
"0.63300943",
"0.6321542",
"0.63154846",
"0.63072866",
"0.63021266",
"0.6297829",
"0.628068",
"0.62766355",
"0.62764806",
"0.62748533",
"0.6271765",
"0.6251976",
"0.6245007"
] | 0.0 | -1 |
Silently check if this is a launch and if so, handle it | function ltiLaunchCheck() {
global $CFG, $PDO;
if ( ! ltiIsRequest() ) return false;
$session_id = ltiSetupSession($PDO);
if ( $session_id === false ) return false;
// Redirect back to ourselves...
$url = curPageURL();
$query = false;
if ( isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0) {
$query = true;
$url .= '?' . $_SERVER['QUERY_STRING'];
}
$location = sessionize($url);
session_write_close(); // To avoid any race conditions...
if ( headers_sent() ) {
echo('<p><a href="'.$url.'">Click to continue</a></p>');
} else {
header('Location: '.$location);
}
exit();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isLaunchable() {\n // on the application launch list is confusing.\n return false;\n }",
"public function manageNotFoundExecutableAction()\n {\n $responses = $this->triggerEvent(__FUNCTION__ . '.normalAction');\n return !$responses->stopped() && $this->flowEvaluator->attemptResume();\n }",
"function errorOnProcessLunch() {\n print \"Failed to lunch process \\n\";\n}",
"protected function runningFromCliOrWrongConfiguration() {}",
"public static function launcher()\n {\n $displayerrors = get_plugin_setting('displayerrors', 'elgg_developer_tools');\n if ($displayerrors) ini_set('display_errors', 1);\n \n /** delete views if its requested **/\n $deleteviews = get_plugin_setting('deleteviews', 'elgg_developer_tools');\n if ($deleteviews) self::_deleteViews();\n \n /** include firePHP if need be **/\n $firephp = get_plugin_setting('enablefirephp', 'elgg_developer_tools');\n if ($firephp) {\n require_once dirname(__FILE__) . '/firephp/FirePHP.class.php';\n require_once dirname(__FILE__) . '/firephp/fb.php';\n }\n else {\n require_once dirname(__FILE__) . '/FirePHPDisabled.php';\n }\n }",
"function onLaunch() {\n // context and resourceLink properties of the class instance\n // to access the current user, context and resource link.\n\n//\t$this->reason = 'Incomplete data';\n// $this->ok = false;\n//\t$users = $context->getMemberships();\n\n }",
"public function shouldSpawn() {\n return !array_key_exists(self::JS_BASE_MODEL_COMMAND, $this->getArgs());\n }",
"public function handle_exit_recovery_mode()\n {\n }",
"public static function handle() {\n die(call_user_func([new self::$_class, self::$_action]));\n }",
"private function parse_args() {\n\t\t//exit;\t\t\n\t}",
"public function handle()\n {\n $this->process->mustRun();\n }",
"public function launchApp()\n {\n if ($this->findAppPort()) {\n return;\n }\n\n exec('open ' . self::APP_LAUNCH_URL);\n\n while (!$this->findAppPort()) {\n sleep(2);\n }\n }",
"abstract function preExit();",
"public function _break()\n {\n //set the internal execution flag to false, stopping execution\n $this->executing = false;\n }",
"public function launch() {\r\n\t\t// Check if the requested class exists\r\n\t\tif(class_exists($this->class)) {\r\n\t\t\t// It is, create a new instance\r\n\t\t\t$this->action_instance = new $this->class($this);\r\n\t\t\t\r\n\t\t\t// Check for action authentication\r\n\t\t\tif( !$this->action_instance->checkAuth() ) {\r\n\t\t\t // Authentication failed! Terminate the script\r\n\t\t\t error('no_auth');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Check if the requested method exists\r\n\t\t\tif( is_callable(array($this->action_instance, $this->method))) {\r\n\t\t\t\t// It is, launch it\r\n\t\t\t\t$this->action_instance->{$this->method}();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// The requested method does not exist, display an error\r\n\t\t\t\treturn error('The requested method does not exist!', false);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// The requested class does not exist, display an error\r\n\t\t\treturn error('The requested controller does not exist!', false);\r\n\t\t}\r\n\t}",
"protected function checkForCliDispatch() {}",
"function onLaunch() \n {\n $user = $this->getOrCreateUser();\n $this->user_id = $user->id;\n\n $activity = $this->getOrCreateActivity();\n $this->activity_id = $activity->id;\n\n // get user role for pivot table\n $role = $this->user->isStaff() ? 'staff' : 'student';\n $this->role = $role;\n\n $this->createOrUpdatePivot($user, $activity, $role);\n\n $userActivity = $user->activities->where('id', $activity->id)->first();\n $currentRoundNumber = is_null($userActivity) ? 1 : $userActivity->pivot->current_round;\n $this->currentRoundNumber = $currentRoundNumber;\n \n $currentPageNumber = is_null($userActivity) ? 1 : $userActivity->pivot->current_page;\n $this->currentPageNumber = $currentPageNumber;\n \n $currentRound = $activity->rounds->where('round_number', $currentRoundNumber)->first();\n $this->format = isset($currentRound->format) ? $currentRound->format : $activity->format;\n }",
"protected function onlyRunFromCommandLine() {\n if (php_sapi_name() != 'cli') {\n die(\"Please run this from the commandline.\\n\");\n }\n }",
"function exitAllowedOn()\n\t{\n\t\t$this->bExitAllowed = true;\n\t}",
"public static function __startup()\n\t{\n\t/*\n\t\t// Right now Phodevi is just using xrandr to set display modes, so if that's not present, this module will be useless\n\t\tif(!pts_client::executable_in_path('xrandr'))\n\t\t{\n\t\t\treturn pts_module::MODULE_UNLOAD;\n\t\t}\n\t*/\n\t\tif(count(phodevi_parser::read_xdpy_monitor_info()) > 1)\n\t\t{\n\t\t\t// No multi-monitor support right now\n\t\t\treturn pts_module::MODULE_UNLOAD;\n\t\t}\n\t}",
"public function onShutDown()\n {\n }",
"public function onShutDown()\n {\n }",
"protected function isInitialInstallationInProgress() {}",
"public function handle()\r\n {\r\n try {\r\n $this->call(\"swooliy:stop\");\r\n\r\n sleep(2);\r\n \r\n $this->call(\"swooliy:start\");\r\n } catch (Throwable $e) {\r\n die($e);\r\n }\r\n }",
"public function runInitialSystemSettings()\n {\n $routeMD = Model::routeInstance();\n\n $route = $routeMD->getRoute();\n if($route != GlobalSystem::ExpTranslatedRequestStartupRoute){\n try{\n $step = new ExecutionStep();\n $step->checkSecretKey;\n $this->connexionDB = $step->checkConnexionHostDB;\n $this->accessDB = $step->checkAccessSystemDB;\n }catch(Exception $error){\n ErrorManager::onErrorRoute($error);\n }\n }\n\n return true;\n }",
"function LT_call_silent() {\n\t$proc = func_get_arg(0);\n\t$args = array_slice(func_get_args(), 1);\n\t$die = FALSE;\n\treturn LT_call($proc, $args, $die);\n}",
"public function launch()\n {\n global $interface;\n global $configArray;\n\n if (isset($_POST['submit'])) {\n $process = $this->_processSubmit();\n }\n\n // Display Page\n if (isset($_GET['lightbox'])) {\n return $this->_processLightbox();\n } else {\n $this->_processNonLightbox();\n }\n }",
"private function launcher() {\n \n $controller = $this->controller;\n $task = $this->task;\n \n if (!isset($controller)) {\n $controller = 'IndexController';\n }\n else {\n $controller = ucfirst($controller).'Controller';\n }\n \n if (!isset($task)) {\n $task = 'index';\n }\n \n $c = new $controller();\n \n call_user_func(array($c, $task));\n \n Quantum\\Output::setMainView($this->controller, $task);\n \n\n }",
"public function handle()\n {\n $item = Inbox::where('id', $this->argument('id'))->first();\n\n if(!$item)\n return $this->error('Item not found');\n\n $class = '\\App\\Jobs\\ActivityPub\\\\'.$item->type;\n if(class_exists($class))\n $class::dispatch($item->id);\n else\n Log::error('Activity not supported: '.$item->type);\n }",
"public function handleShutdown() {\n\t\t$last_error = error_get_last();\n\t\tif ( !empty( $last_error ) ) {\n\t\t\t$this->handleError(\n\t\t\t\t$last_error['type'],\n\t\t\t\t$last_error['message'],\n\t\t\t\t$last_error['file'],\n\t\t\t\t$last_error['line']\n\t\t\t);\n\t\t}\n\t}",
"private function launch_bundle () {\n\t\t$bundle = $this->target_loader->get_bundle_binary_path();\n\t\t$bundle_name = basename($this->target_loader->bundle);\n\t\t\n\t\t// Print the console macro\n\t\tprint(self::CONSOLE_MACRO_LAUNCHED.\"\\n\");\n\n\n\t\tswitch ($this->launch_mode) {\n\t\t\tcase self::LAUNCH_MODE_CONSOLE: {\n\t\t\t\t$this->print_message(\"Launching $bundle_name...\");\n\t\t\t\t$this->launch_process(\"\\\"$bundle\\\" 2>&1\", null, true);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tcase self::LAUNCH_MODE_TERMINAL: {\n\t\t\t\t$this->print_message(\"Launching $bundle_name in Terminal...\");\n\t\t\t\t\n\t\t\t\t$command = \"/usr/bin/osascript <<EOF\\n\";\n\t\t\t\t$command .= \"tell application \\\"Terminal\\\"\\n\";\n\t\t\t\t$command .= \"\tif (count of windows) is 0 then\\n\";\n\t\t\t\t$command .= \"\t\tdo script \\\"'$bundle'\\\"\\n\";\n\t\t\t\t$command .= \"\telse\\n\";\n\t\t\t\t$command .= \"\t\tdo script \\\"'$bundle'\\\" in window 1\\n\";\n\t\t\t\t$command .= \"\tend if\\n\";\n\t\t\t\t$command .= \"\tactivate\\n\";\n\t\t\t\t$command .= \"end tell\\n\";\n\t\t\t\t$command .= \"EOF\\n\";\n\n\t\t\t\t// Execute the osascript\n\t\t\t\texec($command);\n\t\t\t\t\n\t\t\t\t// Activate TextMate again once the process is complete\n\t\t\t\t// ??? how do we know the process quit?\n\t\t\t\t//exec(\"open -a TextMate\");\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"public function handle()\n {\n\n global $argv;\n $arg = $this->argument('action');\n $argv[1] = $argv[2];\n $argv[2] = isset($argv[3]) ? \"-{$argv[3]}\" : '';\n switch ($arg) {\n case 'start':\n $this->start();\n break;\n case 'stop':\n break;\n case 'restart':\n break;\n case 'reload':\n break;\n case 'status':\n break;\n case 'connections':\n break;\n }\n\n }",
"public function needsExecution() {}",
"public function needsExecution() {}",
"public function needsExecution() {}",
"public function needsExecution() {}",
"public function needsExecution() {}",
"public function handle()\n {\n $applications = collect((new SgpBase)->getApplications());\n\n foreach ($applications as $app) {\n if (Carbon::parse($app->applyDate)->diffInDays() > 6) {\n (new SgpPost)->rejectApplication($app->id);\n }\n }\n }",
"public function launch() {\n\t\t$controller = ucfirst($this->getController());\n\t\t$method = $this->getMethod();\n\t\t\n\t\tif (file_exists(APPPATH . 'modules/' . $controller . '.php') === FALSE)\n\t\t\tshowError($this->lang->line('syserr_notfound'), 404);\n\t\t\n\t\tinclude_once(APPPATH . 'modules/' . $controller . '.php');\n\t\t\n\t\tif (class_exists($controller) === FALSE)\n\t\t\tshowError($this->lang->line('syserr_notfound'), 404);\n\n\t\t$app = new $controller();\n\t\t\n\t\tif (method_exists($app, $method) === FALSE)\n\t\t\tshowError($this->lang->line('syserr_notfound'), 404);\n\t\t\n\t\t\n\t\t$app->$method();\n\t}",
"public function default()\n {\n global $controller,$alerts,$local,$view,$theme;\n $tmpFirst = null;\n if ($controller->argc > 0) {\n $tmpFirst = $controller->argv[0];\n $this->ifProfile($tmpFirst);\n }\n }",
"protected static function isCommandLine() {}",
"public function runningNative() {}",
"public function handleShutdown()\n {\n $last_error = error_get_last();\n\n if ( ( $last_error !== null ) and ( in_array($last_error['type'], Array ( E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR, E_CORE_WARNING, E_COMPILE_WARNING, E_PARSE )) ) )\n {\n $this->DontShowBacktrace = true;\n $this->handleError($last_error['type'], $last_error['message'], $last_error['file'], $last_error['line']);\n }\n }",
"public function run() {\n\t\tif ($this->schedule->isRun()) {\n\t\t\t$this->excuteHandle->excute();\n\t\t}\n\t}",
"abstract public function launch(Request $request, Response $response);",
"protected function onBoot() {}",
"function intercept_request(){\n\t\t\tglobal $wp_query;\n\t\t\t$rqt = isset($wp_query->query_vars['pagename']) ? $wp_query->query_vars['pagename'] : '';\n\n\t\t\tif ($rqt === 'splashgate') {\n\t\t\t\t$splashgate_options = array();\n\t\t\t\t$splashgate_options = get_option('splashgate_options');\n\t\t\t\t\n\t\t\t\tif (!empty($splashgate_options['splashpage_id'])) {\n\t\t\t\t\t$splash_link = get_permalink( $splashgate_options['splashpage_id'] );\n\t\t\t\t\tif ($splash_link) {\n\t\t\t\t\t\twp_redirect( $splash_link );\n\t\t\t\t\t\texit;\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\n\t\t}",
"function tryMove($place){\n if($this->goNoGoForLaunch($place)){\n $this->move($place);\n return TRUE;\n }else{\n return False;\n }\n }",
"public function handle()\n {\n // check for CheckIns\n $this->checkIns();\n }",
"function jr_first_run() {\r\n\tif ( isset( $_GET['firstrun'] ) ) do_action( 'appthemes_first_run' );\r\n}",
"public function handle()\n {\n MakeUnattachedGovernmentsInActive::dispatch();\n }",
"function on_start($function)\n{\n return signal(new \\XPSPL\\processor\\SIG_Startup(), $function);\n}",
"function execute() {\n\t\tif (empty($this->args)) {\n\t\t\t$this->__interactive();\n\t\t}\n\n\t\tif (count($this->args) == 1) {\n\t\t\t$this->__interactive($this->args[0]);\n\t\t}\n\n\t\tif (count($this->args) > 1) {\n\t\t\t$type = Inflector::underscore($this->args[0]);\n\t\t\tif ($this->bake($type, $this->args[1])) {\n\t\t\t\t$this->out('done');\n\t\t\t}\n\t\t}\n\t}",
"public function executeOnShutdown();",
"protected function checkScreenAction() {}",
"function check_plugin_mainscreen_name()\r\r\n{\r\r\n $screen = get_current_screen();\r\r\n if (is_object($screen) && $screen->id == 'toplevel_page_oneclick-google-map') {\r\r\n return true;\r\r\n }\r\r\n else {\r\r\n return false;\r\r\n }\r\r\n}",
"public function handlePodiumStart() {\n\t\t$this->displayTeamScoreWidget(false);\n\t}",
"private function _checkPidfile()\n {\n if (!file_exists(static::$pid))\n {\n return true;\n }\n\n $pid = (int)file_get_contents(static::$pid);\n\n if ($pid > 0 && posix_kill($pid, 0))\n {\n die(\"ArrowWorker hint : process is already started\".PHP_EOL);\n }\n else\n {\n die(\"ArrowWorker hint : process ended abnormally , Check your program.\" . self::$pid.PHP_EOL);\n }\n\n die('checking pid file error'.PHP_EOL);\n }",
"public function gearmanRunOnceBeforeExit()\n {\n echo \"i am handling signal!\\n\";\n if (!isset($this->_app)) {\n $this->_app = CApp::getApp();\n }\n// var_dump($this->sub_process_keys);\n foreach ($this->sub_process_keys as $_k => $_subProcessKey) {\n $workeName = $this->_gearmanFuncNamePre.\"_\".$_subProcessKey;\n $this->_app->logger->log(\"i am worker {$workeName},i am tring to run last worker before exit\", \"NOTICE\");\n $dataDir = $this->_app->systemDataDir;\n $workingJobsDir = $dataDir.DIRECTORY_SEPARATOR.self::WORKING_JOBS_DIRNANE;\n if (!file_exists($workingJobsDir)) {\n mkdir($workingJobsDir);\n }\n $registerFuncName = $this->_gearmanFuncNamePre.\"_\".$_subProcessKey;\n $workingJobFile = $workingJobsDir.DIRECTORY_SEPARATOR.$registerFuncName;\n var_dump($workingJobFile);\n if (!file_exists($workingJobFile)) {\n $this->_app->logger->log(\"i am worker {$workeName},i am not working when i am nicely killed\", \"NOTICE\");\n // when job isn't running kill the working process\n posix_kill($this->_forkedPids[$_k], SIGKILL);\n } \n else {\n echo \"the worker $workeName is running\\n\";\n }\n }\n }",
"protected function main()\n /**/\n {\n parent::run();\n }",
"public function getLaunchStage()\n {\n return $this->launch_stage;\n }",
"public function run() {\n\t\t// If this particular request is not a hook, something is wrong.\n\t\tif (!isset($this->server[self::MERGADO_HOOK_AUTH_HEADER])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s is to be used only for handling hooks sent from Mergado.\n\t\t\t\tMergado-Apps-Hook-Auth is missing.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t}\n\n\t\tif (!$decoded = json_decode($this->rawRequest, true)) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle request, because the data to be handled is empty.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t} elseif (!isset($decoded['action'])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle the hook, because the hook action is undefined.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t};\n\n\t\t$this->handle($decoded['action'], $decoded);\n\n\t}",
"public function run()\n {\n /* this particular object won't run */\n }",
"function execute()\n\t{\t\n\t\t// Check for requested action\n\t\t$app_action = isset($_REQUEST['ax']) ? $_REQUEST['ax'] : 'startup_view';\n\t\t\n\t\tif(method_exists($this,$app_action))\n\t\t{\n\t\t\t// Call requested action\n\t\t\t$this->$app_action();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->default_action($app_action);\n\t\t}\n\t}",
"public function correlateStartMessage(): ProcessInstanceInterface;",
"protected function doExit() {\n\t\tif (FLOW_SAPITYPE === 'Web') {\n\t\t\theader('HTTP/1.1 503 Service Temporarily Unavailable');\n\t\t\treadfile(FLOW_PATH_FLOW . 'Resources/Private/Core/LockHoldingStackPage.html');\n\t\t} else {\n\t\t\t$expiresIn = abs((time() - self::LOCKFILE_MAXIMUM_AGE - filemtime($this->lockFlagPathAndFilename)));\n\t\t\techo 'Site is currently locked, exiting.' . PHP_EOL . 'The current lock will expire after ' . $expiresIn . ' seconds.' . PHP_EOL;\n\t\t}\n\t\texit(1);\n\t}",
"public function handle()\n {\n if (parent::handle() === false && ! $this->option('force')) {\n return;\n }\n\n return;\n }",
"protected function beforeActivation() {\n if (!self::checkPreconditions()) {\n ilUtil::sendFailure(\"Cannot activate plugin: Make sure that you have installed the CtrlMainMenu plugin and RouterGUI. Please read the documentation: http://www.ilias.de/docu/goto_docu_wiki_1357_Reporting_Plugin.html\", true);\n //throw new ilPluginException(\"Cannot activate plugin: Make sure that you have installed the CtrlMainMenu plugin and RouterGUI. Please read the documentation: http://www.ilias.de/docu/goto_docu_wiki_1357_Reporting_Plugin.html\");\n return false;\n }\n return true;\n }",
"public function isBooted();",
"function main() {\n\t\tif (!$this->_registerPid()) {\n\t\t\t$this->out('Unable to register Pid');\n\t\t\t$this->_stop();\n\t\t}\n\t\tif (file_exists($this->params['working'] . DS . '.autotest')) {\n\t\t\tinclude($this->params['working'] . DS . '.autotest');\n\t\t}\n\t\tif (!empty($this->params['notify'])) {\n\t\t\t$this->settings['notify'] = $this->params['notify'];\n\t\t}\n\t\tif (!empty($this->params['mode'])) {\n\t\t\t$this->settings['mode'] = $this->params['mode'];\n\t\t}\n\t\t$suffix = '';\n\t\tif (!empty($this->settings['mode'])) {\n\t\t\t$suffix = ' (' . $this->settings['mode'] . ' mode)';\n\t\t}\n\n\t\tNotify::$method = $this->settings['notify'];\n\t\t$this->addHooks();\n\t\tNotify::message('Autopilot Starting', 'in ' . APP_DIR . $suffix, 0, false);\n\t\t$this->buildPaths();\n\t\t$this->run();\n\t}",
"function signalHandler()\n{\n exit(1);\n}",
"public function handle()\n {\n if ($this->hasOption('bootstrap')) {\n $this->call('cocoa:events-2016');\n }\n $this->call('cocoa:events');\n $this->call('cocoa:posts');\n }",
"function exitAllowedOff()\n\t{\n\t\t$this->bExitAllowed = false;\n\t}",
"static function runProcessorAndWait() {\n $process_cmd = get_option('hbo_run_processor_cmd');\n if (substr(php_uname(), 0, 7) != \"Windows\" && false === empty($process_cmd)) {\n $command = \"$process_cmd > /dev/null 2>&1\";\n exec( $command );\n }\n }",
"protected static function _ignoreFrameworkResult() {\n Framework::getInstance()->stop(0);\n }",
"public function handle()\n {\n $monitors = Monitor::query()\n ->where('lighthouse_check_enabled', true)\n ->orderBy('url')\n ->get();\n\n if ($url = $this->option('url')) {\n $monitors = $monitors->filter(fn (Monitor $monitor) => in_array((string) $monitor->url, explode(',', $url)));\n }\n\n $this->comment('Start checking the lighthouse of '.count($monitors).' monitors...');\n\n $monitors->each(function (Monitor $monitor) {\n $this->info(\"Checking lighthouse for {$monitor->url}\");\n\n dispatch(new CheckLighthouseJob($monitor));\n });\n\n $this->info('All done!');\n }",
"public function start()\n {\n die(\"Must override this function in a driver\");\n }",
"public function mainTask()\n\t{\n\t\t// Redirect to version panel of current version (TEMP)\n\t\tApp::redirect(\n\t\t\tRoute::url($this->_route . '&active=versions', false)\n\t\t);\n\t\treturn;\n\t}",
"public function __default()\r\n \t{\r\n \t if( self::isArg( 'notifwindow') )\r\n \t {\r\n $this->view = \"common_notifwindow\";\r\n \t $this->viewArgs['table'] = self::getArg( \"table\", AT_posint, true );\r\n \t }\r\n \t else\r\n \t {\r\n $this->view = \"dummygame_dummygame\";\r\n self::trace( \"Complete reinitialization of board game\" );\r\n }\r\n \t}",
"public function shutDown() {\n\t\techo \"Permission has not been given.<br>\";\n\t}",
"private function needsRestart()\n {\n if (PHP_SAPI !== 'cli' || !defined('PHP_BINARY')) {\n return false;\n }\n\n return !getenv(self::ENV_ALLOW) && $this->loaded;\n }",
"public function handle()\n {\n $action=$this->argument('action');\n\n /*\n *行为 判断\n */\n\n switch($action){\n\n case \"start\":\n\n $this->start();\n\n break;\n\n case \"stop\":\n\n $this->stop();\n\n break;\n case \"restart\" :\n\n $this->restart();\n\n break;\n\n\n }\n\n }",
"public function handle()\n {\n Toolbox::initializePackage($this, $this->wpAddress, $this->folderName);\n }",
"protected function shouldPrompt()\n {\n return !$this->rocketeer->isLocal();\n }",
"public function handle(): int\n {\n $action = $this->argument('action');\n $params = json_decode($this->option('params'), true);\n\n if (config('deploy.method') == 'cron') {\n $schedule = get_config('deploy_schedules', []);\n if (empty($schedule)) {\n return true;\n }\n\n $index = array_key_first($schedule);\n $action = $schedule[$index];\n unset($schedule[$index]);\n set_config('deploy_schedules', $schedule);\n\n if (is_array($action)) {\n $this->autoDeploy->run($action['action'], $action['params']);\n } else {\n $this->autoDeploy->run($action);\n }\n\n return self::SUCCESS;\n }\n\n $this->autoDeploy->run($action, $params);\n\n return self::SUCCESS;\n }",
"public function handle()\n {\n $this->modelName = ucfirst($this->argument('model_name'));\n $model = $this->generateModel($this->modelName, $this->getAction());\n (new RefreshClassHander($this,$model))->handle();\n parent::handle();\n }",
"public function prepareForRestart() {\n\t\tparent::prepareForRestart();\n\t}",
"function boot() {\n\t\tif ( !$this->hasBooted ) {\n\t\t\tregister_shutdown_function( array( &$this, 'shutdown' ) );\n\t\t\tif ( !empty($this->bootFile) ) {\n\t\t\t\trequire_once $this->path( \"/XOOPS/Boot/$this->bootFile\" );\n\t\t\t}\n\t\t\t// @TODO-2.3: This shouldn't be there but is kept temporarily until the\n\t\t\t// old common.php has been cleaned up as it should\n\t\t\tinclude_once XOOPS_ROOT_PATH.\"/include/common.php\";\n\n\t\t\tif ( isset( $_SESSION[$this->xoBundleIdentifier]['currentUser'] ) ) {\n\t\t\t\t$this->acceptUser( $_SESSION[$this->xoBundleIdentifier]['currentUser'] );\n\t\t\t}\n\t\t\tif ( $this->launchStartupItems() ) {\n\t\t\t\treturn true;\n\t\t\t} \n\t\t\t$this->hasBooted = true;\n\t\t}\n\t\treturn true;\n\t}",
"public function shouldReportToSentry()\n {\n $this->shouldExit = true;\n }",
"private function dispatchSig()\n\t{\n\t\tswitch ( $this->signal ) {\n\t\t\t// reload\n\t\t\tcase 'reload':\n\t\t\t\t$this->workerExitFlag = true;\n\t\t\t\tbreak;\n\n\t\t\t// stop\n\t\t\tcase 'stop':\n\t\t\t\t$this->workerExitFlag = true;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tbreak;\n\t\t}\n\t}",
"function wp_recovery_mode_nag()\n {\n }",
"function needsExecution() ;",
"function _access_denied_splash()\n {\n }",
"public function no_op() {\n\t\t\texit( 'Not permitted' );\n\t\t}",
"abstract public function onExited($status);",
"public function isExecutionRunning() {}",
"abstract protected function initializeShell(\\Bitrix\\Main\\System\\IApplicationStrategy $initStrategy = null);",
"public function init() {\n\t\tif ($this->workflowActivitySpecification->isRunning()) {\n\t\t\t$this->workflowActivity->onRestore($this->runtimeContext);\n\t\t}\n\t}",
"public function handle()\n {\n $this->forlocal();\n // $this->forprodserver();\n }",
"public function testStartupProcessAbort()\n {\n $request = new ServerRequest([\n 'url' => 'cakes/index',\n 'params' => [\n 'plugin' => null,\n 'controller' => 'Cakes',\n 'action' => 'index',\n 'stop' => 'startup',\n 'pass' => [],\n ],\n ]);\n $controller = $this->factory->create($request);\n $result = $this->factory->invoke($controller);\n\n $this->assertSame('startup stop', (string)$result->getBody());\n }"
] | [
"0.62638044",
"0.5730684",
"0.56841516",
"0.5625364",
"0.5470447",
"0.5267571",
"0.52101177",
"0.5145513",
"0.512913",
"0.5071467",
"0.50377023",
"0.49776882",
"0.49682775",
"0.49635634",
"0.49546757",
"0.49508715",
"0.49481142",
"0.49372575",
"0.49289343",
"0.49057022",
"0.48844472",
"0.48844472",
"0.48711932",
"0.4840429",
"0.48347366",
"0.4811281",
"0.48021314",
"0.4794417",
"0.47807488",
"0.47503832",
"0.47347137",
"0.4716547",
"0.46879968",
"0.46879968",
"0.46868065",
"0.46868065",
"0.46868065",
"0.46845055",
"0.46757725",
"0.46717146",
"0.46489444",
"0.46365362",
"0.46327704",
"0.4632147",
"0.46102002",
"0.4598935",
"0.45929474",
"0.4589701",
"0.45851657",
"0.4576176",
"0.45758358",
"0.4574978",
"0.4572367",
"0.45613587",
"0.45599815",
"0.4555457",
"0.45548564",
"0.45505235",
"0.4539748",
"0.4539631",
"0.4534708",
"0.45317715",
"0.45253778",
"0.45236695",
"0.45231253",
"0.45210478",
"0.45188656",
"0.45170984",
"0.45125365",
"0.45042333",
"0.45007876",
"0.44983742",
"0.449398",
"0.44908524",
"0.44893748",
"0.44888082",
"0.44638723",
"0.4462711",
"0.4459535",
"0.44584826",
"0.44578868",
"0.4455139",
"0.44529566",
"0.4451734",
"0.44470412",
"0.44466904",
"0.44447252",
"0.44418582",
"0.443555",
"0.4433377",
"0.44301417",
"0.44236374",
"0.44200492",
"0.4416041",
"0.4413142",
"0.441114",
"0.4408149",
"0.44076353",
"0.4406307",
"0.440257"
] | 0.45578507 | 55 |
Extract info from $_POST applying our business rules and using our naming conventions | function ltiExtractPost() {
// Unescape each time we use this stuff - somedy we won't need this...
$FIXED = array();
foreach($_POST as $key => $value ) {
if (get_magic_quotes_gpc()) $value = stripslashes($value);
$FIXED[$key] = $value;
}
$retval = array();
$retval['key'] = isset($FIXED['oauth_consumer_key']) ? $FIXED['oauth_consumer_key'] : null;
$retval['context_id'] = isset($FIXED['context_id']) ? $FIXED['context_id'] : null;
$retval['link_id'] = isset($FIXED['resource_link_id']) ? $FIXED['resource_link_id'] : null;
$retval['user_id'] = isset($FIXED['user_id']) ? $FIXED['user_id'] : null;
if ( $retval['key'] && $retval['context_id'] && $retval['link_id'] && $retval['user_id'] ) {
// OK To Continue
} else {
return false;
}
$retval['service'] = isset($FIXED['lis_outcome_service_url']) ? $FIXED['lis_outcome_service_url'] : null;
$retval['sourcedid'] = isset($FIXED['lis_result_sourcedid']) ? $FIXED['lis_result_sourcedid'] : null;
$retval['context_title'] = isset($FIXED['context_title']) ? $FIXED['context_title'] : null;
$retval['link_title'] = isset($FIXED['resource_link_title']) ? $FIXED['resource_link_title'] : null;
$retval['user_email'] = isset($FIXED['lis_person_contact_email_primary']) ? $FIXED['lis_person_contact_email_primary'] : null;
if ( isset($FIXED['lis_person_name_full']) ) {
$retval['user_displayname'] = $FIXED['lis_person_name_full'];
} else if ( isset($FIXED['lis_person_name_given']) && isset($FIXED['lis_person_name_family']) ) {
$retval['user_displayname'] = $FIXED['lis_person_name_given'].' '.$FIXED['lis_person_name_family'];
} else if ( isset($FIXED['lis_person_name_given']) ) {
$retval['user_displayname'] = $FIXED['lis_person_name_given'];
} else if ( isset($FIXED['lis_person_name_family']) ) {
$retval['user_displayname'] = $FIXED['lis_person_name_given'];
}
$retval['role'] = 0;
if ( isset($FIXED['roles']) ) {
$roles = strtolower($FIXED['roles']);
if ( ! ( strpos($roles,'instructor') === false ) ) $retval['role'] = 1;
if ( ! ( strpos($roles,'administrator') === false ) ) $retval['role'] = 1;
}
return $retval;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function readPost(){\n\t\tIF(isset($_POST['eventName'])) { \n\t\t $this->eventName = trim(strip_tags($_POST['eventName']));\n\t\t}\n\t\tIF(isset($_POST['senderName'])) { \n\t\t $this->senderName = trim(strip_tags($_POST['senderName']));\n\t\t}\n\t\tIF(isset($_POST['senderEmail'])) {\n\t\t $this->senderEmail = trim(strip_tags(preg_replace(\"/[^0-9a-zA-ZäöüÄÖÜÈèÉéÂâáÁàÀíÍìÌâÂ@ \\-\\+\\_\\.]/\", \" \", $_POST['senderEmail'])));\n\t\t}\n\t\tIF(isset($_POST['validateEmail'])){\n\t\t $this->validateEmail = trim(strip_tags($_POST['validateEmail']));\n\t\t}\n\t\tIF(isset($_POST['senderPhone'])){\n\t\t $this->senderPhone = trim(strip_tags($_POST['senderPhone']));\n\t\t}\n\t\tIF(isset($_POST['numberOfTickets'])){\n\t\t $this->numberOfTickets = trim(strip_tags($_POST['numberOfTickets']));\n\t\t}\n\t\tIF(isset($_POST['paymentOption'])){\n\t\t $this->paymentOption = trim(strip_tags($_POST['paymentOption']));\n\t\t}\n\t\tIF(isset($_POST['otherPartyNames'])){\n\t\t $this->otherPartyNames = trim(strip_tags($_POST['otherPartyNames']));\n\t\t}\n\t\tIF(isset($_POST['pickupPoint'])){\n\t\t $this->pickupPoint = trim(strip_tags($_POST['pickupPoint']));\n\t\t} \n\t\tIF(isset($_POST['sittingNear'])){\n\t\t $this->sittingNear = trim(strip_tags($_POST['sittingNear']));\n\t\t}\n\t\tIF(isset($_POST['specialNeeds'])){\n\t\t $this->specialNeeds = trim(strip_tags($_POST['specialNeeds']));\n\t\t}\n\t}",
"function processPostVars()\n {\n $this->id = $_POST['id'];\n $this->role = $_POST['role'];\n $this->firstname = trimStrip($_POST['firstname']);\n $this->surname = trimStrip($_POST['surname']);\n $this->email = trimStrip($_POST['email']);\n $this->login = trimStrip($_POST['login']);\n $this->password = trimStrip($_POST['pass1']);\n }",
"function get_post($name = '', $clean = true) {\n\tif($name === '') {\n\t\t$return = array();\n\n\t\tforeach ($_POST as $key => $post) {\n\t\t\t$return[$key] = $clean ? clean_variable($post) : $post;\n\t\t}\n\t\treturn $return;\n\t}\n\n\tif (!isset($_POST[$name])) {\n\t\treturn '';\n\t}\n\n\treturn $clean ? clean_variable($_POST[$name]) : $_POST[$name];\n}",
"protected function _process_post()\n\t{\n\t\tforeach ($_POST as $k=>$v)\n\t\t{\n\t\t\tif (substr($k, 0, 3)=='_s_' && substr($k, -7)=='_action') {\n\t\t\t\t$this->_form_posted = substr($k, 3, -7);\n\t\t\t\t$this->_form_action = $v;\n\t\t\t} else {\n\t\t\t\t$this->vars[$k] = $v;\n\t\t\t}\n\t\t}\n\n\t\tforeach ($_FILES as $k=>$v)\n\t\t{\n\t\t\tif ($v['error'] == UPLOAD_ERR_OK)\n\t\t\t{\n\t\t\t\tif (is_uploaded_file($v['tmp_name']))\n\t\t\t\t{\n\t\t\t\t\tif ($v['size'] != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_uploaded_files[$k] = UPLOAD_ERR_OK;\n\t\t\t\t\t\t$this->vars[$k] = '_uploaded_file_';\n\t\t\t\t\t\t$this->vars[$k.':name'] = preg_replace('@[\\\\\\\\/\\\\*]@', '', $v['name']);\n\t\t\t\t\t\t$this->vars[$k.':type'] = $v['type'];\n\t\t\t\t\t\t$this->vars[$k.':size'] = $v['size'];\n\t\t\t\t\t\t$this->vars[$k.':tmp_name'] = $v['tmp_name'];\n\t\t\t\t\t}\n\t\t\t\t\telse { $this->_uploaded_files[$k] = UPLOAD_ERR_NO_FILE; }\n\t\t\t\t}\n\t\t\t\telse { $this->_uploaded_files[$k] = UPLOAD_ERR_PARTIAL; }\n\t\t\t}\n\t\t\telseif ($v['error'] != UPLOAD_ERR_NO_FILE) {\n\t\t\t\t$this->_uploaded_files[$k] = $v['error'];\n\t\t\t}\n\t\t}\n\t}",
"private function collectData() {\n $this->Name = $this->sanitize($_POST['Name']);\n $this->Street1 = $this->sanitize($_POST['Street1']);\n $this->Street2 = $this->sanitize($_POST['Street2']);\n $this->CityName = $this->sanitize($_POST['CityName']);\n $this->StateOrProvince = $this->sanitize($_POST['StateOrProvince']);\n $this->Country = $this->sanitize($_POST['Country']);\n $this->PostalCode = $this->sanitize($_POST['PostalCode']);\n }",
"function processPostVars()\n {\n $this->id = $_POST['id'];\n $this->login = trimStrip($_POST['login']);\n $this->surname = trimStrip($_POST['surname']);\n $this->firstname = trimStrip($_POST['firstname']);\n $this->hash = trimStrip($_POST['hash']);\n $this->yearno = (integer)trimStrip($_POST['yearno']);\n $this->groupno = (integer)trimStrip($_POST['groupno']);\n $this->email = trimStrip($_POST['email']);\n $this->calendaryear = intval($_POST['calendaryear']);\n $this->coeff = (float)$_POST['coeff'];\n }",
"function unpack_post() {\n // Globals\n global $min_words;\n global $add_num;\n global $add_char;\n global $case_opt;\n global $separator;\n\n if (array_key_exists('min-words', $_POST)) {\n $min_words = $_POST['min-words'];\n }\n\n if (array_key_exists('add-num', $_POST)) {\n $add_num = True;\n }\n\n if (array_key_exists('add-char', $_POST)) {\n $add_char = True;\n }\n\n if (array_key_exists('separator', $_POST)) {\n $separator = $_POST['separator'];\n }\n\n if (array_key_exists('case-opt', $_POST)) {\n $case_opt = $_POST['case-opt'];\n }\n\n // Mostly just for testing\n return [$min_words, (int)$add_num, (int)$add_char, $separator, $case_opt];\n}",
"private function getPostData()\n {\n $postData = $this->request->getPostValue();\n\n /** Magento may adds the SID session parameter, depending on the store configuration.\n * We don't need or want to use this parameter, so remove it from the retrieved post data. */\n unset($postData['SID']);\n\n //Set original postdata before setting it to case lower.\n $this->originalPostData = $postData;\n\n //Create post data array, change key values to lower case.\n $postDataLowerCase = array_change_key_case($postData, CASE_LOWER);\n $this->postData = $postDataLowerCase;\n }",
"public function collectPostForm($names)\n {\n $defaults = array_fill_keys($names, null);\n $result = array_intersect_key($_POST, $defaults) + $defaults;\n array_walk_recursive(\n $result,\n function (&$item, $key) {\n $item = trim($item);\n }\n );\n\n return $result;\n }",
"private function processPostData() {\n\n if (isset($this->postDataArray['week']) && isset($this->postDataArray['year']))\n {\n\n $this->weekSelected = $this->cleanse_input($this->postDataArray['week']);\n $this->yearSelected = $this->cleanse_input($this->postDataArray['year']);\n }\n else\n {\n $this->weekSelected = $this->weeks[0];\n $this->yearSelected = $this->years[0];\n }\n }",
"function mungeFormData(&$formvars) {\n\n // trim off excess whitespace\n $formvars['Name'] = trim($formvars['Name']);\n $formvars['Comment'] = trim($formvars['Comment']);\n\n }",
"function getPost( $name ) #version 1\n{\n if ( isset($_POST[$name]) ) \n {\n return htmlspecialchars($_POST[$name]);\n }\n return \"\";\n}",
"protected function getPostValues() {}",
"function sanatize_post($post\t=\tarray(\"\"),$val\t=\tarray(\"\")){\n\t\tforeach($val as $key\t=> $value){\n\t\t\t// check if required fields are not null\n\t\t\tif(($value[1]==1) && ($post[$key]==NULL)){\n\t\t\t\t\t$out['error']\t=\t$value[2].\" Field Is Required\";\n\t\t\t\t\treturn $out;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//sanatize the post values\n\t\t\t\tswitch($value[0]){\n\t\t\t\t\t\tcase \"text\":\n\t\t\t\t\t\t\t\t$out[$key]\t=\taddslashes($post[$key]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"int\":\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (filter_var($post[$key], FILTER_VALIDATE_INT) == false) {\n\t\t\t\t\t\t\t\t $out['error']\t=\t$value[2].\" Field Value Is Not Valid\";\n \n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t $out[$key]\t=\taddslashes($post[$key]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"email\":\n\t\t\t\t\t\t\tif (filter_var($post[$key], FILTER_VALIDATE_EMAIL) === false) {\n\t\t\t\t\t\t\t\t $out['error']\t=\t$value[2].\" Field Value Is Not Valid\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t $out[$key]\t=\taddslashes($post[$key]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"dec\":\n\t\t\t\t\t\t\tif (filter_var($post[$key], FILTER_SANITIZE_NUMBER_INT) === false) {\n\t\t\t\t\t\t\t\t $out['error']\t=\t$value[2].\" Field Value Is Not Valid\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t $out[$key]\t=\taddslashes($post[$key]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}\n \n\t\t\treturn $out;\n\t}",
"function isNameViable(){\n\t$postName = filter_var($_POST['name'], FILTER_SANITIZE_SPECIAL_CHARS);\n\tif(strlen($postName) < 3){\n\t\treturn false;\n\t}\n\n\t$f = $postName[0]; #first letter is predicted class\n\t$s = $postName[1]; #second letter is actual class\n\t#third letter is '_'\n\tif(($f=='B' || $f=='D' || $f=='F' || $f=='L' || $f=='R') && \n\t\t($s=='B' || $s=='D' || $s=='F' || $s=='L' || $s=='R') &&\n\t\t$postName[2]=='_'){\n\t\t\treturn true;\n\t} else{\n\t\treturn false;\n\t}\n}",
"private function parseInputValues()\r\n {\r\n parse_str(file_get_contents(\"php://input\"),$data);\r\n\r\n $data = reset($data);\r\n \r\n $data = preg_split('/------.*\\nContent-Disposition: form-data; name=/', $data);\r\n \r\n $this->inputValues = array();\r\n \r\n foreach($data as $input)\r\n {\r\n // get key\r\n preg_match('/\"([^\"]+)\"/', $input, $key);\r\n \r\n // get data\r\n $input = preg_replace('/------.*--/', '', $input);\r\n \r\n // Store to an array\r\n $this->inputValues[$key[1]] = trim(str_replace($key[0], '', $input));\r\n }\r\n }",
"function convPOSTCharset()\t{\n\t\tif ($this->renderCharset != $this->metaCharset && is_array($_POST) && count($_POST))\t{\n\t\t\t$this->csConvObj->convArray($_POST,$this->metaCharset,$this->renderCharset);\n\t\t\t$GLOBALS['HTTP_POST_VARS'] = $_POST;\n\t\t}\n\t}",
"public function getPostValues() {\n $post_check_array = array(\n// submit action\n 'add' => array('filter' => FILTER_SANITIZE_STRING),\n 'update' => array('filter' => FILTER_SANITIZE_STRING),\n // List all update form fields !!!\n// event type name.\n 'datum' => array('filter' => FILTER_SANITIZE_STRING),\n 'prioriteit' => array('filter' => FILTER_SANITIZE_STRING),\n 'username' => array('filter' => FILTER_SANITIZE_STRING),\n 'user' => array('filter' => FILTER_SANITIZE_STRING),\n 'password' => array('filter' => FILTER_SANITIZE_STRING),\n // Help text\n 'status' => array('filter' => FILTER_SANITIZE_STRING),\n // Id of current row\n 'alarm_id' => array('filter' => FILTER_VALIDATE_INT),\n 'alarm_noticed' => array('filter' => FILTER_VALIDATE_INT),\n\t\t\t'alarm_origin' => array('filter' => FILTER_SANITIZE_STRING)\n );\n// Get filtered input:\n $inputs = filter_input_array(INPUT_POST, $post_check_array);\n// RTS\n return $inputs;\n }",
"public function getPostValues()\n {\n // Define the check for params\n $post_check_array = array(\n // submit action\n 'toevoegen' => array('filter' => FILTER_SANITIZE_STRING),\n 'bijwerken' => array('filter' => FILTER_SANITIZE_STRING),\n 'verwijderen' => array('filter' => FILTER_SANITIZE_STRING),\n // question\n 'vraag' => array('filter' => FILTER_SANITIZE_STRING),\n // question type (open or closed)\n 'vraagId' => array('filter' => FILTER_SANITIZE_INT),\n // question type (open or closed)\n 'vraagSoort' => array('filter' => FILTER_SANITIZE_STRING),\n // Education\n 'opleiding' => array('filter' => FILTER_SANITIZE_STRING),\n // question send time\n 'verstuurTijd' => array('filter' => FILTER_SANITIZE_STRING)\n );\n // Get filtered input:\n $inputs = filter_input_array(INPUT_POST, $post_check_array);\n // RTS\n return $inputs;\n }",
"function get_fields_from_post(){\n\t\t$prefix=\"\";\n\t\t$this->id_corp=$_SESSION['ident_corp'];\n\t\t$this->name=htmlentities($_POST[$prefix.$this->ddbb_name]);\n\t\t$this->name_web=htmlentities($_POST[$prefix.$this->ddbb_name_web]);\n\t\t$this->pvp=$_POST[$prefix.$this->ddbb_pvp];\n\t\t$this->tax=$_POST[$prefix.$this->ddbb_tax];\n\t\t$this->pvp_tax=$_POST[$prefix.$this->ddbb_pvp_tax];\n\t\t$this->descrip=htmlentities($_POST[$prefix.$this->ddbb_descrip]);\n\t\t$this->path_photo = $_SESSION['ruta_photo'];\n\t\t\n\n\t\t\n\t\t$this->get_categories_from_post();\n\n\t\treturn 0;\n\t}",
"public function updateFromPOST() {\n if ($this->isSubmit()) {\n foreach (Tools::getValue($this->namebase(), array()) as $name => $value) {\n $key = $this->nameify($name);\n $this->input_values[$key] = $value;\n }\n Configuration::updateValue($this->key(), json_encode($this->input_values));\n }\n }",
"function processRequest(){\n\tglobal $muse; // App settings & database\n\tglobal $HTTP_RAW_POST_DATA;\n\t\n\t// Get the user's posted action\n\t$muse['actionRequestRaw'] = $HTTP_RAW_POST_DATA;\n\t$muse['actionRequest'] = $muse['db']->real_escape_string(trim($HTTP_RAW_POST_DATA));\n\t// First word of action request will be the action keyword.\n\t$muse['actionKeyword'] = strtolower(substr( $muse['actionRequest'], 0, strpos( $muse['actionRequest'], \" \" ) ) );\n\t\n\t// If it's only one word, through it back in. Capatlization issues?\n\tif ($muse['actionKeyword']==false) {\n\t\t$muse['actionKeyword'] = $muse['actionRequest'];\n\t}\n}",
"public function process_post() {\n\t\t$name = $this->node->attr('name');\n\n\n\t\tif (!empty($_POST) && $this->get_post_value($name)) {\n//\t\t\t$this->value = $this->get_post_value($name);\n\t\t\t$this->value($this->get_post_value($name));\n\t\t}\n\t}",
"public function post($name='', $xssClean=true) {\n if($name) {\n if(!isset($_POST[$name]))\n return null;\n \n if(!$xssClean)\n return $_POST[$name];\n \n if(!isset($this->post_data[$name]))\n $this->post_data[$name] = $this->_grubGlobalArray($_POST, $name, $xssClean, self::CONTENT_TYPE_STRING);\n \n return $this->post_data[$name];\n }\n else {\n if(!$xssClean)\n return $_POST;\n \n $this->post_data = $this->arrayXssClean($_POST, self::CONTENT_TYPE_STRING);\n \n return $this->post_data;\n }\n }",
"private function extractFields(array $post)\n\t{\n\t\tforeach ($this->rules['fields'] as $field) {\n\t\t\t\t// $post['login']\n\t\t\tif (!isset($post[$field]) || trim($post[$field]) === '') {\n\t\t\t\t$this->fields[$field] = null;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->fields[$field] = htmlspecialchars(trim($post[$field]));\n\t\t}\n\t}",
"private function get_post( $name ) {\n\t\tif ( isset( $_POST[ $name ] ) ) {\n\t\t\treturn trim( $_POST[ $name ] );\n\t\t}\n\t\treturn null;\n\t}",
"public function ParsePostData() {\n\t\t\tif (array_key_exists($this->strControlId, $_POST)) {\n //$this->blnModified = true;\n\t\t\t\t// It was -- update this Control's value with the new value passed in via the POST arguments\n\t\t\t\t$strValue = $_POST[$this->strControlId];\n\n foreach($this->arrListItems as $objListItem){\n if($objListItem->Value == $strValue){\n $objListItem->Selected = true;\n }else{\n $objListItem->Selected = false;\n }\n }\n }\n }",
"function repopulatePost($name) {\n if (filter_has_var(INPUT_POST, $name)) {\n return htmlspecialchars_decode(sanitize(filter_input(INPUT_POST, $name, FILTER_SANITIZE_STRING)));\n }\n else {\n return '';\n }\n}",
"protected function _readFormFields() {}",
"public static function getPostVars($pattern) {\r\n\r\n/* This function loops through the $_POST\r\n array and extracts all variables that \r\n match the pattern passed. All values \r\n are cleaned using trim and strip slashes\r\n if magic_quotes are on. */\r\n \r\n if (!$_POST) {\r\n //echo \"The POST Array is empty<BR>\";\r\n return FALSE;\r\n }\r\n \r\n if (!$pattern || $pattern == \"\") { $pattern = \"^[a-z0-9_%-]+$\"; }\r\n \r\n foreach ($_POST as $key => $value) {\r\n\r\n\t\tif (is_array($value)) {\r\n\t\t\t$postvars[\"$key\"] = $value;\r\n\t\t}\r\n\t\telseif (eregi($pattern, $key) && $value != 9999 && $key != \"Submit\") {\r\n\t\t \r\n\t\t // Trim data\r\n\t\t $key = trim($key);\r\n\t\t $value = trim($value);\r\n\t\t \r\n\t\t // Strip slashes if magic quotes in effect\r\n\t\t if (get_magic_quotes_gpc()) {\r\n\t\t $key = stripslashes($key);\r\n\t\t $value = stripslashes($value);\r\n\t\t }\r\n\t\t\r\n\t\t // enter into the post vars to be returned\r\n\t\t \r\n\t\t $postvars[\"$key\"] = $value;\r\n\t\t \r\n\t\t} // End of if loop\r\n \t} // End of foreach loop\r\n \r\n if (!$postvars) { return FALSE; }\r\n else { return $postvars; }\r\n\r\n}",
"function input($name){\n\t\tif(isset($_POST[$name])){\n\t\t\t$t = $this->simpleCleanInput($_POST[$name]);\n\t\t\tif($t !== false){\n\t\t\t\treturn $t;\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t}",
"public function getFormData(){\n\n\t\t\t\n\t\t\t$expectedVariables = ['title','email','checkbox'];\n\n\n\t\t\tforeach ($expectedVariables as $variable) {\n\n\t\t\t\t// creating entries for error field\t\n\t\t\t\t$this->moviesuggest['errors'][$variable]=\"\";\n\n\t\t\t\t// move all $_POST values into MovieSuggest array\n\t\t\t\tif(isset($_POST[$variable])){\n\t\t\t\t\t$this->moviesuggest[$variable] = $_POST[$variable];\n\t\t\t\t}else{\n\t\t\t\t\t$this->moviesuggest[$variable] = \"\";\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// var_dump($moviesuggest);\n\t\t\t// die();\n\t}",
"function posted_value($name) {\n if(isset($_POST[$name])) {\n return htmlspecialchars($_POST[$name]);\n }\n}",
"protected function getValuesFromPOST(array &$errors) {\n\t\t$name = Strings::normalize(Request::getPOST('name'));\n\t\tif (!$name)\n\t\t\t$errors[] = array('name',\n\t\t\t\tTranslation::defaultGet('Premanager', 'noUserNameInputtedError'));\n\t\telse if (!User::isValidName($name))\n\t\t\t$errors[] = array('name',\n\t\t\t\tTranslation::defaultGet('Premanager', 'nameContainsSlashes'));\n\t\telse if (!User::isNameAvailable($name, $this->_user))\n\t\t\t$errors[] = array('name',\n\t\t\t\tTranslation::defaultGet('Premanager', 'userNameAlreadyExistsError'));\n\t\n\t\t$password = Request::getPOST('password');\n\t\tif ($password || !$this->_user) {\n\t\t\t$passwordConfirmation = Request::getPOST('passwordConfirmation');\n\t\t\tif (!$password)\n\t\t\t\t$errors[] = array('password',\n\t\t\t\t\tTranslation::defaultGet('Premanager', 'noPasswordInputtedError'));\n\t\t\telse {\n\t\t\t\tif (!$passwordConfirmation)\n\t\t\t\t\t$errors[] = array('passwordConfirmation',\n\t\t\t\t\t\tTranslation::defaultGet('Premanager',\n\t\t\t\t\t\t'noPasswordConfirmationInputtedError'));\n\t\t\t\tif ($password && $passwordConfirmation &&\n\t\t\t\t\t$password != $passwordConfirmation)\n\t\t\t\t\t$errors[] = array('passwordConfirmation',\n\t\t\t\t\t\tTranslation::defaultGet('Premanager',\n\t\t\t\t\t\t'passwordConfirmationInvalidError'));\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t$email = Strings::normalize(Request::getPOST('email'));\n\t\t$emailConfirmation =\n\t\t\tStrings::normalize(Request::getPOST('emailConfirmation'));\n\t\tif ($email) {\n\t\t\tif (!User::isValidEmail($email))\n\t\t\t\t$errors[] = array('email',\n\t\t\t\t\tTranslation::defaultGet('Premanager', 'invalidEmailAddressError'));\n\t\t\telse if (!User::isEmailAvailable($email, $this->_user))\n\t\t\t\t$errors[] = array('email', Translation::defaultGet('Premanager',\n\t\t\t\t\t'emailAddressAlreadyInUseError'));\n\t\t\telse if (!$emailConfirmation)\n\t\t\t\t$errors[] = array('emailConfirmation', Translation::defaultGet(\n\t\t\t\t\t'Premanager', 'noEmailConfirmationInputtedError'));\n\t\t\telse if ($emailConfirmation != $email)\n\t\t\t\t$errors[] = array('emailConfirmation', Translation::defaultGet(\n\t\t\t\t\t'Premanager', 'emailConfirmationInvalidError'));\n\t\t}\n\t\t\n\t\tif (!$this->_user || $this->_user->getID())\n\t\t\t$isEnabled = !!Request::getPOST('isEnabled');\n\t\telse\n\t\t\t$isEnabled = true;\n\t\t\n\t\treturn array(\n\t\t\t'name' => $name,\n\t\t\t'email' => $email,\n\t\t\t'emailConfirmation' => $emailConfirmation,\n\t\t\t'password' => $password,\n\t\t\t'passwordConfirmation' => $passwordConfirmation,\n\t\t\t'isEnabled' => $isEnabled);\n\t}",
"function sanitizeFields()\n\t{\n\t\tif(isset($this->sanitize) && isset($this->data[$this->name]))\n\t\t{\n\t\t\tforeach($this->data[$this->name] as $field => $value)\n\t\t\t{\n\t\t\t\tif(isset($this->sanitize[$field]))\n\t\t\t\t{\n\t\t\t\t\tif(!is_array($this->sanitize[$field]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->data[$this->name][$field] = $this->sanitize($this->data[$this->name][$field], $this->sanitize[$field]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tforeach($this->sanitize[$field] as $action)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->data[$this->name][$field] = $this->sanitize($this->data[$this->name][$field], $action);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"function getFromPost() {\r\n\t\t\r\n\t\t//Event Page variables.\r\n\t\t$this->name = $_POST['eventName'];\r\n\t\t$this->date = $_POST['eventDate'];\r\n\t\t$this->time = $_POST['eventTime'];\r\n\t\t$this->time_before = $_POST['time_before'];\r\n\t\t$this->freq = $_POST['frequency'];\r\n\t\t$this->notif_method = $_POST['method'];\r\n\t}",
"function readform() {\n\t\t$this->ftpmirror->name = $_POST['name'];\n\t\t$this->ftpmirror->url = $_POST['url'];\n\t\t$this->ftpmirror->location = $_POST['location'];\n\t\t$this->ftpmirror->email = $_POST['email'];\n\t\t$this->ftpmirror->description = $_POST['description'];\n\t\t$this->ftpmirror->comments = $_POST['comments'];\n\t\t\n\t\t// Validate details\n\t\t$errors = $this->ftpmirror->validate();\n\n\t\treturn $errors;\n\t}",
"function _map_post_data_for_model()\n\t{\n\t\t// create map the abbreviate post data to database\n\t\t$post_data_map = array(\n 'id'\t=> 'device_id',\n 'h'\t\t=> 'heading',\n 'la'\t=> 'latitude',\n 'lo' \t=> 'longitude',\n 's' \t=> 'speed',\n 't' \t=> 'timestamp',\n \t);\n \t\n\t\t// create new array with full column names as keys to to be passed in\n\t\t// to model\n \t$event = array();\n \tforeach ($post_data_map as $key => $value) {\n \t\t$post_value = $this->input->post($key);\n\t\t\t\n\t\t\t// break and return NULL if any value is blank\n\t\t\tif (!isset($post_value) or $post_value == '') {\n\t\t\t\treturn NULL;\n\t\t\t} else {\n\t \t\t$event[$value] = $post_value;\n\t\t\t}\n\t\t}\n\t\treturn $event;\n\t}",
"function handle_post($indata) {\n// showDebug('form_class POST:');\n// showArray($indata); \n return;\n }",
"public function get_post_data() {\n\t\tforeach($this->form_fields as $form_field_key => $form_field_value) {\n\t\t\tif ($form_field_value['type'] == \"select_card_types\") {\n\t\t\t\t$form_field_key_select_card_types = $this->plugin_id . $this->id . \"_\" . $form_field_key;\n\t\t\t\t$select_card_types_values = array();\n\t\t\t\t$_POST[$form_field_key_select_card_types] = $select_card_types_values;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $this->data ) && is_array( $this->data ) ) {\n\t\t\treturn $this->data;\n\t\t}\n\t\treturn $_POST;\n\t}",
"public function ParsePostData() {}",
"public function GetFormPostedValues() {\n\t\t$req_fields=array(\"description\",\"date_open\",\"date_closed\");\n\n\t\tfor ($i=0;$i<count($req_fields);$i++) {\n\n\t\t\t//echo $_POST['application_id'];\n\t\t\tif (ISSET($_POST[$req_fields[$i]]) && !EMPTY($_POST[$req_fields[$i]])) {\n\t\t\t\t$this->SetVariable($req_fields[$i],EscapeData($_POST[$req_fields[$i]]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//echo \"<br>\".$this->req_fields[$i].\"<br>\";\n\t\t\t\t$this->$req_fields[$i]=\"\";\n\t\t\t}\n\t\t}\n\t}",
"function _post($v) { // clean Post - returns a useable $_POST variable or NULL if and only if it is not set\r\n return isset($_POST[$v]) ? bwm_clean($_POST[$v]) : NULL;\r\n}",
"private function parsed_data()\n {\n $parsed_data = array();\r\n\r\n //post data\r\n $parsed_data['name'] = $this->input->post(\"name\", TRUE);\r\n $parsed_data['email'] = $this->input->post(\"email\", TRUE);\r\n $parsed_data['countryID'] = $this->input->post(\"country\", TRUE);\r\n $parsed_data['phone'] = $this->input->post(\"phone\", TRUE);\r\n $parsed_data['message'] = $this->input->post(\"message\", TRUE);\r\n $parsed_data['IP'] = $this->input->ip_address();\r\n $parsed_data['browser'] = $this->input->user_agent();\r\n //post data\r\n\r\n return $parsed_data;\n }",
"public function getPost()\n {\n if (!isset($this->_post)) {\n if (self::$_input && \\bbn\\Str::isJson(self::$_input)) {\n $this->_post = json_decode(self::$_input, 1);\n }\n elseif (!empty($_POST)) {\n $this->_post = $_POST;\n }\n\n if (!$this->_post) {\n $this->_post = [];\n }\n else {\n $this->_has_post = true;\n //$this->_post = bbn\\Str::correctTypes($this->_post);\n foreach ($this->_post as $k => $v) {\n if (X::indexOf($k, '_bbn_') === 0) {\n if (!defined(strtoupper(substr($k, 1)))) {\n define(strtoupper(substr($k, 1)), $v);\n }\n\n unset($this->_post[$k]);\n }\n }\n }\n }\n\n return $this->_post;\n }",
"function tidyInputs(){\n\tglobal $nric,$firstName,$lastName,$dob,$address1,$address2,$poCode,\n$homeNum,$handphoneNum,$email,$description;\n\tglobal $faID;\n\t\n\t$nric = preg_replace('/[^a-zA-Z0-9]/','',$nric);\n\t$firstName = preg_replace('/[^a-zA-Z0-9 ]/','',$firstName);\n\t$lastName = preg_replace('/[^a-zA-Z0-9 ]/','',$lastName);\n\t$dob = preg_replace('/[^0-9-]/','',$dob);\n\t$address1 = preg_replace('/[^a-zA-Z0-9 -_.,#]/','',$address1);\n\t$address2 = preg_replace('/[^a-zA-Z0-9 -_.,#]/','',$address2);\n\t$poCode = preg_replace('/[^0-9]/','',$poCode);\n\t$homeNum = preg_replace('/[^0-9]/','',$homeNum);\n\t$handphoneNum = preg_replace('/[^0-9]/','',$handphoneNum);\n\t$email = preg_replace('/[^a-zA-Z0-9@._-]/','',$email);\n\t$description = preg_replace('/[^a-zA-Z0-9 -_.,#]/','',$description);\n\t\n\t$faID = preg_replace('/[^0-9]/','',$faID);\n}",
"private function getPostData() {\n\t\t$data = null;\n\t\t\n\t\t// Get from the POST global first\n\t\tif (empty($_POST)) {\n\t\t\t// For API calls we need to look at php://input\n\t\t\tif (!empty(file_get_contents('php://input'))) {\n\t\t\t\t$data = @json_decode(file_get_contents('php://input'), true);\n\t\t\t\tif ($data === false || $data === null) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//TODO: What is this for? isn't 'php://input' always empty at this point?\n\t\t\t\t$dataStr = file_get_contents('php://input');\n\t\t\t\tparse_str($dataStr, $data);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$data = $_POST;\n\t\t}\n\t\t\n\t\t// Normalize boolean values\n\t\tforeach ($data as $name => &$value) {\n\t\t\tif ($value === 'true') {\n\t\t\t\t$value = true;\n\t\t\t}\n\t\t\telse if ($value === 'false') {\n\t\t\t\t$value = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $data;\n\t}",
"private function validateInput(){\n $name = filter_var($_POST['name'], FILTER_SANITIZE_STRING);\n $ip = filter_var($_POST['ip'], FILTER_VALIDATE_IP);\n $subnet = filter_var($_POST['subnet'], FILTER_VALIDATE_IP);\n $mac = filter_var($_POST['mac'], FILTER_VALIDATE_MAC);\n if($name && $ip && $subnet && $mac){\n return [\n 'name' => $name,\n 'ip' => $ip,\n 'subnet' => $subnet,\n 'mac' => $mac\n ];\n }else{\n return false;\n }\n }",
"private function _parseForm()\n {\n if( !empty( $this->boundary ) )\n {\n $chunks = @preg_split( '/[\\-]+'.$this->boundary.'(\\-\\-)?/', $this->input, -1, PREG_SPLIT_NO_EMPTY );\n $request = array();\n $files = array();\n $nd = 0;\n $nf = 0;\n\n if( is_array( $chunks ) )\n {\n foreach( $chunks as $index => $chunk )\n {\n $chunk = ltrim( $chunk, \"-\\r\\n\\t\\s \" );\n $lines = explode( \"\\r\\n\", $chunk );\n $levels = '';\n $name = '';\n $file = '';\n $type = '';\n $value = '';\n $path = '';\n $copy = false;\n\n // skip empty chunks\n if( empty( $chunk ) || empty( $lines ) ) continue;\n\n // extract name/filename\n if( strpos( $lines[0], 'Content-Disposition' ) !== false )\n {\n $line = $this->_line( array_shift( $lines ) );\n $name = $this->_value( @$line['name'], '', true );\n $file = $this->_value( @$line['filename'], '', true );\n }\n // extract content-type\n if( strpos( $lines[0], 'Content-Type' ) !== false )\n {\n $line = $this->_line( array_shift( $lines ) );\n $type = $this->_value( @$line['content'], '', true );\n }\n // rebuild value\n $value = trim( implode( \"\\r\\n\", $lines ) );\n\n // FILES data\n if( !empty( $type ) )\n {\n if( !empty( $value ) )\n {\n $path = str_replace( '\\\\', '/', sys_get_temp_dir() .'/php'. substr( sha1( rand() ), 0, 6 ) );\n $copy = file_put_contents( $path, $value );\n }\n if( preg_match( '/(\\[.*?\\])$/', $name, $tmp ) )\n {\n $name = str_replace( $tmp[1], '', $name );\n $levels = preg_replace( '/\\[\\]/', '['.$nf.']', $tmp[1] );\n }\n $files[ $name.'[name]'.$levels ] = $file;\n $files[ $name.'[type]'.$levels ] = $type;\n $files[ $name.'[tmp_name]'.$levels ] = $path;\n $files[ $name.'[error]'.$levels ] = !empty( $copy ) ? 0 : UPLOAD_ERR_NO_FILE;\n $files[ $name.'[size]'.$levels ] = !empty( $copy ) ? filesize( $path ) : 0;\n $nf++;\n }\n else // POST data\n {\n $name = preg_replace( '/\\[\\]/', '['.$nd.']', $name );\n $request[ $name ] = $value;\n $nd++;\n }\n }\n // finalize arrays\n $_REQUEST = array_merge( $_GET, $this->_data( $request ) );\n $_FILES = $this->_data( $files );\n return true;\n }\n }\n return false;\n }",
"public function parsePostData()\n {\n }",
"function NormalizeFormVars()\r\n {\r\n //the element means false. Explicitely setting this false here\r\n //to help in later form value processing\r\n $arr_elements = \r\n $this->config->element_info->GetElements($this->GetCurrentPageNum());\r\n \r\n foreach($arr_elements as $ename => $e)\r\n {\r\n $preparsed_var = $this->config->GetPreParsedVar($ename);\r\n if(isset($this->formvars[$preparsed_var]))\r\n {\r\n $disp_var = $this->config->GetDispVar($ename);\r\n $this->formvars[$disp_var] = $this->formvars[$ename];\r\n $this->formvars[$ename] = $this->formvars[$preparsed_var];\r\n }\r\n if(isset($this->formvars[$ename])){continue;}\r\n \r\n switch($e['type'])\r\n {\r\n case 'single_chk':\r\n {\r\n $this->formvars[$ename] = false;\r\n break;\r\n }\r\n case 'chk_group':\r\n case 'multiselect':\r\n {\r\n $this->formvars[$ename] = array();\r\n break;\r\n }\r\n default:\r\n {\r\n $this->formvars[$ename]='';\r\n }\r\n }\r\n }\r\n }",
"public function process()\n\t{\n\t\tif(isset($_POST[$this->input_name()])) {\n\t\t\t$this->value = $_POST[$this->input_name()];\n\t\t}\n\t\telse {\n\t\t\t$this->value = false;\n\t\t}\n\t}",
"private function _postValidation()\r\n\t{\r\n // Used $_POST here to allow us to modify them directly - naughty I know :)\r\n\r\n\t\tif (empty($_POST['description']) OR strlen($_POST['description']) > 10000)\r\n\t\t\t$this->_mod_errors[] = $this->l('Description is invalid');\r\n\t\t// could check that this is a valid path, but the next test will\r\n\t\t// do that for us anyway\r\n\t\t// But first we need to get rid of the escape characters\r\n\t\t$_POST['filepath'] = $this->winFixFilename($_POST['filepath']);\r\n\t\tif (empty($_POST['filepath']) OR (strlen($_POST['filepath']) > 255))\r\n\t\t\t$this->_mod_errors[] = $this->l('The target location is invalid');\r\n\r\n\t\tif (file_exists($_POST['filepath']) && !is_writable($_POST['filepath']))\r\n\t\t\t$this->_mod_errors[] = $this->l('File error.<br />Cannot write to').' '.$_POST['filepath'];\r\n\t}",
"abstract protected function getFormName();",
"function postToVar() {\n foreach ($this->fields() as $f) {\n if ($this->$f === false) $this->$f = $this->input->post($f);\n }\n }",
"private function _handleFormPost()\n {\n // see submit.php\n // 'FILE_OBJECTS' => 'handle_file_post',\n // 'BASE64_ENCODED_FILE_OBJECTS' => 'handle_base64_encoded_file_post',\n // 'TRANSFER_IDS' => 'handle_transfer_ids_post'\n }",
"public function normalizeFormData(array $postVars)\n {\n $output = array();\n\n foreach ($postVars as $key => $val) {\n if (strstr($key, 'action_') || $key == 'SecurityID') {\n continue;\n }\n\n if (is_array($val)) {\n $val = implode(\",\", $val);\n }\n\n $key = str_replace(\"_\", \" \", $key);\n $output[$key] = $val;\n }\n\n return $output;\n }",
"protected function processPost() {\n\t\tif (isset($_POST['posted'])) {\n\t\t\t$this->is_save_request = TRUE;\n\t\t\tunset($_POST['posted']);\n\t\t}\n\n\t\t// process the remaining post vars\n\t\tif (0) deb(\"Survey1: processPost: POST = \", $_POST);\n\t\tforeach($_POST as $job_id=>$offer) {\n\t\t\tif ($job_id == 'username') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$job_name = get_job_name($job_id);\n\t\t\t// All offers except positive integers are treated as 0, meaning \"I don't want to do this job\"\n\t\t\tif ($offer == NULL || $offer < 0 || !is_numeric($offer)) $offer = 0;\n\t\t\tif (is_float($offer)) $offer = round($is_offer);\n\t\t\tif (0) deb(\"Survey1: processPost: job_name = offer: \", $job_name.\" = \".$offer);\n\t\t\t$this->results[$job_id] = $offer;\n\t\t}\n\t\tif (0) deb(\"Survey1: processPost: Results:\", $this->results);\n\t}",
"function readFromPost() {\n\t\t$this->idt = requestVar('idt');\n\t\t$this->newIdt = requestVar('template');\n\t\t$this->description = requestVar('description');\n\t\t$this->postsHeader = requestVar('postListHeader');\n\t\t$this->postBody = requestVar('postBody');\n\t\t$this->postsFooter = requestVar('postListFooter');\n\t\t$this->formLogged = requestVar('formLogged');\n\t\t$this->form = requestVar('formNotLogged');\n\t\t$this->navigation = requestVar('navigation');\n\t\t$this->name = requestVar('nameNoUrl');\n\t\t$this->nameLin = requestVar('nameUrl');\n\t\t$this->memberName = requestVar('memberName');\n\t\t$this->date = requestVar('date');\n\t\t$this->time = requestVar('time'); \n\t\t$this->nextPage = requestVar('nextPage');\n\t\t$this->previousPage =requestVar('previousPage');\n\t\t$this->firstPage = requestVar('firstPage');\n\t\t$this->lastPage = requestVar('lastPage');\t\n\n\t\t$this->urlToLink = (requestVar('urlToLink') == 'yes') ? true : false;\n\t\t$this->emoToImg = \t (requestVar('emoToImg') == 'yes') ?true : false;\n\t\t$this->gravSize = \t (int)requestVar('gravSize');\n\t\t$this->gravDefault = requestVar('gravDefault');;\n\n\n\t\t\n\t\t$this->action = requestVar('action');\n\t}",
"function getPost($key) {\n\t$value = '';\n\tif (isset($_POST[$key])) {\n\t\t$value = $_POST[$key];\n\t}\n\t// return $value;\n\t//Phan 2: Ham xu ly ky tu dac biet\n\treturn removeSpecialCharacter($value);\n}",
"public function userinfo() {\n\n return $_POST;\n\n }",
"function pull_post()\n\t{\n\t\t$this->preorderID = @$_POST['preorderID'];\n\t\tif ($this->preorderID) { $this->set_preorderID($this->preorderID); }\n\n\t\tif (@$_POST['itemID']) { $this->set_itemID(@$_POST['itemID']); }\n\n\t\t$active = (isset($_GET['active'])?$_GET['active']:@$_POST['active']);\n\t\tif (!strlen($active)) { $active = PRE_ACTIVE; }\n\t\t$this->active = $active;\n\n\t\tif (isset($_POST['info']))\n\t\t{\n\t\t\t$this->info = $_POST['info'];\n\t\t\twhile (list($key,$val) = each($this->info)) { $this->info[$key] = stripslashes($val); }\n\t\t\treset($this->info);\n\t\t}\n\n\t\tif (isset($_POST['customerinfo']))\n\t\t{\n\t\t\t$this->customerinfo = $_POST['customerinfo'];\n\t\t\twhile (list($key,$val) = each($this->customerinfo)) { $this->customerinfo[$key] = stripslashes($val); }\n\t\t\treset($this->customerinfo);\n\t\t}\n\n\t\tif (isset($_POST['customer_status']))\n\t\t{\n\t\t\t$this->customer_status = $_POST['customer_status'];\n\t\t\treset($this->customer_status);\n\t\t}\n\n\t\t$this->customerID = @$_POST['customerID'];\n\t}",
"protected function p_processName()\n {\n $name = $this->comment->name;\n\n // define variables\n $matches = [];\n $normal_trip = '';\n $secure_trip = '';\n\n if (preg_match(\"'^(.*?)(#)(.*)$'\", $this->comment->name, $matches)) {\n $matches_trip = [];\n $name = trim($matches[1]);\n\n preg_match(\"'^(.*?)(?:#+(.*))?$'\", $matches[3], $matches_trip);\n\n if (count($matches_trip) > 1) {\n $normal_trip = $this->processTripcode($matches_trip[1]);\n $normal_trip = $normal_trip ? '!'.$normal_trip : '';\n }\n\n if (count($matches_trip) > 2) {\n $secure_trip = '!!'.$this->processSecureTripcode($matches_trip[2]);\n }\n }\n\n $this->comment->name = $name;\n $this->comment->trip = $normal_trip . $secure_trip;\n\n return ['name' => $name, 'trip' => $normal_trip . $secure_trip];\n }",
"function get_form_field($field_name)\n{\n global $HTTP_GET_VARS;\n global $HTTP_POST_VARS;\n\n $field_value = null;\n if (isset($_GET)) {\n if (isset($_GET[$field_name])) $field_value = $_GET[$field_name];\n else if (isset($_POST[$field_name]))\n $field_value = $_POST[$field_name];\n else if (isset($_GET[\"_\".$field_name]))\n $field_value = $_GET[\"_\".$field_name];\n else if (isset($_POST[\"_\".$field_name]))\n $field_value = $_POST[\"_\".$field_name];\n }\n else {\n if (isset($HTTP_GET_VARS[$field_name]))\n $field_value = $HTTP_GET_VARS[$field_name];\n else if (isset($HTTP_POST_VARS[$field_name]))\n $field_value = $HTTP_POST_VARS[$field_name];\n else if (isset($HTTP_GET_VARS[\"_\".$field_name]))\n $field_value = $HTTP_GET_VARS[\"_\".$field_name];\n else if (isset($HTTP_POST_VARS[\"_\".$field_name]))\n $field_value = $HTTP_POST_VARS[\"_\".$field_name];\n }\n if (isset($field_value) && get_magic_quotes_gpc()) {\n if (is_array($field_value)) strip_form_field_arrays($field_value);\n else $field_value = stripslashes($field_value);\n }\n return $field_value;\n}",
"function handlePOSTRequest() {\n if (array_key_exists('submitProjectionRequest', $_POST)) {\n handleProjectionRequest();\n }\n }",
"public function normalizeData()\n {\n if (is_numeric($this->Streetname2)) {\n $this->HouseNumber = $this->Streetname2;\n $this->Streetname2 = \"\";\n }\n\n// Sometimes people will input - To mean Idfk why are you asking me to input this?\n if ($this->Phone && strlen($this->Phone) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid Phone [$this->Phone] ignoring\"));\n $this->Phone = '';\n }\n\n if ($this->State && strlen($this->State) < 2) {\n $this->addMessage($this->getFormatedMessage(\"Invalid State [$this->State] ignoring\"));\n $this->State = '';\n }\n\n if ($this->CompanyName && strlen($this->CompanyName) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid CompanyName[$this->CompanyName] ignoring \"));\n $this->CompanyName = '';\n }\n\n $this->Description = $this->escapeTextData($this->Description);\n if ($this->Description && strlen($this->Description) > 255) {\n $this->Description = substr($this->Description, 0, 255);\n\n //Make sure we are not sending a broken special char\n $descChars = str_split($this->Description); \n for ($i = 254; $i > 251; --$i) {\n if ($descChars[$i] == '&') {\n $this->Description = substr($this->Description, 0, $i);\n }\n }\n }\n\n if($this->Description && strlen($this->Description) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid description $this->Description ignoring \"));\n $this->Description = ''; \n }\n }",
"function process_post()\r\n{\r\n $myReturn = ''; //set to initial empty value\r\n\r\n foreach($_POST as $varName=> $value)\r\n {#loop POST vars to create JS array on the current page - include email\r\n $strippedVarName = str_replace(\"_\",\" \",$varName);#remove underscores\r\n if(is_array($_POST[$varName]))\r\n {#checkboxes are arrays, and we need to collapse the array to comma separated string!\r\n $myReturn .= $strippedVarName . \": \" . implode(\",\",$_POST[$varName]) . PHP_EOL;\r\n }else{//not an array, create line\r\n $myReturn .= $strippedVarName . \": \" . $value . PHP_EOL;\r\n }\r\n }\r\n return $myReturn;\r\n}",
"function getPostValue ( $name ) {\n\tglobal $HTTP_POST_VARS;\n\n\tif ( isset ( $_POST ) && is_array ( $_POST ) && ! empty ( $_POST[$name] ) ) {\n\t\t$HTTP_POST_VARS[$name] = $_POST[$name];\n\t\treturn $_POST[$name];\n\t} else if ( ! isset ( $HTTP_POST_VARS ) ) {\n\t\treturn null;\n\t} else if ( ! isset ( $HTTP_POST_VARS[$name] ) ) {\n\t\treturn null;\n\t}\n\treturn ( $HTTP_POST_VARS[$name] );\n}",
"public static function getPostData() {\n\n $DataObj = new stdClass();\n\n foreach ($_POST as $name => $value)\n $DataObj->$name = $value;\n\n return $DataObj;\n }",
"function ValidRequiredPost($name) {\n return isset($_POST[$name]) && $_POST[$name] != \"\";\n}",
"function process_post()\n{\n $myReturn = ''; //set to initial empty value\n\n foreach($_POST as $varName=> $value)\n {#loop POST vars to create JS array on the current page - include email\n $strippedVarName = str_replace(\"_\",\" \",$varName);#remove underscores\n if(is_array($_POST[$varName]))\n {#checkboxes are arrays, and we need to collapse the array to comma separated string!\n $myReturn .= $strippedVarName . \": \" . implode(\",\",$_POST[$varName]) . PHP_EOL;\n }else{//not an array, create line\n $myReturn .= $strippedVarName . \": \" . $value . PHP_EOL;\n }\n }\n return $myReturn;\n}",
"public function validateName()\n {\n if (strlen(trim($_POST[$this->key])) < $this->minLength) {\n self::$errors[] = $this->convertUnderscores() . \" field requires at least $this->minLength characters\";\n }\n\n //check for profanity.\n if ($this->noProfanity) {\n $this->checkProfanity();\n }\n\n //lastly, check for valid first name patterns.\n\n if (!preg_match(\"/^[a-zA-Z]+[ -\\/\\\\'\\\"]*[a-zA-Z]+[ \\\"]{0,2}[a-zA-Z]*$/\", trim($_POST[$this->key]))) {\n self::$errors[] = \"Not a valid \" . $this->convertUnderscores();\n }\n\n return self::$errors ? false : true;\n }",
"public static function manage_post_data(&$post) {\n\t\tif (count($post) > 0) {\n\t\t\tforeach ($post as $key => $value) {\n\t\t\t\t$key = Encryption::decrypt($key);\t\n\t\t\t\t$name = self::fetch_name($key);\n\t\t\t\t$errors[$name] = self::is_valid_request($key, $value);\n\t\t\t\t$output[$name] = self::apply_filters($key, $value);\n\t\t\t}\n\t\t\tself::$requested_data = $output;\n\t\t\tself::$errors = $errors;\n\t\t}\n\t\telse {\n\t\t\tself::$requested_data = false;\n\t\t}\n\t\t$post = array();\n\t}",
"public function sanitize_input_fields()\n {\n }",
"private static function processFormFields(array $postArray)\n {\n\n $formFields = false;\n\n // If there are POST variables and the array is not empty\n if ($postArray) {\n // Initialize the $kv array for later use\n $postFields = [];\n\n // For each POST variable as $name_of_input_field => $value_of_input_field\n foreach ($postArray as $key => $value) {\n // Set array element for each POST variable (ie. first_name=Kurt)\n $postFields[] = stripslashes($key) . \"=\" . stripslashes($value);\n }\n\n // Create a query string with join function separated by ampersands\n $formFields = join(\"&\", $postFields);\n }\n\n return $formFields;\n }",
"function parse_incoming()\n {\n\t\t//-----------------------------------------\n\t\t// Attempt to switch off magic quotes\n\t\t//-----------------------------------------\n\n\t\t@set_magic_quotes_runtime(0);\n\n\t\t$this->get_magic_quotes = @get_magic_quotes_gpc();\n\t\t\n \t//-----------------------------------------\n \t// Clean globals, first.\n \t//-----------------------------------------\n \t\n\t\t$this->clean_globals( $_GET );\n\t\t$this->clean_globals( $_POST );\n\t\t$this->clean_globals( $_COOKIE );\n\t\t$this->clean_globals( $_REQUEST );\n \t\n\t\t# GET first\n\t\t$input = $this->parse_incoming_recursively( $_GET, array() );\n\t\t\n\t\t# Then overwrite with POST\n\t\t$input = $this->parse_incoming_recursively( $_POST, $input );\n\t\t\n\t\t$this->input = $input;\n\t\t\n\t\t$this->define_indexes();\n\n\t\tunset( $input );\n\t\t\n\t\t# Assign request method\n\t\t$this->input['request_method'] = strtolower($this->my_getenv('REQUEST_METHOD'));\n\t}",
"function parseIncoming(){\r\n\t\t# THIS NEEDS TO BE HERE!\r\n\t\t$this->get_magic_quotes = @get_magic_quotes_gpc();\r\n\r\n \t\tif(is_array($_GET)){\r\n\t\t\twhile(list($k, $v) = each($_GET)){\r\n\t\t\t\tif(is_array($_GET[$k])){\r\n\t\t\t\t\twhile(list($k2, $v2) = each($_GET[$k])){\r\n\t\t\t\t\t\t$this->input[$this->parseCleanKey($k)][$this->parseCleanKey($k2)] = $this->parseCleanValue($v2);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$this->input[$this->parseCleanKey($k)] = $this->parseCleanValue($v);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Overwrite GET data with post data\r\n\t\tif(is_array($_POST)){\r\n\t\t\twhile(list($k, $v) = each($_POST)){\r\n\t\t\t\tif(is_array($_POST[$k])){\r\n\t\t\t\t\twhile(list($k2, $v2) = each($_POST[$k])){\r\n\t\t\t\t\t\t$this->input[$this->parseCleanKey($k)][$this->parseCleanKey($k2)] = $this->parseCleanValue($v2);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$this->input[$this->parseCleanKey($k)] = $this->parseCleanValue($v);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->input['requestMethod'] = strtolower($_SERVER['REQUEST_METHOD']);\r\n//\t\techo '<pre>'.print_r($this->input, 1).'</pre>';exit;\r\n\t}",
"private function separatePostFields($validationFields) {\r\n\t\t\t$postFields = array();\r\n\t\t\tforeach ($validationFields as $field) {\r\n\t\t\t\tif ($field->getMethod() == \"post\")\r\n\t\t\t\t\t$postFields[] = $field;\r\n\t\t\t}\r\n\t\t\treturn $postFields;\r\n\t\t}",
"public function __sanitise() { $this->username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_SPECIAL_CHARS);\n $this->password = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);\n $hashed_password = password_hash($password, PASSWORD_BCRYPT);\n $this->email = filter_input(INPUT_POST, 'email', FILTER_SANITIZE_SPECIAL_CHARS);\n $this->usertype = filter_input(INPUT_POST, 'lib_code', FILTER_SANITIZE_SPECIAL_CHARS);\n }",
"protected function processSpecialInputFields(MortarFormInput $input)\n\t{\n\n\t}",
"function check_extract($POST_param_name, $success_variable_name, $function_name) {\n\t\tif (empty($_POST[\"$POST_param_name\"])) {\n\t\t\t$return_arr = array(\n\t\t\t\t'success' => '0',\n\t\t\t\t'fail_reason' => \"'$POST_param_name' field is required\");\n\t\t\techo json_encode($return_arr);\n\t\t\tdie();\t\t\n\t\t} else {\n\t\t\t$GLOBALS[\"$success_variable_name\"] = test_input($_POST[\"$POST_param_name\"]);\n\t\t}\n\t}",
"function check_extract($POST_param_name, $success_variable_name, $function_name) {\n\t\tif (empty($_POST[\"$POST_param_name\"])) {\n\t\t\t$return_arr = array(\n\t\t\t\t'success' => '0',\n\t\t\t\t'fail_reason' => \"'$POST_param_name' field is required\");\n\t\t\techo json_encode($return_arr);\n\t\t\tdie();\t\t\n\t\t} else {\n\t\t\t$GLOBALS[\"$success_variable_name\"] = test_input($_POST[\"$POST_param_name\"]);\n\t\t}\n\t}",
"function check_extract($POST_param_name, $success_variable_name, $function_name) {\n\t\tif (empty($_POST[\"$POST_param_name\"])) {\n\t\t\t$return_arr = array(\n\t\t\t\t'success' => '0',\n\t\t\t\t'fail_reason' => \"'$POST_param_name' field is required\");\n\t\t\techo json_encode($return_arr);\n\t\t\tdie();\t\t\n\t\t} else {\n\t\t\t$GLOBALS[\"$success_variable_name\"] = test_input($_POST[\"$POST_param_name\"]);\n\t\t}\n\t}",
"function _process_user_info()\n\t{\n\t\t$user_info = null;\n\t\t$code = $this->input->get('code');\n\n\t\t//Google redirects with code insead of post\n\t\tif( $code )\n\t\t{\n\t\t\t$user_info = get_user_info( $this->input->get('code') );\n\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t$user_info['email'] = trim($this->input->post('email'));\n\t\t\t$user_info['username'] = trim($this->input->post('username'));\n\t\t}\n\n\t\treturn $user_info;\n\t}",
"public function postData()\n\t{\n\t\t$this->setCustomerName($_POST['frmcname']);\n\t\t$this->setCustomerAddress1($_POST['frmcaddy1']);\n\t\t$this->setCustomerAddress2($_POST['frmcaddy2']);\n\t\t$this->setCustomerCity($_POST['frmccity']);\n\t\t$this->setCustomerZipcode($_POST['frmczipcode']);\n\t\t$this->setCustomerState($_POST['frmcstate']);\n\t\t$this->setCustomerPhone( $_POST['frmcpnumber']);\n\t\t$this->setCustomerExt($_POST['frmcext']);\n\t\t$this->setCustomerFax($_POST['frmcfnumber']);\n\t\t$this->setCustomerEmail($_POST['frmcemail']);\n\t\t$this->setCustomerRdp($_POST['frmcrdp']);\n\t\t$this->setCustomerNotes($_POST['frmcnotes']);\n\t\t$this->setFlag($_POST['frmflaggedq']);\n\t\t$this->setFlagReason($_POST['frmflagreason']);\n\t}",
"function Sanitizer($data) {\r\n $data = trim($data);\r\n // it'll strip the slashes in the field \r\n $data = stripcslashes($data);\r\n // for special characters in html like < / >\r\n $data = htmlspecialchars($data);\r\n return $data;\r\n{}\r\n\r\nif($_SERVER['REQUEST_METHOD'] === 'POST') {\r\n $name = Sanitizer($_POST['name']);\r\n $email = Sanitizer($_POST['email']);\r\n $message = Sanitizer($_POST['message']);\r\n $subject = Sanitizer($_POST['subject']);\r\n \r\n}\r\n$wholeCheckedInputs = vsprintf(\"these are the inputs from the from\", array($name, $email, $subject, $message));\r\nprint_r($wholeCheckedInputs);\r\n/**\r\n * we can use Php filters like filter_var() / filter_input() <- for a single argument\r\n * or we can even check out multiple arguments using filter_input_array()\r\n */\r\n\r\n}",
"private function inputs(){\n\t\tswitch($_SERVER['REQUEST_METHOD']){ // Make switch case so we can add additional \n\t\t\tcase \"GET\":\n\t\t\t\t$this->_request = $this->cleanInputs($_REQUEST); //or $_GET\n\t\t\t\t$this->_method = \"GET\";\n\t\t\t\t//$this->logRequest();\n\t\t\t\tbreak;\n\t\t\tcase \"POST\":\n\t\t\t\t$this->_request = $this->cleanInputs($_REQUEST); //or $_GET\n\t\t\t\t$this->_method = \"POST\";\n\t\t\t\t//$this->logRequest();\n\t\t\t\tbreak;\n\t\t\tcase \"PUT\":\n\t\t\t\t$this->_request = $this->cleanInputs($_REQUEST); //or $_GET\n\t\t\t\t$this->_method = \"PUT\";\n\t\t\t\t//$this->logRequest();\n\t\t\t\tbreak;\n\t\t\tcase \"DELETE\":\n\t\t\t\t$this->_request = $this->cleanInputs($_REQUEST); //or $_GET\n\t\t\t\t$this->_method = \"DELETE\";\n\t\t\t\t//$this->logRequest();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->response('Forbidden',403);\n\t\t\t\tbreak;\n\t\t}\n\t}",
"function getPOSTData() {\n // check headers for one of two specific content-types\n $headers = getallheaders();\n $headerError = 'You must specify a Content-Type of either `application/x-www-form-urlencoded` or `application/json`';\n if ( !isset($headers['Content-Type']) ) {\n errorExit( 400, $headerError );\n }\n\n if ( $headers['Content-Type'] === 'application/json' ) {\n // parse the input as json\n $requestBody = file_get_contents( 'php://input' );\n $data = json_decode( $requestBody );\n if ( $data === null ) {\n errorExit( 400, 'Error parsing JSON' );\n }\n return $data;\n } else if ( $headers['Content-Type'] === 'application/x-www-form-urlencoded' ) {\n // convert the $_POST data from an associative array to an object\n return (object)$_POST;\n } else {\n errorExit( 400, $headerError );\n }\n}",
"function sanitizeName() {\n $pattern = \"/[0-9`!@#$%^&*()_+\\-=\\[\\]{};':\\\"\\\\|,.<>\\/?~]/\";\n if (!preg_match($pattern, $this->fname) && !preg_match($pattern, $this->lname)) {\n $this->fname = trim($this->fname);\n $this->lname = trim($this->lname);\n } else {\n die(\"Error. Check your form data\");\n }\n }",
"function getPostData($str){\n $data = $_POST[$str] ?? '';\n return htmlentities($data);\n}",
"function getInput()\r\n\t{\r\n\t\t$this->name = trim($_POST['name']);\r\n\r\n\t\t$this->desg = trim($_POST['desg']);\r\n\r\n\t\t$this->gender = trim($_POST['gender']);\r\n\r\n\t\t\r\n\t\tif(strcmp($this->gender, 'M') == 0)\r\n\t\t{\r\n\t\t\t$this->addr = trim($_POST['office']);\r\n\t\t}\t\r\n\r\n\t\telseif(strcmp($this->gender, 'F') == 0)\r\n\t\t\t$this->addr = trim($_POST['resd']);\r\n\r\n\t\t\r\n\t\t$this->contacts = array(trim($_POST['con1']));\r\n\t\tarray_push($this->contacts, trim($_POST['con2']), trim($_POST['con3']), trim($_POST['con4']), trim($_POST['con5']));\r\n\r\n\t\t$this->emails = array(trim($_POST['email1']));\r\n\t\tarray_push($this->emails, trim($_POST['email2']));\r\n\r\n\t\t//print_r($this->emails);\r\n\r\n\t\t$this->validateInput();\r\n\r\n\t}",
"function getSubmittedRealName() {\n\t\treturn $this->data_array['realname'];\n\t}",
"private function prepare_form_data()\n {\n $form_data = array(\n 'email' => array(\n 'name' => 'email',\n 'options' => array(\n '' => '--',\n ),\n 'extra' => array('id'=>'login-email', 'autofocus'=>''),\n ),\n 'password' => array(\n 'name' => 'password',\n 'options' => array(\n '' => '--',\n ),\n 'extra' => array('id'=>'login-password'),\n ),\n\n 'lbl-email' => array(\n 'target' => 'email',\n 'label' => 'E-mail Address',\n ),\n 'lbl-password' => array(\n 'target' => 'password',\n 'label' => 'Password',\n ),\n\n 'btn-submit' => array(\n 'value' => 'Login',\n 'extra' => array(\n 'class' => 'btn btn-primary',\n ),\n ),\n );\n\n return \\DG\\Utility::massage_form_data($form_data);\n }",
"function _postn($v) {\r\n $r = isset($_POST[$v]) ? bwm_clean($_POST[$v]) : '';\r\n return $r == '' ? NULL : $r;\r\n}",
"private static function getPostParams()\n\t{\n\t\treturn (count($_POST) > 0) ? $_POST : json_decode(file_get_contents('php://input'), true);\n\t}",
"private function formProcess() {\n if (isset($_POST['firstname']) && $_POST['firstname']) {\n $this->set_fname(format_uppercase_text($_POST['firstname']));\n } // Required\n if (isset($_POST['lastname']) && $_POST['lastname']) {\n $this->set_lname(format_uppercase_text($_POST['lastname']));\n } // Required\n if (isset($_POST['addressOne']) && $_POST['addressOne']) {\n $this->set_addressOne(format_text($_POST['addressOne']));\n } // Required\n if (isset($_POST['addressTwo']) && $_POST['addressTwo']) {\n $this->set_addressTwo(format_text($_POST['addressTwo']));\n } else {\n $this->set_addressTwo(\"\");\n }\n if (isset($_POST['city']) && $_POST['city']) {\n $this->set_city(format_uppercase_text($_POST['city']));\n } //Required\n if (isset($_POST['state']) && $_POST['state']) {\n $this->set_state(format_text($_POST['state']));\n } //Required\n if (isset($_POST['postalCode']) && $_POST['postalCode']) {\n $this->set_postalcode(format_text($_POST['postalCode']));\n } //Required\n if (isset($_POST['email']) && $_POST['email']) {\n $this->set_email(format_text(strtolower($_POST['email'])));\n } else {\n $this->set_email(\"\");\n }\n if (isset($_POST['homePhone']) && $_POST['homePhone']) {\n $this->set_homephone(format_text($_POST['homePhone']));\n } else {\n $this->set_homephone(\"\");\n }\n if (isset($_POST['workPhone']) && $_POST['workPhone']) {\n $this->set_workphone(format_text($_POST['workPhone']));\n } else {\n $this->set_workphone(\"\");\n }\n if (isset($_POST['cellPhone']) && $_POST['cellPhone']) {\n $this->set_cellphone(format_text($_POST['cellPhone']));\n } else {\n $this->set_cellphone(\"\");\n }\n /**\n if (isset($_POST['goalie']) && $_POST['goalie'] == \"on\") {\n $goalie = \"Y\";\n } else {\n $goalie = \"N\";\n }\n if (isset($_POST['defense']) && $_POST['defense'] == \"on\") {\n $defense = \"Y\";\n } else {\n $defense = \"N\";\n }\n if (isset($_POST['center']) && $_POST['center'] == \"on\") {\n $center = \"Y\";\n } else {\n $center = \"N\";\n }\n if (isset($_POST['wing']) && $_POST['wing'] == \"on\") {\n $wing = \"Y\";\n } else {\n $wing = \"N\";\n }\n */\n if (isset($_POST['position']) && $_POST['position']) {\n $this->set_position($_POST['position']);\n } //Required\n if (isset($_POST['jerseySize']) && $_POST['jerseySize']) {\n $this->set_jerseysize($_POST['jerseySize']);\n } //Required\n if ((isset($_POST['jerseyNumChoiceOne']) && $_POST['jerseyNumChoiceOne']) || $_POST['jerseyNumChoiceOne'] == 0) {\n $this->set_jerseyNumberOne($_POST['jerseyNumChoiceOne']);\n } //Required\n if ((isset($_POST['jerseyNumChoiceTwo']) && $_POST['jerseyNumChoiceTwo']) || $_POST['jerseyNumChoiceTwo'] == 0) {\n $this->set_jerseyNumberTwo($_POST['jerseyNumChoiceTwo']);\n } //Required\n if ((isset($_POST['jerseyNumChoiceThree']) && $_POST['jerseyNumChoiceThree']) || $_POST['jerseyNumChoiceThree'] == 0) {\n $this->set_jerseyNumberThree($_POST['jerseyNumChoiceThree']);\n } //Required\n if (isset($_POST['travelWith']) && $_POST['travelWith']) {\n $this->set_travelingWithWho(format_text($_POST['travelWith']));\n } else {\n $this->set_travelingWithWho(\"\");\n }\n if (isset($_POST['additionalNotes']) && $_POST['additionalNotes']) {\n $this->set_notes(format_text($_POST['additionalNotes']));\n } else {\n $this->set_notes(\"\");\n }\n if (isset($_POST['skillLevel']) && $_POST['skillLevel']) {\n $this->set_skilllevel($_POST['skillLevel']);\n } //Required\n if (isset($_POST['willSub']) && $_POST['willSub'] == \"Y\") {\n $this->set_wantToSub(1);\n if (isset($_POST['sunSub']) && $_POST['sunSub'] == \"on\") {\n $this->set_subSunday(1);\n } else {\n $this->set_subSunday(0);\n }\n if (isset($_POST['monSub']) && $_POST['monSub'] == \"on\") {\n $this->set_subMonday(1);\n } else {\n $this->set_subMonday(0);\n }\n if (isset($_POST['tueSub']) && $_POST['tueSub'] == \"on\") {\n $this->set_subTuesday(1);\n } else {\n $this->set_subTuesday(0);\n }\n if (isset($_POST['wedSub']) && $_POST['wedSub'] == \"on\") {\n $this->set_subWednesday(1);\n } else {\n $this->set_subWednesday(0);\n }\n if (isset($_POST['thuSub']) && $_POST['thuSub'] == \"on\") {\n $this->set_subThursday(1);\n } else {\n $this->set_subThursday(0);\n }\n if (isset($_POST['friSub']) && $_POST['friSub'] == \"on\") {\n $this->set_subFriday(1);\n } else {\n $this->set_subFriday(0);\n }\n if (isset($_POST['satSub']) && $_POST['satSub'] == \"on\") {\n $this->set_subSaturday(1);\n } else {\n $this->set_subSaturday(0);\n }\n } else {\n $this->set_wantToSub(0);\n $this->set_subSunday(0);\n $this->set_subMonday(0);\n $this->set_subTuesday(0);\n $this->set_subWednesday(0);\n $this->set_subThursday(0);\n $this->set_subFriday(0);\n $this->set_subSaturday(0);\n }\n if (isset($_POST['teamRep']) && $_POST['teamRep'] == \"Y\") {\n $this->set_wantToBeATeamRep(1);\n } else {\n $this->set_wantToBeATeamRep(0);\n }\n if (isset($_POST['referee']) && $_POST['referee'] == \"Y\") {\n $this->set_wantToBeARef(1);\n } else {\n $this->set_wantToBeARef(0);\n }\n if (isset($_POST['paymentPlan']) && $_POST['paymentPlan'] == \"1\") {\n $this->set_paymentPlan(1);\n } else if (isset($_POST['paymentPlan']) && $_POST['paymentPlan'] == \"2\") {\n $this->set_paymentPlan(2);\n } else if (isset($_POST['paymentPlan']) && $_POST['paymentPlan'] == \"3\") {\n $this->set_paymentPlan(3);\n } else if (isset($_POST['paymentPlan']) && $_POST['paymentPlan'] == \"4\") {\n $this->set_paymentPlan(4);\n } else if (isset($_POST['paymentPlan']) && $_POST['paymentPlan'] == \"5\") {\n $this->set_paymentPlan(1);\n }\n #Setup the positions comma separated value\n \n /** - This is no longer needed. We set positions directly above.\n $positions = \"\";\n if($goalie == \"Y\") {\n if($defense == \"Y\" || $center == \"Y\" || $wing == \"Y\") {\n $positions .= \"G, \";\n } else {\n $positions .= \"G\";\n }\n }\n if($defense == \"Y\") {\n if($center == \"Y\" || $wing == \"Y\") {\n $positions .= \"D, \";\n } else {\n $positions .= \"D\";\n }\n }\n if($center == \"Y\") {\n if($wing == \"Y\") {\n $positions .= \"C, \";\n } else {\n $positions .= \"C\";\n }\n }\n if($wing == \"Y\") {\n $positions .= \"W\";\n }\n $this->set_position($positions);\n */\n if (isset($_POST['drilLeague']) && $_POST['drilLeague']) {\n $this->set_drilLeague($_POST['drilLeague']);\n } //Required\n if (isset($_POST['payToday']) && $_POST['payToday'] == \"on\") {\n $this->set_payToday(1);\n } else {\n $this->set_payToday(0);\n }\n if (isset($_POST['usaHockeyMembership']) && $_POST['usaHockeyMembership']) {\n $this->set_usaHockeyMembership(format_trim(strtoupper($_POST['usaHockeyMembership'])));\n } else {\n $this->set_usaHockeyMembership(\"\");\n }\n }",
"public function getPostVariables();",
"public function cleanseFields() {\n $this->dictionary->remove('nospam');\n $this->dictionary->remove('blank');\n $submitVar = $this->controller->getProperty('submitVar');\n if (!empty($submitVar)) {\n $this->dictionary->remove($submitVar);\n }\n }",
"public static function getPostValue($name)\n {\n if (isset($_GET[$name])) return $_GET[$name];\n else if(isset($_POST[$name])) return $_POST[$name];\n else return '';\n }",
"function parse_form($array) {\n// build reserved keyword array\n//Anything put in here will not show up in your email when form is processed\n $reserved_keys[] = \"MAX_FILE_SIZE\";\n $reserved_keys[] = \"required\";\n $reserved_keys[] = \"redirect\";\n //$reserved_keys[] = \"email\";\n $reserved_keys[] = \"require\";\n $reserved_keys[] = \"path_to_file\";\n $reserved_keys[] = \"recipient\";\n $reserved_keys[] = \"subject\";\n $reserved_keys[] = \"bgcolor\";\n $reserved_keys[] = \"text_color\";\n $reserved_keys[] = \"link_color\";\n $reserved_keys[] = \"vlink_color\";\n $reserved_keys[] = \"alink_color\";\n $reserved_keys[] = \"title\";\n $reserved_keys[] = \"missing_fields_redirect\";\n $reserved_keys[] = \"env_report\";\n $reserved_keys[] = \"Submit\";\n $reserved_keys[] = \"submit\";\n //$reserved_keys[] = \"name\";\n $reserved_keys[] = \"Name\";\n $reserved_keys[] = \"submit_x\";\n $reserved_keys[] = \"submit_y\";\n $reserved_keys[] = \"sendit\";\n if (count($array)) {\n while (list($key, $val) = each($array)) {\n//check for email injection\n\t\tif(!has_no_emailheaders($val)){\n\t\t\tprint_error(\"Please don't spam\");\n\t\t}\n\t\t\n// exclude reserved keywords\n $reserved_violation = 0;\n for ($ri=0; $ri<count($reserved_keys); $ri++) {\n if ($key == $reserved_keys[$ri]) $reserved_violation = 1;\n }\n// prepare content\n if ($reserved_violation != 1) {\n\t// let's check to see if they are check boxes\n if (is_array($val)) {\n for ($z=0; $z<count($val); $z++) {\n $nn=$z+1;\n $content .= \"$key #$nn: $val[$z]\\n\";\n }\n }\n\t // if the values contains nothing do nothing then\n\t // don't add it to the content)\n elseif($val != \"\") $content .= \"$key: $val\\n\";\n }\n } // end of while\nreturn $content;\n }\n}",
"public static function checkPostData($data) {\n\t\t\t/* This method use the php function htmlentities for each values in $_POST and return an array with securised data */\n foreach ($data as $key => $value) {\n $data[$key] = htmlentities($value);\n }\n return $data;\n\t\t}"
] | [
"0.6516136",
"0.6413577",
"0.63955134",
"0.6355176",
"0.63020694",
"0.62495565",
"0.62340105",
"0.61609066",
"0.61508507",
"0.6115393",
"0.602803",
"0.5927564",
"0.5851881",
"0.58501774",
"0.5843353",
"0.5836976",
"0.58360356",
"0.58305955",
"0.58273757",
"0.58180106",
"0.5796057",
"0.57649976",
"0.57631147",
"0.5752224",
"0.5741396",
"0.57411677",
"0.5737782",
"0.5719753",
"0.57079107",
"0.56797314",
"0.56771123",
"0.5631723",
"0.56011",
"0.5595727",
"0.55877435",
"0.5583516",
"0.5561763",
"0.5552866",
"0.5552718",
"0.55401623",
"0.55111164",
"0.5486694",
"0.54844165",
"0.5471387",
"0.54657143",
"0.5462884",
"0.5459238",
"0.54574823",
"0.54452723",
"0.54447556",
"0.5440784",
"0.5439633",
"0.5436126",
"0.5433366",
"0.5429469",
"0.54293776",
"0.5414319",
"0.5410721",
"0.53950113",
"0.53870475",
"0.5385187",
"0.5381759",
"0.53817326",
"0.53806907",
"0.5379577",
"0.5375394",
"0.5365102",
"0.53542715",
"0.5352055",
"0.534913",
"0.5341984",
"0.5329143",
"0.53207284",
"0.531602",
"0.53143823",
"0.53115565",
"0.5306071",
"0.53053683",
"0.53040457",
"0.529995",
"0.52964765",
"0.52964765",
"0.52964765",
"0.5289789",
"0.5269994",
"0.526742",
"0.5262643",
"0.52586126",
"0.52495027",
"0.52490664",
"0.5246001",
"0.5245741",
"0.5242758",
"0.5240186",
"0.52385527",
"0.52364564",
"0.52345437",
"0.5230955",
"0.52184993",
"0.52150255",
"0.52094233"
] | 0.0 | -1 |
Make sure to include the file in case multiple instances are running on the same server and they have not changed the session secret Also make these change every 30 minutes | function ltiGetCompositeKey($post, $session_secret) {
$comp = $session_secret .'::'. $post['key'] .'::'. $post['context_id'] .'::'.
$post['link_id'] .'::'. $post['user_id'] .'::'. intval(time() / 1800) .
$_SERVER['HTTP_USER_AGENT'] . '::' . __FILE__;
return md5($comp);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_session_secret_handler () {\n$secret =$this->secure_random(16);\n$session_cookie_params = session_get_cookie_params();\n\nsetcookie('session_secret', $secret, $session_cookie_params['lifetime'], $session_cookie_params['path'], $session_cookie_params['domain'], $session_cookie_params['secure'], $session_cookie_params['httponly']);\n$_SESSION['session_secret'] = hash('sha256', $secret);\n\n}",
"private function session_id()\r\n {\r\n return md5(__FILE__ . \"_\" . $_SERVER[\"HTTP_HOST\"]);\r\n }",
"public function regenerateSession(){\n $authToken=$_COOKIE[self::COOKIENAME];\n if ($authToken){\n $authToken=base64_decode($authToken);\n $iv = substr($authToken,0,self::IVLEN);\n $crypted = substr($authToken,self::IVLEN);\n $token = openssl_decrypt($crypted, self::ALG, self::AESKEY,OPENSSL_RAW_DATA,$iv);\n if ($token===false){\n $this->__destruct();\n die('Decryption error');\n }\n\t $token = json_decode($token,true);\n\t $username=$token[\"loggedUser\"];\n\t // shoutout error if decryption failed\n\n // if user exists in backend storage\n if ($this->userExists($username)){\n $this->loggedUser=$username;\n $this->authToken=$_COOKIE[self::COOKIENAME];\n // reset cookie (to set new expiration date)\n $this->setAuthCookie();\n }\n else\n // logout if user does not exists in backend storage\n $this->logOut();\n }\n // no cookie - logout\n else $this->logOut();\n }",
"function stripe_session(){\n Dotenv::createImmutable(__DIR__)->load(); \n (new StripePhp\\App\\StripeSession())->create();\n}",
"function get_cookie_secret(){\n $file = dirname(__FILE__).'/../cache/.htcookiesecret.php';\n if(@file_exists($file)){\n return md5(trim(file($file)));\n }\n\n $secret = '<?php #'.(rand()*time()).'?>';\n if(!$fh = fopen($file,'w')) die(\"Couldn't write to $file\");\n if(fwrite($fh, $secret) === FALSE) die(\"Couldn't write to $file\");\n fclose($fh);\n\n return md5($secret);\n}",
"function init_site_secret()\n {\n \t$secret = md5(rand().microtime());\n \tif (datalist_set('__site_secret__', $secret))\n \t\treturn $secret;\n \t\t\n \treturn false;\n }",
"protected function regenerate()\n {\n $hash_chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n $hash = \"\";\n\n $exists = true;\n $sessions_tbl = $this->db->query('SELECT hash FROM sessions');\n $sessions = array();\n while($row = $sessions_tbl->fetchArray()) {\n $sessions[] = $row['hash'];\n }\n\n while($exists) {\n for($i = 0; $i < 64; $i++) {\n $r = rand(0, strlen($hash_chars) - 1);\n $hash.= $hash_chars[$r];\n }\n\n $exists = in_array($hash, $sessions);\n }\n\n self::$sid = $this->db->escapeString($hash);\n $sql = 'INSERT INTO sessions(hash, timestamp) VALUES(\"'.self::$sid.'\", \"'.time().'\")';\n $this->db->exec($sql);\n setcookie('PHPFASTSESSID', self::$sid, time() + $this->max_age);\n }",
"public function session_configure()\n {\n if (!$this->session)\n return;\n\n $lifetime = $this->config->get('session_lifetime', 0) * 60;\n\n // set keep-alive/check-recent interval\n if ($keep_alive = $this->config->get('keep_alive')) {\n // be sure that it's less than session lifetime\n if ($lifetime)\n $keep_alive = min($keep_alive, $lifetime - 30);\n $keep_alive = max(60, $keep_alive);\n $this->session->set_keep_alive($keep_alive);\n }\n\n $this->session->set_secret($this->config->get('des_key') . $_SERVER['HTTP_USER_AGENT']);\n $this->session->set_ip_check($this->config->get('ip_check'));\n }",
"public function setSecret() {\r\n $rand = $this->psl['crypt/rand'];\n\n $this->secret = $rand->bytes(32);\r\n $cookieParam = session_get_cookie_params();\r\n setcookie(\r\n $this->keyCookie,\r\n base64_encode($this->secret),\r\n $cookieParam['lifetime'],\r\n $cookieParam['path'],\r\n $cookieParam['domain'],\r\n $cookieParam['secure'],\r\n $cookieParam['httponly']\r\n );\r\n return true;\r\n }",
"function loadSession() {}",
"protected function regenerateSessionId() {}",
"protected function regenerateSessionId() {}",
"private function updateSession() {\n\t\t//update the login time.\n\t\tif (isset ( $this->session )) {\n\t\t\t$this->session ['lastlogin'] = time ();\n\t\t}\n\t\t\n\t\t//write $session['uid'], $session['name'], $session['lastlogin'] to file\n\t\tif (isset ( $this->session )) {\n\t\t\tfile_put_contents ( self::SESSION_FILE, serialize ( $this->session ) );\n\t\t} elseif (file_exists ( self::SESSION_FILE )) { //remove session information\n\t\t\tsession_destroy();\n\t\t\tunlink ( self::SESSION_FILE );\n\t\t}\n\t}",
"function session()\n {\n if (!API_MODE) {\n session_name('SKELETON');\n session_start();\n } else {\n ini_set('session.use_cookies', '0');\n }\n }",
"public static function generate(){\r\n return Session::put(Config::get('session/token_name'), md5(uniqid()));\r\n }",
"function startSessionLoged() {\n $this->session->set_ini(); //call ini_set. must be called in every script cause it doesnt remain!\n $this->session->regenerate(); //regenerate the session id\n $this->session->generateTokenId($this->connection,$this->user->getUsrID()); //return the tokenId \n $this->session->initiate($this->user->getKeepMeLogged()); //set values for ip, agent... confirmation\n $this->session->initiateToken($this->session->getToken(), $this->user->getUsrID());\n $this->session->setExpiration(); //set the expiration of idle session\n $this->session->setCookie(); //secure the session cookie\n $this->session->wClose();\n\n }",
"public function __construct() {\n //no session under cli\n if (php_sapi_name() === 'cli') {\n return false;\n }\n\n //100 minutes expire time , php default value is 180\n session_cache_expire(100);\n session_start();\n session_regenerate_id(TRUE); //每次从新加载都会产生一个新的session id\n int_set(\"session.use_only_cookies\", 1); //表示只使用cookies存放session id,这可以避免session固定攻击\n }",
"private function _sess_run() {\n\t\t// session\n\t\tini_set('session.save_handler', $this->sess_save_handler);\n\t\t$path = array();\n\t\tforeach ($this->sess_server as $server) {\n\t\t\tif (isset($server['host']) && isset($server['port'])) {\n\t\t\t\t$path[] = \"tcp://{$server['host']}:{$server['port']}?\" . http_build_query(isset($server['params']) ? $server['params'] : array());\n\t\t\t}\n\t\t}\n\t\tif (empty($path)) {\n\t\t\tshow_error('Session save_path is empty');\n\t\t}\n\t\tini_set('session.save_path', implode(',', $path));\n\n\t\tini_set('session.gc_maxlifetime', $this->sess_expiration);\t// 过期时间\n\t\t// cookie\n\t\tini_set('session.cookie_secure', 0);\t\t// 0 http:// 1 https://\n\t\tini_set('session.cookie_httponly', 1);\t\t// 不让JS读取session的cookie\n\t\tsession_name($this->sess_cookie_name);\n\n\t\tsession_start();\n\t\t// delete old flashdata (from last request)\n\t\t$this->_flashdata_sweep();\n\t\t// mark all new flashdata as old (data will be deleted before next request)\n\t\t$this->_flashdata_mark();\n\t}",
"protected function generateSessionToken() {}",
"function sec_session_start() {\n $session_name = 'msitadmissions'; // Set a custom session name\n $secure = false; // Set to true if using https.\n $httponly = true; // This stops javascript being able to access the session id. \n \n ini_set('session.use_only_cookies', 1); // Forces sessions to only use cookies. \n\t\t$cookieParams = session_get_cookie_params(); // Gets current cookies params.\n session_set_cookie_params($cookieParams[\"lifetime\"], $cookieParams[\"path\"], $cookieParams[\"domain\"], $secure, $httponly); \n session_name($session_name); // Sets the session name to the one set above.\n session_start(); // Start the php session\n session_regenerate_id(); // regenerated the session, delete the old one. \n}",
"public function __construct()\n {\n $this->config = array(\n 'name' => null, //name of the session\n 'use_only_cookies' => null, //force the use of cookies not passed session ID\n 'hash_function' => null, //what hash function to use 0=md5 1=sha1\n 'save_path' => null, //where to save the sessions defaults to system default\n 'cookie_secure' => null, //force cookies to be sent over ssh only\n 'gc_maxlifetime' => null, //how long to wait before garbage collection sessions\n 'gc_probability' => null, //how long to wait before garbage collection sessions\n 'gc_divisor' => null, //how long to wait before garbage collection sessions\n 'cookie_lifetime' => null, //seconds for session timeout\n 'cookie_path' => null, //domain path where the cookie will work\n 'cookie_domain' => null, //domain where the cookie will work\n );\n }",
"function phpAds_SessionDataStore()\n{\n $dal = new MAX_Dal_Admin_Session();\n //$conf = $GLOBALS['_MAX']['CONF'];\n global $session;\n if (isset($_COOKIE['sessionRPID']) && $_COOKIE['sessionRPID'] != '') {\n $session_id = $_COOKIE['sessionRPID'];\n $serialized_session_data = serialize($session);\n $dal->storeSerializedSession($serialized_session_data, $session_id);\n }\n // Randomly purge old sessions\n // XXX: Why is this random?\n // XXX: Shouldn't this be done by a daemon, or at least at logout time?\n srand((double)microtime()*1000000);\n if(rand(1, 100) == 42) {\n $dal->pruneOldSessions();\n }\n}",
"function get_site_secret()\n {\n \t$secret = datalist_get('__site_secret__');\n \tif (!$secret) $secret = init_site_secret();\n \t\n \treturn $secret;\n }",
"function sec_session_start() {\n\t $session_name = 'sec_session_id'; // Set a custom session name\n\t $secure = false; // Set to true if using https.\n\t $httponly = true; // This stops javascript being able to access the session id. \n\n\t ini_set('session.use_only_cookies', 1); // Forces sessions to only use cookies. \n\t $cookieParams = session_get_cookie_params(); // Gets current cookies params.\n\t session_set_cookie_params(ConfigFunctions::getSessionLength(true), $cookieParams[\"path\"], $cookieParams[\"domain\"], $secure, $httponly); \n\t session_name($session_name); // Sets the session name to the one set above.\n\t session_start(); // Start the php session\n\t session_regenerate_id(); // regenerated the session, delete the old one. \n\t}",
"function regeneratesession() {\n if(isset($_SESSION['OBSOLETE']) || $_SESSION['OBSOLETE'] == true)\n return;\n\n // Set current session to expire in 10 seconds\n $_SESSION['OBSOLETE'] = true;\n $_SESSION['EXPIRES'] = time() + 10;\n\n // Create new session without destroying the old one\n session_regenerate_id(false);\n\n // Grab current session ID and close both sessions to allow other scripts to use them\n $newSession = session_id();\n session_write_close();\n\n // Set session ID to the new one, and start it back up again\n session_id($newSession);\n if (session_status() == PHP_SESSION_NONE ) { session_start(); }; // recommended way for versions of PHP >= 5.4.0\n\n // Now we unset the obsolete and expiration values for the session we want to keep\n unset($_SESSION['OBSOLETE']);\n unset($_SESSION['EXPIRES']);\n}",
"private function initializePHPSession(): void\n {\n session_name(Config::getInstance()->values['session']['cookie_name']);\n\n /**\n * In localhost mode, security session_set_cookie_params causing problems in the sessions, so we disable this if we are in localhost mode.\n * Otherwise, if we are in production mode, we activate it.\n */\n if (!Server::isLocalHost()) {\n $iTime = (int)Config::getInstance()->values['session']['expiration'];\n session_set_cookie_params(\n $iTime,\n Config::getInstance()->values['session']['path'],\n Config::getInstance()->values['session']['domain'],\n Server::isHttps(),\n true\n );\n }\n\n @session_start();\n }",
"public static function start() {\t\t\t\n\t\t\t// get session id\n $sessionid = Functions::encrypt_decrypt('encrypt', \"Bengalathon\");\n \n //set session name\n\t\t\tini_set('session.name', $sessionid.'_SESID');\n \t\t\t\n //set session name\n\t\t\tini_set('session.name', base64_encode(BASE_PATH).'_SESID');\n \n //set session path\n\t\t\tini_set('session.cookie_path', \"/\");\n\t\t\t \t\t\t\n //set session domain\n ini_set('session.cookie_domain', $_SERVER['HTTP_HOST']);\n \n //set session httponly\n ini_set('session.cookie_httponly', true);\n \n //set session secure https\n ini_set('session.cookie_secure', false);\n \n\t\t\t// start the session\n\t\t\t@session_start();\t\t\n\t\t\t\n\t\t\t// get session token\n\t\t\t$token = self::get('token');\n\t\t\t\n\t\t\t// set session token\n\t\t\tif (empty($token)) {\n\t\t\t\tif (function_exists('mcrypt_create_iv')) {\n\t\t\t\t\tself::set('token', bin2hex(mcrypt_create_iv(32, MCRYPT_DEV_URANDOM)));\n\t\t\t\t} else {\n\t\t\t\t\tself::set('token', bin2hex(openssl_random_pseudo_bytes(32)));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// return session id\t\t\t\n\t\t\treturn session_id();\n\t\t}",
"public static function generate(){\n\t\treturn Session::put(Config::get('session/token_name'), md5(uniqid()));\t\t// Now we build the session class to utilis this method.\n\t}",
"function regenerateSession($reload = false)\n{\n if(!isset($_SESSION['fingerprint']) || $reload) {\n $_SESSION['fingerprint'] = sha1(md5($_SERVER['REMOTE_ADDR'].'ahsh')\n .md5($_SERVER['HTTP_USER_AGENT'].'afke'));\n }\n\n /**\n * Create new session and destroy the old one\n */\n session_regenerate_id(true);\n global $CONFIG;\n if($CONFIG->Subdomains->Top_domain) {\n setcookie(session_name(), session_id(), 0, \"/\", \".\".$CONFIG->Subdomains->Top_domain, true);\n }\n}",
"private function getSession() {\n\t\t//read session file and fill the array\n\t\tif (file_exists ( self::SESSION_FILE )) {\n\t\t\t$this->session = unserialize ( file_get_contents ( self::SESSION_FILE ) );\n\t\t}\n\t\t\n\t\t//If the last session has expired, remove the session\n\t\tif (isset ( $this->session ) && $this->session ['lastlogin'] + (10 * 60) <= time ()) {\n\t\t\tunset ( $this->session );\n\t\t\t$this->updateSession ();\n\t\t}\n\t}",
"function _RegenerateId()\n {\n if ($this->regenerate_id && function_exists('session_regenerate_id')) {\n if (version_compare('5.1.0', phpversion(), '>=')) {\n //session_regenerate_id(true);\n } else {\n \t//session_regenerate_id();\n }\n }\n }",
"function sec_session_start() {\r\n $session_name = 'sec_session_id'; // define name of session\r\n $secure = SECURE;\r\n // to avoid access to session id via JavaScript.\r\n $httponly = true;\r\n // Zwingt die Sessions nur Cookies zu benutzen.\r\n if (ini_set('session.use_only_cookies', 1) === FALSE) {\r\n header(\"Location: ../index.php?err=Could not initiate a safe session (ini_set)\");\r\n exit();\r\n }\r\n // Holt Cookie-Parameter.\r\n $cookieParams = session_get_cookie_params();\r\n session_set_cookie_params($cookieParams[\"lifetime\"], $cookieParams[\"path\"], $cookieParams[\"domain\"], $secure, $httponly);\r\n // Setzt den Session-Name zu oben angegebenem.\r\n session_name($session_name);\r\n session_start(); // Startet die PHP-Sitzung \r\n session_regenerate_id(); // Erneuert die Session, löscht die alte. \r\n }",
"public function session_init()\n {\n // session started (Installer?)\n if (session_id())\n return;\n\n $sess_name = $this->config->get('session_name');\n $sess_domain = $this->config->get('session_domain');\n $lifetime = $this->config->get('session_lifetime', 0) * 60;\n\n // set session domain\n if ($sess_domain) {\n ini_set('session.cookie_domain', $sess_domain);\n }\n // set session garbage collecting time according to session_lifetime\n if ($lifetime) {\n ini_set('session.gc_maxlifetime', $lifetime * 2);\n }\n\n ini_set('session.cookie_secure', rcube_ui::https_check());\n ini_set('session.name', $sess_name ? $sess_name : 'roundcube_sessid');\n ini_set('session.use_cookies', 1);\n ini_set('session.use_only_cookies', 1);\n ini_set('session.serialize_handler', 'php');\n\n // use database for storing session data\n $this->session = new rcube_session($this->get_dbh(), $this->config);\n\n $this->session->register_gc_handler(array($this, 'temp_gc'));\n $this->session->register_gc_handler(array($this, 'cache_gc'));\n\n // start PHP session (if not in CLI mode)\n if ($_SERVER['REMOTE_ADDR'])\n session_start();\n\n // set initial session vars\n if (!$_SESSION['user_id'])\n $_SESSION['temp'] = true;\n\n // restore skin selection after logout\n if ($_SESSION['temp'] && !empty($_SESSION['skin']))\n $this->config->set('skin', $_SESSION['skin']);\n }",
"private function renewSession() {}",
"function generateSessionKey(){\n\t\t // genereate session and form key\n\t\t$this->formSession['key'] = rand();\n\t\t$GLOBALS[\"TSFE\"]->fe_user->setKey('ses',$this->extKey, $this->formSession);\n\t\t$GLOBALS[\"TSFE\"]->storeSessionData();\n\t}",
"function secure_session_timeout() {\n if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 1800)) {\n \n // unset $_SESSION variable for the run-time \n session_unset();\n \n // destroy session data in storage\n session_destroy();}\n \n // update last activity time stamp \n $_SESSION['LAST_ACTIVITY'] = time(); \n \n if (!isset($_SESSION['CREATED'])) {\n $_SESSION['CREATED'] = time();\n // session started more than 30 minutes ago \n } else if (time() - $_SESSION['CREATED'] > 1800) {\n\n // change session ID for the current session and invalidate old session ID \n session_regenerate_id(true); \n \n // update creation time\n $_SESSION['CREATED'] = time(); \n }\n\n}",
"private static function safeStart()\n {\n // Check if csrf token exists\n if (empty($_SESSION['csrf_token_2'])) {\n if (function_exists('openssl_random_pseudo_bytes')) {\n $_SESSION['csrf_token_2'] = bin2hex(openssl_random_pseudo_bytes(32, $cstrong));\n } else {\n $_SESSION['csrf_token_2'] = bin2hex(openssl_random_pseudo_bytes(32));\n }\n }\n }",
"function sess_run()\n {\n //If we are, update the session length to reflect the \"user specific length\"\n if ($this->persistant_session() != FALSE) {\n $this->sess_length = $this->persistant_session();\n }\n\n //Set Session Name\n session_name($this->sess_name);\n\n //Set Session Lifetime (this is in seconds, unlike setting a normal cookie which requires a date/time)\n ini_set('session.cookie_lifetime', $this->sess_length);\n\n $current_session_id = session_id();\n if ($current_session_id != '') {\n //By calling Session_ID - with the current session_id - we force to renew the cookie (and the expiry time)\n session_id($current_session_id);\n }\n //If the session doesn't exist yet, there is no need to do this.\n\n //Start or Continue our Session\n session_start();\n\n //User IP Match - Run if required to do so\n if ($this->sess_match_ip == TRUE) {\n if (!isset($_SESSION['ip_address'])) {\n //If our session does not previously contain an IP address, this is the user's first visit. Record their IP.\n //Do not check again now until next page load.\n $_SESSION['ip_address'] = $this->_ra_encode($this->CI->input->ip_address());\n } else {\n if ($this->_ra_decode($_SESSION['ip_address']) != $this->CI->input->ip_address()) {\n //User IP Match failed - destory the session (and any stored data) immediantly.\n $this->sess_destroy();\n //Do not continue, and return \"FALSE\"\n return FALSE;\n }\n }\n }\n\n //User UserAgent (browser) Match - Run if required to do so\n if ($this->sess_match_useragent == TRUE) {\n if (!isset($_SESSION['user_agent'])) {\n //If our session does not previously contain a UserAgent, this is the user's first visit. Record their UserAgent.\n //Do not check again now until next page load.\n $_SESSION['user_agent'] = $this->_ra_encode(trim(substr($this->CI->input->user_agent(), 0, 50)));\n } else {\n if ($this->_ra_decode($_SESSION['user_agent']) != trim(substr($this->CI->input->user_agent(), 0, 50))) {\n //User UserAgent (browser) Match failed - destory the session (and any stored data) immediantly.\n $this->sess_destroy();\n //Do not continue, and return \"FALSE\";\n return FALSE;\n }\n }\n }\n\n //If session encryption is enabled, decode the session data and pass it to the array userdata() for compatability reasons.\n $this->userdata = $this->_ra_decode($_SESSION);\n\n //Return TRUE - successfully started/continued our session\n return TRUE;\n }",
"function confprod()\n{\n global $app, $appname, $appversion;\n $app->config([\n 'debug' => false,\n 'cookies.lifetime' => '1 day',\n 'cookies.secret_key' => 'b4924c3579e2850a6fad8597da7ad24bf43ab78e',\n\n ]);\n $app->getLog()->setEnabled(true);\n $app->getLog()->setLevel(\\Slim\\Log::WARN);\n $app->getLog()->info($appname . ' ' . $appversion . ': Running in production mode.');\n $app->getLog()->info('Running on PHP: ' . PHP_VERSION);\n error_reporting(E_ALL ^ (E_DEPRECATED | E_USER_DEPRECATED));\n}",
"public function setCookiePolicy()\n {\n if ($this->checkSameSiteNoneCompatible()) {\n config([\n 'session.secure' => true,\n 'session.same_site' => 'none',\n ]);\n }\n }",
"public function refresh()\n {\n session_regenerate_id(true);\n }",
"function session_start2() \r\t{\r\t\tif (SIS_SECURE == true){\r\t\t\t$session_name = md5('lib'.$_SERVER['REMOTE_ADDR'].$_SERVER['HTTP_USER_AGENT']);\t\t\t\r\t\t\t$httponly = true;\r\t\t\tif (ini_set('session.use_only_cookies', 1) === FALSE) {\r\t\t\t\tdie('Could not initiate a safe session (ini_set)');\r\t\t\t}\r\t\t\t$cookieParams = session_get_cookie_params();\r\t\t\tsession_set_cookie_params($cookieParams[\"lifetime\"],\r\t\t\t\t\t$cookieParams[\"path\"],\r\t\t\t\t\t$cookieParams[\"domain\"],\r\t\t\t\t\ttrue,\r\t\t\t\t\t$httponly);\t\t\r\t\t\tsession_name($session_name);\r\t\t\tsession_start();\r\t\t\tsession_regenerate_id();\r\t\t}else{\r\t\t\tsession_start();\r\t\t}\r\t}",
"function _session_regenerate_id()\r\n {\r\n $old_session_id = session_id();\r\n $old_session_data = $_SESSION;\r\n\r\n // regenerate session id and store it\r\n session_regenerate_id();\r\n $new_session_id = session_id();\r\n\r\n // switch to the old session and destroy its storage\r\n session_id($old_session_id);\r\n session_destroy();\r\n\r\n // switch back to the new session id and send the cookie\r\n session_id($new_session_id);\r\n session_start();\r\n\r\n // restore the old session data into the new session\r\n $_SESSION = $old_session_data;\r\n\r\n // update the session creation time\r\n $_SESSION['regenerated'] = _get_time();\r\n\r\n // end the current session and store session data.\r\n session_write_close();\r\n }",
"private static function configureSession()\n {\n if(!isset($_SESSION))\n {\n session_start();\n }\n }",
"function __construct() {\n\t\tkataMakeTmpPath('sessions');\n\t}",
"public function iniciar() {\r\n session_regenerate_id();\r\n }",
"public function storeSessionTokenInRegistry() {}",
"public static function generate() \n{\n // set the `$tokenKey variable` by calling `get method` on `Config object`\n $tokenKey = Config::get('session.tokenKey');\n \n\n /* uniqid() - generates a unique ID based on the microtime (the current time in microseconds).\n Returns the unique identifier, as a string.\n Parametrs: 2 Optional parametrs.\n https://www.w3schools.com/php/func_misc_uniqid.asp */\n $random_string = uniqid();\n\n /* md5 — Calculate the md5 hash of a string\n Returns the calculated MD5 hash on success, or FALSE on failure\n Parametrs:\n 1) string\tRequired. The string to be calculated\n 2) raw\tOptional. Specifies hex or binary output format:\n TRUE - Raw 16 character binary format\n FALSE - Default. 32 character hex number\n https://www.w3schools.com/php/func_string_md5.asp */\n $token = md5($random_string);\n\n // add new element in the $_SESSION[] array\n return Session::put($tokenKey, $token);\n}",
"protected function setupSession()\n\t{\n\t\t$name = $this->appType . \"id\";\n\t\tsession_name($name);\n\n\t\t$path = getenv(\"P_SESSION_DIR\") ?: $GLOBALS[\"BASE_DIR\"] . \"/session\";\n\t\tif (! is_dir($path)) {\n\t\t\tif (! mkdir($path, 0777, true))\n\t\t\t\tjdRet(E_SERVER, \"fail to create session folder: $path\");\n\t\t}\n\t\tif (! is_writeable($path))\n\t\t\tjdRet(E_SERVER, \"session folder is NOT writeable: $path\");\n\t\tsession_save_path ($path);\n\n\t\tini_set(\"session.cookie_httponly\", 1);\n\n\t\t$path = getenv(\"P_URL_PATH\");\n\t\tif ($path)\n\t\t{\n\t\t\t// e.g. path=/cheguanjia\n\t\t\tini_set(\"session.cookie_path\", $path);\n\t\t}\n\t}",
"function Pico_VerifySession()\n{\n\tglobal $db;\n\n\t$check = $db->force_multi_assoc('SHOW TABLES LIKE ?', PICO_SESSIONS);\n\tif (!is_array($check)) \n\t{\n\t\t$session_table = PICO_SESSIONS;\n\t\t$db->run(<<<SQL\nCREATE TABLE IF NOT EXISTS `$session_table` (\n `session_id` varchar(100) NOT NULL,\n `user_id` bigint(11) NOT NULL,\n `expiration` bigint(11) NOT NULL,\n `auth_token` varchar(50) NOT NULL\n);\nSQL\n);\n\t}\n\n\tif (!isset($_COOKIE['keep_session'])) { return 0; }\n\n\t$session_data = unserialize(base64_decode($_COOKIE['keep_session']));\n\tif (!is_array($session_data)) { exit(); } // hack attempt\n\n\t// delete old sessions\n\t$db->run('DELETE FROM `'.PICO_SESSIONS.'` WHERE `expiration`<?', time());\n\n\t// see if a valid session\n\t$user_id = $db->result('SELECT `user_id` FROM `'.PICO_SESSIONS.'` WHERE `session_id`=? AND `auth_token`=?', \n\t\t$session_data['session_id'], decrypt($session_data['auth_token'])\n\t);\n\n\tif (is_numeric($user_id))\n\t{\n\t\t$user_data = $db->assoc('SELECT * FROM `'.DB_USER_TABLE.'` WHERE `id`=?', $user_id);\n\t\t$user_ip = getenv('REMOTE_ADDR');\n\t\t$db->run('UPDATE `'.DB_USER_TABLE.'` SET `last_login`=?, `last_ip`=? WHERE `id`=?', time(), $user_ip, $user_id);\n\n\t\treturn $user_data['id'];\n\n\t\t//define('USER_ACCESS', $user_data['access']);\n\t\t//define('USER_ID', $user_data['id']);\n\t}\n\telse\n\t{\n\t\t// destroy cookie\n\t\t$domain = CookieDomain();\n\t\tsetcookie('keep_session', '', time() - 3600, '/', $domain);\n\n\t\treturn 0;\n\t\t//define('USER_ACCESS', 0);\n\t}\n}",
"function load_open_session($key=VANCO_KEY) {\n $shm = shmop_open(VANCO_MEM, \"c\", 0644, 58);\n $session = shmop_read($shm, 0, 48);\n $age = time() - shmop_read($shm, 48, 10);\n shmop_close($shm);\n if($age < 86400) {\n return trim(decrypt($session, $key)); # Read decrypt and trim from shared memory\n } else {\n return false;\n }\n}",
"public function __construct()\n {\n ini_set('session.use_cookies', 1);\n ini_set('session.use_only_cookies', 1);\n ini_set('session.use_trans_sid', 0);\n ini_set('session.save_handler', 'files');\n ini_set('session.gc_maxlifetime', 3600);\n\n session_name($this->sessionName);\n session_set_cookie_params(\n $this->sessionMaxLifeTime,\n $this->sessionPath,\n $this->sessionDomain,\n $this->sessionSSL,\n $this->sessionHTTPOnly\n );\n session_save_path($this->sessionSavePath);\n\n /*\n * very important : so read, write \n * can use them form my class not from SessionHandler\n * */\n session_set_save_handler($this, true);\n }",
"function sec_session_start() {\r\n $session_name = 'sec_session_id'; // Set a custom session name\r\n $secure = false;\r\n // This stops JavaScript being able to access the session id.\r\n $httponly = true;\r\n // Forces sessions to only use cookies.\r\n if (ini_set('session.use_only_cookies', 1) === FALSE) {\r\n header(\"Location: session_error.php?err=Could not initiate a safe session (ini_set)\");\r\n exit();\r\n }\r\n // Gets current cookies params.\r\n $cookieParams = session_get_cookie_params();\r\n session_set_cookie_params($cookieParams[\"lifetime\"],\r\n $cookieParams[\"path\"], \r\n $cookieParams[\"domain\"], \r\n $secure,\r\n $httponly);\r\n // Sets the session name to the one set above.\r\n session_name($session_name);\r\n session_start(); // Start the PHP session \r\n session_regenerate_id(); // regenerated the session, delete the old one. \r\n}",
"private function openSession() {\n $this->sessionId = isset($_POST['key']) ? $_POST['key'] : (isset($_GET['key']) ? $_GET['key'] : 'null');\n\n if($this->sessionId == 'null' || strlen($this->sessionId) === 0) {\n $this->sessionId = rand(0, 999999999);\n }\n\n session_id($this->sessionId);\n session_name(\"gibSession\");\n session_start();\n }",
"function start($sid = \"\")\n {\n global $zone, $application;\n\n $drop_session_cookie = false;\n\n if ($zone == \"AdminZone\")\n {\n ini_set(\"session.cookie_lifetime\", 0);\n session_name(\"AZSESSID\");\n if ($application->db->DB_isTableExists($application->getAppIni('DB_TABLE_PREFIX').\"settings\") != null)\n {\n $duration_cfg = (int)modApiFunc(\"Settings\", \"getParamValue\", \"ADMIN_SESSION_DURATION\", \"ADM_SESSION_DURATION_VALUE\");\n }\n else\n {\n $duration_cfg = 3600;\n }\n $ClientSessionLifetime = $duration_cfg;\n }\n else\n {\n \tif (isset($_COOKIE['save_session']) && $_COOKIE['save_session'] == \"save\")\n \t{\n \t if ($application->db->DB_isTableExists($application->getAppIni('DB_TABLE_PREFIX').\"settings\") != null)\n {\n $cz_duration_cfg = (int)modApiFunc(\"Settings\", \"getParamValue\", \"CUSTOMER_ACCOUNT_SETTINGS\", \"CUSTOMER_SESSION_DURATION_VALUE\");\n }\n else\n {\n $cz_duration_cfg = 3600*24*30; //30 days\n }\n\n \t\tini_set(\"session.cookie_lifetime\", $cz_duration_cfg);\n ini_set(\"session.gc_maxlifetime\", $cz_duration_cfg);\n \t}\n \telse\n \t{\n \t\tini_set(\"session.cookie_lifetime\", 0);\n #ini_set(\"session.gc_maxlifetime\", 0);\n $drop_session_cookie = true;\n\n \t}\n\n session_name(\"CZSESSID\");\n }\n\n if ($sid)\n {\n session_id($sid);\n }\n\n $session_save_handler = $application->getAppIni('SESSION_SAVE_HANDLER');\n if ($session_save_handler == 'DB')\n {\n // redefine session handler\n __set_session_db_handler();\n }\n elseif ($session_save_handler != 'PHP_INI')\n {\n ini_set(\"session.save_handler\", $session_save_handler);\n }\n\n $session_save_path = $application->getAppIni('SESSION_SAVE_PATH');\n if ($session_save_path == 'AVACTIS_CACHE_DIR')\n {\n session_save_path($application->getAppIni(\"PATH_CACHE_DIR\"));\n }\n elseif ($session_save_path != 'PHP_INI')\n {\n session_save_path($session_save_path);\n }\n\n session_start();\n\n global $application;\n $HTTP_URL = md5($application->getAppIni('HTTP_URL'));\n if (!isset($_COOKIE['HTTP_URL']))\n {\n setcookie('HTTP_URL', $HTTP_URL, time());\n }\n elseif ($_COOKIE['HTTP_URL']!=$HTTP_URL)\n {\n setcookie('HTTP_URL', $HTTP_URL, time());\n session_destroy();\n\n if ($session_save_handler == 'DB')\n {\n // redefine session handler (http://bugs.php.net/bug.php?id=32330)\n // redefine session handler\n __set_session_db_handler();\n }\n session_start();\n }\n\n if ($zone == \"CustomerZone\")\n {\n $sess = session_get_cookie_params();\n if ($drop_session_cookie)\n $t = 0;\n else\n $t = time()+$sess['lifetime'];\n setcookie(session_name(), session_id(), $t, '/');\n if ($application -> getCurrentProtocol() == 'http')\n $temp_url = $application->getAppIni('SITE_HTTPS_URL');\n else\n $temp_url = $application->getAppIni('SITE_URL');\n $temp_url = parse_url($temp_url);\n if (isset($temp_url['host']))\n setcookie(session_name(), session_id() , $t, '/', $temp_url['host']);\n }\n\n //\n // , .\n // , .\n // , , .\n // .\n // IP .\n // .\n // .\n //\n $CURRENT_PRODUCT_VERSION = PRODUCT_VERSION;\n\n $current_hash = \"\";\n if ($zone != \"AdminZone\")\n {\n loadModuleFile('configuration/const.php');\n /*_use(dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR.'configuration'.DIRECTORY_SEPARATOR.'configuration_api.php');\n\n $tables = Configuration::getTables();\n $ss = $tables['store_settings']['columns'];\n\n $s = new DB_Select();\n $s->addSelectTable('store_settings');\n $s->addSelectValue('variable_value','value');\n $s->WhereValue($ss['name'], DB_EQ, SYSCONFIG_CHECKOUT_FORM_HASH);\n $v = $application->db->getDB_Result($s);\n $current_hash = $v[0]['value'];*/\n\n $cache = CCacheFactory::getCache('hash');\n $current_hash = $cache->read(SYSCONFIG_CHECKOUT_FORM_HASH);\n }\n\n $current_ips = getClientIPs();\n\n if((!array_key_exists('PRODUCT_VERSION', $_SESSION) ||\n $_SESSION['PRODUCT_VERSION'] != $CURRENT_PRODUCT_VERSION && $zone != \"AdminZone\")||\n// ! @array_intersect($_SESSION['REMOTE_ADDR'], $current_ips) ||\n// @$_SESSION['HTTP_USER_AGENT'] != @$_SERVER['HTTP_USER_AGENT'] || commented so that SIM Method of Authorize.Net redirect to orderplaced page\n (!array_key_exists(SYSCONFIG_CHECKOUT_FORM_HASH, $_SESSION) ||\n $current_hash != $_SESSION[SYSCONFIG_CHECKOUT_FORM_HASH] && $zone != \"AdminZone\") )\n {\n if(!empty($_SESSION['CartContent']) && is_array($_SESSION['CartContent']))\n {\n foreach($_SESSION['CartContent'] as $cart_id => $cart_content)\n {\n modApiFunc('Cart', 'removeGCfromDB', $cart_content['product_id']);\n }\n }\n //see this::session_clean1()\n session_unset();\n session_destroy();\n\n if ($session_save_handler == 'DB')\n {\n // redefine session handler (http://bugs.php.net/bug.php?id=32330)\n // redefine session handler\n __set_session_db_handler();\n }\n session_start();\n }\n $_SESSION['PRODUCT_VERSION'] = $CURRENT_PRODUCT_VERSION;\n $_SESSION[SYSCONFIG_CHECKOUT_FORM_HASH] = $current_hash;\n $_SESSION['REMOTE_ADDR'] = $current_ips;\n $_SESSION['HTTP_USER_AGENT'] = @$_SERVER['HTTP_USER_AGENT'];\n //\n\n foreach($_SESSION as $key => $val)\n {\n $this->keyvalList[$key] = $val;\n// $this->set($key, $val);\n }\n $this->started = TRUE;\n\n if ($zone == \"AdminZone\")\n {\n if (!$this->is_Set('ClientSessionLifetime'))\n {\n $this->set('ClientSessionLifetime', time());\n }\n else\n {\n $delta_time = time()-$this->get('ClientSessionLifetime');\n if (($delta_time > $ClientSessionLifetime)&&($ClientSessionLifetime!=0))\n {\n $this->un_Set('currentUserID');\n }\n $this->set('ClientSessionLifetime', time());\n }\n }\n }",
"public function start()\n {\n session_name($this->getConfigVariable('name'));\n ini_set(\"session.use_only_cookies\", $this->getConfigVariable('use_only_cookies'));\n ini_set(\"session.cookie_secure\", $this->getConfigVariable('cookie_secure'));\n ini_set(\"session.hash_function\", $this->getConfigVariable('hash_function'));\n // create a private session directory so that another script\n // with a lower lifetime doesn't clean up our session\n $path = $this->getConfigVariable('save_path');\n if (!empty($path) and\n is_dir($path) and\n is_writable($path)\n ) {\n ini_set('session.save_path', $this->getConfigVariable('save_path'));\n }\n //When to destroy sessions on the filesystem\n ini_set('session.gc_maxlifetime', $this->getConfigVariable('gc_maxlifetime'));\n ini_set('session.gc_probability', $this->getConfigVariable('gc_probability'));\n ini_set('session.gc_divisor', $this->getConfigVariable('gc_divisor'));\n\n //session_set_cookie_params (lifetime,path,domain,secure)\n session_set_cookie_params(\n $this->getConfigVariable('cookie_lifetime'),\n $this->getConfigVariable('cookie_path'),\n $this->getConfigVariable('cookie_domain'),\n $this->getConfigVariable('cookie_secure')\n );\n\n //the session_cache_limiter cache-control line is there to kill a bug in\n //IE that causes the PDF not to be cached over ssl.\n //these lines allow the caching and let the file be downloaded.\n //This bug doesn't seem to affect the preview\n //it was present in IE6 and IE7\n session_cache_limiter('must-revalidate');\n\n session_start();\n //do a very small check to see if the browser is the same as the originating browser\n //this canbe fooled easily, but provides a bit of security\n if (empty($_SESSION)) {\n $this->setup();\n } elseif (empty($_SESSION['security']) or\n $_SESSION['security']['user-agent'] != md5(\n empty($_SERVER['HTTP_USER_AGENT']) ? '' : $_SERVER['HTTP_USER_AGENT']\n )\n ) {\n $this->restart();\n }\n }",
"function secure_session_start() {\n \n $session_name = '_crowdcc_sess'; \n /* set a custom session name */\n \n $secure = FALSE; \n /* set SSL level, true if using https. */\n $https = isset($secure) ? $secure : isset($_SERVER['HTTPS']);\n\n /* Make sure the session cookie is not accessable via javascript. */\n $httponly = TRUE;\n\n /* Set the domain to default to the current domain. */\n /* $domain = isset($domain) ? $domain : isset($_SERVER['SERVER_NAME']); */\n /* $domain = '.example.com'; // cookies be available across all sub-domains */\n \n $domain = $_SERVER['SERVER_NAME']; // http://localhost/\n\n /* set the domain path (http page path). */\n $path = '/';\n\n /* Set the cookie lifetime for domain and path. Set to 0 if you want the session cookie to be set until the user closes */\n /* the browser. Use time() + seconds otherwise. */\n /* $lifetime = 0; */\n\n $lifetime = 2700;\n\n /* forces sessions not to include the identifier in the URL, and not to read the URL for identifier. */\n ini_set('session.use_trans_sid', 0); \n \n /* hash algorithm to use for the sessionid. (use hash_algos() to get a list of available hashes.) */\n $session_hash = 'sha512';\n \n /* check if hash is available */\n if (in_array($session_hash, hash_algos())) {\n /* set the has function. */\n ini_set('session.hash_function', $session_hash);\n }\n\n /* How many bits per character of the hash. */\n /* The possible values are '4' (0-9, a-f), '5' (0-9, a-v), and '6' (0-9, a-z, A-Z, \"-\", \",\"). */\n ini_set('session.hash_bits_per_character', 5);\n \n /* force the session to only use cookies, not URL variables. */\n ini_set(\"session.use_cookies\", 1);\n ini_set(\"session.use_only_cookies\", 1);\n ini_set(\"session.use_trans_sid\", 1); // try and prevent addtional PHPSESSID being generated\n \n /* HTTP Only */\n ini_set('session.cookie_httponly', 1);\n\n /* ini_set('session.cache_expire', 45); */\n ini_set('session.cookie_lifetime', 0);\n ini_set(\"session.gc_maxlifetime\", $lifetime);\n\n ini_set(\"session.gc_probability\", 1);\n ini_set(\"session.gc_divisor\", 100);\n \n ini_set('session.cookie_domain', '.localhost'); // domain\n ini_set('url_rewriter.tags', ''); // ensure that the session id is *not* passed on the url.\n\n /* Get session cookie parameters */\n $cookieParams = session_get_cookie_params();\n\n // if($remember) {\n // Generate new auth key for each log in (so old auth key can not be used multiple times in case of cookie hijacking)\n // $cookie_auth= rand(10) . $username;\n // $auth_key = session_encrypt($cookie_auth);\n // $auth_query = mysql_query(\"UPDATE users SET auth_key = '\" . $auth_key . \"' WHERE username = '\" . $username . \"'\");\n // setcookie(\"auth_key\", $auth_key, time() + 60 * 60 * 24 * 7, \"/\", \"example.com\", false, true)\n // }\n \n /* set the parameters */\n session_set_cookie_params($cookieParams['lifetime'], $cookieParams['path'], $domain, $https, $httponly); \n \n /* change the session name */\n session_name($session_name);\n\n /* now we can start the session */\n if (session_status() == PHP_SESSION_NONE ) { session_start(); }; // recommended way for versions of PHP >= 5.4.0\n\n // Manually set the cookie\n // setcookie(\"sid\", session_id(), strtotime(\"+1 hour\"), \"/\", \".wblinks.com\", true, true);\n // if ( PHP_VERSION < 5.2 ){@setcookie( $session_name, $value, $expires, $path, $domain. '; HttpOnly' );}else{@setcookie( $session_name, $value, $expires, $path, $domain, NULL, TRUE );}\n // setcookie(\"sid\", session_id($session_name), strtotime(\"+1 hour\"), \"/\", \".localhost\", true, true);\n // setcookie(session_name($session_name),session_id(),time()+$lifetime);\n\n /* this line regenerates the session and delete the old one. \n it also generates a new encryption key in the database. */\n session_regenerate_id(true);\n\n}",
"private function define_secret() {\n\t\t$secret = '';\n\t\treturn $secret;\n\t}",
"function token_generator() {\n $token = $_SESSION['token'] = md5(uniqid(mt_rand(),true));\n\n return $token;\n}",
"private function sessionId()\n\t{\n\t\treturn md5(sha1(sha1(microtime() . rand(1111111, 9999999))));\n\t}",
"function set_ini(){\n session_name(self::_SESSION_NAME_); \n //ini_set('session.name',self::_SESSION_NAME_);\n // **PREVENTING SESSION HIJACKING**\n // Prevents javascript XSS attacks aimed to steal the session ID (jscript cant access cookies now)\n ini_set('session.cookie_httponly', 1);\n // Adds entropy into the randomization of the session ID, as PHP's random number\n // generator has some known flaws\n ini_set('session.entropy_file', self::_SESSION_ENTROPY_);\n ini_set('session.entropy_length', self::_SESSION_ENTROPY_LENGTH); \n // Uses a strong hash\n ini_set('session.hash_function', self::_SESSION_HASH_);\n // **PREVENTING SESSION FIXATION**\n // Session ID cannot be passed through URLs\n ini_set('session.use_cookies', 'true'); \n ini_set('session.use_only_cookies', 1);\n // Uses a secure connection (HTTPS) if possible\n //if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') \n //ini_set('session.cookie_secure', 1); \n session_start();\n\n }",
"function startSession(){\r\n\r\n\t\tsession_name(\"phpBMS\".preg_replace('/\\W/',\"\",APPLICATION_NAME).\"v096ID\");\r\n\t\tsession_start();\r\n\r\n\t}",
"function setSessionOn() {\n ini_set(\"session.cookie_lifetime\", 0);\n ini_set(\"session.use_cookies\", 1);\n ini_set(\"session.use_only_cookies\" , 1);\n ini_set(\"session.use_strict_mode\", 1);\n ini_set(\"session.cookie_httponly\", 1);\n ini_set(\"session.cookie_secure\", 1);\n ini_set(\"session.cookie_samesite\" , \"Strict\");\n ini_set(\"session.cache_limiter\" , \"nocache\");\n ini_set(\"session.sid_length\" , 48);\n ini_set(\"session.sid_bits_per_character\" , 6);\n ini_set(\"session.hash_function\" , \"sha256\");\n \n session_name(\"Authentification\");\n return session_start();\n}",
"function checkSession()\n{\n if(sha1(md5($_SERVER['REMOTE_ADDR'].'ahsh').md5($_SERVER['HTTP_USER_AGENT'].'afke'))\n != @$_SESSION['fingerprint'])\n {\n Flash::create('Session check failed');\n return false;\n }\n if(mt_rand(1, 20) == 1)\n {\n regenerateSession();\n }\n return true;\n}",
"function sess_id()\n {\n return session_id();\n }",
"function securityUpdateToken() {\n\tif (isset($_SESSION['security_token']['time']) && $_SESSION['security_token']['time'] + TOKEN_EXPIRATION > time()) {\n\t\t$_SESSION['security_token']['time'] = time();\n\t\treturn;\n\t}\n\n\t// update the token\n\t$_SESSION['security_token'] = array();\n\t$_SESSION['security_token']['value'] = md5(time());\n\t$_SESSION['security_token']['time'] = time();\n}",
"public function sess_update()\r\r\n\t{\r\r\n\t\t// We only update the session every five minutes by default\r\r\n\t\tif (($this->parent->userdata['last_activity'] + $this->parent->sess_time_to_update) >= $this->parent->now)\r\r\n\t\t{\r\r\n\t\t\treturn;\r\r\n\t\t}\r\r\n\r\r\n\t\t// Regenerate session id\r\r\n\t\tsession_regenerate_id();\r\r\n\r\r\n\t\t// Update the session data in the session data array\r\r\n\t\t$this->parent->userdata['session_id'] = session_id();\r\r\n\t\t$this->parent->userdata['last_activity'] = $this->parent->now;\r\r\n\t}",
"public function generateToken(){\n //if(empty($_SESSION['token']) && (empty($_SESSION['tokenAge']) || (time() - (int)$_SESSION['tokenAge']) > (int)$this->maxAge)){\n if(function_exists('random_bytes')){\n $_SESSION['token'] = bin2hex(random_bytes(32));\n }elseif(function_exists('mcrypt_create_iv')){\n $_SESSION['token'] = bin2hex(mcrypt_create_iv(32, MCRYPT_DEV_URANDOM));\n }else{\n $_SESSION['token'] = bin2hex(openssl_random_pseudo_bytes(32));\n }\n $_SESSION['tokenAge'] = time();\n //} \n }",
"public function persistSessionToken() {}",
"public function persistSessionToken() {}",
"public function persistSessionToken() {}",
"public function persistSessionToken() {}",
"public function getSessionSecret() {\r\n\t\t$session = $this->getSession ();\r\n\t\tif (isset ( $session ['session_secret'] )) {\r\n\t\t\treturn $session ['session_secret'];\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"private function aim() {\n\t\t# The class pretends to use the session for storing the\n\t\t# permanent memory of one application\n\t\t# wheteher it does or doesn't a log in to execute it.\n\t\t# It has two ways of make the logout:\n\t\t#\ta) The logout is performed by calling to a website from\n\t\t#\t\twhich yhe user will need to login again to come back\n\t\t#\t\tinside the app.\n\t\t#\tb) The logout is performed changing to the anonymous user\n\t\t#\t\tand accessing to the places suitable for that user.\n\t}",
"function set_csrf_token()\n{\n if (!isset($_SESSION[SESSION_PREFIX . 'csrf_token'])) {\n $_SESSION[SESSION_PREFIX . 'csrf_token'] = sha1(session_id() . (function_exists('openssl_random_pseudo_bytes')\n ? openssl_random_pseudo_bytes(32)\n : (time() + microtime(true)) . mt_rand(0, 99999999)));\n }\n}",
"function sec_session_start(){\n $session_name = 'sec_session_id';\n $secure = false;\n // This stops Javascript being able to access the session id\n $httponly = true;\n // Forces sessions to only use cookies.\n if (ini_set('session.use_only_cookies',1) === FALSE){\n header(\"Location: ../error.php?err=Could not initiate a safe session (ini_set)\");\n exit();\n }\n //Gets current cookie params.\n $cookieParams = session_get_cookie_params();\n session_set_cookie_params($cookieParams[\"lifetime\"], $cookieParams[\"path\"], $cookieParams[\"domain\"], $secure, $httponly);\n //Sets the session name to the one set above\n session_name($session_name);\n session_start();\n session_regenerate_id(true);\n}",
"function startSession($app) {\r\n\tif($app!=\"\") session_set_cookie_params(0, $app); // limit PHPSESSID to \"/appdomain/myapp1\" folder\r\n\tsession_start();\r\n}",
"private function sessionRegenerateId()\n {\n // even if the session were hijacked, it will be expired very soon, so doing this way we reduce chance of users's (or admin's) account penetration\n // again, it's not 100% way to do secure accounts, but it makes hijacking harder\n // and yes, i almost copied code from php.net ;)\n\n // step 0. make sure that session is active\n if (session_status() !== PHP_SESSION_ACTIVE) {\n session_start();\n }\n\n // step 1: create new session id\n $newSessionID = session_create_id($this->sessionIDPrefix);\n\n // outdated session, we don't need it\n $this->unsetSESSION('session_created');\n\n // step 2: push time of regenerating into current session\n $this->setSESSION('session_annihilated', time());\n\n // step 3: save new session id into old session\n $this->setSESSION('new_session_id', $newSessionID);\n\n // step 4: generate new session id and keep old session\n session_regenerate_id(false);\n\n // see? we create new session with new identifier, but old session is still alive!\n // in this session we don't need new id and destroy time\n $this->unsetSESSION('session_annihilated');\n $this->unsetSESSION('new_session_id');\n\n // and create time of creating to check it later\n $this->setSESSION('session_created', time());\n }",
"static public function begin(){ \n $_SESSION['session_time'] = time(); \n }",
"public function setSessionToken() {\n\t\t\t$session_token = hash('sha256', microtime());\n\t\t\t$_SESSION['session_token'] = $session_token;\n\t\t\treturn $session_token;\n\t\t}",
"function kcsite_session_start() {\n\tif (!session_id()){\n\t\tsession_start();\n\t}\n}",
"public static function regenerateSessionid();",
"public function refresh()\n {\n $sess = $this->_di->get('Input')->getAll('session');\n $id = session_regenerate_id(true);\n session_destroy();\n session_start();\n $_SESSION = $sess;\n }",
"function wpdev_session_start() {\n session_start();\n }",
"public static function setSessionIni () {\n \n // session host. Use .example.com if you want to allow session\n // accross sub domains. Interesting: You can not use testserver\n // server without country part)\n \n $session_host = conf::getMainIni('session_host');\n if ($session_host){\n ini_set(\"session.cookie_domain\", $session_host);\n }\n \n \n $session_save_path = conf::getMainIni('session_save_path');\n if ($session_save_path) { \n ini_set(\"session.save_path\", $session_save_path);\n }\n \n \n \n // session time\n $session_time = conf::getMainIni('session_time');\n if (!$session_time) { \n $session_time = '0';\n }\n ini_set(\"session.cookie_lifetime\", $session_time);\n\n // session path\n $session_path = conf::getMainIni('session_path');\n if ($session_path) {\n ini_set(\"session.cookie_path\", $session_path);\n }\n\n // secure session\n $session_secure = conf::getMainIni('session_secure');\n if ($session_secure) { \n ini_set(\"session.cookie_secure\", true);\n } else {\n ini_set(\"session.cookie_secure\", false);\n }\n\n // set a session name. You need this if the session \n // should cross sub domains\n $session_name = conf::getMainIni('session_name');\n if ($session_name) { \n session_name($session_name);\n }\n }",
"public function __construct()\n {\n $path = rtrim(dirname($_SERVER['SCRIPT_NAME']), '\\\\/');\n\n $config = array_merge([\n 'name' => 'pletfix_session',\n 'lifetime' => 0,\n 'path' => $path, // '/',\n 'domain' => null,\n 'secure' => false,\n 'http_only' => true,\n ], config('session', []));\n\n $this->lifetime = $config['lifetime'] * 60;\n\n session_set_cookie_params(\n $this->lifetime,\n $config['path'],\n $config['domain'],\n $config['secure'],\n $config['http_only']\n );\n\n if (isset($config['save_path'])) {\n session_save_path($config['save_path']);\n }\n\n session_name($config['name']);\n }",
"public function refreshSession() {}",
"function sec_session_start() {\n\t$session_name = 'sec_session_id';\n\t$secure = false;\n\t$httponly = true;\n\t\n\tini_set ( 'session.use_only_cookies', 1 );\n\t$cookieParams = session_get_cookie_params ();\n\tsession_set_cookie_params ( 0 );\n\tsession_name ( $session_name );\n\tsession_start ();\n\tsession_regenerate_id ();\n}",
"function load_config() {\n $config_file = \"scripts/i-erp.conf\";\n $comment = \"#\";\n // open the config file\n $fp = fopen($config_file, \"r\");\n if (!$fp) {\n echo(\"Failed to open file\");\n return 0;\n }\n // loop through the file lines and pull out variables\n while (!feof($fp)) {\n $line = trim(fgets($fp));\n if ($line && $line[0] != $comment) {\n $pieces = explode(\"=\", $line);\n $option = trim($pieces[0]);\n $value = trim($pieces[1]);\n $config_values[$option] = $value;\n }\n }\n fclose($fp);\n $_SESSION['install_lib'] = $config_values['install_lib'];\n $_SESSION['server'] = $config_values['server'];\n $_SESSION['timeout'] = $config_values['timeout'];\n $_SESSION['appname'] = $config_values['appname'];\n $_SESSION['h_logo'] = $config_values['h_logo'];\n $_SESSION['si_logo'] = $config_values['si_logo'];\n $_SESSION['copyr'] = $config_values['copyr'];\n return 1;\n}",
"private function check()\n\t{\n\t\tif (!session_id())\n\t\t{\n\t\t\tsession_start();\n\t\t}\n\t}",
"function myStartSession() {\n\n\tif(!session_id() && is_user_logged_in() ) {\n\n\t\tsession_start();\n\t}\n\t\n\tif (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 1800)) {\n\n\t\t// last request was more than 30 minutes ago\n\t\t$siteURL = site_url();\n\n\t\tsession_unset(); // unset $_SESSION variable for the run-time\n\n\t\tsession_destroy(); // destroy session data in storage\n\t\twp_logout();\n\t\n\t\twp_redirect( \"/wp-login.php?sessexp=1\" ); \n\t\texit;\n\n\t}\n\telse{\n\n\t$_SESSION['LAST_ACTIVITY'] = time();\n\t}\n\n}",
"private function define_jwt_secret_key() {\n\t\tdefine( 'JWT_AUTH_SECRET_KEY', get_option( $this->option_name_jwt_secret_key ) );\n\t}",
"private function getCurrentPhpSid(){if($this->phpsid=$this->MakeSafe->thisData(\"PHPSESSID\",\"PARANOID_STRING\",26,32,\"COOKIE\")){$this->valid=true;}else{$this->valid=false;}}",
"public static function regenerate_sid() {\n\t\t$key = self::generate_sid();\n\t\tdatabase()->start_query('sessions', 'UPDATE')\n\t\t\t->set(array('key' => $key))\n\t\t\t->where(array('key' => self::$sid))\n\t\t\t\t->run();\n\t\tself::setcookie($key);\n\t}",
"private static function set_token() {\n\t\t\t// Bring in the $session variable\n\t\t\tglobal $session;\n\t\t\t// Generate a random token of 64 length\n\t\t\t$token = self::generate_token(64);\n\t\t\t// Store it in the $_SESSION\n\t\t\t$session->set('csrf_token', $token);\n\t\t}",
"private static function init(){\n\t\t\tif (session_status() != PHP_SESSION_ACTIVE) {\n\t\t\t\tsession_start();\n\t\t\t}\n\t\t}",
"function persistsession(){\n\tglobal $config;\n\n\t$has_session = isset($_SESSION[$config->sesskey]);\n\t$has_cookie = (isset($_COOKIE[$config->sesskeycookiename]) and $_COOKIE[$config->sesskeycookiename]!= '');\n\tif(!$has_session and $has_cookie){\n\t\t//perform login from cookie\n\t\t$cookieparts=explode(\"|\",$_COOKIE[$config->sesskeycookiename]);\n\t\t//cookie should contain encrypt(password)|encrypt(roleid)|username|md5(http_user_agent)|lang|encrypt(orgid)\n\t\tif(count($cookieparts)==6){\n\t\t\t$orgid_enc = trim($cookieparts[5]);\n\t\t\t$lang = trim($cookieparts[4]);\n\t\t\t$remoteuseragent = trim($cookieparts[3]);\n\t\t\t$username = trim($cookieparts[2]);\n\t\t\t$roleid_enc = trim($cookieparts[1]);\n\t\t\t$password = trim($cookieparts[0]);\n\t\t\trequire_once(\"EnDecryptText.php\");\n\t\t\t$EnDecryptText = new EnDecryptText();\n\t\t\trequire_once(\"api-functions.php\");\n\t\t\t//only if cookie has correct data, do login. otherwise, unlog user.\n\t\t\tif(do_auth($username,$EnDecryptText->Decrypt_Text($password)) and $remoteuseragent==md5($_SERVER[\"HTTP_USER_AGENT\"])){\n\t\t \t\t//restore session\n\t\t \t\t$_SESSION[$config->sesskey] = $username;\n\t\t \t\t$_SESSION[$config->sesskey.\"pw\"] = $password;\n\t\t \t\t$_SESSION[$config->sesskey.\"rl\"] = $roleid_enc;\n\t\t\t\t\t$_SESSION[$config->sesskey.\"or\"] = $orgid_enc;\n\t\t \t\t$_SESSION[$config->sesskey.\"lang\"] = $lang;\n\t\t\t} else {\n\t\t\t\t//destroy cookies\n\t\t\t\tsetcookie($config->sesskeycookiename, \"\", time() - $config->cookie_lifetime);\n\t\t\t\t//destroy session\n\t\t\t\tsession_unset();\n\t\t\t\tsession_destroy();\n\t\t\t}\n\t\t}\n\t}\n}",
"function WebDPCookie(){\r\n $cookie = [\r\n \"sessionid=\",\r\n \"sessionid=\",\r\n \"sessionid=\"\r\n ];\r\n \r\n return $cookie[mt_rand(0, count($cookie) - 1)];\r\n}",
"public function instantiateSession()\n {\n session_start();\n\n if (isset($_SESSION['instanceID']) === false && defined('DOING_CRON') === false) {\n $this->generateDemoInstance();\n } else {\n $this->instanceID = $_SESSION['instanceID'];\n }\n }",
"public function avoidSessionHijacking()\n\t{\n\t\t// TODO\n\t}",
"public function startSession() {\n if (ini_set('session.use_only_cookies', 1) === FALSE) {\n return;\n }\n //session_name('');\n session_start();\n session_regenerate_id();\n }"
] | [
"0.6764995",
"0.6292511",
"0.6242697",
"0.6198571",
"0.6130797",
"0.60833585",
"0.60627824",
"0.6061157",
"0.5998924",
"0.5990009",
"0.59589773",
"0.59589773",
"0.5910251",
"0.58969283",
"0.58964455",
"0.5888761",
"0.58533657",
"0.583841",
"0.5836149",
"0.5802247",
"0.57976073",
"0.5796784",
"0.5796225",
"0.578894",
"0.5786978",
"0.5781304",
"0.5763508",
"0.57509375",
"0.57485217",
"0.57420856",
"0.57185465",
"0.5645165",
"0.5638064",
"0.56362855",
"0.56339884",
"0.5626616",
"0.56221664",
"0.5617851",
"0.5614987",
"0.56143004",
"0.5611746",
"0.5609676",
"0.55929136",
"0.55817723",
"0.556643",
"0.55632925",
"0.55603796",
"0.5558699",
"0.5557012",
"0.55561775",
"0.55518055",
"0.5550492",
"0.5550471",
"0.5548986",
"0.5539459",
"0.55376947",
"0.5530123",
"0.5528562",
"0.550845",
"0.5502352",
"0.5474483",
"0.5473061",
"0.5468085",
"0.5467023",
"0.54625255",
"0.54591215",
"0.5449059",
"0.54472446",
"0.54465014",
"0.54465014",
"0.54465014",
"0.54465014",
"0.5444376",
"0.54363847",
"0.5424743",
"0.5424598",
"0.542286",
"0.54185575",
"0.54148996",
"0.54080504",
"0.54063857",
"0.54038703",
"0.53984934",
"0.53980446",
"0.5395537",
"0.53904617",
"0.53820187",
"0.53773236",
"0.5375983",
"0.5375062",
"0.53732735",
"0.5371869",
"0.5367838",
"0.5366653",
"0.53650063",
"0.53649527",
"0.5363998",
"0.5363246",
"0.53625166",
"0.5360243",
"0.536004"
] | 0.0 | -1 |
Returns as much as we have in all the tables Assume.. $pdo>setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | function ltiLoadAllData($pdo, $p, $profile_table, $post) {
$errormode = $pdo->getAttribute(PDO::ATTR_ERRMODE);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "SELECT k.key_id, k.key_key, k.secret, c.context_id, c.title AS context_title,
l.link_id, l.title AS link_title,
u.user_id, u.displayname AS user_displayname, u.email AS user_email,
u.subscribe AS subscribe, u.user_sha256 AS user_sha256,
m.membership_id, m.role, m.role_override";
if ( $profile_table ) {
$sql .= ",
p.profile_id, p.displayname AS profile_displayname, p.email AS profile_email,
p.subscribe AS profile_subscribe";
}
if ( $post['service'] ) {
$sql .= ",
s.service_id, s.service_key AS service";
}
if ( $post['sourcedid'] ) {
$sql .= ",
r.result_id, r.sourcedid, r.grade";
}
$sql .="\nFROM {$p}lti_key AS k
LEFT JOIN {$p}lti_context AS c ON k.key_id = c.key_id AND c.context_sha256 = :context
LEFT JOIN {$p}lti_link AS l ON c.context_id = l.context_id AND l.link_sha256 = :link
LEFT JOIN {$p}lti_user AS u ON k.key_id = u.key_id AND u.user_sha256 = :user
LEFT JOIN {$p}lti_membership AS m ON u.user_id = m.user_id AND c.context_id = m.context_id";
if ( $profile_table ) {
$sql .= "
LEFT JOIN {$profile_table} AS p ON u.profile_id = p.profile_id";
}
if ( $post['service'] ) {
$sql .= "
LEFT JOIN {$p}lti_service AS s ON k.key_id = s.key_id AND s.service_sha256 = :service";
}
if ( $post['sourcedid'] ) {
$sql .= "
LEFT JOIN {$p}lti_result AS r ON u.user_id = r.user_id AND l.link_id = r.link_id";
}
$sql .= "\nWHERE k.key_sha256 = :key LIMIT 1\n";
// echo($sql);
$parms = array(
':key' => lti_sha256($post['key']),
':context' => lti_sha256($post['context_id']),
':link' => lti_sha256($post['link_id']),
':user' => lti_sha256($post['user_id']));
if ( $post['service'] ) {
$parms[':service'] = lti_sha256($post['service']);
}
$row = pdoRowDie($pdo, $sql, $parms);
// Restore ERRMODE
$pdo->setAttribute(PDO::ATTR_ERRMODE, $errormode);
return $row;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_all()\n {\n\n $query = \"SELECT * FROM \".$this->table_name;\n //prepare query\n $stmt = $this->conn->prepare($query);\n\n\n try{\n if( $stmt->execute())\n return $stmt;\n\n } catch(PDOException $exception){\n echo \"Connection error: \" . $exception->getMessage();\n }\n\n return false;\n\n }",
"function Select_All_Records($table_name) {\r\n global $con;\r\n $sql = \"select * from $table_name\";\r\n try {\r\n $stmt = $con->query($sql);\r\n return $stmt;\r\n } catch (PDOException $e) {\r\n print $e->getMessage();\r\n }\r\n}",
"protected function getAll(){\n\t\t\n\t\t$connection = DB::connect();\n\t\t\n\t\t$sql = \"SELECT * FROM $this->_tableName\";\n\t\t$result = '';\n\t\t\n\t\ttry {\n\t\t\t$stmt = $connection->query($sql);\n\t\t\t$result = $stmt->fetchAll();\n\t\t\n\t\t\treturn $result;\n\t\t\n\t\t} catch (PDOException $e){\n\t\t\tdie('Error: '.$e->getMessage().'<br/>');\n\t\t}\n\t}",
"function query( string $tableName, PDO $db ){\n try{\n // Consulta a realizar\n $query = \"SELECT * FROM \".$tableName; \n // Preparamos la consulta\n $stmt = $db->prepare($query);\n // Ejecutamos\n $stmt->execute();\n //return $stmt->fetchAll( PDO::FETCH_OBJ);\n return $stmt->fetchAll( PDO::FETCH_ASSOC);\n\n }\n catch( Exception $exception ){\n echo \"<br>\";\n echo \"Error inesperado al consultar: \". $exception->getMessage();\n }\n}",
"public function fetchAll()\n {\n //*** your code goes here\n //*** if there is an error, return an array which includes an error code of 2 and message == ERROR_UNABLE\n $listing = $this->table->select();\n if ($listing) {\n $data = [];\n $hydrator = $this->table->getResultSetPrototype()->getHydrator();\n foreach ($listing as $entity) $data[] = $hydrator->extract($entity);\n $result = ['success' => 1, 'data' => $data];\n } else {\n $result = ['success' => 0, 'error' => 1, 'message' => self::ERROR_UNABLE];\n }\n return $result;\n }",
"function all($table)\n{\n try {\n //connexion bd\n $cnx = connecter_db();\n //preparer une sql\n $rp = $cnx->prepare(\"select * from $table order by id desc \");\n //executer\n $rp->execute();\n $resultat = $rp->fetchAll(); //extraire tous\n return $resultat;\n } catch (PDOException $e) {\n echo \"Erreur dans all\" . $e->getMessage();\n }\n}",
"protected static function get_db_records(){\n\n\t\t$records = 0;\n\t\t$tables = static::get_tables();\n\n\t\tforeach ($tables as &$table) {\n\n\t\t\t$records += static::get_table_records($table);\n\n\t\t\tunset($table);\n\t\t}\n\n\t\treturn $records;\n\t}",
"public function readAll($tabel){\n\ttry {\n\t\t$query = $this->db->prepare(\"SELECT * FROM $tabel\");\n\t\t$query->execute();//echo\"SELECT * FROM $tabel\";\n\t\treturn $query;\n\t}\n\tcatch (PDOException $e) {\n\t\t$error = $e->getMessage();\n\t\techo \"<script>alert('$error')</script>\";\n\t\treturn false;\n\t}\n}",
"function fetchAll($pdo, $resultado)\n{\n try {\n $sql_query = 'SELECT * FROM names_app';\n $gsent = $pdo->prepare($sql_query);\n $gsent->execute();\n $resultado = $gsent->fetchAll();\n } catch (PDOException $e) {\n print \"¡Error!: \" . $e->getMessage() . \"<br/>\";\n die();\n }\n}",
"public function select_all()\r\n {\r\n\r\n $sql = \"SELECT * FROM \".ERROR_MESSAGSES_TABLE;\r\n\r\n $stmt = $this->conn->prepare($sql);\r\n\r\n if($stmt)\r\n {\r\n $stmt->execute();\r\n\r\n $res = $stmt->get_result();\r\n\r\n while ($row = $res->fetch_assoc()){\r\n \r\n $data[] = $row;\r\n }\r\n\r\n return $data;\r\n \r\n $stmt->close();\r\n }\r\n else\r\n {\r\n $this->myfile = fopen(\"DatabaseErrLog.txt\", \"a\") or die(\"Unable to open file!\");\r\n\r\n $txt = \"Failed prepare statement to select all records from \".ERROR_MESSAGSES_TABLE.\" - \".date(\"Y-d-m h:i:s\", time()).PHP_EOL;\r\n\r\n fwrite($this->myfile, $txt);\r\n \r\n fclose($this->myfile);\r\n }\r\n }",
"public function countAll(){\r\n \r\n $query = \"SELECT id FROM \" . $this->table_name . \"\";\r\n \r\n $stmt = $this->conn->prepare( $query );\r\n $stmt->execute();\r\n \r\n $num = $stmt->rowCount();\r\n \r\n return $num;\r\n}",
"public function countAll(){\n \n $query = \"SELECT id FROM \" . $this->table_name . \"\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n \n $num = $stmt->rowCount();\n \n return $num;\n}",
"function SQLDonnees($sth) {\n try {\n return $sth->fetchAll();\n } catch (Exception $e) {\n ob_end_clean();\n die('<!DOCTYPE html><html><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><title>Arcade 2i</title><link rel=\"stylesheet\" type=\"text/css\" href=\"assets/css/bootstrap.css\"/><link rel=\"stylesheet\" type=\"text/css\" href=\"assets/css/style.css\"/><script src=\"https://code.jquery.com/jquery-2.2.3.min.js\"></script><script src=\"assets/js/bootstrap.js\"></script></head><body><div class=\"container\"><div class=\"row\"><div class=\"alert alert-danger\">Erreur lors de l\\'execution de la page : ' . $e->getMessage() . '</div></div></div></body></html>');\n }\n}",
"public function readAll(){\n $rq = \"SELECT * FROM Objets\";\n $stmt = $this->pdo->prepare($rq);\n $data = array();\n if(!$stmt->execute($data)){\n throw new Exception($pdo->errorInfo());\n }\n return $result = $stmt->fetchAll();\n }",
"public function fetchAll(){\n try{\n $this->array = $this->resultado->fetchAll();\n } catch (PDOException $e){\n $this->errors[] = 'error: function fetchAll<br/>'.$e->getMessage();\n $this->array = NULL;\n }\n return $this->array;\n }",
"protected function getAffectedTables() {\n\t\treturn PKP_TEST_ENTIRE_DB;\n\t}",
"function get_total_all_records($connect,$query)\n{\n $statement = $connect->prepare($query);\n $statement->execute();\n return $statement->rowCount();\n}",
"public abstract function fetchAll($table);",
"public function getAll(){\n try{\n $sql = \"SELECT * FROM {$this->tabela}\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute();\n $dados = $stm->fetchAll(PDO::FETCH_OBJ);\n return $dados;\n }catch(PDOException $erro){\n echo \"<script>alert('Erro na linha: {$erro->getLine()}')</script>\";\n }\n }",
"function readAll(){\n\n\t\t$query = \"SELECT * FROM \" . $this->table_name .\"\";\n\t\t$stmt = $this->conn->prepare($query);\n\t\t$stmt->execute();\n\t\treturn $stmt;\n\t}",
"public function fetchAll($query){\n $stmt = $this->pdo->prepare($query);\n $stmt->execute();\n $row=$stmt->rowCount();\n if($row<=0){\n return 0;\n } else{\n return $stmt->fetchAll();\n }\n }",
"public function countAll(){\n \n $query = \"SELECT id FROM \" . $this->table_name . \"\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n \n $num = $stmt->rowCount();\n \n return $num;\n }",
"function all(){\n try{\n $link= connecter_db();\n $rp=$link->prepare(\"select * from etudiant order by id desc\");\n $rp->execute();\n $resultat= $rp->fetchAll(); \n\n return $resultat;\n }catch(PDOException $e ){\n die (\"erreur de recuperation des etudiants dans la base de donnees \".$e->getMessage());\n }\n\n}",
"public function queryAll() {\r\n $sql = \"SELECT * FROM $this->table\";\r\n $stmt = ConnectionFactory::prepare($sql);\r\n $stmt->execute();\r\n return $stmt->fetchAll();\r\n }",
"public static function getAll()\n {\n\n $sql = 'SELECT * FROM ' . static::$tableName;\n $stm = Db::getInstance()->prepare($sql);\n\n if ($stm->execute() === true) {\n $ob = $stm->fetchAll(\\PDO::FETCH_CLASS | \\PDO::FETCH_PROPS_LATE, get_called_class(), array_keys(static::viewTableSchema()));\n return $ob;\n } else {\n return false;\n }\n }",
"function getAll($table) {\n $sql = \"select * from {$table}\";\n\n try {\n DB::select($sql);\n } catch(Exception $e) {\n echo \"Error: {$e->getMessage()}\";\n }\n }",
"public function fetchAll(){\r\n$table=$this->getTable();\r\nreturn $this->fetch_array($this->query(\"SELECT * FROM {$table}\"));\r\n}",
"private function CheckIfTablesExist():array {\n // Do all of the table checks once here.\n // NOTE: $this->debug() function is declared in dbAbstract.class.php.\n \n if(!$this->query(\"select TABLE_NAME from information_schema.tables where (table_schema = '$this->masterdb') and (table_name = 'bots')\")) {\n $this->debug(\"Database $this->siteName: $this->self: table bots does not exist in the $this->masterdb database: \". __LINE__, true);\n }\n if(!$this->query(\"select TABLE_NAME from information_schema.tables where (table_schema = '$this->masterdb') and (table_name = 'bots2')\")) {\n $this->debug(\"Database $this->siteName: $this->self: table bots2 does not exist in the $this->masterdb database: \". __LINE__, true);\n }\n if(!$this->query(\"select TABLE_NAME from information_schema.tables where (table_schema = '$this->masterdb') and (table_name = 'tracker')\")) {\n $this->debug(\"Database $this->siteName: $this->self: table tracker does not exist in the $this->masterdb database: \". __LINE__, true);\n }\n if(!$this->query(\"select TABLE_NAME from information_schema.tables where (table_schema = '$this->masterdb') and (table_name = 'myip')\")) {\n $this->debug(\"Database $this->siteName: $this->self: table myip does not exist in the $this->masterdb database: \". __LINE__, true);\n }\n if(!$this->query(\"select TABLE_NAME from information_schema.tables where (table_schema = '$this->masterdb') and (table_name = 'counter')\")) {\n $this->debug(\"Database $this->siteName: $this->self: table counter does not exist in the $this->masterdb database: \". __LINE__, true);\n } \n if(!$this->query(\"select TABLE_NAME from information_schema.tables where (table_schema = '$this->masterdb') and (table_name = 'counter2')\")) {\n $this->debug(\"Database $this->siteName: $this->self: table bots does not exist in the $this->masterdb database: \". __LINE__, true);\n }\n if(!$this->query(\"select TABLE_NAME from information_schema.tables where (table_schema = '$this->masterdb') and (table_name = 'daycounts')\")) {\n $this->debug(\"Database $this->siteName: $this->self: table daycounts does not exist in the $this->masterdb database: \". __LINE__, true);\n }\n if(!$this->query(\"select TABLE_NAME from information_schema.tables where (table_schema = '$this->masterdb') and (table_name = 'logagent')\")) {\n $this->debug(\"Database $this->siteName: $this->self: table logagent does not exist in the $this->masterdb database: \" . __LINE__, true);\n }\n\n // The masterdb must be owned by 'barton'. That is the dbinfo->user must be\n // 'barton'. There is one database where this is not true. The 'test' database has a\n // mysitemap.json file that has dbinfo->user as 'test'. It is in the\n // bartonphillips.com/exmples.js/user-test directory.\n // In general all databases that are going to do anything with counters etc. must have a user\n // of 'barton' and $this->nodb false. The program without 'barton' can NOT do any calls via masterdb!\n\n //error_log(\"Database user: \" . $this->user);\n //error_log(\"Database dbinfo->user: \" . $this->dbinfo->user);\n \n if(!$this->query(\"select TABLE_NAME from information_schema.tables where (table_schema = '$this->masterdb') and (table_name = 'myip')\")) {\n $this->debug(\"Database $this->siteName: $this->self: table myip does not exist in the $this->masterdb database: \". __LINE__, true);\n }\n\n $this->query(\"select myIp from $this->masterdb.myip\");\n\n while([$ip] = $this->fetchrow('num')) {\n $myIp[] = $ip;\n }\n \n $myIp[] = DO_SERVER; // BLP 2022-04-30 - Add my server.\n\n //error_log(\"Database after myIp set, this: \" . print_r($this, true));\n \n return $myIp;\n }",
"public function testResultNumTables()\n {\n \t$this->assertEquals(1, $this->conn->query('SELECT * FROM test')->numTables());\n \t$this->assertEquals(2, $this->conn->query('SELECT * FROM test INNER JOIN child ON test.id = child.idTest')->numTables(), \"SELECT FROM test, child\");\n }",
"private function preExe(){\n\t\t$pre = $this->prepare($this->_query);\n\t\t$pre->execute();\n\t\treturn $pre->fetchAll();\n\t}",
"function getSports(){\n global $con;\n try {\n $sql=\"SELECT * FROM `sports` a where a.TIME <> 'FINAL' LIMIT 5 \";\n $sql = $con->prepare($sql);\n $sql->execute();\n buildSportsTable($sql->fetchAll());\n } catch (PDOException $e) {\n echo $e;\n }\n}",
"function SelektoDatabasen(){\n global $db;\n $SqlStmt=$db->prepare(\"select * from p149pm_roombook\");\n try{ $SqlStmt->execute(); } catch (PDOException $e) { die(); }\n while($row = $SqlStmt->fetch(PDO::FETCH_ASSOC)) { $smartRs[] = $row; }\n if ($SqlStmt->rowCount() > 0) {return $smartRs; }\n\n}",
"protected function _fetchExistingDatabaseTables()\n {\n $query = 'SHOW TABLES';\n $this->_existingTables = $this->_readConn->fetchCol($query);\n }",
"public function findAll() {\r\n$sql = \"SELECT * FROM $this->tabela\";\r\n$stm = DB::prepare($sql);\r\n$stm->execute();\r\nreturn $stm->fetchAll();\r\n}",
"function get_total_all_records($connect)\n{\n\t$statement = $connect->prepare('SELECT * FROM sites');\n\t$statement->execute();\n\treturn $statement->rowCount();\n}",
"function vidageTable()\n {\n try {\n $res = $this->connection->exec('delete from ' . $this->table);\n } catch (PDOException $e) {\n $res = -1;\n if ($this->debug_mode > 0) {\n $this->addMessage($e->getMessage());\n }\n throw new ObjetBDDException($e->getMessage());\n }\n return $res;\n }",
"function getAll() {\n global $dbh, $schema;\n try {\n // using prepared statements will help protect you from SQL injection\n $stmt = $dbh->prepare(\"SELECT * FROM $schema.ingrediente\");\n $stmt->execute();\n // get array containing all of the result set rows \n $result = $stmt->fetchall(PDO::FETCH_ASSOC);\n return $result;\n }\n catch(PDOException $e) {\n $_SESSION[\"s_errors\"][\"generic\"][] = \"ERRO[16]: \".$e->getMessage();\n header(\"Location: ../../index.php\");\n die;\n }\n }",
"public function executeGetRows($result) {\n try { \n if ($result->execute()) return $result->fetchAll(PDO::FETCH_ASSOC);\n else return 0;\n }\n catch (PDOException $e){ $this->reportDBError($e->getMessage().\"<hr>\".$e->getTraceAsString()); } \n }",
"public function rowCount() {}",
"function checkTables($pdo, $tablename)\n{\n $tableCheck = $pdo->query(\"SELECT * FROM $tablename\");\n if(!empty($tableCheck))\n {\n echo \"Table created\\n\";\n }\n else\n {\n echo \"ERROR: Table not created\\n\";\n }\n}",
"function getTableSize(){\n\t\t $db = $this->startDB();\n\t\t \n\t\t $sql = \"SELECT count(id) as IDcount\n\t\t FROM \".$this->penelopeTabID.\"\n\t\t \";\n\t\t \n\t\t $result = $db->fetchAll($sql);\n\t\t if($result){\n\t\t\t\t$this->recordCount = $result[0][\"IDcount\"]+0;\n\t\t }\n\t\t else{\n\t\t\t\treturn false;\n\t\t }\n\t }",
"public function countAllRows()\n {\n return $this->getDbTable()->countAllRows();\n }",
"function rows($sth){\n try{\n switch(dbconection::$conntype){\n case \"pdo\" : return $sth->rowCount(); break;\n case \"mysql\" : return mysql_num_rows($sth); break;\n case \"postgresql\" : return pg_num_rows ( $sth ); break;\n default : throw new Exception(\"Nenhum tipo de conexão definida.\");\n }\n }catch(Exception $e){\n printr(\"ROWS ERROR : \".$e->getMessage());\n }\n }",
"public function getNumTables() {}",
"public function getNumTables() {}",
"public function getNumTables() {}",
"public function getAllData($table){\n $sql = \"select * from $table\";\n $this->execute($sql);\n if($this->num_rows() == 0){\n $data = 0;\n }\n else {\n while($datas = $this->getData()){\n $data[] = $datas;\n }\n }\n return $data;\n }",
"function totalMovies(){\n global $pdo;\n $oneMovieInfoSelect = '\n SELECT *\n FROM movie\n ';\n\n $request = $pdo->prepare($oneMovieInfoSelect);\n\n if ($request->execute() === false ) {\n print_r( $request->errorInfo() );\n }else {\n return $request->rowCount();\n }\n return false;\n}",
"private function prepareTables() {}",
"function tableExists($pdo, $table) {\r\n // Run it in try/catch in case PDO is in ERRMODE_EXCEPTION.\r\n try {\r\n $result = $pdo->query(\"SELECT 1 FROM $table LIMIT 1\");\r\n } catch (Exception $e) {\r\n // We got an exception == table not found\r\n return FALSE;\r\n }\r\n\r\n // Result is either boolean FALSE (no table found) or PDOStatement Object (table found)\r\n return $result !== FALSE;\r\n}",
"public function getAll($sql, $params=[]){\n try \n {\n $stmt = $this->dbh->prepare($sql);\n $stmt->execute($params);\n return $stmt->fetchAll();\n \n } catch (PDOException $e) \n {\n throw new Exception($e->getMessage());\n }\n\n }",
"function fetchAll($table_name)\n\t {\n\t\t\n\t\t $res=mysql_query(\"select * from $table_name\");\n\t\t return $res;\n\t\t\n\t }",
"function get_total_all_records($connect)\r\n{\r\n\t$statement = $connect->prepare('\r\n\t\tSELECT * FROM equipment_checkout \r\n\t\tINNER JOIN equipment ON equipment.equip_id = equipment_checkout.equip_id\r\n\t\tWHERE equipment_checkout.empl_id = \"'.$_SESSION['user_id'].'\" \r\n\t');\r\n\t$statement->execute();\r\n\treturn $statement->rowCount();\r\n}",
"public function checkIfTablesExist()\n {\n foreach (self::DB_TABLE_INFO as $tableName => $createSql) {\n try {\n $result = $this->connection->query('SELECT 1 FROM turns LIMIT 1');\n } catch (Exception $e) {\n $result = false;\n }\n\n if ($result === false) {\n $this->connection->exec($createSql);\n }\n }\n }",
"public function getTableCount($table)\n {\n $DB = new PDO(DB_DRIVER.':host='.DB_SERVER.';dbname='.DB_DATABASE, DB_SERVER_USERNAME, DB_SERVER_PASSWORD , $dboptions); \n try {\n \n ///\n \n $sql = \"SELECT COUNT(*) AS num FROM \". $table;\n $stmt = $DB->prepare($sql);\n $stmt->execute();\n $row_count = $stmt->fetchAll();\n return $row_count[0][\"num\"] ;\n\n } catch (Exception $ex) {\n\n echo $ex->getMessage();\n }\n }",
"public function countAllRecords($table_name){\n\t\treturn $this->db->count_all($table_name);\n $this->db->close();\n\t}",
"function get_all_data_output( $con, $table, $offset ){\n\t\n\t\tif ( $table == 'events' )\n\t\t\t$res = select_all_events_output( $con, 0, $offset ); \n\t\telse if ( $table == 'checkins' )\n\t\t\t$res = select_all_checkins_output( $con, 0, $offset ); \n\t\t\n\t\treturn $res;\n\t\t/*\n\t\t$result = $res;\n\t\tfree_result($res);\n\t\treturn $result;\n\t\t*/\n\t}",
"abstract public function getTables();",
"function num_rows()\r\n\t{\r\n\t\tif ( ! $this->pdo_results ) {\r\n\t\t\t$this->pdo_results = $this->result_id->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t}\r\n\t\treturn sizeof($this->pdo_results);\r\n\t}",
"private function getTableNames(){\n $exceptions = array_merge(\n self::EXCEPTION_TABLES,\n explode(\",\",str_replace(' ','',$this->params['exceptions']))\n );\n $exceptions = array_filter($exceptions);\n $this->tables = DB::table('information_schema.tables')->select([\n 'table_name'\n ])->where('table_schema','public')->whereNotIn('table_name',$exceptions)->get();\n }",
"protected function getDatabaseTables() {}",
"public final function checkTables()\n {\n $stmt = self::$globalConnection->query('SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = \"BASE TABLE\" AND TABLE_SCHEMA = \"' . self::$database . '\"');\n $tables = [];\n while ($row = $stmt->fetch()) $tables[] = $row[0];\n $stmt->closeCursor();\n \n $needed_tables = [\n self::USERS,\n self::CLIENTS,\n self::CONFIG,\n self::RELOADS,\n self::EXPENSES,\n self::FORMULAS,\n self::FORMULAS_BOUGHT,\n self::FORMULAS_BOUGHT_PRODUCTS,\n self::FORMULAS_CHOICES,\n self::FORMULAS_CHOICES_PRODUCTS,\n self::FORMULAS_EDITS,\n self::PRODUCTS,\n self::PRODUCTS_BOUGHT,\n self::PRODUCTS_EDITS,\n self::PRODUCTS_GROUPS,\n self::REPLENISHMENTS,\n self::USERS\n ];\n \n if(count(array_intersect($tables, $needed_tables)) >= count($needed_tables)) return;\n \n self::query('SET foreign_key_checks = 0');\n \n if (! in_array($this->USERS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->USERS` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `username` varchar(255) NOT NULL,\n `email` varchar(255) NOT NULL,\n `firstname` varchar(255) NOT NULL,\n `familyname` varchar(255) NOT NULL,\n `phone` varchar(20) DEFAULT NULL,\n `group_id` tinyint(11) NOT NULL DEFAULT '1',\n `registration` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,\n `last_signin` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,\n `signin_count` bigint(20) NOT NULL DEFAULT '0',\n `password` varchar(500) NOT NULL,\n `permissions` longtext,\n PRIMARY KEY (`id`),\n UNIQUE KEY `username` (`username`),\n UNIQUE KEY `email` (`email`)\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->CLIENTS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->CLIENTS` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `user_id` bigint(20) COMMENT \"user\\'s id\",\n `member` int(11) NOT NULL DEFAULT '0',\n `balance` float(10,2) NOT NULL DEFAULT '0.00',\n PRIMARY KEY (`id`),\n FOREIGN KEY (`user_id`)\n REFERENCES `$this->USERS`(`id`)\n ON UPDATE CASCADE\n ON DELETE SET NULL\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->RELOADS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->RELOADS` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"reload\\'s id\",\n `user_id` bigint(20) NOT NULL COMMENT \"user\\'s id\",\n `amount` float(10,2) NOT NULL COMMENT \"reload\\'s amount\",\n `user_balance` float(10,2) NOT NULL DEFAULT \"0.00\" COMMENT \" user\\'s balance after transaction\",\n `details` varchar(255) NOT NULL DEFAULT \"APP/UNKNOW\" COMMENT \"reload method\",\n `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT \"transaction\\'s date\",\n PRIMARY KEY (`id`),\n FOREIGN KEY (`user_id`)\n REFERENCES `$this->CLIENTS`(`id`)\n ON UPDATE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->CONFIG, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->CONFIG` (\n `id` int(11) NOT NULL AUTO_INCREMENT COMMENT \"id\",\n `name` varchar(255) NOT NULL COMMENT \"configuration key\",\n `value` text NOT NULL COMMENT \"configuration value\",\n `edit` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT \"last edition\",\n PRIMARY KEY (`id`)\n ) ENGINE=MyISAM DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->EXPENSES, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->EXPENSES` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"transaction\\'s id\",\n `user_id` bigint(20) NOT NULL COMMENT \"user\\'s id\",\n `user_balance` float(10,2) NOT NULL DEFAULT \"0.00\" COMMENT \"user\\'s balance after transaction\",\n `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT \"transaction\\'s date\",\n PRIMARY KEY (`id`),\n FOREIGN KEY (`user_id`)\n REFERENCES `$this->CLIENTS`(`id`)\n ON UPDATE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->PRODUCTS_GROUPS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->PRODUCTS_GROUPS` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"product group id\",\n `name` varchar(30) NOT NULL COMMENT \"product group name\",\n `display_name` varchar(255) NOT NULL COMMENT \"product group display name\",\n `edit` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT \"edit time\",\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->PRODUCTS_EDITS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->PRODUCTS_EDITS` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT \"edit id\",\n `product` bigint(20) NOT NULL COMMENT \"product id\",\n `name` varchar(255) NULL DEFAULT NULL COMMENT \"new product name\",\n `price` float(10,2) NULL DEFAULT NULL COMMENT \"new product price\",\n `edit` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT \"edition\",\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->PRODUCTS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->PRODUCTS` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"product id\",\n `product_group` bigint(11) NOT NULL DEFAULT \"0\" COMMENT \"product group\",\n `image` longtext COMMENT \"product image\",\n `stock` BIGINT NOT NULL DEFAULT \"0\" COMMENT \"amount in stock\",\n `viewable` tinyint(1) NOT NULL DEFAULT \"1\" COMMENT \"does the product have to be shown\",\n `last_edit` bigint(20) NOT NULL DEFAULT \"0\" COMMENT \"last product edit id\",\n PRIMARY KEY (`id`),\n FOREIGN KEY (`last_edit`)\n REFERENCES `$this->PRODUCTS_EDITS`(`id`)\n ON UPDATE CASCADE,\n FOREIGN KEY (`product_group`)\n REFERENCES `$this->PRODUCTS_GROUPS`(`id`)\n ON UPDATE CASCADE\n ON DELETE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->PRODUCTS_BOUGHT, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->PRODUCTS_BOUGHT` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"transaction id\",\n `expense_id` bigint(11) NOT NULL COMMENT \"expense id\",\n `product_id` bigint(11) NOT NULL COMMENT \"product bought id\",\n `edit_id` bigint(20) NULL DEFAULT NULL COMMENT \"product edit id at the transaction date\",\n `user_id` bigint(20) NOT NULL COMMENT \"user id\",\n `quantity` int(11) NOT NULL DEFAULT \"1\" COMMENT \"product quantity\",\n `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT \"transaction date\",\n PRIMARY KEY (`id`),\n FOREIGN KEY (`expense_id`)\n REFERENCES `$this->EXPENSES`(`id`)\n ON UPDATE CASCADE\n ON DELETE CASCADE,\n FOREIGN KEY (`edit_id`)\n REFERENCES `$this->PRODUCTS_EDITS`(`id`)\n ON UPDATE CASCADE,\n FOREIGN KEY (`user_id`)\n REFERENCES `$this->CLIENTS`(`id`)\n ON UPDATE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->REPLENISHMENTS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->REPLENISHMENTS` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"replenishment id\",\n `product_id` bigint(11) COMMENT \"product id\",\n `quantity` int(11) NOT NULL COMMENT \"replenishment quantity\",\n `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT \"replenishment date\",\n PRIMARY KEY (`id`),\n FOREIGN KEY (`product_id`)\n REFERENCES `$this->PRODUCTS`(`id`)\n ON UPDATE CASCADE\n ON DELETE SET NULL\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->FORMULAS_EDITS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->FORMULAS_EDITS` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT \"id\",\n `formula` bigint(20) NOT NULL COMMENT \"formula id\",\n `name` varchar(255) NULL DEFAULT NULL COMMENT \"new formula name\",\n `price` float(10,2) NULL DEFAULT NULL COMMENT \"new formula price\",\n `edit` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT \"edition\",\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->FORMULAS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->FORMULAS` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"formula\\'s id\",\n `image` longtext COMMENT \"formula\\'s image\",\n `viewable` tinyint(1) NOT NULL DEFAULT \"1\" COMMENT \"is the formula viewable\",\n `last_edit` bigint(20) NOT NULL DEFAULT \"0\" COMMENT \"last formula edit id\",\n PRIMARY KEY (`id`),\n FOREIGN KEY (`last_edit`)\n REFERENCES `$this->FORMULAS_EDITS`(`id`)\n ON UPDATE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->FORMULAS_BOUGHT, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->FORMULAS_BOUGHT` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"transaction id\",\n `expense_id` bigint(11) NOT NULL COMMENT \"expense id\",\n `formula_id` bigint(11) NOT NULL COMMENT \"formula id\",\n `edit_id` bigint(20) NULL DEFAULT NULL COMMENT \"formula edit id at the transaction date\",\n `user_id` bigint(20) NOT NULL COMMENT \"user id\",\n `quantity` int(11) NOT NULL DEFAULT \"1\" COMMENT \"quantity\",\n `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT \"transaction date\",\n PRIMARY KEY (`id`),\n FOREIGN KEY (`expense_id`)\n REFERENCES `$this->EXPENSES`(`id`)\n ON UPDATE CASCADE\n ON DELETE CASCADE,\n FOREIGN KEY (`edit_id`)\n REFERENCES `$this->FORMULAS_EDITS`(`id`)\n ON UPDATE CASCADE,\n FOREIGN KEY (`user_id`)\n REFERENCES `$this->CLIENTS`(`id`)\n ON UPDATE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->FORMULAS_BOUGHT_PRODUCTS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->FORMULAS_BOUGHT_PRODUCTS` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"id\",\n `transaction_id` bigint(11) NOT NULL COMMENT \"id in formulas bought\",\n `product_id` bigint(11) NOT NULL COMMENT \"product id\",\n `product_edit` BIGINT(20) NULL COMMENT \"the product edit\",\n `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT \"transaction date\",\n PRIMARY KEY (`id`),\n FOREIGN KEY (`transaction_id`)\n REFERENCES `$this->FORMULAS_BOUGHT`(`id`)\n ON UPDATE CASCADE\n ON DELETE CASCADE,\n FOREIGN KEY (`product_edit`)\n REFERENCES `$this->PRODUCTS_EDITS`(`id`)\n ON UPDATE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->FORMULAS_CHOICES, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->FORMULAS_CHOICES` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"formula choice id\",\n `formula` bigint(11) NOT NULL COMMENT \"formula id\",\n `name` varchar(255) NOT NULL COMMENT \"choice name\",\n `edit` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT \"edit time\",\n PRIMARY KEY (`id`),\n FOREIGN KEY (`formula`)\n REFERENCES `$this->FORMULAS`(`id`)\n ON DELETE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->FORMULAS_CHOICES_PRODUCTS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->FORMULAS_CHOICES_PRODUCTS` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"id\",\n `choice` bigint(11) NOT NULL COMMENT \"formula choice id\",\n `product` bigint(11) NOT NULL COMMENT \"product id\",\n `edit` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT \"edit time\",\n PRIMARY KEY (`id`),\n FOREIGN KEY (`choice`)\n REFERENCES `$this->FORMULAS_CHOICES`(`id`)\n ON DELETE CASCADE,\n FOREIGN KEY (`product`)\n REFERENCES `$this->PRODUCTS`(`id`)\n ON DELETE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n self::query('SET foreign_key_checks=1;');\n }",
"public function countAll(){\n \n // query to select all user records\n $query = \"SELECT Mabh FROM \" . $this->table_name . \"\";\n \n // prepare query statement\n $stmt = $this->conn->prepare($query);\n \n // execute query\n $stmt->execute();\n \n // get number of rows\n $num = $stmt->rowCount();\n \n // return row count\n return $num;\n}",
"public function count(){\n $query = \"SELECT COUNT(*) as total_rows FROM \" . $this->table_name . \"\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n return $row['total_rows'];\n}",
"public static function getAll()\r\n {\r\n $consulta = \"SELECT * FROM \" . self::TABLE_NAME;\r\n try {\r\n // Preparar sentencia\r\n $comando = DatabaseConnection::getInstance()->getDb()->prepare($consulta);\r\n // Ejecutar sentencia preparada\r\n $comando->execute();\r\n\r\n return $comando->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n } catch (PDOException $e) {\r\n return false;\r\n }\r\n }",
"public function getAllData($table_name){\n return $this->getStatement(\"select * from \".$table_name);\n }",
"function countAll(){\r\n //Does this need an empty string appended at the end?\r\n \r\n $query = \"SELECT SubjectID FROM \" . \"$this->table_name\" . \"\";\r\n // debug_to_console('query: '. $query);\r\n $stmt = $this->dbConn->prepare( $query );\r\n $stmt->execute();\r\n \r\n $count = $stmt->rowCount();\r\n \r\n return $count;\r\n }",
"function dbGetAll(){\r\n global $db_query;\r\n return $db_query->fetchAll(PDO::FETCH_ASSOC); \r\n}",
"public function count(){\n $query = \"SELECT COUNT(*) as total_rows \n FROM $this->table_name\";\n\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n return $row['total_rows'];\n}",
"public function findAll(){\n \n\t\t$sql = 'SELECT * FROM ' . self::TABLENAME;\n\n \t$db = new Database(); // se creeaza conexiunea la baza de date\n\t\t$stmt = $db->getConnection()->prepare($sql);\n\t\t$stmt->execute();\n\t\t$results = $stmt->fetchAll();\n\t\n\t\treturn $results; \n }",
"public function findAll(){\n \n\t\t$sql = 'SELECT * FROM ' . self::TABLENAME;\n\n \t$db = new Database(); // se creeaza conexiunea la baza de date\n\t\t$stmt = $db->getConnection()->prepare($sql);\n\t\t$stmt->execute();\n\t\t$results = $stmt->fetchAll();\n\t\n\t\treturn $results; \n }",
"public function fetch()\n {\n try {\n $sth = $this->conn->prepare($this->query);\n if ($sth->execute($this->bind) !== false)\n {\n if ($sth->execute() !== false) {\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n $this->countable = sizeof($result);\n return $result;\n }\n }\n }\n catch(PDOException $e) {\n $this->errors[] = $e->getMessage();\n return false;\n }\n }",
"function best_levels_truncate($pdo)\n{\n $result = $pdo->exec('TRUNCATE TABLE best_levels');\n\n if ($result === false) {\n throw new Exception(\"Could not truncate all-time best levels table.\");\n }\n\n return $result;\n}",
"public function getAll($tables){\n return $this->db->get($tables)->result();\n }",
"public function getAll($tables){\n return $this->db->get($tables)->result();\n }",
"public function getAll($tables){\n return $this->db->get($tables)->result();\n }",
"function fetchAllAudit()\n\t\t{\n\t\t$db = DB::getInstance();\n\t\t$stmt = $db->query(\"SELECT\n\t\t\t\tid,\n\t\t\t\tusername,\n\t\t\t\taudit_id,\n\t\t\t\taudit_userid,\n\t\t\t\taudit_userip,\n\t\t\t\taudit_othus,\n\t\t\t\taudit_eventcode,\n\t\t\t\taudit_action,\n\t\t\t\taudit_itemid,\n\t\t\t\taudit_timestamp\n\t\t\tFROM audit LEFT JOIN users ON audit_userid = id ORDER BY audit_id DESC\");\n\t\t\t$results = $stmt->results();\n\t\t\t$count = $stmt->count();\n\t\t\treturn $results;\n\t\t\treturn $count;\n\t\t}",
"public function fetchAll($fetchMode = \\PDO::FETCH_BOTH);",
"public function all()\n {\n try {\n if($this->visible) {\n $visibleStatement = implode(\",\", $this->visible);\n $this->sqlStatement = str_replace(\"*\", $visibleStatement, $this->sqlStatement);\n }\n $statement = $this->db->prepare($this->sqlStatement);\n\n $statement->execute();\n $statement->setFetchMode(PDO::FETCH_ASSOC);\n\n $results = $statement->fetchAll();\n\n return $results;\n\n } catch(PDOException $e) {\n return $e;\n }\n }",
"function count_sql($table) {\n\t$dbh = db_connect(); #DATABASE CONNEXION\n\n\t$dossier = $dbh->query('SELECT COUNT(*) FROM ' . $table)->fetch();\n\tforeach ($dossier as $count) return $count;\n\n\techo($count);\n}",
"function getResultOfPreparedStatement($result){\n try {\n if($result->num_rows > 0){\n $DbResult = $result->fetch_all(MYSQLI_ASSOC);\n return $DbResult;\n }\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n}",
"function GetBanksList(PDO $db)\r\n{\r\n $sql = $db->prepare('SELECT name, address, chairmain, share_premium FROM bank');\r\n try {\r\n $sql->execute();\r\n } catch (\\PDOException $e) {\r\n \\core\\Logger::CatchError(\"index::GetBankList: PDOException. Information about error: {$e->errorInfo[2]}\");\r\n }\r\n\r\n return $sql->fetchAll();\r\n}",
"function pdo_tablename($stmt, $i) {\r\n return pdo_result($stmt, $i, 0);\r\n }",
"function find_all($table) {\n global $db;\n if(tableExists($table))\n {\n return find_by_sql(\"SELECT * FROM \".$db->escape($table));\n }\n}",
"function find_all($table) {\n global $db;\n if(tableExists($table))\n {\n return find_by_sql(\"SELECT * FROM \".$db->escape($table));\n }\n}",
"function tableExists($pdo, $table) {\n \n // Try a select statement against the table\n // Run it in try/catch in case PDO is in ERRMODE_EXCEPTION.\n try {\n $result = $pdo->query(\"SELECT 1 FROM $table LIMIT 1\");\n } catch (Exception $e) {\n // We got an exception == table not found\n return FALSE;\n }\n // Result is either boolean FALSE (no table found) or PDOStatement Object (table found)\n return $result !== FALSE;\n \n }",
"function countRows($conn, $inputTable){\n\n\t$table;\n\t//whitelisting tables that are gettable\n\tswitch($inputTable){\n\t\tcase \"levelone\":\n\t\t\t$table = \"levelone\";\n\t\t\tbreak;\n\t\tcase \"leveltwo\":\n\t\t\t$table = \"leveltwo\";\n\t\t\tbreak;\n\t\tcase \"levelthree\":\n\t\t\t$table = \"levelthree\";\n\t\t\tbreak;\n\t\tcase \"levelfour\":\n\t\t\t$table = \"levelfour\";\n\t\t\tbreak;\n\t\tcase \"plancomponent\":\n\t\t\t$table = \"plancomponent\";\n\t\t\tbreak;\n\t\tcase \"plan\":\n\t\t\t$table = \"plan\";\n\t\t\tbreak;\n\t}\n\t\n\t$sql = \"SELECT count(*) FROM $table\";\n\n\t$sth = $conn->prepare($sql);\n\t$sth->execute();\n\t\n\t$rows = array();\n\t\n\twhile($r = $sth->fetch(PDO::FETCH_ASSOC)) {\n\t\t$rows[] = $r;\n\t}\n\treturn $rows[0][\"count(*)\"];\n}",
"public function retrieveAll(){\r\n $conn = new ConnectionManager();\r\n $pdo = $conn->getConnection();\r\n \r\n\r\n // Add your codes here\r\n\r\n\r\n return $result;\r\n }",
"public function getCant() {\n\t\treturn $this->db->count_all ( self::TABLE_NAME );\n\t}",
"private function generateTables()\n\t\t{\n\t\t\tif ($this->connectFail == False)\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t*\tdatabase schema access\n\t\t\t\t*/\n\n\t\t\t\t$content = file_get_contents('dbase.sql');\n\t\t\t\t$queries = explode(\";\\n\\n\", $content);\n\n\t\t\t\tforeach ($queries as $key => $query)\n\t\t\t\t{\n\t\t\t\t\t$er = False;\n\t\t\t\t\t$df = $this->execQuery($query);\n\n\t\t\t\t\t#print $df.\"\\n\".$er.PHP_EOL;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function fetchAll(): array {\n\n if($this->database === null) {\n throw new \\Exception('Database connection has not been set.');\n }\n\n $this->queryProperty->setFetchType($this->queryProperty::FETCH_ALL);\n\n $cachedResult = $this->checkQueriesCache($this->queryProperty);\n if ($cachedResult !== null) {\n $this->cacheAndResetQueryProperties();\n return $cachedResult;\n }\n\n $task = $this->createTask();\n $result = $task->fetchAll(\\PDO::FETCH_ASSOC);\n $this->cacheAndResetQueryProperties($result);\n return $result;\n }",
"public function fALL()\n {\n $fetch_all_data = $this->query->fetchAll(PDO::FETCH_OBJ);\n if($fetch_all_data)\n {\n return $fetch_all_data;\n }else{\n return false;\n }\n \n }",
"public function getTheRows(){\n if($this->dboutcomes == false){\n return false;\n }\n //get the total number of rows affected\n return mysqli_num_rows($this->dboutcomes);\n }",
"public function getAll(){\n try\n {\n\n # throw new \\PDOException(\"testing catch on upper level\");\n\n $movieList = array();\n\n $query = \"SELECT * FROM \".$this->tableName;\n\n $this->connection = Connection::getInstance();\n\n $resultSet = $this->connection->execute($query);\n \n if($resultSet){\n $mapping= $this->map($resultSet);\n if(!is_array($mapping)){\n array_push($movieList,$mapping);\n }else{\n $movieList=$mapping;\n }\n }\n \n }catch(\\PDOException $ex)\n {\n throw $ex;\n }\n\n if(!empty($resultSet)){\n \n return $movieList; \n }else{\n return null;\n }\n }",
"public function getAll(){\n $sqlQuery = \"SELECT * FROM \".$this->t_name.\"\";\n //prepate stamt;\n $stmt = $this->conn->prepare($sqlQuery);\n $stmt->execute();\n //kembalikan nilai stmt\n return $stmt;\n }",
"public function getStatus(){\n $pdo = new DBConnection();\n $db = $pdo->DBConnect();\n try{\n $db->beginTransaction();\n $sql = \"SELECT * from status ORDER BY id asc\";\n $record = $db->prepare($sql); \n $record->execute();\n $regExists = $record->rowCount();\n if ($regExists) {\n $dataList = $record->fetchAll(PDO::FETCH_ASSOC);\n $db->commit();\n $db = null;\n return $dataList;\n } else {\n $db->commit();\n $db = null;\n return $regExists;\n }\n }catch (PDOException $exc){\n $db->rollback();\n $db = null;\n echo $exc->getMessage();\n return null;\n } \n }",
"function database_load_all()\n {\n if( !is_resource($this->_last_resource) )\n {\n return FALSE;\n }\n \n $resource = $this->_last_resource;\n $return_data = array();\n while( $data = $this->database_fetch_assoc($resource) )\n {\n $return_data[] = $data;\n }\n \n return $return_data;\n\t}",
"public function getNombreTables() {\n\t\t\n\t\t\t$this->log->debug(\"Maintenance::getNombreTables() Début\");\n\t\t\t\n\t\t\t$total = 0;\n\t\t\n\t\t\ttry {\n\t\t\t\t$sql = \"select count(*) from information_schema.tables where table_schema=?\";\n\t\t\t\t$sth = $this->dbh->prepare($sql);\n\t\t\t\t$sth->execute(array(DB_NAME));\n\t\t\t\t\t\n\t\t\t\t// Obtenir le nombre de tables\n\t\t\t\t$total = $sth->fetchColumn();\n\t\t\t\n\t\t\t} catch (Exception $e) {\n\t\t\t\tErreur::erreurFatal('018', \"Maintenance::getNombreTables() - Erreur technique détectée : '\" . $e->getMessage() . $e->getTraceAsString() . \"'\", $this->log);\n\t\t\t}\n\t\t\t\t\t\n\t\t\t$this->log->debug(\"Maintenance::getNombreTables() Fin total = '$total'\");\n\t\t\n\t\t\treturn $total;\n\t\t}",
"private function checkTable()\n\t{\n\t\t$erreur = array();\n\t\tinclude (dirname(__FILE__).'/sql/sql-install.php');\n\t\t// the array is called $sql;\n\n\t\tforeach ($sql as $key => $s)\n\t\t{\n\t\t\t// We check if the table allready exist\n\t\t\t$table_exist_sql = 'SHOW TABLES LIKE \\''._DB_PREFIX_.$key.'\\';';\n\t\t\tif (!Db::getInstance()->executeS($table_exist_sql))\n\t\t\t{\n\t\t\t\t//If the table not exist we install it\n\t\t\t\tDb::getInstance()->execute($s);\n\t\t\t\t$erreur_sql = Db::getInstance()->getMsgError();\n\t\t\t\tif (!empty($erreur_sql))\n\t\t\t\t\t$erreur[] = $erreur_sql;\n\n\t\t\t}\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t// If the table exist we verify the structure\n\t\t\t\tpreg_match_all('/`(\\w+)`/mi', $s, $matches); // We catch all the columns name of the table\n\t\t\t\t$final_columns = array_unique($matches[1]); // We erase the duplicate entry\n\t\t\t\t// We search in the array an entry who could be the name of the table\n\t\t\t\t$key_to_unset = array_search(_DB_PREFIX_.$key,$final_columns);\n\t\t\t\tif ($key_to_unset !== FALSE)\n\t\t\t\t\tunset($final_columns[(int)$key_to_unset]); // We unset it\n\t\t\t\t$final_columns = array_values($final_columns);\n\n\t\t\t\t$describe_sql = 'DESCRIBE '._DB_PREFIX_.$key;\n\t\t\t\t$existing_columns = Db::getInstance()->executeS($describe_sql);\n\t\t\t\t$existing_columns = array_column($existing_columns, 'Field');\n\t\t\t\t$nfinal_columns = count($final_columns);\n\t\t\t\tfor ($i = 0; $i < $nfinal_columns; $i++)\n\t\t\t\t{\n\t\t\t\t\tif (!in_array($final_columns[$i],$existing_columns)) // If we don't find the item in existing table, we create it\n\t\t\t\t\t{\n\t\t\t\t\t\t$pattern = '/`'.(string)$final_columns[$i].'`(.+),\\n/i';\n\t\t\t\t\t\tpreg_match($pattern, $s, $columns_spec);\n\t\t\t\t\t\t$sql_append_fields = 'ALTER TABLE `'._DB_PREFIX_.$key.'` ADD `'.(string)$final_columns[$i].'` '.$columns_spec[1];\n\t\t\t\t\t\tDb::getInstance()->execute($sql_append_fields);\n\t\t\t\t\t\t$erreur_sql = Db::getInstance()->getMsgError();\n\t\t\t\t\t\tif (!empty($erreur_sql))\n\t\t\t\t\t\t\t$erreur[] = $erreur_sql;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// We check if in the existing table is there columns that need to be removed\n\t\t\t\t$nexisting_columns = count($existing_columns);\n\t\t\t\tfor ($j = 0; $j < $nexisting_columns; $j++)\n\t\t\t\t{\n\t\t\t\t\tif (!in_array($existing_columns[$j],$final_columns)) // If an existing column is not in the futur table, we delete this field form the db\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql_erase_fields = 'ALTER TABLE `'._DB_PREFIX_.$key.'` DROP `'.(string)$existing_columns[$j].'`';\n\t\t\t\t\t\tDb::getInstance()->execute($sql_erase_fields);\n\t\t\t\t\t\t$erreur_sql = Db::getInstance()->getMsgError();\n\t\t\t\t\t\tif (!empty($erreur_sql))\n\t\t\t\t\t\t\t$erreur[] = $erreur_sql;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}",
"abstract public function countTable();",
"function count_pdo($query = '', $bind = '') {\r\n if ($query == '') {\r\n error_log(\"The Count function query is empty!\");\r\n return false;\r\n }\r\n\r\n// END TEST FOR EMPTY VALUES\r\n\r\n if (!isset($GLOBALS['db_conn']) || $GLOBALS['db_conn'] == '') {\r\n $db = db_con();\r\n } else {\r\n $db = $GLOBALS['db_conn'];\r\n }\r\n\r\n try {\r\n if ($bind == '') {\r\n $query = substr($db->quote($query), 1, -1);\r\n $stmt = $db->query($query);\r\n $row_count = $stmt->fetchColumn();\r\n } else {\r\n $stmt = $db->prepare($query);\r\n $stmt->execute($bind);\r\n $row_count = $stmt->fetchColumn();\r\n }\r\n } catch (PDOException $ex) {\r\n $ex->getMessage();\r\n error_log(\"There was a PDO query error! Query: \" . $query . \" || PDO Message: \" . $ex);\r\n return false;\r\n }\r\n\r\n return $row_count;\r\n}"
] | [
"0.6836648",
"0.6475068",
"0.64276564",
"0.64267415",
"0.63989216",
"0.63211507",
"0.63152176",
"0.62161314",
"0.61821145",
"0.61486685",
"0.6146371",
"0.6135666",
"0.6127071",
"0.6110878",
"0.60998213",
"0.6092394",
"0.60887176",
"0.6084373",
"0.6065775",
"0.60466164",
"0.602667",
"0.60160303",
"0.59512603",
"0.59335303",
"0.5930813",
"0.5927906",
"0.5924327",
"0.5906624",
"0.5897662",
"0.58783",
"0.58608526",
"0.58606607",
"0.58596814",
"0.58571297",
"0.5834594",
"0.58343625",
"0.5823556",
"0.5809418",
"0.5796903",
"0.5796517",
"0.578379",
"0.57769024",
"0.5767486",
"0.57656056",
"0.57656056",
"0.57656056",
"0.576428",
"0.5750309",
"0.57439053",
"0.57378554",
"0.57260025",
"0.5722073",
"0.57147175",
"0.5713628",
"0.570894",
"0.5701298",
"0.56769234",
"0.5669543",
"0.566822",
"0.5666955",
"0.5665537",
"0.56628484",
"0.56547445",
"0.5650088",
"0.5642321",
"0.5635214",
"0.56105256",
"0.56102324",
"0.56095266",
"0.56064683",
"0.56064683",
"0.5600535",
"0.5598578",
"0.5593398",
"0.5593398",
"0.5593398",
"0.55900353",
"0.5589998",
"0.5588543",
"0.5587778",
"0.558697",
"0.55810595",
"0.55792964",
"0.5573987",
"0.5573987",
"0.55707693",
"0.55678576",
"0.55671453",
"0.5562288",
"0.5556579",
"0.55562717",
"0.5555627",
"0.55453634",
"0.5542076",
"0.55383646",
"0.55317825",
"0.5526874",
"0.5525318",
"0.55207616",
"0.55177665",
"0.5513663"
] | 0.0 | -1 |
Insert the missing bits and update the new bits... TODO: Contemplate the deep mystery of transactions here | function ltiAdjustAata($pdo, $p, &$row, $post) {
$errormode = $pdo->getAttribute(PDO::ATTR_ERRMODE);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$actions = array();
if ( $row['context_id'] === null) {
$sql = "INSERT INTO {$p}lti_context
( context_key, context_sha256, title, key_id, created_at, updated_at ) VALUES
( :context_key, :context_sha256, :title, :key_id, NOW(), NOW() )";
pdoQueryDie($pdo, $sql, array(
':context_key' => $post['context_id'],
':context_sha256' => lti_sha256($post['context_id']),
':title' => $post['context_title'],
':key_id' => $row['key_id']));
$row['context_id'] = $pdo->lastInsertId();
$row['context_title'] = $post['context_title'];
$actions[] = "=== Inserted context id=".$row['context_id']." ".$row['context_title'];
}
if ( $row['link_id'] === null && isset($post['link_id']) ) {
$sql = "INSERT INTO {$p}lti_link
( link_key, link_sha256, title, context_id, created_at, updated_at ) VALUES
( :link_key, :link_sha256, :title, :context_id, NOW(), NOW() )";
pdoQueryDie($pdo, $sql, array(
':link_key' => $post['link_id'],
':link_sha256' => lti_sha256($post['link_id']),
':title' => $post['link_title'],
':context_id' => $row['context_id']));
$row['link_id'] = $pdo->lastInsertId();
$row['link_title'] = $post['link_title'];
$actions[] = "=== Inserted link id=".$row['link_id']." ".$row['link_title'];
}
$user_displayname = isset($post['user_displayname']) ? $post['user_displayname'] : null;
$user_email = isset($post['user_email']) ? $post['user_email'] : null;
if ( $row['user_id'] === null && isset($post['user_id']) ) {
$sql = "INSERT INTO {$p}lti_user
( user_key, user_sha256, displayname, email, key_id, created_at, updated_at ) VALUES
( :user_key, :user_sha256, :displayname, :email, :key_id, NOW(), NOW() )";
pdoQueryDie($pdo, $sql, array(
':user_key' => $post['user_id'],
':user_sha256' => lti_sha256($post['user_id']),
':displayname' => $user_displayname,
':email' => $user_email,
':key_id' => $row['key_id']));
$row['user_id'] = $pdo->lastInsertId();
$row['user_email'] = $user_email;
$row['user_sha256'] = lti_sha256($post['user_id']);
$row['user_displayname'] = $user_displayname;
$actions[] = "=== Inserted user id=".$row['user_id']." ".$row['user_email'];
}
if ( $row['membership_id'] === null && $row['context_id'] !== null && $row['user_id'] !== null ) {
$sql = "INSERT INTO {$p}lti_membership
( context_id, user_id, role, created_at, updated_at ) VALUES
( :context_id, :user_id, :role, NOW(), NOW() )";
pdoQueryDie($pdo, $sql, array(
':context_id' => $row['context_id'],
':user_id' => $row['user_id'],
':role' => $post['role']));
$row['membership_id'] = $pdo->lastInsertId();
$row['role'] = $post['role'];
$actions[] = "=== Inserted membership id=".$row['membership_id']." role=".$row['role'].
" user=".$row['user_id']." context=".$row['context_id'];
}
// We need to handle the case where the service URL changes but we already have a sourcedid
$oldserviceid = $row['service_id'];
if ( $row['service_id'] === null && $post['service'] && $post['sourcedid'] ) {
$sql = "INSERT INTO {$p}lti_service
( service_key, service_sha256, key_id, created_at, updated_at ) VALUES
( :service_key, :service_sha256, :key_id, NOW(), NOW() )";
pdoQueryDie($pdo, $sql, array(
':service_key' => $post['service'],
':service_sha256' => lti_sha256($post['service']),
':key_id' => $row['key_id']));
$row['service_id'] = $pdo->lastInsertId();
$row['service'] = $post['service'];
$actions[] = "=== Inserted service id=".$row['service_id']." ".$post['service'];
}
// If we just created a new service entry but we already had a result entry, update it
if ( $oldserviceid === null && $row['result_id'] !== null && $row['service_id'] !== null && $post['service'] && $post['sourcedid'] ) {
$sql = "UPDATE {$p}lti_result SET service_id = :service_id WHERE result_id = :result_id";
pdoQueryDie($pdo, $sql, array(
':service_id' => $row['service_id'],
':result_id' => $row['result_id']));
$actions[] = "=== Updated result id=".$row['result_id']." service=".$row['service_id']." ".$post['sourcedid'];
}
// If we don'have a result but do have a service - link them together
if ( $row['result_id'] === null && $row['service_id'] !== null && $post['service'] && $post['sourcedid'] ) {
$sql = "INSERT INTO {$p}lti_result
( sourcedid, sourcedid_sha256, service_id, link_id, user_id, created_at, updated_at ) VALUES
( :sourcedid, :sourcedid_sha256, :service_id, :link_id, :user_id, NOW(), NOW() )";
pdoQueryDie($pdo, $sql, array(
':sourcedid' => $post['sourcedid'],
':sourcedid_sha256' => lti_sha256($post['sourcedid']),
':service_id' => $row['service_id'],
':link_id' => $row['link_id'],
':user_id' => $row['user_id']));
$row['result_id'] = $pdo->lastInsertId();
$row['sourcedid'] = $post['sourcedid'];
$actions[] = "=== Inserted result id=".$row['result_id']." service=".$row['service_id']." ".$post['sourcedid'];
}
// If we don'have a result and do not have a service - just store the result (prep for LTI 2.0)
if ( $row['result_id'] === null && $row['service_id'] === null && ! $post['service'] && $post['sourcedid'] ) {
$sql = "INSERT INTO {$p}lti_result
( sourcedid, sourcedid_sha256, link_id, user_id, created_at, updated_at ) VALUES
( :sourcedid, :sourcedid_sha256, :link_id, :user_id, NOW(), NOW() )";
pdoQueryDie($pdo, $sql, array(
':sourcedid' => $post['sourcedid'],
':sourcedid_sha256' => lti_sha256($post['sourcedid']),
':link_id' => $row['link_id'],
':user_id' => $row['user_id']));
$row['result_id'] = $pdo->lastInsertId();
$actions[] = "=== Inserted LTI 2.0 result id=".$row['result_id']." service=".$row['service_id']." ".$post['sourcedid'];
}
// Here we handle updates to sourcedid
if ( $row['result_id'] != null && $post['sourcedid'] != null && $post['sourcedid'] != $row['sourcedid'] ) {
$sql = "UPDATE {$p}lti_result
SET sourcedid = :sourcedid, sourcedid_sha256 = :sourcedid_sha256
WHERE result_id = :result_id";
pdoQueryDie($pdo, $sql, array(
':sourcedid' => $post['sourcedid'],
':sourcedid_sha256' => lti_sha256($post['sourcedid']),
':result_id' => $row['result_id']));
$row['sourcedid'] = $post['sourcedid'];
$actions[] = "=== Updated sourcedid=".$row['sourcedid'];
}
// Here we handle updates to context_title, link_title, user_displayname, user_email, or role
if ( isset($post['context_title']) && $post['context_title'] != $row['context_title'] ) {
$sql = "UPDATE {$p}lti_context SET title = :title WHERE context_id = :context_id";
pdoQueryDie($pdo, $sql, array(
':title' => $post['context_title'],
':context_id' => $row['context_id']));
$row['context_title'] = $post['context_title'];
$actions[] = "=== Updated context=".$row['context_id']." title=".$post['context_title'];
}
if ( isset($post['link_title']) && $post['link_title'] != $row['link_title'] ) {
$sql = "UPDATE {$p}lti_link SET title = :title WHERE link_id = :link_id";
pdoQueryDie($pdo, $sql, array(
':title' => $post['link_title'],
':link_id' => $row['link_id']));
$row['link_title'] = $post['link_title'];
$actions[] = "=== Updated link=".$row['link_id']." title=".$post['link_title'];
}
if ( isset($post['user_displayname']) && $post['user_displayname'] != $row['user_displayname'] && strlen($post['user_displayname']) > 0 ) {
$sql = "UPDATE {$p}lti_user SET displayname = :displayname WHERE user_id = :user_id";
pdoQueryDie($pdo, $sql, array(
':displayname' => $post['user_displayname'],
':user_id' => $row['user_id']));
$row['user_displayname'] = $post['user_displayname'];
$actions[] = "=== Updated user=".$row['user_id']." displayname=".$post['user_displayname'];
}
if ( isset($post['user_email']) && $post['user_email'] != $row['user_email'] && strlen($post['user_email']) > 0 ) {
$sql = "UPDATE {$p}lti_user SET email = :email WHERE user_id = :user_id";
pdoQueryDie($pdo, $sql, array(
':email' => $post['user_email'],
':user_id' => $row['user_id']));
$row['user_email'] = $post['user_email'];
$actions[] = "=== Updated user=".$row['user_id']." email=".$post['user_email'];
}
if ( isset($post['role']) && $post['role'] != $row['role'] ) {
$sql = "UPDATE {$p}lti_membership SET role = :role WHERE membership_id = :membership_id";
pdoQueryDie($pdo, $sql, array(
':role' => $post['role'],
':membership_id' => $row['membership_id']));
$row['role'] = $post['role'];
$actions[] = "=== Updated membership=".$row['membership_id']." role=".$post['role'];
}
// Restore ERRMODE
$pdo->setAttribute(PDO::ATTR_ERRMODE, $errormode);
return $actions;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function forceInsert() {\n\t\t\n\t\t\t$this->_isUpdate = false;\n\t\t\t\n\t\t}",
"private function addBits($bitindex, $value){\n\t\t$dcindex = (int)floor($bitindex/31);\n\t\t$dcbit = $bitindex % 31;\n\t\t\n\t\tif($dcindex > count($this->storagedcs)){ Error(\"You're trying to insert bits outside the range covered by the storage dcs\"); }\n\t\t\n\t\t$dc = $this->storagedcs[$dcindex];\n\t\t\n\t\t// if it will exceed the deathcounter's capacity\n\t\tif( ($dcbit + getBinaryPower($value)) > 31){\n\t\t\t// split value's bits \n\t\t\t$overflow = 31 - $dcbit;\n\t\t\t$modcap = pow(2,$overflow);\n\t\t\t$value1 = $value % $modcap;\n\t\t\t$value2 = floor($value / $modcap);\n\n\t\t\tif( ($dcindex+1) > count($this->storagedcs)){ Error(\"You're trying to insert bits outside the range covered by the storage dcs\"); }\n\t\t\t\n\t\t\t// across next dc\n\t\t\t$dc2 = $this->storagedcs[$dcindex+1];\n\t\t\treturn $dc->add($value1 << $dcbit) . $dc2->add($value2);\n\t\t}\n\t\t\n\t\t// otherwise just place in dc normally\n\t\treturn $dc->add($value << $dcbit);\n\t}",
"function insert_state($state) {\n if (!RefineData::isStateExists($state)) {\n RefineData::insertState(remove_numbers($state));\n }\n}",
"public function add_or_replace()\n {\n $this->insert_replace('table', array('foo' => 'bar'));\n\n // you can also do\n $this->replace();\n $this->insert('table', array('foo' => 'bar'));\n }",
"public function testInsert() {\n $data = array();\n\n foreach ($this->collapsed as $key => $value) {\n $data = Hash::insert($data, $key, $value);\n }\n\n $this->assertEquals($this->expanded, $data);\n $this->assertEquals(array(), Hash::insert(array(), '', 'value'));\n }",
"static private function placeBitInDatamatrix(&$datamatrix, &$assigned, $bit, $row, $col, $totalRows, $totalCols){\n if ($row < 0) {\n $row += $totalRows;\n $col += 4 - (($totalRows+4)%8);\n }\n if ($col < 0) {\n $col += $totalCols;\n $row += 4 - (($totalCols+4)%8);\n }\n if (!isset($assigned[$row][$col]) || $assigned[$row][$col] != 1) {\n $datamatrix[$row][$col] = $bit;\n $assigned[$row][$col] = 1;\n }\n }",
"public function add_data_to_tombstone(){\n }",
"private function basicRolling ()\n {\n $brandName = Brand::find($this->brandUpdate)->name;\n $updateBrand = $this->alokasiBa($brandName);\n $brandCount = $this->alokasiCount($brandName);\n $newStoreAllocation = Store::actualBa($this->newStore)->first();\n if ($newStoreAllocation[$updateBrand] - $newStoreAllocation[$brandCount] == 0 && count($this->replaceBa) == 0){\n $newStoreAllocation->update([$updateBrand => $newStoreAllocation[$updateBrand] += 1]);\n $this->triggerRolling($this->oldStore, $this->newStore, $this->ba, true, true);\n } else {\n $this->triggerRolling($this->oldStore, $this->newStore, $this->ba);\n }\n $this->ba->store()->updateExistingPivot($this->oldStore, ['store_id' => $this->newStore]);\n\n\n $wip = WIP::create(['store_id' => $this->oldStore, 'ba_id' => $this->ba->id, 'status' => 'replacement',\n 'brand_id' => $this->request->get('brandId'), 'fullfield' => 'hold', 'reason' => $this->alasanBa ,\n 'filling_date' => $this->request->get('pengajuanRequest'), 'effective_date' => $this->request->get('firstDate')]);\n if ($this->differentReo) {\n WIP::where('id', $wip->id)->update(['pending' => 1]);\n }\n }",
"public function hookActionShopDataDuplication($params)\r\n\t{\r\n\t\tDb::getInstance()->execute('\r\n\t\tINSERT IGNORE INTO '._DB_PREFIX_.'staticblock_shop (id_staticblock, id_shop, is_active)\r\n\t\tSELECT id_staticblock, '.(int)$params['new_id_shop'].', is_active\r\n\t\tFROM '._DB_PREFIX_.'staticblock_shop\r\n\t\tWHERE id_shop = '.(int)$params['old_id_shop']);\r\n\t\t\r\n\t\t//duplicate hometab language for shop\r\n\t\tDb::getInstance()->execute('\r\n\t\tINSERT IGNORE INTO '._DB_PREFIX_.'staticblock_lang (id_staticblock, id_lang, id_shop, title, content)\r\n\t\tSELECT id_staticblock, id_lang, '.(int)$params['new_id_shop'].', title, content\r\n\t\tFROM '._DB_PREFIX_.'staticblock_lang\r\n\t\tWHERE id_shop = '.(int)$params['old_id_shop']);\r\n\t}",
"public function bitAllx() {\n\t\t\t$db = new database();\n\t\t\t$results = $db->getAll(\"SELECT id, clientid, timestamp FROM claimants_data ORDER BY id DESC ;\");\n\t\t\t\n\t\t\tforeach ($results AS $result) {\n\t\t\t\n\t\t\t\t$check = claimants::checkCallTimes($result['id']);\n\t\t\t\t$thisBit = 0;\n\t\t\t\t\n\t\t\t\tif ($check['morning1']) $thisBit = $thisBit + self::morning1;\n\t\t\t\tif ($check['morning2']) $thisBit = $thisBit + self::morning2;\n\t\t\t\tif ($check['afternoon1']) $thisBit = $thisBit + self::afternoon1;\n\t\t\t\tif ($check['afternoon2']) $thisBit = $thisBit + self::afternoon2;\n\t\t\t\tif ($check['evening1']) $thisBit = $thisBit + self::evening1;\n\t\t\t\tif ($check['evening2']) $thisBit = $thisBit + self::evening2;\n\t\t\t\t\n\t\t\t\tprint $result['id'] . \" - \" . $thisBit . \"<br />\";\n\t\t\t\t\n\t\t\t\t$db->query(\"UPDATE claimants_data SET `bit` = '\".$thisBit.\"' WHERE `claimants_data`.`id` ='\".$result['id'].\"';\");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}",
"public function add_or_update()\n {\n $this->on_duplicate_key('foo = foo + 1');\n $this->insert('table', array('foo' => 'bar'));\n }",
"function updateRawcoins()\n{\n // debuglog(__FUNCTION__);\n\n exchange_set_default('alcurex', 'disabled', true);\n exchange_set_default('binance', 'disabled', true);\n exchange_set_default('empoex', 'disabled', true);\n exchange_set_default('coinbene', 'disabled', true);\n exchange_set_default('coinexchange', 'disabled', true);\n exchange_set_default('coinsmarkets', 'disabled', true);\n exchange_set_default('escodex', 'disabled', true);\n exchange_set_default('gateio', 'disabled', true);\n exchange_set_default('jubi', 'disabled', true);\n exchange_set_default('nova', 'disabled', true);\n exchange_set_default('stocksexchange', 'disabled', true);\n exchange_set_default('tradesatoshi', 'disabled', true);\n\n settings_prefetch_all();\n\n if (!exchange_get('bittrex', 'disabled')) {\n $list = bittrex_api_query('public/getcurrencies');\n if (isset($list->result) && !empty($list->result)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='bittrex'\");\n foreach ($list->result as $currency) {\n if ($currency->Currency == 'BTC') {\n exchange_set('bittrex', 'withdraw_fee_btc', $currency->TxFee);\n continue;\n }\n updateRawCoin('bittrex', $currency->Currency, $currency->CurrencyLong);\n }\n }\n }\n\n if (!exchange_get('bitz', 'disabled')) {\n $list = bitz_api_query('tickerall');\n if (!empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='bitz'\");\n foreach ($list as $c => $ticker) {\n $e = explode('_', $c);\n if (strtoupper($e[1]) !== 'BTC')\n continue;\n $symbol = strtoupper($e[0]);\n updateRawCoin('bitz', $symbol);\n }\n }\n }\n\n if (!exchange_get('bleutrade', 'disabled')) {\n $list = bleutrade_api_query('public/getcurrencies');\n if (isset($list->result) && !empty($list->result)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='bleutrade'\");\n foreach ($list->result as $currency) {\n if ($currency->Currency == 'BTC') {\n exchange_set('bleutrade', 'withdraw_fee_btc', $currency->TxFee);\n continue;\n }\n updateRawCoin('bleutrade', $currency->Currency, $currency->CurrencyLong);\n }\n }\n }\n\n if (!exchange_get('coinbene', 'disabled')) {\n $data = coinbene_api_query('market/symbol');\n $list = objSafeVal($data, 'symbol');\n if (is_array($list) && !empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='coinbene'\");\n foreach ($list as $ticker) {\n if ($ticker->quoteAsset != 'BTC')\n continue;\n $symbol = $ticker->baseAsset;\n updateRawCoin('coinbene', $symbol);\n }\n }\n }\n\n if (!exchange_get('crex24', 'disabled')) {\n $list = crex24_api_query('currencies');\n if (is_array($list) && !empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='crex24'\");\n foreach ($list as $currency) {\n $symbol = objSafeVal($currency, 'symbol');\n $name = objSafeVal($currency, 'name');\n if ($currency->isFiat || $currency->isDelisted)\n continue;\n updateRawCoin('crex24', $symbol, $name);\n }\n }\n }\n\n if (!exchange_get('poloniex', 'disabled')) {\n $poloniex = new poloniex;\n $tickers = $poloniex->get_currencies();\n if (!$tickers)\n $tickers = array();\n else\n dborun(\"UPDATE markets SET deleted=true WHERE name='poloniex'\");\n foreach ($tickers as $symbol => $ticker) {\n if (arraySafeVal($ticker, 'disabled'))\n continue;\n if (arraySafeVal($ticker, 'delisted'))\n continue;\n updateRawCoin('poloniex', $symbol);\n }\n }\n\n if (!exchange_get('c-cex', 'disabled')) {\n $ccex = new CcexAPI;\n $list = $ccex->getPairs();\n if ($list) {\n sleep(1);\n $names = $ccex->getCoinNames();\n\n dborun(\"UPDATE markets SET deleted=true WHERE name='c-cex'\");\n foreach ($list as $item) {\n $e = explode('-', $item);\n $symbol = strtoupper($e[0]);\n\n updateRawCoin('c-cex', $symbol, arraySafeVal($names, $e[0], 'unknown'));\n }\n }\n }\n\n if (!exchange_get('yobit', 'disabled')) {\n $res = yobit_api_query('info');\n if ($res) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='yobit'\");\n foreach ($res->pairs as $i => $item) {\n $e = explode('_', $i);\n $symbol = strtoupper($e[0]);\n updateRawCoin('yobit', $symbol);\n }\n }\n }\n\n if (!exchange_get('coinexchange', 'disabled')) {\n $list = coinexchange_api_query('getmarkets');\n if (isset($list->result) && !empty($list->result)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='coinexchange'\");\n foreach ($list->result as $item) {\n if ($item->BaseCurrencyCode != 'BTC')\n continue;\n $symbol = $item->MarketAssetCode;\n $label = objSafeVal($item, 'MarketAssetName');\n updateRawCoin('coinexchange', $symbol, $label);\n }\n }\n }\n\n if (!exchange_get('coinsmarkets', 'disabled')) {\n $list = coinsmarkets_api_query('apicoin');\n if (!empty($list) && is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='coinsmarkets'\");\n foreach ($list as $pair => $data) {\n $e = explode('_', $pair);\n if ($e[0] != 'BTC')\n continue;\n $symbol = strtoupper($e[1]);\n updateRawCoin('coinsmarkets', $symbol);\n }\n }\n }\n\n if (!exchange_get('cryptopia', 'disabled')) {\n $list = cryptopia_api_query('GetMarkets');\n if (isset($list->Data)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='cryptopia'\");\n foreach ($list->Data as $item) {\n $e = explode('/', $item->Label);\n if (strtoupper($e[1]) !== 'BTC')\n continue;\n $symbol = strtoupper($e[0]);\n updateRawCoin('cryptopia', $symbol);\n }\n }\n }\n\n if (!exchange_get('cryptobridge', 'disabled')) {\n $list = cryptobridge_api_query('ticker');\n if (is_array($list) && !empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='cryptobridge'\");\n foreach ($list as $ticker) {\n $e = explode('_', $ticker->id);\n if (strtoupper($e[1]) !== 'BTC')\n continue;\n $symbol = strtoupper($e[0]);\n updateRawCoin('cryptobridge', $symbol);\n }\n }\n }\n\n if (!exchange_get('escodex', 'disabled')) {\n $list = escodex_api_query('ticker');\n if (is_array($list) && !empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='escodex'\");\n foreach ($list as $ticker) {\n #debuglog (json_encode($ticker));\n if (strtoupper($ticker->base) !== 'BTC')\n continue;\n $symbol = strtoupper($ticker->quote);\n updateRawCoin('escodex', $symbol);\n }\n }\n }\n\n if (!exchange_get('hitbtc', 'disabled')) {\n $list = hitbtc_api_query('symbols');\n if (is_object($list) && isset($list->symbols) && is_array($list->symbols)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='hitbtc'\");\n foreach ($list->symbols as $data) {\n $base = strtoupper($data->currency);\n if ($base != 'BTC')\n continue;\n $symbol = strtoupper($data->commodity);\n updateRawCoin('hitbtc', $symbol);\n }\n }\n }\n\n if (!exchange_get('kraken', 'disabled')) {\n $list = kraken_api_query('AssetPairs');\n if (is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='kraken'\");\n foreach ($list as $pair => $item) {\n $pairs = explode('-', $pair);\n $base = reset($pairs);\n $symbol = end($pairs);\n if ($symbol == 'BTC' || $base != 'BTC')\n continue;\n if (in_array($symbol, array(\n 'GBP',\n 'CAD',\n 'EUR',\n 'USD',\n 'JPY'\n )))\n continue;\n if (strpos($symbol, '.d') !== false)\n continue;\n $symbol = strtoupper($symbol);\n updateRawCoin('kraken', $symbol);\n }\n }\n }\n\n if (!exchange_get('alcurex', 'disabled')) {\n $list = alcurex_api_query('market', '?info=on');\n if (is_object($list) && isset($list->MARKETS)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='alcurex'\");\n foreach ($list->MARKETS as $item) {\n $e = explode('_', $item->Pair);\n $symbol = strtoupper($e[0]);\n updateRawCoin('alcurex', $symbol);\n }\n }\n }\n\n if (!exchange_get('binance', 'disabled')) {\n $list = binance_api_query('ticker/allBookTickers');\n if (is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='binance'\");\n foreach ($list as $ticker) {\n $base = substr($ticker->symbol, -3, 3);\n // XXXBTC XXXETH BTCUSDT (no separator!)\n if ($base != 'BTC')\n continue;\n $symbol = substr($ticker->symbol, 0, strlen($ticker->symbol) - 3);\n updateRawCoin('binance', $symbol);\n }\n }\n }\n\n if (!exchange_get('gateio', 'disabled')) {\n $json = gateio_api_query('marketlist');\n $list = arraySafeVal($json, 'data');\n if (!empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='gateio'\");\n foreach ($list as $item) {\n if ($item['curr_b'] != 'BTC')\n continue;\n $symbol = trim(strtoupper($item['symbol']));\n $name = trim($item['name']);\n updateRawCoin('gateio', $symbol, $name);\n }\n }\n }\n\n if (!exchange_get('nova', 'disabled')) {\n $list = nova_api_query('markets');\n if (is_object($list) && !empty($list->markets)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='nova'\");\n foreach ($list->markets as $item) {\n if ($item->basecurrency != 'BTC')\n continue;\n $symbol = strtoupper($item->currency);\n updateRawCoin('nova', $symbol);\n //debuglog(\"nova: $symbol\");\n }\n }\n }\n\n if (!exchange_get('stocksexchange', 'disabled')) {\n $list = stocksexchange_api_query('markets');\n if (is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='stocksexchange'\");\n foreach ($list as $item) {\n if ($item->partner != 'BTC')\n continue;\n if ($item->active == false)\n continue;\n $symbol = strtoupper($item->currency);\n $name = trim($item->currency_long);\n updateRawCoin('stocksexchange', $symbol, $name);\n }\n }\n }\n\n if (!exchange_get('empoex', 'disabled')) {\n $list = empoex_api_query('marketinfo');\n if (is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='empoex'\");\n foreach ($list as $item) {\n $e = explode('-', $item->pairname);\n $base = strtoupper($e[1]);\n if ($base != 'BTC')\n continue;\n $symbol = strtoupper($e[0]);\n updateRawCoin('empoex', $symbol);\n }\n }\n }\n\n if (!exchange_get('kucoin', 'disabled')) {\n $list = kucoin_api_query('currencies');\n if (kucoin_result_valid($list) && !empty($list->data)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='kucoin'\");\n foreach ($list->data as $item) {\n $symbol = $item->name;\n $name = $item->fullName;\n updateRawCoin('kucoin', $symbol, $name);\n }\n }\n }\n\n if (!exchange_get('livecoin', 'disabled')) {\n $list = livecoin_api_query('exchange/ticker');\n if (is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='livecoin'\");\n foreach ($list as $item) {\n $e = explode('/', $item->symbol);\n $base = strtoupper($e[1]);\n if ($base != 'BTC')\n continue;\n $symbol = strtoupper($e[0]);\n updateRawCoin('livecoin', $symbol);\n }\n }\n }\n\n if (!exchange_get('shapeshift', 'disabled')) {\n $list = shapeshift_api_query('getcoins');\n if (is_array($list) && !empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='shapeshift'\");\n foreach ($list as $item) {\n $status = $item['status'];\n if ($status != 'available')\n continue;\n $symbol = strtoupper($item['symbol']);\n $name = trim($item['name']);\n updateRawCoin('shapeshift', $symbol, $name);\n //debuglog(\"shapeshift: $symbol $name\");\n }\n }\n }\n\n if (!exchange_get('tradesatoshi', 'disabled')) {\n $data = tradesatoshi_api_query('getcurrencies');\n if (is_object($data) && !empty($data->result)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='tradesatoshi'\");\n foreach ($data->result as $item) {\n $symbol = $item->currency;\n $name = trim($item->currencyLong);\n updateRawCoin('tradesatoshi', $symbol, $name);\n }\n }\n }\n\n //////////////////////////////////////////////////////////\n\n $markets = dbocolumn(\"SELECT DISTINCT name FROM markets\");\n foreach ($markets as $exchange) {\n if (exchange_get($exchange, 'disabled')) {\n $res = dborun(\"UPDATE markets SET disabled=8 WHERE name='$exchange'\");\n if (!$res)\n continue;\n $coins = getdbolist('db_coins', \"id IN (SELECT coinid FROM markets WHERE name='$exchange')\");\n foreach ($coins as $coin) {\n // allow to track a single market on a disabled exchange (dev test)\n if (market_get($exchange, $coin->getOfficialSymbol(), 'disabled', 1) == 0) {\n $res -= dborun(\"UPDATE markets SET disabled=0 WHERE name='$exchange' AND coinid={$coin->id}\");\n }\n }\n debuglog(\"$exchange: $res markets disabled from db settings\");\n } else {\n $res = dborun(\"UPDATE markets SET disabled=0 WHERE name='$exchange' AND disabled=8\");\n if ($res)\n debuglog(\"$exchange: $res markets re-enabled from db settings\");\n }\n }\n\n dborun(\"DELETE FROM markets WHERE deleted\");\n\n $list = getdbolist('db_coins', \"not enable and not installed and id not in (select distinct coinid from markets)\");\n foreach ($list as $coin) {\n if ($coin->visible)\n debuglog(\"{$coin->symbol} is no longer active\");\n // todo: proper cleanup in all tables (like \"yiimp coin SYM delete\")\n // if ($coin->symbol != 'BTC')\n // $coin->delete();\n }\n}",
"function blake2bUpdate(&$ctx, $input) {\n\t\tfor ($i = 0; $i < count($input); $i++) {\n\t\t\tif ($ctx['c'] === 128) { // buffer full ?\n\t\t\t\t$ctx['t'] += $ctx['c']; // add counters\n\t\t\t\t$this->blake2bCompress($ctx, false); // compress (not last)\n\t\t\t\t$ctx['c'] = 0; // counter to zero\n\t\t\t}\n\t\t\t$ctx['b'][$ctx['c']++] = $input[$i];\n\t\t}\n\t}",
"function update_r1110() {\n\t$r = q(\"ALTER TABLE `app` ADD `app_addr` CHAR( 255 ) NOT NULL DEFAULT '',\nADD `app_price` CHAR( 255 ) NOT NULL DEFAULT '',\nADD `app_page` CHAR( 255 ) NOT NULL DEFAULT '',\nADD INDEX ( `app_price` )\");\n\n\treturn UPDATE_SUCCESS;\n\n}",
"function __Update(state $state, $data, $databitlen) {\n //$index = 0; /*the starting address of the data to be compressed*/\n\n $state->databitlen += $databitlen;\n $index = 0;\n\n /* if there is remaining data in the buffer, fill it to a full message block first */\n /* we assume that the size of the data in the buffer is the multiple of 8 bits if it is not at the end of a message */\n\n\n /* There is data in the buffer, but the incoming data is insufficient for a full block */\n if (($state->datasize_in_buffer > 0) && (($state->datasize_in_buffer + $databitlen) < 512)) {\n if (($databitlen & 7) == 0) {\n _memcpy($state->buffer, $state->datasize_in_buffer >> 3, $data, 0, 64 - ($state->datasize_in_buffer >> 3));\n } else {\n _memcpy($state->buffer, $state->datasize_in_buffer >> 3, $data, 0, 64 - ($state->datasize_in_buffer >> 3) + 1);\n }\n $state->datasize_in_buffer += $databitlen;\n $databitlen = 0;\n }\n\n /* There is data in the buffer, and the incoming data is sufficient for a full block */\n if (($state->datasize_in_buffer > 0) && (($state->datasize_in_buffer + $databitlen) >= 512)) {\n _memcpy($state->buffer, $state->datasize_in_buffer >> 3, $data, 0, 64 - ($state->datasize_in_buffer >> 3));\n $index = 64 - ($state->datasize_in_buffer >> 3);\n $databitlen = $databitlen - (512 - $state->datasize_in_buffer);\n F8($state);\n $state->datasize_in_buffer = 0;\n }\n\n\n /* hash the remaining full message blocks */\n for (; $databitlen >= 512; ($index = $index + 64), ($databitlen = $databitlen - 512)) {\n _memcpy($state->buffer, 0, $data, $index, 64);\n F8($state);\n }\n\n\n /* store the partial block into buffer, assume that -- if part of the last byte is not part of the message, then that part consists of 0 bits */\n if ($databitlen > 0) {\n if (($databitlen & 7) == 0) {\n _memcpy($state->buffer, 0, $data, $index, ($databitlen & 0x1ff) >> 3);\n } else {\n _memcpy($state->buffer, 0, $data, $index, (($databitlen & 0x1ff) >> 3) + 1);\n }\n $state->datasize_in_buffer = $databitlen;\n }\n}",
"function updatebases()\n {\n\n $tot_data = 0;\n $tot_idx = 0;\n $tot_all = 0;\n $total_gain = 0;\n $local_query = \"SHOW TABLE STATUS\";\n $result = db_query($local_query);\n if (db_num_rows($result[\"resource\"])) {\n while ($row = db_fetch_row($result)) {\n $local_query = 'OPTIMIZE TABLE '.$row[0];\n $resultat = db_query($local_query);\n }\n return true;\n }\n }",
"public function add_or_ignore()\n {\n $this->insert_ignore('table', array('foo' => 'bar'));\n\n // you can also do\n $this->ignore();\n $this->insert('table', array('foo' => 'bar'));\n }",
"public function safeUp()\n {\n $fields = (new Query())\n ->select(['*'])\n ->from([Table::FIELDS])\n ->where(['like', 'context', 'superTableBlockType:'])\n ->andWhere(['type' => MissingField::class])\n ->all();\n\n foreach ($fields as $field) {\n $settings = Json::decode($field['settings']);\n\n if (is_array($settings) && array_key_exists('expectedType', $settings)) {\n $expectedType = $settings['expectedType'];\n $newSettings = $settings['settings'] ?? [];\n\n $this->update(Table::FIELDS, [\n 'type' => $expectedType,\n 'settings' => $newSettings,\n ], [\n 'id' => $field['id']\n ]);\n }\n }\n }",
"public function syncTransactions(): void\n\t{\n\t\tif (!$this->checkTransactions()) {\n\t\t\treturn;\n\t\t}\n\n\t\t$transactions = $this->getTransactionList();\n\n\t\t/** @var array<\\Eshop\\DB\\Order> $orders */\n\t\t$orders = $this->orderRepository->many()->setIndex('this.code')->toArrayOf('uuid');\n\t\t/** @var array<\\Eshop\\DB\\EHubTransaction> $existingTransactions */\n\t\t$existingTransactions = $this->EHubTransactionRepository->many()->toArray();\n\n\t\t$newTransactionsValues = [];\n\n\t\tforeach ($transactions as $transaction) {\n\t\t\t$transactionPK = DIConnection::generateUuid('eHubTransactionId', $transaction['id']);\n\t\t\t$transactionValues = [\n\t\t\t\t'order' => null,\n\t\t\t];\n\n\t\t\tif (isset($existingTransactions[$transactionPK])) {\n\t\t\t\t$transactionValues = $existingTransactions[$transactionPK]->toArray();\n\t\t\t}\n\n\t\t\t$transactionValues['transactionId'] = $transaction['id'];\n\t\t\t$transactionValues['status'] = $transaction['status'];\n\t\t\t$transactionValues['createdTs'] = (new Carbon($transaction['dateTime']))->format('Y-m-d G:i');\n\t\t\t$transactionValues['clickDateTime'] = (new Carbon($transaction['clickDateTime']))->format('Y-m-d G:i');\n\t\t\t$transactionValues['orderAmount'] = (float) $transaction['orderAmount'];\n\t\t\t$transactionValues['originalOrderAmount'] = $transaction['originalOrderAmount'] ?? null;\n\t\t\t$transactionValues['originalCurrency'] = $transaction['originalCurrency'] ?? null;\n\t\t\t$transactionValues['commission'] = isset($transaction['commission']) ? (float) $transaction['commission'] : null;\n\t\t\t$transactionValues['type'] = $transaction['type'];\n\t\t\t$transactionValues['orderId'] = $transaction['orderId'] ?? null;\n\t\t\t$transactionValues['couponCode'] = $transaction['couponCode'] ?? null;\n\t\t\t$transactionValues['newCustomer'] = $transaction['newCustomer'] ?? null;\n\n\t\t\tif (isset($orders[$transaction['orderId']])) {\n\t\t\t\t$transactionValues['order'] = $orders[$transaction['orderId']];\n\t\t\t}\n\n\t\t\t$newTransactionsValues[] = $transactionValues;\n\t\t}\n\n\t\t$this->EHubTransactionRepository->syncMany($newTransactionsValues);\n\t}",
"private function addMoreStoreToBa()\n {\n $this->ba->store()->attach($this->newStore);\n $baCount = count($this->ba->fresh()->store);\n if ($baCount > 1) $this->ba->update(['status' => 'mobile']);\n $this->ba->fresh()->store->map(function ($item) use ($baCount) {\n $updateBrand = $this->alokasiBa(Brand::find($this->brandUpdate)->name);\n $updateData = [];\n $updateAllocation = ( $item[$updateBrand] == 0 ) ? 1 / $baCount : (1 / $baCount) + ($item[$updateBrand] - 1 );\n $updateData[$updateBrand] = $updateAllocation;\n\n if ($updateBrand != $this->request->get('brandId') && $item->id != $this->newStore) {\n $reduceBrand = $this->alokasiBa($this->request->get('brand'));\n $updateData[$reduceBrand] = $item[$reduceBrand] -= 1;\n $this->triggerRolling($item->id, 0, $this->ba, false, true, true);\n } else if ($item->id == $this->newStore && $updateBrand != $this->request->get('brandId') && BaSummary::hasEmptySpot($item->id, $updateBrand)->first() == null ) {\n $this->triggerRolling(0, $this->newStore, $this->ba, false, true);\n } else if ($item->id == $this->newStore && BaSummary::hasEmptySpot($item->id, $updateBrand)->first() != null) {\n $this->triggerRolling(0, $this->newStore, $this->ba, false);\n }\n\n Store::find($item->id)->update($updateData);\n });\n }",
"public function populateTransaction($data = array())\n\t{\n\t\ttry {\n\t\t\t$data = EMerchantPayHelper::sanitizeData($data, $this);\n\n\t\t\t// Check if transaction exists\n\t\t\t$insert_query = $this->db->query(\"\n\t\t\t\tSELECT\n\t\t\t\t\t*\n\t\t\t\tFROM\n\t\t\t\t\t`\" . DB_PREFIX . \"emerchantpay_checkout_transactions`\n\t\t\t\tWHERE\n\t\t\t\t\t`unique_id` = '\" . $data['unique_id'] . \"'\n\t\t\t\");\n\n\t\t\tif ($insert_query->rows) {\n\t\t\t\t$this->updateTransaction($data);\n\t\t\t} else {\n\t\t\t\t$this->addTransaction($data);\n\t\t\t}\n\t\t} catch (Exception $exception) {\n\t\t\t$this->logEx($exception);\n\t\t}\n\t}",
"public function buy($basket){\n $data = array();\n $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n //echo \"basketid = \".$basket['basketID'];\n try{\n $this->pdo->beginTransaction();\n $this->pdo->exec(\"insert into ShoppingBasket(basketID,username) values('\".$basket['basketID'].\"','\".$basket['username'].\"')\");\n foreach($basket['items'] as $item){\n $this->pdo->exec(\"insert into Contains(ISBN,basketID,number) values('\".$item['isbn'].\"','\".$basket['basketID'].\"','\".$item['number'].\"')\");\n $this->pdo->exec(\"insert into ShippingOrder(ISBN,warehouseCode,username,number) values('\".$item['isbn'].\"','w100','\".$basket['username'].\"','\".$item['number'].\"') on duplicate key update number=\".$item['number']);\n if($item['isMultiWarehouseUpdate']){\n $counter = $item['number'];\n foreach($item['warehouseUpdate'] as $warehouseUpdate){\n $warehouseCode = $warehouseUpdate['warehouseCode'];\n $counter -= $warehouseUpdate['stock'];\n if($counter>=0){\n //echo \"updating \".$warehouseCode.\" with counter = \".$counter;\n $this->pdo->exec(\"update stocks set number=0 where ISBN=\".$item['isbn'].\" and warehouseCode='\".$warehouseCode.\"'\");\n }else{\n /*10 6 4\n 7 1 -3\n 8 2 -2\n 9 3 -1\n 10 4 0*/\n $newstock = $warehouseUpdate['stock']+$counter; // counter is negative here\n //echo \"updating \".$warehouseCode.\" with new stock = \".$newstock;\n $this->pdo->exec(\"update stocks set number=\".$newstock.\" where ISBN=\".$item['isbn'].\" and warehouseCode='\".$warehouseCode.\"'\");\n }\n \n }\n }else{\n $warehouseCode = $item['warehouseUpdate']['warehouseCode'];\n //echo \"updating \".$warehouseCode;\n $this->pdo->exec(\"update stocks set number=number-\".$item['number'].\" where ISBN=\".$item['isbn'].\" and warehouseCode='\".$warehouseCode.\"'\");\n }\n \n }\n $this->pdo->commit();\n $data['success']=true;\n }catch(PDOException $pe){\n $this->pdo->rollback();\n $data['success']=false;\n $data['errmsg']=$pe->getMessage();\n }\n return $data;\n }",
"private function insertUnMatched()\n {\n $newElements = $this->unMatchedCollection->map(function ($item) {\n\n //Unset primary key property because it can create Integrity constraint violation: Duplicate ID\n if(!in_array($this->primaryKey,$this->associativeColumns) && !in_array($this->primaryKey,$this->associativePivots))\n unset($item->id);\n\n if(!empty($this->associativeColumns))\n {\n $newItem = new \\stdClass();\n foreach ($this->associativeColumns as $baseColumn => $mergeColumn)\n {\n $newItem->$baseColumn = $item->$mergeColumn;\n }\n foreach ($this->associativePivots as $baseColumn => $mergeColumn)\n {\n $newItem->$baseColumn = $item->$mergeColumn;\n }\n\n $item = $newItem;\n }\n\n\n return get_object_vars($item);\n\n })->toArray();\n\n if (!empty($newElements))\n $this->rowInserted = DB::table($this->baseTable)->insert($newElements);\n }",
"public static function populateTransaction($data = array())\n {\n global $db;\n\n try {\n // Check if transaction exists\n $insertQuery = $db->Execute(\"\n SELECT\n *\n FROM\n `\" . static::$table_name . \"`\n WHERE\n `unique_id` = '\" . $data['unique_id'] . \"'\n \");\n\n if ($insertQuery->RecordCount() > 0) {\n static::updateTransaction($data);\n } else {\n static::addTransaction($data);\n }\n } catch (\\Exception $exception) {\n //$this->logEx($exception);\n }\n }",
"public function prepareUpdate() {\n $this->connection->update($this->mapTable)\n ->fields(array('needs_update' => MigrateMap::STATUS_NEEDS_UPDATE))\n ->execute();\n }",
"function addItem(){\r\n// this means, lets say last week i created a item with code x. then i deleted it.(set lock_item=1)\r\n// today as that item_name doesnt exist anymore, i want to reuse it to another item. i cant do \r\n// insert item query as it will lead to unique index criteria erro. so i must update earlier row.\r\n// current addItem function only sets lock_item=0, but doesnt update other rows.\r\n\r\n\tglobal $item, $lab, $item_name, $cost, $status, $comments, $operation, $connection, $result, $bill_serial,\r\n\t$iv_serial, $product_code, $tequip, $vendor,$comments_sql, $item_name_sql, $product_code_sql;\r\n\tif($item==-1||$lab==-1||$bill_serial==-1){\r\n\t\taddToToast(\"please select Lab/Vendor/Apparatus from dropdown\",0);\r\n\t}\r\n\telse{ \r\n\t\t/*\t\t\tInserting items one by one \t\t\t\t*/\r\n\t\tforeach ($item_name_sql as $key => $value) {\r\n\t\t //checking if the item is presenet in the inventory\r\n\t\t\tif(!doesItemExist(\"inventory\", \"item_code\", $item_name_sql[$key])){ //if item is not present in inventory\r\n\t\t\t\t$query=\"\r\n\t\t\t\tINSERT INTO \r\n\t\t\t\tinventory (\tlab_serial, \r\n\t\t\t\tserial_item, \r\n\t\t\t\titem_code,\r\n\t\t\t\tproduct_code, \r\n\t\t\t\ttequip, \r\n\t\t\t\tcost, \r\n\t\t\t\tstatus,\r\n\t\t\t\treceipt_serial,\r\n\t\t\t\tlast_operation\r\n\t\t\t\t) \r\n\t\t\t\tvalues(\r\n\t\t\t\t{$lab},\r\n\t\t\t\t{$item}, \r\n\t\t\t\t'{$item_name_sql[$key]}',\r\n\t\t\t\t'{$product_code_sql[$key]}',\r\n\t\t\t\t{$tequip}, \r\n\t\t\t\t{$cost},\r\n\t\t\t\t{$status},\r\n\t\t\t\t{$bill_serial},\r\n\t\t\t\t{$operation}\r\n\t\t\t) \";\r\n\t\t\tperform_query($connection, $query, \"failed to insert into inventory\");\r\n\t\t\t\t // to insert into inventory log, but we need serial of that item_code\r\n\t\t\t$iv_serial=mysqli_insert_id($connection);\r\n\t\t\tinventoryLog();\r\n\t\t\taddToToast(\"Created new apparatus of name {$item_name[$key]} of cost {$cost}\",1);\r\n\t\t}\r\n\t\telse{ \t\t\r\n\t\t\t //if item is already present, it may be an error\r\n\t\t\t \t\t\t//probability is that the item may have been locked and now needs to be unlocked\r\n\t\t\t$row=mysqli_fetch_assoc($result);\r\n\t\t\tif(1==$row['lock_item']){\r\n\t\t\t\t$date= date(\"Y-m-d H:i:s\");\r\n\t\t\t\t$query=\"SELECT serial from inventory where item_code={$item_name_sql[$key]}\";\r\n\t\t\t\t$result=perform_query($connection, $query, \"failed to get serial\");\r\n\t\t\t\t$row=mysqli_fetch_assoc($result);\r\n\t\t\t\t$iv_serial=$row['serial'];\r\n\t\t\t\t$query=\"UPDATE \r\n\t\t\t\tinventory \r\n\t\t\t\tset \r\n\t\t\t\tlock_item=0, \r\n\t\t\t\tupdated='{$date}', \r\n\t\t\t\tlab_serial={$lab}, \r\n\t\t\t\tcost={$cost} \r\n\t\t\t\twhere \r\n\t\t\t\titem_code='{$item_name_sql[$key]}'\";\r\n\t\t\t\tperform_query($connection, $query, \"failed to update\");\r\n\t\t\t\t$comments.=\" item was unlocked\";\r\n\t\t\t\tinventoryLog();\r\n\t\t\t\taddToToast(\"{$comments}\",1);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\taddToToast(\"its already present \",0);\r\n\t\t}\t\r\n\t}\r\n\r\n} \r\n}",
"protected function _postUpdate()\n {\n \tif($this->_old_currency_code != $this->currency_code) {\n \t\t$pins = new \\Pin\\Pin();\n \t\t$pins->update(array(\n \t\t\t'currency_code' => $this->currency_code\t\t\n \t\t), array(\n \t\t\t'user_id = ?' => $this->user,\n \t\t\t'currency_code IS NOT NULL' => true\n \t\t));\n \t}\n }",
"function addUpdate() {\n\t\tif ($this->id) $this->update();\n\t\telse $this->insert();\n\t}",
"function restoreTable(&$new_values, &$changes, &$address, &$reference){\n\t$primary_key_field = $reference['PrimaryKey'];\n\t$active_table = $reference['ActiveTable'];\n\t//var_dump($reference, $address);\n\t//loop all information and save new data in the database\n\t$query = \"\"; $query_condition = \"\"; $field_counter = 0;\n\t$last_address_field = \"\";\n\tforeach($address as $field=>$location){\n\t\tif($field_counter++ > 0){\n\t\t\tif($primary_key_field != $last_address_field)\n\t\t\t\t$query .= \", \";\n\t\t\tif($field_counter > 2)\n\t\t\t\t$query_condition .= \" && \";\n\t\t} else\n\t\t\t$changes[$active_table][$field][$new_values[$location]] = PDB($new_values[$location],true, $con); //keep the same value of the first expected column to Primary Key of the table\n\t\t//check if the field has any other reference\n\t\t//var_dump($primary_key_field);\n\t\tif(@$reference[$field] && is_array($reference[$field]) && $changes[$reference[$field]['table']][($reference[$field]['Field'])][$new_values[$location]] ){\n\t\t\tif($primary_key_field != $field)\n\t\t\t\t$query .= \"`{$field}`='\".PDB($changes[$reference[$field]['table']][($reference[$field]['Field'])][$new_values[$location]],true,$con).\"'\";\n\t\t\tif($field_counter > 1)\n\t\t\t\t$query_condition .= \"`{$field}`='\".PDB($changes[$reference[$field]['table']][($reference[$field]['Field'])][$new_values[$location]],true,$con).\"'\";\n\t\t} else {\n\t\t\tif($primary_key_field != $field)\n\t\t\t\t$query .= \"`{$field}`='\".PDB($new_values[$location],true,$con).\"'\";\n\t\t\tif($field_counter > 1)\n\t\t\t\t$query_condition .= \"`{$field}`='\".PDB($new_values[$location],true,$con).\"'\";\n\t\t}\n\t\t$last_address_field = $field;\n\t}\n\t\n\t//echo $query_condition;\n\t//check if the row exist before after all formatting\n\tif(!$primary_key = returnSingleField($sql = \"SELECT `{$primary_key_field}` FROM `{$active_table}`\".($query_condition?\" WHERE \".$query_condition:\"\"),$primary_key_field,true,$con)){\n\t\t//echo $sql; echo \"<br />\";\n\t\t$primary_key = saveAndReturnID($sql = \"INSERT INTO `{$active_table}` SET {$query}\",$con);\n\t\t//echo $sql; echo \"<hr />\";\n\t}\n\t//echo $primary_key;\n\t//now set new replacement value in the change variable now\n\t$changes[$active_table][$primary_key_field][$new_values[$address[$primary_key_field]]] = $primary_key;\n}",
"function insertAllProducts($modul, $table, $primekey, $id, $columns, $aFieldsNumbers, $aChangedVersions, $addCondition='', $saveVer=array()){\n\tglobal $CONFIG, $insertAll;\n\t\n\t$date = new DateTime(); \n\t$now = $date->format('Y-m-d H:i:s');\n\t$now0 = '0000-00-00 00:00:00';\n\t\n\t$aListLanguagesByCountries = array();\n\t$aListDevices = array();\n\t$aSaveVersions = array();\n\n\tif(in_array(array(0,0,0), $aChangedVersions)){\n\t\t$aSaveVersions = $saveVer;\n\t}else{\n\t\t// if master has not changed, change only changed versions\n\t\t$aSaveVersions = $aChangedVersions;\n\t}\n\n\t\n\tforeach($aSaveVersions as $aVersion){\n\t\t$id_count = $aVersion[0];\n\t\t$id_lang = $aVersion[1];\n\t\t$id_dev = $aVersion[2];\n\t\t$id_clid = 0;\n\t\t\n\t\t// External variation\n\t\t$queryE = $CONFIG['dbconn']->prepare('\n\t\t\t\t\t\t\t\t\t\t\tSELECT ' . str_replace('##TYPE##', 'ext', $columns[0]) . ',\n\t\t\t\t\t\t\t\t\t\t\t\t' . str_replace('##TYPE##', 'extloc', $columns[1]) . ',\n\t\t\t\t\t\t\t\t\t\t\t\t' . str_replace('##TYPE##', 'loc', $columns[3]) . '\n\t\t\t\t\t\t\t\t\t\t\tFROM ' . $table . '_ext \n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN ' . $table . '_ext AS ' . $table . '_extloc\n\t\t\t\t\t\t\t\t\t\t\t\tON ' . $table . '_ext.' . $primekey . '=' . $table . '_extloc.' . $primekey . '\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND ' . $table . '_extloc.id_count = (:id_count)\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND ' . $table . '_extloc.id_lang = (:id_lang)\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND ' . $table . '_extloc.id_dev = (:id_dev)\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND ' . $table . '_extloc.id_clid = (:id_clid)\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND ' . $table . '_extloc.del = (:nultime) \n\t\t\t\t\t\t\t\t\t\t\t\t\t' . str_replace('##TYPE##', 'extloc', $addCondition) . '\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN ' . $table . '_loc \n\t\t\t\t\t\t\t\t\t\t\t\tON ' . $table . '_ext.' . $primekey . '=' . $table . '_loc.' . $primekey . '\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND ' . $table . '_loc.id_count = (:id_count)\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND ' . $table . '_loc.id_lang = (:id_lang)\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND ' . $table . '_loc.id_dev = (:id_dev)\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND ' . $table . '_loc.id_clid = (:id_clid)\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND ' . $table . '_loc.del = (:nultime) \n\t\t\t\t\t\t\t\t\t\t\t\t\t' . str_replace('##TYPE##', 'loc', $addCondition) . '\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tWHERE ' . $table . '_ext.id_count = (:nul)\n\t\t\t\t\t\t\t\t\t\t\t\tAND ' . $table . '_ext.id_lang = (:nul)\n\t\t\t\t\t\t\t\t\t\t\t\tAND ' . $table . '_ext.id_dev = (:nul)\n\t\t\t\t\t\t\t\t\t\t\t\tAND ' . $table . '_ext.id_clid = (:id_clid)\n\t\t\t\t\t\t\t\t\t\t\t\tAND ' . $table . '_ext.' . $primekey . ' = (:primekey)\n\t\t\t\t\t\t\t\t\t\t\t\tAND ' . $table . '_ext.del = (:nultime)\n\t\t\t\t\t\t\t\t\t\t\t\t' . str_replace('##TYPE##', 'ext', $addCondition) . '\n\t\t\t\t\t\t\t\t\t\t\t');\n\t\t$queryE->bindValue(':primekey', $id, PDO::PARAM_INT);\n\t\t$queryE->bindValue(':id_count', $id_count, PDO::PARAM_INT);\n\t\t$queryE->bindValue(':id_lang', $id_lang, PDO::PARAM_INT);\n\t\t$queryE->bindValue(':id_dev', $id_dev, PDO::PARAM_INT);\n\t\t$queryE->bindValue(':id_clid', $id_clid, PDO::PARAM_INT);\n\t\t$queryE->bindValue(':nul', 0, PDO::PARAM_INT);\n\t\t$queryE->bindValue(':nultime', '0000-00-00 00:00:00', PDO::PARAM_STR);\n\t\t$queryE->execute();\n\t\t$rowsE = $queryE->fetchAll(PDO::FETCH_ASSOC); \n\t\t$numE = $queryE->rowCount();\n\t\tif($numE > 0){\n\t\t\tforeach($rowsE[0] as $k=>$v){\n\t\t\t\tif(substr_count($k, '_extloc') == 0 && substr_count($k, '_locall') == 0 && substr_count($k, '_locloc') == 0){\n\t\t\t\t\tif(isset($rowsE[0][$k.'_extloc'])){\n\t\t\t\t\t\tif((!in_array($k, $aFieldsNumbers) && $rowsE[0][$k.'_extloc'] != \"\") || (in_array($k, $aFieldsNumbers) && $rowsE[0][$k.'_extloc'] > 0)) $rowsE[0][$k] = $rowsE[0][$k.'_extloc'];\n\t\t\t\t\t\t//unset($rowsE[0][$k.'_extloc']);\n\t\t\t\t\t}\n\t\t\t\t\tif(isset($rowsE[0][$k.'_locloc'])){\n\t\t\t\t\t\tif((!in_array($k, $aFieldsNumbers) && $rowsE[0][$k.'_locloc'] != \"\") || (in_array($k, $aFieldsNumbers) && $rowsE[0][$k.'_locloc'] > 0)) $rowsE[0][$k] = $rowsE[0][$k.'_locloc'];\n\t\t\t\t\t\t//unset($rowsE[0][$k.'_locloc']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\n\t\tif($numE > 0){\n\t\t\t$col2 = '';\n\t\t\t$value2 = '';\n\t\t\t$upd2 = \"\";\n\t\t\tforeach($rowsE[0] as $key2 => $val2){\n\t\t\t\tif(substr_count($key2, '_extloc') == 0 && substr_count($key2, '_locall') == 0 && substr_count($key2, '_locloc') == 0){\n\t\t\t\t\t$col2 .= ', ' . $key2;\n\t\t\t\t\t$value2 .= ', \"' . str_replace('\"', '\\\"', $val2) . '\"';\n\t\t\t\t\t$upd2 .= $key2.' = \"' . str_replace('\"', '\\\"', $val2) . '\", ' ;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$query = 'INSERT INTO ' . $table . '_uni ';\n\t\t\t$query .= '(id_count, id_lang, id_dev, id_clid, create_at, create_from, change_from' . $col2 . ') ';\n\t\t\t$query .= 'VALUES ';\t\t\t\t\t\n\t\t\t$query .= '('.$id_count.', '.$id_lang.', '.$id_dev.', '.$id_clid.', \"'.$now0.'\", '.$CONFIG['USER']['id_real'].', '.$CONFIG['USER']['id_real']. $value2 . ') '; \n\t\t\t$query .= 'ON DUPLICATE KEY UPDATE ';\t\n\t\t\t$query .= '' . $upd2 . ' change_from='.$CONFIG['USER']['id_real'].', del=\"0000-00-00 00:00:00\";';\n\t\t\t$insertAll .= $query . '\n';\n\t\t}\n\t}\n}",
"function blightReset()\n{\n\t$db = blightDB();\n\t$sessid = GWF_Session::getSession()->getID();\n\t$hash = GWF_Random::randomKey(32, 'ABCDEF0123456789');\n\t$query = \"REPLACE INTO blight VALUES($sessid, '$hash', 0)\";\n\treturn $db->queryWrite($query);\n}",
"private function updateUndoMd5()\n\t{\n\t\t$this->undoMd5 = $this->getUndoMd5();\n\t}",
"public function prepDatabases () {\n\t\tforeach( $this->wikiDBs as $wikiID => $db ) {\n\n\t\t\t$this->output( \"\\n#\\n# Adding initial offset to user IDs in $wikiID\\n#\" );\n\n\t\t\t$prepTables = $this->tablesToModify\n\t\t\t\t+ array( \"user\" => $this->userTable )\n\t\t\t\t+ array( \"user_properties\" => $this->userPropsTable );\n\n\t\t\tforeach ( $prepTables as $tableName => $tableInfo ) {\n\t\t\t\t$idField = $tableInfo['idField'];\n\t\t\t\t$db->query( \"UPDATE $tableName SET $idField = $idField + $this->initialOffset WHERE $idField != 0 AND $idField IS NOT NULL\" );\n\t\t\t}\n\n\t\t\t$db->query( \"UPDATE ipblocks SET ipb_user = ipb_user + $this->initialOffset WHERE ipb_user != 0 AND ipb_user IS NOT NULL\");\n\t\t\t$db->query( \"UPDATE ipblocks SET ipb_by = ipb_by + $this->initialOffset WHERE ipb_by != 0 AND ipb_by IS NOT NULL\");\n\n\t\t\t// DROP external_user table. See https://www.mediawiki.org/wiki/Manual:External_user_table\n\t\t\t$db->query( \"DROP TABLE IF EXISTS external_user\" );\n\n\t\t}\n\t}",
"public function needsIncrementOffset();",
"public function clobberPassword()\n\t{\n\t\tif( empty($this->myAuthID) && empty($this->myAccountID) )\n\t\t\tthrow PasswordResetException::toss( $this, 'NO_ACCOUNT_OR_AUTH_ID' ) ;\n\t\tif( empty($this->myNewToken) )\n\t\t\tthrow PasswordResetException::toss( $this, 'REENTRY_AUTH_FAILED' ) ;\n\t\t$theAuthFilter = $this->chooseIdentifierForSearch() ;\n\t\t$theSql = SqlBuilder::withModel( $this->model )\n\t\t\t->startWith( 'UPDATE ' )->add( $this->model->tnAuth )\n\t\t\t->setParamPrefix( ' SET ' )\n\t\t\t->mustAddParam( 'pwhash',\n\t\t\t\t\tStrings::hasher( $this->getRandomCharsFromToken() ) )\n\t\t\t->startWhereClause()\n\t\t\t->mustAddParam( $theAuthFilter['col'], $theAuthFilter['val'] )\n\t\t\t->endWhereClause()\n\t\t\t;\n//\t\t$this->debugLog( $theSql->mySql ) ;\n\t\ttry { $theSql->execDML() ; }\n\t\tcatch( PDOException $pdox )\n\t\t{\n\t\t\t$this->errorLog( __METHOD__ . ': ' . $pdox->getMessage() ) ;\n\t\t\tthrow PasswordResetException::toss( $this,\n\t\t\t\t\t'DANG_PASSWORD_YOU_SCARY' ) ;\n\t\t}\n\t}",
"function build_bitwise_swap($profilefieldid, $loc1, $loc2)\n{\n\n\tglobal $vbulletin;\n\n\t$loc1value = pow(2, $loc1 - 1);\n\t$loc2value = pow(2, $loc2 - 1);\n\n\t// Zero loc1 in temp field\n\t$vbulletin->db->query_write(\"\n\t\tUPDATE \" . TABLE_PREFIX . \"userfield\n\t\tSET temp = temp - $loc1value\n\t\tWHERE temp & $loc1value\n\t\");\n\t// Copy loc2 to loc1\n\t$vbulletin->db->query_write(\"\n\t\tUPDATE \" . TABLE_PREFIX . \"userfield\n\t\tSET temp = temp + $loc1value\n\t\tWHERE temp & $loc2value\n\t\");\n\t// Zero loc2 in temp field\n\t$vbulletin->db->query_write(\"\n\t\tUPDATE \" . TABLE_PREFIX . \"userfield\n\t\tSET temp = temp - $loc2value\n\t\tWHERE temp & $loc2value\n\t\");\n\t// Copy loc1 from perm field to loc2 temp field\n\t$vbulletin->db->query_write(\"\n\t\tUPDATE \" . TABLE_PREFIX . \"userfield\n\t\tSET temp = temp + $loc2value\n\t\tWHERE field$profilefieldid & $loc1value\n\t\");\n\n}",
"public function testPatchAlreadyApplied() {\n $sink = new Sink;\n $sink->table('ut_pop');\n $sink->initialize();\n\n DB::insert('db_deltas', array('file'))\n ->values(\n array('01-ut_pop-add_column'),\n array('02-ut_pop-add_column')\n )->execute();\n $sink->patch($available, $applied);\n\n $this->assertArrayHasKey('ut_pop', $available);\n $this->assertEquals(2, count($available['ut_pop']));\n\n $this->assertEquals(0, count($applied));\n }",
"public function testUpdateConflict() {\n\t\tself::$sag->put(\"foo\", self::$temp);\n\t}",
"protected function beforeInsert() {\n\t\t$lookup = new LookupImageCodeDao();\n\t\t$lookup->setCode($this->getCode());\n\t\t$lookup->setImageId($this->getId());\n\t\t$lookup->setProjectId($this->getProjectId());\n\t\t$lookup->save();\n\t}",
"protected function _postUpdate()\n\t{\n\t\t$pinTable = new \\Pin\\Pin();\n\t\t$wishlistTable = new \\Wishlist\\Wishlist();\n\t\t$userTable = new \\User\\User();\n\t\t$pinLikeTable = new \\Pin\\PinLike();\n\n\t\tif(array_key_exists('status', $this->_modifiedFields)) {\n\t\t\t//wishlist status change\n\t\t\t$wishlistTable->update(array('status'=>$this->status), array('user_id = ?' => $this->id));\n\t\t\t//pin status change\n\t\t\t$pinTable->update(array('status'=>$this->status), array('user_id = ?' => $this->id));\n\t\t\t//pin like status change\n\t\t\t$pinLikeTable = new \\Pin\\PinLike();\n\t\t\t$pinLikeTable->update(array('status'=>$this->status), array('user_id = ?' => $this->id));\n\t\t\t$userTable->update(array(\n\t\t\t\t\t'likes' => new \\Core\\Db\\Expr('('.$pinLikeTable->select()->from($pinLikeTable,'count(1)')->where('pin_like.user_id = user.id AND pin_like.status = 1').')')\n\t\t\t), array('status = ?' => 1));\n\t\t\t//follow\n\t\t\t$followWishlistTable = new \\Wishlist\\WishlistFollow();\n\t\t\t$followIgnoreWishlistTable = new \\Wishlist\\WishlistFollowIgnore();\n\t\t\t$followUserTable = new \\User\\UserFollow();\n\t\t\t$followWishlistTable->update(array('status' => $this->status), array('user_id = ? OR follow_id = ?' => $this->id));\n\t\t\t$followIgnoreWishlistTable->update(array('status' => $this->status), array('user_id = ? OR follow_id = ?' => $this->id));\n\t\t\t$followUserTable->update(array('status' => $this->status), array('user_id = ? OR follow_id = ?' => $this->id));\n\t\t}\n\t\t\n\t\tif(array_key_exists('public', $this->_modifiedFields)) {\n\t\t\t$wishlistTable->update(array('public'=>$this->public), array('user_id = ?' => $this->id));\n\t\t\t$pinTable->update(array('public'=>$this->public), array('user_id = ?' => $this->id));\n\t\t\t$pinLikeTable = new \\Pin\\PinLike();\n\t\t\t$pinLikeTable->update(array('status'=>3), array('user_id = ?' => $this->id));\n\t\t\t$userTable->update(array(\n\t\t\t\t\t'likes' => new \\Core\\Db\\Expr('('.$pinLikeTable->select()->from($pinLikeTable,'count(1)')->where('pin_like.user_id = user.id AND pin_like.status = 1').')')\n\t\t\t), array('status = ?' => 1));\n\t\t}\n\n\t\t$userTable->updateInfo($this->id);\n\t\t\n\t\t\\Base\\Event::trigger('user.update',$this->id);\n\n\t}",
"function myPear_update11(){\n myPear_db()->qquery(\"UPDATE zzz_avatars SET av_address = '' WHERE (av_address != '' AND av_address IS NOT NULL)\",1);\n if (!myPear_db()->columnExists('av_zip','zzz_avatars')){\n myPear_db()->qquery(\"ALTER TABLE `zzz_avatars` ADD `av_zip` VARCHAR( 132 ) NOT NULL DEFAULT '' AFTER `av_address`\"); \n myPear_db()->reset_cache();\n }\n if (!myPear_db()->columnExists('l_class','zzz_lists')){\n myPear_db()->qquery(\"ALTER TABLE `zzz_lists` ADD `l_class` VARCHAR( 64 ) NOT NULL AFTER `l_parent`\",1);\n myPear_db()->qquery(\"ALTER TABLE `zzz_units` ADD `u_class` VARCHAR( 64 ) NOT NULL AFTER `u_parent`\",1); \n myPear_db()->reset_cache();\n } \n}",
"private function reload()\n {\n $p = 0;\n for ($i = self::N - self::M; $i--; ++$p) {\n $m = $this->state['mt'][$p + self::M];\n $u = $this->state['mt'][$p];\n $v = $this->state['mt'][$p + 1];\n $this->state['mt'][$p] = ($m ^ ((($u & 0x80000000) | ($v & 0x7fffffff)) >> 1) ^ (-($u & 0x00000001) & 0x9908b0df));\n }\n for ($i = self::M; --$i; ++$p) {\n $m = $this->state['mt'][$p + self::M - self::N];\n $u = $this->state['mt'][$p];\n $v = $this->state['mt'][$p + 1];\n $this->state['mt'][$p] = ($m ^ ((($u & 0x80000000) | ($v & 0x7fffffff)) >> 1) ^ (-($u & 0x00000001) & 0x9908b0df));\n }\n $m = $this->state['mt'][$p + self::M - self::N];\n $u = $this->state['mt'][$p];\n $v = $this->state['mt'][0];\n $this->state['mt'][$p] = ($m ^ ((($u & 0x80000000) | ($v & 0x7fffffff)) >> 1) ^ (-($u & 0x00000001) & 0x9908b0df));\n\n $this->state['left'] = self::N;\n $this->state['next'] = 0;\n }",
"function update_wallet($cust_id,$amount,$sale_id,$user_id,$sale_type){\n\tglobal $connection; \n\t$trans=\"CUSTOMER PAID UPFRONT\"; \n\t$update_wallet=mysqli_query($connection,\"INSERT INTO kp_sc (cust_id,amount) VALUES ('$cust_id', '$amount') ON DUPLICATE KEY UPDATE amount=amount+'$amount'\") or die(mysqli_error($connection));\n\n\tif ($update_wallet) {\n\t\t$create_history = mysqli_query($connection,\"INSERT INTO kp_sc_hist(cust_id,amount,trans,user_id,trans_id,trans_type,day) \n\t\tVALUES('$cust_id','$amount','$trans','$user_id','$sale_id','$sale_type',CURRENT_DATE)\") or die(mysqli_error($connection));\n\t}else{\n\t\t error_logs(\"PAY CREDIT ORDER\",\"COULDN'T UPDATE WALLET FOR SALE ID $sale_id\");\n\t}\n\t\n}",
"function AddUpdateOptionBOMItem($BID, $opId, $arryDetails,$index) {//$option_ID,//\r\n global $Config;\r\n extract($arryDetails);\r\n //print_r($arryDetails);//die;\r\n \r\n if ($opId == '') {\r\n $strUpSQLQuery = \"update inv_bill_of_material set \r\n\t\t\t\ttotal_cost='\" . $TotalValue . \"',\r\n\t\t\t\tUpdatedDate = '\" . $Config['TodayDate'] . \"'\r\n\t\t\t\twhere bomID='\" . $BID.\"'\";\r\n //echo $strUpSQLQuery ;die;\r\n\r\n $this->query($strUpSQLQuery, 0);\r\n }\r\n \r\n \r\n for ($j = 1; $j<=$arryDetails['newNumberLine'.$index.'']; $j++) {\r\n \r\n if (!empty($arryDetails[\"newsku$index-$j\"])) {\r\n \r\n $id = $arryDetails[\"newid$index-$j\"];\r\n //print_r($id);\r\n if ($id > 0) {\r\n $sql = \"update inv_item_bom set orderby = '\".$arryDetails[\"orderby$index-$j\"].\"', item_id='\" . $arryDetails[\"newitem_id$index-$j\"] . \"', sku='\" . addslashes($arryDetails[\"newsku$index-$j\"]) . \"',`Primary`='\" .$arryDetails[\"Primary$index-$j\"] . \"', description='\" . addslashes($arryDetails[\"newdescription$index-$j\"]) . \"', wastageQty='\" . addslashes($arryDetails[\"newWastageqty$index-$j\"]) . \"', bom_qty='\" . addslashes($arryDetails[\"newqty$index-$j\"]) . \"', unit_cost='\" . addslashes($arryDetails[\"newprice$index-$j\"]) . \"', total_bom_cost='\" . addslashes($arryDetails[\"newamount$index-$j\"]) . \"',`Condition`='\" . addslashes($arryDetails[\"newCondition$index-$j\"]) . \"',req_item='\" . addslashes($arryDetails[\"newreq_item$index-$j\"]) . \"' where id='\" . $id.\"'\"; \r\n $this->query($sql, 0);\r\n } \r\n else {\r\n $sql = \"insert into inv_item_bom (bomID,optionID, item_id, sku, description, wastageQty, bom_qty, unit_cost, total_bom_cost,`Condition`,req_item,orderby,`Primary`) values('\" . $BID . \"','\" . $opId . \"','\" . $arryDetails[\"newitem_id$index-$j\"] . \"', '\" . addslashes($arryDetails[\"newsku$index-$j\"]) . \"', '\" . addslashes($arryDetails[\"newdescription$index-$j\"]) . \"', '\" . addslashes($arryDetails[\"newWastageqty$index-$j\"]) . \"', '\" . addslashes($arryDetails[\"newqty$index-$j\"]) . \"', '\" . addslashes($arryDetails[\"newrice$index-$j\"]) . \"','\" . addslashes($arryDetails[\"newamount$index-$j\"]) . \"','\" . addslashes($arryDetails[\"newCondition$index-$j\"]) . \"','\" . addslashes($arryDetails[\"newreq_item$index-$j\"] ). \"', orderby = '\".$arryDetails[\"orderby$index-$j\"].\"','\" . addslashes($arryDetails[\"Primary$index-$j\"]) . \"')\";\r\n $this->query($sql, 0);\r\n \r\n }\r\n \r\n }\r\n \r\n \r\n }\r\n //die;\r\n return true;\r\n }",
"public function testItemQtyUpdate()\n {\n $item = $this->addItem();\n $itemHash = $item->getHash();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n\n $this->assertEquals(7, $item->qty);\n $this->assertEquals($itemHash, $item->getHash());\n\n $options = [\n 'a' => 2,\n 'b' => 1\n ];\n\n $item = $this->addItem(1, 1, false, $options);\n $this->addItem(1, 1, false, array_reverse($options));\n\n $this->assertEquals(2, $item->qty);\n }",
"private function addNewMix()\n {\n $this->db->beginTransaction();\n\n $department = $this->getDepartment();\n\n if (!isset($this->facility_id)) {\n $this->facility_id = $department->getFacilityID();\n unset($this->facility);\n }\n\n $facility = $this->getFacility();\n $user = new User($this->db);\n\n /* if company use module ReductionScheme we should check and correct solvent outputs */\n if ($user->checkAccess('reduction', $facility->getCompanyID())) {\n $this->correctSolventOutputInReductionScheme();\n }\n\n $insertQuery = $this->getInsertMixQuery();\n if (!$this->db->query($insertQuery)) {\n $this->db->rollbackTransaction();\n return false;\n }\n $mixID = $this->db->getLastInsertedID();\n\n if ($this->products && is_array($this->products) && count($this->products) > 0) {\n $insertProductsQuery = $this->getInsertProductsQuery($mixID);\n if (!$this->db->query($insertProductsQuery)) {\n $this->db->rollbackTransaction();\n return false;\n }\n } else {\n //\twe should not save mix without products\n $this->db->rollbackTransaction();\n return false;\n }\n\n\n $this->db->commitTransaction();\n\n $this->mix_id = $mixID;\n //\tsave to trash_bin\n $this->save2trash('C', $this->mix_id);\n return $mixID;\n }",
"public function increase()\n {\n $reservedIds = [];\n if ($this->reserved !== null) {\n $reservedIds = explode(',', $this->reserved);\n }\n $this->next++;\n while (in_array($this->next, $reservedIds)) {\n $this->next++;\n }\n $this->save();\n }",
"public function setValueBitColumns()\n {\n // Get BIT columns\n $columns = $this->Model->bitColumns;\n foreach ($columns as $column) {\n $this->Request[$column] = (isset($this->Request[$column])) ? 1 : 0;\n }\n }",
"public static function storeBin ($request)\n {\n $bin_transfer = new BinTransfer;\n $bin_transfer->transferred_date = date('Y-m-d', strtotime($request->get('transfer_date')));\n $bin_transfer->location_id = $request->get('location');\n $bin_transfer->created_by = '1';\n $bin_transfer->memo = $request->get('memo');\n $bin_transfer->dt_created = date('Y-m-d, H:i:s');\n $bin_transfer->status = 'Active';\n\n if ($bin_transfer->save()) {\n $new_bin_transfer = self::find($bin_transfer->bin_transfer_id);\n $new_bin_transfer->reference_no = 'BT00000000' . $bin_transfer->bin_transfer_id;\n\n if ($new_bin_transfer->update()) {\n\n $item_id = $request->get('item_id');\n $quantity = $request->get('quantity');\n $bin_qty = $request->get('bin_quantity');\n $from_bin_id = $request->get('from_bin_id');\n $to_bin_id = $request->get('to_bin_id');\n\n for ($i=0; $i<count($item_id); $i++) {\n $bin_items = new BinItems;\n $bin_items->item_id = $item_id[$i];\n $bin_items->location_id = $request->get('location');\n $bin_items->quantity = $quantity[$i];\n $bin_items->bin_id = '1';\n $bin_items->created_by = '1';\n $bin_items->dt_created = date('Y-m-d, H:i:s');\n $bin_items->status = 'Active';\n\n if ($bin_items->save()) {\n if (array_key_exists($item_id[$i], $from_bin_id)) {\n $bin_transfered_item = new BinItransferredItems;\n $bin_transfered_item->bin_transfer_id = $bin_transfer->bin_transfer_id;\n $bin_transfered_item->item_id = $item_id[$i];\n $bin_transfered_item->from_bin_id = $from_bin_id[$item_id[$i]];\n $bin_transfered_item->to_bin_id = $to_bin_id[$item_id[$i]];\n $bin_transfered_item->quantity = $bin_qty[$item_id[$i]];\n $bin_transfered_item->created_by = '1';\n $bin_transfered_item->dt_created = date('Y-m-d, H:i:s');\n $bin_transfered_item->status = 'Active';\n $bin_transfered_item->save();\n } else {\n continue;\n }\n }\n }\n return true;\n }\n } else {\n return false;\n }\n }",
"function update_r1115() {\n\t// won't be able to login.\n\n\t$r = q(\"update account set account_flags = (account_flags ^ 1) where (account_flags & 1) \");\n\treturn UPDATE_SUCCESS;\n}",
"public function testInsertAndUpdateNothing()\n {\n // return empty api result (loadByNationality)\n $apiProvider = $this->tester->getApiProvider(true);\n\n $importer = new \\App\\Service\\CustomersImporter(\n $apiProvider,\n $this->denormalizer,\n $this->repository\n );\n\n $this->assertEquals(\n [\n 'inserted' => 0,\n 'updated' => 0,\n ],\n $importer->import()\n );\n }",
"function addPayment($data) {\n //Sample code from the reference\n $db = configDB();\n\t$q2 = $db->prepare('SELECT pid FROM products WHERE name = ?');\n if (is_array($data)) {\n\t\t// TODO: reconstruct the hash using the same algorithm\n $q = $db->prepare('UPDATE payment_info SET txnid = ?, payment_status = ? WHERE payment_amount = ? AND order_hash = ? AND order_id = ?');\n\t\t$q3 = $db->prepare('SELECT order_salt FROM payment_info WHERE payment_amount = ? AND itemid = ? AND order_id = ?');\n\t\t$temp_cart_content = '';\n\t\t$salt = '';\n\t\tfor($k = 1; $k<1000; $k++){\n\t\t\tif(array_key_exists(\"item_name_\".$k, $data) == true){\n\t\t\t\t$res = $q2->execute(array($data[\"item_name_\".$k]));\n\t\t\t\t$temp = $q2->fetchAll();\n\t\t\t\t//error_log(print_r($temp, true));\n\t\t\t\tif(count($temp)==0){\n\t\t\t\t\t$temp_cart_content.= 999;\n\t\t\t\t}else{\n\t\t\t\t\t$temp_cart_content .= $temp[0][\"pid\"];\n\t\t\t\t}\n\t\t\t\t$temp_cart_content .= \",\";\n\t\t\t\t$temp_cart_content .= $data[\"quantity_\".$k];\n\t\t\t\t// $temp_cart_content .= '1';\n\t\t\t\t$temp_cart_content .= \"@\";\n\t\t\t}else{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// $temp_cart_content = \"123\";\n\t\terror_log(print_r($temp_cart_content, true));\n\t\t$return_salt = '0';\n\t\t//CAST($data['payment_amount'] AS DECIMAL(10,1))\n\t\tif($q3->execute(array($data['payment_amount'], $temp_cart_content, $data['invoice']))){\n\t\t\t$return_salt = $q3->fetchAll();\n\t\t\t// error_log(print_r($return_salt, true));\n\t\t\tif(count($return_salt)==0){\n\t\t\t\t$return_salt = '0';\n\t\t\t}else{\n\t\t\t\t$return_salt = $return_salt[count($return_salt)-1][\"order_salt\"];\n\t\t\t}\n\t\t}\n\t\terror_log(print_r($return_salt, true));\n\t\t//$digest = hash(\"sha256\",$currency.\"|\".$email.\"|\".$salt.$shopping_cart_content.\"|\".$total_price, false);\n\t\t$recalculate_hash = hash(\"sha256\",$data['payment_currency'].\"|\".$data['receiver_email'].\"|\".$return_salt.$temp_cart_content.\"|\".$data['payment_amount'], false);\n\t\terror_log(print_r($recalculate_hash, true));\n\t\t// $date = new DateTime(\"now\", new DateTimeZone('Asia/Hong_Kong') );\n // $current_time = $date->format('Y-m-d H:i:s');\n if($q->execute(array($data['txn_id'], $data['payment_status'], $data['payment_amount'], $recalculate_hash, $data['invoice'])))\n \treturn $q->rowCount();\n }\n\n return false;\n}",
"public function testUpdateChangesInputInDatabase()\n {\n $transaction = factory(Transaction::class)->states('with_account')->create();\n $transactionArray = $transaction->toArray();\n $transactionArray['amount'] = 155.49;\n\n $updatedTransaction = $this->repository->update($transactionArray, $transaction->id);\n\n $this->assertEquals($transaction->id, $updatedTransaction->id);\n $this->assertDatabaseHas('transactions', array_add($transactionArray, 'id', $updatedTransaction->id));\n }",
"abstract protected function _regenerate();",
"public function safeUp()\n\t{\n $numbers=$this->dbConnection->createCommand(\"select distinct number from sim where operator_id=2\")->queryColumn();\n $processed=0;\n foreach($numbers as $n) {\n $number=Number::model()->findByAttributes(array('number'=>$n));\n if (!$n) {\n echo \"can't find number '$n'\";\n continue;\n }\n MegafonBalanceEmailImporter::recalcNumberBalanceStatus($number);\n $processed++;\n if ($processed%100==0) {\n echo \"processed $processed/\".count($numbers).\"\\n\";\n }\n }\n\t}",
"function update_sqliTransaction($update_query, $table, $expectedResult){\n $connection = updateConnectionString();\n mysqli_autocommit($connection,FALSE);\n mysqli_query($connection,\"start transaction\"); \n \n $sql = \"Select * FROM $table\";\n $result = mysqli_query($connection,$sql); \n $rowsBefore = mysqli_num_rows($result);\n \n $queryresult = mysqli_query($connection, $update_query) \n or die(mysqli_error($connection));\n $affectedRows = mysqli_affected_rows($connection);\n \n $sql = \"Select * FROM $table\";\n $result = mysqli_query($connection,$sql); \n $rowsAfter = mysqli_num_rows($result);\n \n if(($rowsBefore != $rowsAfter) || ($affectedRows != $expectedResult)){\n if($affectedRows != 0){\n include(\"logs/logsMail.php\");\n mysqli_query($connection,\"rollback\");\n }else{\n mysqli_query($connection,\"commit\");\n } \n }else{\n mysqli_query($connection,\"commit\");\n }\n mysqli_close($connection);\n return $queryresult;\n }",
"function renumberTagTableOffset($baseOffset) {\n $baseSize = 2 + count($this->tagTable) * (2+2+4+4);\n $extendOffset = $baseOffset + $baseSize;\n $extendSize = 0;\n foreach ($this->tagTable as $tag) {\n ;\n } \n //\n $this->baseOffset = $baseOffset;\n $this->baseSize = $baseSize;\n $this->extendOffset = $extendOffset;\n $this->baseSize = $baseSize;\n }",
"private function copyData()\n {\n $connection = Yii::app()->db;\n $transaction = $connection->beginTransaction();\n try {\n $connection->createCommand('INSERT INTO ' . $connection->quoteTableName($this->tableMemory) . ' SELECT * FROM ' . $connection->quoteTableName($this->table))->execute();\n $transaction->commit();\n return true;\n } catch (Exception $e) {\n Yii::log('Transaction error: ' . print_r($e->getMessage(), true), 'error', 'extensions.CodMtfs.Mtfs');\n $transaction->rollback();\n }\n }",
"public function reset_pin_no_put ()\r\n {\r\n $reset_pin = $this->uri->segment(3);\r\n $table = STAFF_TB;\r\n $table_prefix = '';\r\n $function_name = $this->getFunctionName ( __FUNCTION__ );\r\n $columns = 'reset_pin,pin';\r\n $params = array();\r\n $params['table'] = $table;\r\n $params['function_name'] = $function_name;\r\n $params['columns'] = $columns;\r\n $params['table_prefix'] = $table_prefix;\r\n $params['id'] = $reset_pin;\r\n $params['id_col'] = 'reset_pin';\r\n $params['success_message'] = COMMON_STAFF_UPDATE;\r\n $this->_update_common_table($params);\r\n }",
"public function insert() {\n $this->observer->idchangemoney = $this->connection->insert(\"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), $this->user->iduser);\n }",
"public function testaddCoinsToUser(){\n $old_coins = R::getCell('SELECT coins FROM user WHERE id = 1');\n addCoinsToUser(1, 50);\n $new_coins = R::getCell('SELECT coins FROM user WHERE id = 1');\n $this->assertEquals($old_coins + 50, $new_coins);\n R::exec('UPDATE user SET coins = '.$old_coins.' WHERE id = 1');\n }",
"function db_install_302p1()\n{\n $oDb = Phpfox::getLib('database');\n\n if (!$oDb->isField(Phpfox::getT('advancedmarketplace'), 'total_dislike'))\n {\n $oDb->query(\"ALTER TABLE `\" . Phpfox::getT('advancedmarketplace') . \"`\n ADD `total_dislike` int(10) unsigned NOT NULL DEFAULT '0' AFTER `total_like` \");\n }\n\n if (!$oDb->isField(Phpfox::getT('advancedmarketplace'), 'is_notified'))\n {\n $oDb->query(\"ALTER TABLE `\" . Phpfox::getT('advancedmarketplace') . \"`\n ADD `is_notified` tinyint(1) NOT NULL DEFAULT '0' AFTER `auto_sell` \");\n }\n}",
"public function testInsertingNewTransaction()\n {\n putenv('DB_CONNECTION=sqlite_testing');\n\n $user = factory(\\App\\User::class)->make();\n\n $this->be($user);\n\n $user->save();\n\n $item = factory(\\App\\item::class)->make();\n\n $item->save();\n\n Log::shouldReceive('info');\n\n $repository = new Repositories\\TransactionRepository(new Transaction);\n $repository->insert($user->email, $item->id, '', 0);\n\n $this->assertDatabaseHas('transactions', [\n 'email' => $user->email,\n 'item_fk'=>$item->id,\n 'tokens_spent'=>0\n ]);\n }",
"public function updateDatabase(){\n\n\t\t$newdir = NEW_DIRECTORY;\n\t\tif(!file_exists($newdir)){\n\t\t\techo \"Please configure NEW_DIRECTORY in config/constants.php\";\n\t\t\tbreak;\n\t\t}\n\t\t\t\n\t\t$newlist = scandir($newdir);\n\n\n\t\tforeach($newlist as $pack){\n\t\t\tif(strlen($pack) > 2){\n\t\t\t\t$file = $newdir.$pack;\n\t\t\t\t$info = pathinfo($file);\n\t\t\t\t$name = $this->db->escape($info['filename']);\n\t\t\t\t$type = $this->db->escape(@$info['extension']);\n\t\t\t\t//If there is an extension then add it to db;\n\t\t\t\tif ($type == \"'zip'\" || $type == \"'rar'\"){\n\t\t\t\t\t$filesize = filesize($file);\n\t\t\t\t\t$sql = \"INSERT IGNORE into Packs (`packname`, `filetype`, `size_bytes`) VALUES ($name, $type, '$filesize')\";\n\t\t\t\t\t//DB Insert, packname is UNIQUE.\n\t\t\t\t\t$this->db->query($sql);\n\t\t\t\t}\n\t\t\t}//end packname greater then 2 charactors. (. and .. directories)\n\n\t\t}\n\techo \"All 'new' packs added to database and marked for scanning.\\n\";\n\t}",
"private function insert_dummy_version_data($data)\n {\n foreach ($data as $version) {\n $insert_sql = sprintf(\"INSERT INTO %s (version) VALUES ('%s')\", RUCKUSING_TS_SCHEMA_TBL_NAME, $version);\n $this->adapter->query($insert_sql);\n }\n }",
"protected function _insert()\n {\n \n }",
"protected function _insert()\n {\n \n }",
"public function registerIPDtoIBO($member_id, $upline_id, $endorser_id, $new_activation_code)\n {\n $connection = $this->_connection;\n $beginTrans = $connection->beginTransaction();\n \n $old_activation_code = $this->selectActivationCodeById($member_id);\n \n try\n {\n $sql = \"UPDATE members \n SET account_type_id = 3,\n upline_id = :upline_id,\n endorser_id = :endorser_id,\n activation_code = :activation_code\n WHERE member_id = :member_id\";\n $command = $connection->createCommand($sql);\n $command->bindValue(':member_id', $member_id);\n $command->bindValue(':upline_id', $upline_id);\n $command->bindValue(':endorser_id', $endorser_id);\n $command->bindValue(':activation_code', $new_activation_code);\n $rowCount = $command->execute();\n \n if ($rowCount > 0) \n {\n $sql2 = \"INSERT INTO member_migration_logs (member_id, from_account_type_id, to_account_type_id, old_activation_code, new_activation_code)\n VALUES (:member_id, :from_account_type_id, :to_account_type_id, :old_activation_code, :new_activation_code)\";\n $command2 = $connection->createCommand($sql2);\n $command2->bindValue(':member_id', $member_id);\n $command2->bindValue(':from_account_type_id', 5);\n $command2->bindValue(':to_account_type_id', 3);\n $command2->bindValue(':old_activation_code', $old_activation_code);\n $command2->bindValue(':new_activation_code', $new_activation_code);\n $rowCount2 = $command2->execute();\n \n if ($rowCount2 > 0)\n {\n $beginTrans->commit();\n return true;\n }\n else\n {\n $beginTrans->rollback(); \n return false;\n }\n } \n else\n {\n $beginTrans->rollback(); \n return false;\n }\n }\n catch (CDbException $e)\n {\n $beginTrans->rollback(); \n return false;\n }\n }",
"public function testReplace()\n {\n $value = uniqid();\n $metaInfo = Metainfo::fromValue('test', $value);\n $metaInfo->setPackage($this->package);\n \n $this->repo->save($metaInfo, true);\n \n $remaining = $this->repo->findAll();\n $this->assertCount(1, $remaining);\n $info = current($remaining);\n $this->assertEquals($value, $info->getValue());\n }",
"public function alterExtensionTable() {\n\t$query = $this->db->query(\"DELETE FROM `\".DB_PREFIX.\"extension` WHERE type='module' AND code != 'digitalElephantFilter' AND code != 'basel_installer'\");\n\t\n$oc_extension = array(\n array('extension_id' => '475','type' => 'module','code' => 'basel_instagram'),\n array('extension_id' => '474','type' => 'module','code' => 'category'),\n array('extension_id' => '473','type' => 'module','code' => 'account'),\n array('extension_id' => '472','type' => 'module','code' => 'basel_content'),\n array('extension_id' => '471','type' => 'module','code' => 'basel_layerslider'),\n array('extension_id' => '470','type' => 'module','code' => 'basel_megamenu'),\n array('extension_id' => '469','type' => 'module','code' => 'basel_products'),\n array('extension_id' => '468','type' => 'module','code' => 'blog_latest'),\n array('extension_id' => '467','type' => 'module','code' => 'basel_carousel')\n);\n\t\n\tforeach ($oc_extension as $result) {\n $this->db->query(\"INSERT INTO `\" . DB_PREFIX . \"extension` SET \"\n\t\t\t\t. \"type = '\" . $result['type'] . \"', \"\n . \"code = '\" . $result['code'] . \"'\");\n \t}\n\n\t}",
"private function _update() {\n\n $this->db->replace(XCMS_Tables::TABLE_USERS, $this->getArray());\n $this->attributes->save();\n\n }",
"public function fixedUpdate($data)\n {\n if (!$this->settings) {\n $this->settings = $this->initDefaultSettings();\n }\n $lastCheckedBlock = $this->settings['lastCheckedBlock'];\n $filters = $this->settings['filters'];\n if ($filters) {\n // Luckily we had filter active. It should have all new transactions\n $pending = $filters['pending'];\n if ($pending) {\n $this->checkPending($pending);\n }\n } else {\n // No filters found. Need to install one and manually check everything from last update\n // Let's hope we will end here only once after first start or long downtime of system\n // Still, better to send notification that something can be wrong here\n }\n $this->checkFilter();\n return 0;\n }",
"abstract public function insert();",
"function insAccionBitacora($idIncidencia, $idUsuario, $idAccion) {\r\n $datosBitacora['idIncidencia'] = $idIncidencia;\r\n $datosBitacora['idUsuario'] = $idUsuario;\r\n $datosBitacora['iAccion'] = $idAccion;\r\n return $this->db->insert('BitacoraAcciones_T', $datosBitacora);\r\n }",
"private function _after_install() {\n global $COURSE, $DB;\n \n if(!$this->_found) { // if the block's instance hasn't been cached\n // lookup the DB to check if this block instance already exists\n $result = $DB->get_record('block_group_choice', array('course_id' => $COURSE->id, 'instance_id' => $this->instance->id));\n if($result) { // if the block's instance already exist in the DB\n $this->_found = true;\n }\n else { // if this block instance doesn't exist we insert a first set of preferences\n $entries = new stdClass();\n $entries->instance_id = $this->instance->id;\n $entries->course_id = $COURSE->id;\n $entries->showgroups = 1;\n $entries->maxmembers = 2;\n $entries->allowchangegroups = 0;\n $entries->allowstudentteams = 1;\n $entries->allowmultipleteams = 0;\n $DB->insert_record('block_group_choice', $entries);\n }\n }\n }",
"function updateAddressBalance( $address=null, $asset_list=null ){\n global $mysqli, $counterparty, $addresses, $assets;\n // Lookup any balance for this address and asset\n $balances = getAddressBalances($address, $asset_list);\n if(count($balances)){\n foreach($balances as $balance){\n $address_id = $addresses[$balance['address']]; // Translate address to address_id\n $asset = $balance['asset'];\n $asset_id = $assets[$asset]; // Translate asset to asset_id\n $quantity = $balance['quantity'];\n $results = $mysqli->query(\"SELECT id FROM balances WHERE address_id='{$address_id}' AND asset_id='{$asset_id}' LIMIT 1\");\n if($results){\n if($results->num_rows){\n // Update asset balance\n $results = $mysqli->query(\"UPDATE balances SET quantity='{$quantity}' WHERE address_id='{$address_id}' AND asset_id='{$asset_id}'\");\n if(!$results)\n byeLog('Error while trying to update balance record for ' . $address . ' - ' . $asset);\n } else {\n // Create asset balance only if the quantity is greater than 0\n if($quantity){\n $results = $mysqli->query(\"INSERT INTO balances (asset_id, address_id, quantity) values ('{$asset_id}','{$address_id}','{$quantity}')\");\n if(!$results)\n byeLog('Error while trying to create balance record for ' . $address . ' - ' . $asset);\n }\n }\n } else {\n byeLog('Error while trying to lookup balance record for ' . $address . ' - ' . $asset);\n }\n }\n }\n}",
"private function insert7Action(){\n\t\tinclude_once(System_Properties::ADMIN_MOD_PATH.'/models/default/db_insVPic.php');\n\t\tinclude_once(System_Properties::ADMIN_MOD_PATH.'/models/bike/db_selBikeAd.php');\n\t\tinclude_once(System_Properties::ADMIN_MOD_PATH.'/models/default/db_updVPic.php');\n\t\t\n\t\tif (isset($this -> adminNS -> bikeAds) && is_array($this -> adminNS -> bikeAds)\t\t\t\n\t\t\t&& isset($this -> adminNS -> bikeAds['bikeID'])){\n\t\t\t$bikeAdsNS = $this -> adminNS -> bikeAds;\n\t\t\t$bikeDetails = db_selBikeAd(array('bikeID' => $bikeAdsNS['bikeID']));\n\t\t\tif ($bikeDetails != false){\n\t\t\t\t$bikeDetails = $bikeDetails[0];\n\t\t\t\t\n\t\t\t\tif (isset($this -> adminNS -> bikePhoto) && is_array($this -> adminNS -> bikePhoto)){\t\t\t\t\t\t\t\t\n\t\t\t\t\tforeach ($this -> adminNS -> bikePhoto as $bikePhoto){\n\t\t\t\t\t\tdb_updVPic(array('vPicID' => $bikePhoto['vPicID']\n\t\t\t\t\t\t\t\t\t\t, 'vPicTMP' => '0'\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this -> resetnsAction();\n\t\t\t\t$this -> _redirect('/bike/'.$bikeDetails['bikeID']);\n\t\t\t}else{\n\t\t\t\t$this -> resetnsAction();\n\t\t\t\t$this -> indexAction();\n\t\t\t}\n\t\t}else{\n\t\t\t$this -> resetnsAction();\n\t\t\t$this -> indexAction();\n\t\t}\t\t\n\t}",
"public function insert() {\n return XN_Cache::insertProper($this->id, $this->value, $this->labels, true);\n }",
"public function processUpdate()\n {\n // Clear SWAPPED state bit\n $this->_state &= ~self::SWAPPED;\n\n $this->_memManager->processUpdate($this, $this->_id);\n }",
"function addToWallet($Input = array(), $UserID, $StatusID = 1) {\n $this->db->trans_start();\n\n $OpeningWalletAmount = $this->getUserWalletOpeningBalance($UserID, 'ClosingWalletAmount');\n $OpeningWinningAmount = $this->getUserWalletOpeningBalance($UserID, 'ClosingWinningAmount');\n $OpeningCashBonus = $this->getUserWalletOpeningBalance($UserID, 'ClosingCashBonus');\n $InsertData = array_filter(array(\n \"UserID\" => $UserID,\n \"Amount\" => @$Input['Amount'],\n \"OpeningWalletAmount\" => $OpeningWalletAmount,\n \"OpeningWinningAmount\" => $OpeningWinningAmount,\n \"OpeningCashBonus\" => $OpeningCashBonus,\n \"WalletAmount\" => @$Input['WalletAmount'],\n \"WinningAmount\" => @$Input['WinningAmount'],\n \"CashBonus\" => @$Input['CashBonus'],\n \"ClosingWalletAmount\" => ($StatusID == 5) ? (($OpeningWalletAmount != 0) ? ((@$Input['TransactionType'] == 'Cr') ? $OpeningWalletAmount + @$Input['WalletAmount'] : $OpeningWalletAmount - @$Input['WalletAmount'] ) : @$Input['WalletAmount']) : $OpeningWalletAmount,\n \"ClosingWinningAmount\" => ($StatusID == 5) ? (($OpeningWinningAmount != 0) ? ((@$Input['TransactionType'] == 'Cr') ? $OpeningWinningAmount + @$Input['WinningAmount'] : $OpeningWinningAmount - @$Input['WinningAmount'] ) : @$Input['WinningAmount']) : $OpeningWinningAmount,\n \"ClosingCashBonus\" => ($StatusID == 5) ? (($OpeningCashBonus != 0) ? ((@$Input['TransactionType'] == 'Cr') ? $OpeningCashBonus + @$Input['CashBonus'] : $OpeningCashBonus - @$Input['CashBonus'] ) : @$Input['CashBonus']) : $OpeningCashBonus,\n \"Currency\" => @$Input['Currency'],\n \"CouponCode\" => @$Input['CouponCode'],\n \"PaymentGateway\" => @$Input['PaymentGateway'],\n \"TransactionType\" => @$Input['TransactionType'],\n \"TransactionID\" => (!empty($Input['TransactionID'])) ? $Input['TransactionID'] : substr(hash('sha256', mt_rand() . microtime()), 0, 20),\n \"Narration\" => @$Input['Narration'],\n \"EntityID\" => @$Input['EntityID'],\n \"UserTeamID\" => @$Input['UserTeamID'],\n \"CouponDetails\" => @$Input['CouponDetails'],\n \"PaymentGatewayResponse\" => @$Input['PaymentGatewayResponse'],\n \"EntryDate\" => date(\"Y-m-d H:i:s\"),\n \"StatusID\" => $StatusID\n ));\n $this->db->insert('tbl_users_wallet', $InsertData);\n $WalletID = $this->db->insert_id();\n\n /* Update User Balance */\n if ($StatusID == 5) {\n switch (@$Input['Narration']) {\n case 'Deposit Money':\n case 'Admin Deposit Money':\n $this->db->set('WalletAmount', 'WalletAmount+' . @$Input['Amount'], FALSE);\n break;\n case 'Join Contest Winning':\n $this->db->set('WinningAmount', 'WinningAmount+' . @$Input['WinningAmount'], FALSE);\n break;\n case 'Join Contest':\n case 'Private Contest Fee':\n $this->db->set('WalletAmount', 'WalletAmount-' . @$Input['WalletAmount'], FALSE);\n $this->db->set('WinningAmount', 'WinningAmount-' . @$Input['WinningAmount'], FALSE);\n $this->db->set('CashBonus', 'CashBonus-' . @$Input['CashBonus'], FALSE);\n break;\n case 'Cancel Contest':\n $this->db->set('WalletAmount', 'WalletAmount+' . @$Input['WalletAmount'], FALSE);\n $this->db->set('WinningAmount', 'WinningAmount+' . @$Input['WinningAmount'], FALSE);\n $this->db->set('CashBonus', 'CashBonus+' . @$Input['CashBonus'], FALSE);\n break;\n case 'Wrong Winning Distribution':\n $this->db->set('WinningAmount', 'WinningAmount-' . @$Input['WinningAmount'], FALSE);\n break;\n\n case 'Signup Bonus':\n case 'Verification Bonus':\n case 'First Deposit Bonus':\n case 'Referral Bonus':\n case 'Admin Cash Bonus':\n case 'Coupon Discount':\n $this->db->set('CashBonus', 'CashBonus+' . @$Input['Amount'], FALSE);\n break;\n case 'Withdrawal Request':\n $this->db->set('WinningAmount', 'WinningAmount-' . @$Input['WinningAmount'], FALSE);\n if (@$Input['WithdrawalStatus'] == 1) {\n $this->db->set('WithdrawalHoldAmount', 'WithdrawalHoldAmount+' . @$Input['WinningAmount'], FALSE);\n }\n break;\n case 'Withdrawal Reject':\n $this->db->set('WinningAmount', 'WinningAmount+' . @$Input['WinningAmount'], FALSE);\n $this->db->set('WithdrawalHoldAmount', 'WithdrawalHoldAmount-' . @$Input['WinningAmount'], FALSE);\n break;\n default:\n break;\n }\n $this->db->where('UserID', $UserID);\n $this->db->limit(1);\n $this->db->update('tbl_users');\n }\n\n $this->db->trans_complete();\n if ($this->db->trans_status() === FALSE) {\n return FALSE;\n }\n return $WalletID;\n }",
"function adding_part()\n{\n\tinclude 'storedInfo.php';\n\tini_set('display_errors', 'On');\n\t$owner = $_SESSION['billy'];\n\t$element_num = $_POST['ElementNum'];\n\t$part_desc = $_POST['desc'];\n\t//$quantity = $_POST['quantity'];\n\n\t$mysqli = new mysqli(\"oniddb.cws.oregonstate.edu\",\"jonesmi-db\",$myPassword,\"jonesmi-db\");\n\tif($mysqli->connect_errno){\n\t\t//echo \"Connection error \" . $mysqli->connect_errno . \" \" . $mysqli->connect_error;\n\t}\n\t\n\tif(!($stmt1 = $mysqli->prepare(\"INSERT INTO MissingPiece(element_num, part_desc) VALUES (?,?)\")))\n\t{\n\t\techo \"Prepare failed: \" . $stmt1->errno . \" \" . $stmt1->error;\n\t}\n\tif(!($stmt1->bind_param('is', $element_num, $part_desc)))\n\t{ \n\t\techo \"Bind failed: \" . $stmt1->errno . \" \" . $stmt1->error;\n\t}\n\tif(!$stmt1->execute())\n\t{\n\t\t//echo \"Execute failed: \" . $stmt1->errno . \" \" . $stmt1->error;\n\t} else \n\t{\n\t\t$result = $stmt1->insert_id;\n\t\t//echo \"Added \" . $stmt1->affected_rows . \" rows to MissingPiece.\";\n\t}\n\n\tif(!($stmt = $mysqli->prepare(\"INSERT INTO UserMissing(uid, pid) VALUES (?,?)\")))\n\t{ \n\t\techo \"Prepare failed: insert uid pid \" . $stmt->errno . \" \" . $stmt->error;\n\t}\n\tif(!($stmt->bind_param('ii',$owner,$result)))\n\t{\n\t\techo \"Bind Failed: \" . $stmt->errno . \" \" . $stmt->error;\n\t}\n\tif(!$stmt->execute())\n\t{\n\t\techo \"Execute failed: pid \" . $stmt->errno . \" \" . $stmt->error;\n\t} else {\n\t\techo \"Successfully added \" . $stmt->affected_rows . \" to the list.\";\n\t}\n\t$mysqli->close();\n\t\n}",
"private function updateWallet ($vendor, $transaction) {\n $commission = $this->calculateCommission($transaction->type, $vendor->user_id, $transaction->amount);\n $distCommission = $this->calculateCommission($transaction->type, $vendor->parent_id, $transaction->amount);\n $superDistId = Vendor::where('user_id', $vendor->parent_id)->first()->parent_id;\n $superDistCommission = $this->calculateCommission($transaction->type, $superDistId, $transaction->amount);\n\n\n // Perform Wallet Updations for Amount Transacted\n if ($transaction->type == 1 || $transaction->type == 2) {\n $vendor->balance += $transaction->type == 1 ? -$transaction->amount : ($transaction->type == 2 ? $transaction->amount : 0);\n $amount_wallet_transaction = WalletTransaction::create([\n 'user_id' => $vendor->id,\n 'transaction_type' => $transaction->type == 1 ? 0 : ($transaction->type == 2 ? 1 : null),\n 'amount' => $transaction->amount,\n 'balance' => $vendor->balance\n ]);\n\n $key = $transaction->type == 1 ? 'debit_id' : ($transaction->type == 2 ? 'credit_id' : '');\n\n AepsWalletAction::create([\n 'user_id' => $vendor->id,\n 'amount' => $transaction->amount,\n 'status' => 1,\n $key => $amount_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => false\n ]);\n\n $dipl_vendor = Vendor::where('type', 8)->lockForUpdate()->first();\n $dipl_vendor->balance += $transaction->type == 1 ? -$transaction->amount : ($transaction->type == 2 ? $transaction->amount : 0);\n $dipl_vendor->save();\n $dipl_amount_wallet_transaction = WalletTransaction::create([\n 'user_id' => $dipl_vendor->id,\n 'transaction_type' => $transaction->type == 1 ? 0 : ($transaction->type == 2 ? 1 : null),\n 'amount' => $transaction->amount,\n 'balance' => $dipl_vendor->balance\n ]);\n\n AepsWalletAction::create([\n 'user_id' => $dipl_vendor->id,\n 'amount' => $transaction->amount,\n 'status' => 1,\n $key => $dipl_amount_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => false\n ]);\n\n }\n\n $dipl_vendor = Vendor::where('type', 8)->lockForUpdate()->first();\n\n // Perform Wallet Updations for Commission\n if ($commission && $dipl_vendor->commission && $vendor->commission) {\n if ($commission['rate_type'] == 1)\n $vendor->balance += $commission['rate'];\n if ($commission['rate_type'] == 2)\n $vendor->balance += $transaction->amount * $commission['rate']/100;\n $commission_wallet_transaction = WalletTransaction::create([\n 'user_id' => $vendor->id,\n 'transaction_type' => 1,\n 'amount' => $commission['rate'],\n 'balance' => $vendor->balance\n ]);\n\n AepsWalletAction::create([\n 'user_id' => $vendor->id,\n 'amount' => $commission['rate'],\n 'status' => 1,\n 'credit_id' => $commission_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => true\n ]);\n }\n\n if ($distCommission && $dipl_vendor->commission) {\n $distributor = Vendor::where('user_id', $vendor->parent_id)->lockForUpdate()->first();\n if ($distributor && $distributor->commission == 1) {\n if ($distCommission['rate_type'] == 1)\n $distributor->balance += $distCommission['rate'];\n if ($distCommission['rate_type'] == 2)\n $distributor->balance += $transaction->amount * $distCommission['rate']/100;\n $commission_wallet_transaction = WalletTransaction::create([\n 'user_id' => $distributor->id,\n 'transaction_type' => 1,\n 'amount' => $distCommission['rate'],\n 'balance' => $distributor->balance\n ]);\n\n $distributor->save();\n\n AepsWalletAction::create([\n 'user_id' => $distributor->id,\n 'amount' => $distCommission['rate'],\n 'status' => 1,\n 'credit_id' => $commission_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => true\n ]);\n } \n }\n\n if ($superDistCommission && $dipl_vendor->commission) {\n $superDistributor = Vendor::where('user_id', $superDistId)->lockForUpdate()->first();\n if ($superDistributor && $superDistributor->commission == 1) {\n if ($superDistCommission['rate_type'] == 1)\n $superDistributor->balance += $superDistCommission['rate'];\n if ($superDistCommission['rate_type'] == 2)\n $superDistributor->balance += $transaction->amount * $superDistCommission['rate']/100;\n $commission_wallet_transaction = WalletTransaction::create([\n 'user_id' => $superDistributor->id,\n 'transaction_type' => 1,\n 'amount' => $superDistCommission['rate'],\n 'balance' => $superDistributor->balance\n ]);\n\n $superDistributor->save();\n\n AepsWalletAction::create([\n 'user_id' => $superDistributor->id,\n 'amount' => $superDistCommission['rate'],\n 'status' => 1,\n 'credit_id' => $commission_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => true\n ]);\n }\n \n }\n\n return $vendor->balance;\n }",
"function update_basket (array $data)\n {\n// debug_print ('INFO: Update Basket', $data);\n global $connection;\n// $member_id_you = $_SESSION['member_id'];\n $producer_id_you = $_SESSION['producer_id_you'];\n // Allow admins to override certain checks if the requested action is not for themselves\n $admin_override = true;\n if ($member_id_you == $data['member_id'] || ! CurrentMember::auth_type('cashier'))\n {\n $admin_override = false;\n }\n// Set this value manually when converting from transactions to ledger accounting\n$admin_override = true;\n // Set flags for needed validations and operations\n switch ($data['action'])\n {\n // checkout will checkout all the items in the basket\n case 'checkout':\n $test_for_membership_privilege = true;\n $test_customer_ordering_window = true;\n $initiate_set_checkout = true;\n $initiate_checkout_items = true;\n break;\n // same as \"checkout\" but only synchs items that were already checked out\n case 'synch_ledger_items':\n $test_for_membership_privilege = true;\n $test_customer_ordering_window = true;\n $initiate_set_checkout = true;\n $synch_ledger_items = true;\n break;\n // set_uncheckout is currently disabled\n case 'set_checkout':\n $test_for_membership_privilege = true;\n $test_customer_ordering_window = true;\n $initiate_set_checkout = true;\n break;\n // un_checkout is currently disabled\n case 'un_checkout':\n $test_customer_ordering_window = true;\n $initiate_un_checkout = true;\n break;\n // update the site (Pickup|Home|Work)\n case 'set_site':\n $update_site = true;\n break;\n default:\n die(debug_print('ERROR: 679217 ', 'unexpected request', basename(__FILE__).' LINE '.__LINE__));\n break;\n }\n // Get information about the basket for this member\n // Prefer to access basket by basket_id\n if ($data['basket_id'] != 0)\n {\n $basket_info = get_basket ($data['basket_id']);\n }\n // Then try with member_id/delivery_id combination\n elseif ($data['member_id'] != 0 && $data['delivery_id'] != 0)\n {\n $basket_info = get_basket ($data['member_id'], $data['delivery_id']);\n }\n // Otherwise we don't know enough to get the basket\n else\n {\n die(debug_print('ERROR: 970893 ', 'incomplete information to locate basket', basename(__FILE__).' LINE '.__LINE__));\n }\n // Check that we actually got some basket information\n if (! is_array ($basket_info))\n {\n die(debug_print('ERROR: 701854 ', 'basket does not exist', basename(__FILE__).' LINE '.__LINE__));\n }\n // Check that the member is not pending or discontinued\n if ($test_for_membership_privilege && ! $admin_override)\n {\n if ($member_info['pending'] == 1 || $member_info['membership_discontinued'] == 1)\n {\n die(debug_print('ERROR: 974383 ', 'incorrect privilege to order', basename(__FILE__).' LINE '.__LINE__));\n }\n }\n // Check if shopping is closed for this order\n if ($test_customer_ordering_window && ! $admin_override && !(new ActiveCycle())->is_open_for_ordering())\n {\n die(debug_print('ERROR: 823186 ', 'customer ordering period is not in effect', basename(__FILE__).' LINE '.__LINE__));\n }\n // Update the basket with a new site and information related to the new site\n if ($update_site)\n {\n\ndebug_print (\"ERROR: 892573 \", \"UPDATE DELCODE\", basename(__FILE__).' LINE '.__LINE__);\n\n if ($data['delivery_type'] == 'H' || $data['delivery_type'] == 'W') $query_delivery_type = 'D'; // H[ome] and W[ork] --> D[elivery]\n else $query_delivery_type = $data['delivery_type']; // P[ickup]\n // Could check for changes and abort otherwise, but this will force updating\n // delivery_postal_code just in case it might have changed.\n $query_site = '\n SELECT\n delivery_charge,\n delivery_postal_code\n FROM '.NEW_TABLE_SITES.'\n WHERE\n site_id = \"'.mysql_real_escape_string($data['site_id']).'\"\n AND delivery_type = \"'.$query_delivery_type.'\"\n AND inactive = \"0\"\n AND site_type = \"customer\"';\n $result_site = mysql_query($query_site, $connection) or die(debug_print (\"ERROR: 892573 \", array ($query_site,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n // Got we some information, then post the new information\n if ($row_site = mysql_fetch_array($result_site))\n {\n\n $query_update_basket = '\n UPDATE '.NEW_TABLE_BASKETS.'\n SET\n delivery_cost = \"'.mysql_real_escape_string($row_site['delivery_charge']).'\",\n delivery_postal_code = \"'.mysql_real_escape_string($row['delivery_postal_code']).'\",\n site_id = \"'.mysql_real_escape_string($data['site_id']).'\",\n delivery_type = \"'.mysql_real_escape_string($data['delivery_type']).'\"\n WHERE basket_id = \"'.mysql_real_escape_string($basket_info['basket_id']).'\"';\n $result_update_basket = mysql_query($query_update_basket, $connection) or die(debug_print (\"ERROR: 892764 \", array ($query_update_basket,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n\ndebug_print (\"INFO: 892573 \", $query_update_basket, basename(__FILE__).' LINE '.__LINE__);\n\n // Update the $basket_info with changes\n $basket_info['delivery_cost'] = $row_site['delivery_charge'];\n $initiate_delivery_charge = true;\n }\n // Otherwise error\n else\n {\n die(debug_print('ERROR: 898952 ', 'requested site does not exist or is not available', basename(__FILE__).' LINE '.__LINE__));\n }\n }\n // Change the checked_out setting on the basket\n // Do this early so the update_basket_item will process the ledger items (only if they are in a checked-out state)\n if ($initiate_set_checkout)\n {\n // Get the number of items in the basket that are checked out\n $query = '\n SELECT\n '.NEW_TABLE_PRODUCTS.'.tangible,\n COUNT('.NEW_TABLE_BASKET_ITEMS.'.bpid) AS count\n FROM\n '.NEW_TABLE_BASKET_ITEMS.'\n LEFT JOIN\n '.NEW_TABLE_PRODUCTS.' USING(product_id,product_version)\n WHERE\n '.NEW_TABLE_BASKET_ITEMS.'.basket_id = \"'.mysql_real_escape_string($basket_info['basket_id']).'\"\n GROUP BY\n '.NEW_TABLE_PRODUCTS.'.tangible';\n $result = mysql_query($query, $connection) or die(debug_print (\"ERROR: 758023 \", array ($query,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n while ($row = mysql_fetch_array($result))\n {\n if ($row['tangible'] == '0') $intangible_count = $row['count'];\n if ($row['tangible'] == '1') $tangible_count = $row['count'];\n }\n // Preference is to set basket count to the number of *tangible* items in the basket\n if ($tangible_count > 0) $checked_out = $tangible_count;\n // Otherwise if there are no tangible items, we set to [negative] the number of *intangible* items in the basket\n elseif ($intangible_count > 0) $checked_out = 0 - $intangible_count;\n // Otherwise the basket is empty.\n else $checked_out = 0;\n $query = '\n UPDATE '.NEW_TABLE_BASKETS.'\n SET checked_out = \"'.mysql_real_escape_string($checked_out).'\"\n WHERE basket_id = \"'.mysql_real_escape_string($basket_info['basket_id']).'\"';\n $result = mysql_query($query, $connection) or die(debug_print (\"ERROR: 892764 \", array ($query,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n // Sync the variable we just changed\n $basket_info['checked_out'] = $checked_out ;\n\n // If there is an order cost (fixed), then post it (or clear it if wrongly set).\n if ($basket_info['order_cost'] != 0 &&\n $basket_info['order_cost_type'] == 'fixed' &&\n $basket_info['checked_out'] != 0)\n {\n // Add the order cost to the ledger for this basket\n $ledger_status = basket_item_to_ledger(array (\n 'transaction_group_id' => $data['transaction_group_id'],\n 'source_type' => 'member',\n 'source_key' => $data['member_id'],\n 'target_type' => 'internal',\n 'target_key' => 'order_cost',\n 'amount' => $basket_info['order_cost'],\n 'text_key' => 'order cost',\n 'posted_by' => $_SESSION['member_id'],\n 'basket_id' => $basket_info['basket_id'],\n 'site_id' => $basket_info['site_id'],\n 'delivery_id' => $basket_info['delivery_id'],\n 'match_keys' => array ('source_type','source_key','target_type','target_key','text_key','basket_id')\n ));\n }\n // If there is an order cost (percent), then post it (or clear it if wrongly set).\n elseif ($basket_info['order_cost'] != 0 &&\n $basket_info['order_cost_type'] == 'percent' &&\n $basket_info['checked_out'] != 0)\n {\n // First need to know the basket total to calculate the percent cost\n $query = '\n SELECT\n SUM(amount) AS order_total\n FROM\n '.NEW_TABLE_LEDGER.'\n WHERE\n basket_id = \"'.mysql_real_escape_string($basket_info['basket_id']).'\"\n AND (text_key = \"quantity cost\"\n OR text_key = \"weight cost\")';\n $result = mysql_query($query, $connection) or die(debug_print (\"ERROR: 678304 \", array ($query,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n if ($row = mysql_fetch_array($result))\n {\n $order_total = $row['order_total'];\n $order_cost_total = round ($row['order_total'] * $basket_info['order_cost'] / 100, 2);\n }\n // Add the order cost to the ledger for this basket\n $ledger_status = basket_item_to_ledger(array (\n 'transaction_group_id' => $data['transaction_group_id'],\n 'source_type' => 'member',\n 'source_key' => $data['member_id'],\n 'target_type' => 'internal',\n 'target_key' => 'order_cost',\n 'amount' => $basket_info['order_cost'],\n 'text_key' => 'order cost',\n 'posted_by' => $_SESSION['member_id'],\n 'basket_id' => $basket_info['basket_id'],\n 'site_id' => $basket_info['site_id'],\n 'delivery_id' => $basket_info['delivery_id'],\n 'match_keys' => array ('source_type','source_key','target_type','target_key','text_key','basket_id')\n ));\n }\n }\n // For checkout, synchronize ledger entries to all basket_items\n if ($initiate_checkout_items || $synch_ledger_items)\n {\n // $initiate_checkout_items: check out all items and synch ledger\n // $synch_ledger_items: repost existing checked_out items to the ledger\n if ($synch_ledger_items)\n {\n // Restrict to just the checked_out items\n $query_where = '\n AND checked_out != \"0\"';\n }\n // Get the items currently in the basket\n $query_basket_items = '\n SELECT\n bpid,\n product_id,\n product_version\n FROM '.NEW_TABLE_BASKET_ITEMS.'\n WHERE basket_id = \"'.mysql_real_escape_string($basket_info['basket_id']).'\"'.\n $query_where;\n $result_basket_items = mysql_query($query_basket_items, $connection) or die(debug_print (\"ERROR: 892785 \", array ($query_basket_items,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n // Go through all the basket items (or all the checked_out items)\n while ($row_basket_items = mysql_fetch_array($result_basket_items))\n {\n $basket_item_info = update_basket_item (array(\n 'action' => 'synch_ledger',\n 'delivery_id' => $data['delivery_id'],\n 'member_id' => $data['member_id'],\n 'product_id' => $row_basket_items['product_id'],\n 'product_version' => $row_basket_items['product_version']\n ));\n if (! is_array($basket_item_info))\n {\n $basket_info['checked_out'] = 0;\n die(debug_print (\"ERROR: 902784 \", 'update_basket_item() did not return array.', basename(__FILE__).' LINE '.__LINE__));\n }\n }\n }\n // This is done for any/all changes, so not conditional except for baskets that are not checked-out.\n if ($basket_info['checked_out'] != 0)\n {\n // If there is a delivery charge, then post it (or clear it if wrongly set).\n if ($basket_info['delivery_cost'] != 0 || $initiate_delivery_charge)\n {\n // Add the delivery cost to the ledger for this basket\n $ledger_status = basket_item_to_ledger(array (\n 'transaction_group_id' => $data['transaction_group_id'],\n 'source_type' => 'member',\n 'source_key' => $data['member_id'],\n 'target_type' => 'internal',\n 'target_key' => 'delivery_cost',\n 'amount' => $basket_info['delivery_cost'],\n 'text_key' => 'delivery cost',\n 'posted_by' => $_SESSION['member_id'],\n 'basket_id' => $basket_info['basket_id'],\n 'site_id' => $basket_info['site_id'],\n 'delivery_id' => $basket_info['delivery_id'],\n 'match_keys' => array ('source_type','source_key','target_type','target_key','text_key','basket_id')\n ));\n }\n }\n\n// // For un_checkout, clear all ledger entries related to the basket and basket_items\n// // This will remove or clear the cost of ledger entries for all products in the basket\n// if ($initiate_un_checkout)\n// {\n// // Get the items currently in the basket\n// $query_basket_items = '\n// SELECT\n// bpid,\n// product_id,\n// product_version\n// FROM '.NEW_TABLE_BASKET_ITEMS.'\n// WHERE basket_id = \"'.mysql_real_escape_string($basket_info['basket_id']).'\"';\n// $result_basket_items = mysql_query($query_basket_items, $connection) or die(debug_print (\"ERROR: 892785 \", array ($query_basket_items,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n// // Go through all the basket items\n// while ($row_basket_items = mysql_fetch_array($result_basket_items))\n// {\n// // Problem: clear_item removes all quantity from the basket. We would like to leave the basket unchanged.\n// // ... but if we define that as the desired behavior, then we have something, at least...\n// $basket_item_info = update_basket_item (array(\n// 'action' => 'un_checkout',\n// 'delivery_id' => $data['delivery_id'],\n// 'member_id' => $data['member_id'],\n// 'product_id' => $row_basket_items['product_id'],\n// 'product_version' => $row_basket_items['product_version'],\n// 'post_even_if_zero' => 'YES'\n// ));\n// if ($basket_item_info != 'clear_item:'.$row_basket_items['bpid'])\n// {\n// return('error 100: expected \"clear_item:'.$row_basket_items['bpid'].'\" but got \"'.$basket_item_info.'\"');\n// }\n// }\n// // And un-checkout the basket as well\n// // Remove the delivery cost from the ledger for this basket\n// $ledger_status = basket_item_to_ledger(array (\n// 'source_type' => 'member',\n// 'source_key' => $data['member_id'],\n// 'target_type' => 'internal',\n// 'target_key' => 'delivery_cost',\n// 'amount' => 0,\n// 'text_key' => 'delivery cost',\n// 'posted_by' => $_SESSION['member_id'],\n// 'basket_id' => $basket_info['basket_id'],\n// 'site_id' => $basket_info['site_id'],\n// 'delivery_id' => $basket_info['delivery_id'],\n// 'match_keys' => array ('source_type','source_key','target_type','target_key','text_key','basket_id')\n// ));\n// }\n// // Change the checked_out setting on the basket\n// // Do this last so the update_basket_item will clear ledger items (only if they are in a checked-out state)\n// if ($initiate_un_checkout)\n// {\n// $query = '\n// UPDATE '.NEW_TABLE_BASKETS.'\n// SET checked_out = \"0\"\n// WHERE basket_id = \"'.mysql_real_escape_string($basket_info['basket_id']).'\"';\n// $result = mysql_query($query, $connection) or die(debug_print (\"ERROR: 892764 \", array ($query,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n// $basket_info['checked_out'] = 0;\n// }\n\n // At this point, all basket information has been updated, so we need to consider any changes to the ledger.\n// * messages link a message to this transaction\n// * post_even_if_zero 'YES' will delete the transaction is zero and a singleton\n\n\n// NEED TO ADD PAYPAL SURCHARGE CALCULATION\n\n // Return the new (possibly changed) basket_info array\n return ($basket_info);\n }",
"public function setKeysFromInserted()\n\t{\n\t\t$keys = $this->database->getNewKeys();\n\n\t\t$this->data = Arr::mergeDeep($this->data, $keys);\n\n\t\t$this->key = $keys[$this->primaryKey] ?? null;\n\t}",
"function movelidup($taskid){\n global $_TABLES;\n //check if there is a lid above this one..\n //also take into account if the lid above this one is the first task, this task must replace it as the first task..\n $templateid=DB_getItem( $_TABLES['nftemplatedata'], 'nf_templateID', \"id=\" . $taskid );\n $thisLid=DB_getItem( $_TABLES['nftemplatedata'], 'logicalid', \"id=\" . $taskid );\n $sql = \"SELECT id,logicalID FROM {$_TABLES['nftemplatedata']} WHERE nf_templateID='$templateid' AND logicalID < $thisLid \";\n $sql .= \"ORDER BY logicalID DESC LIMIT 1\";\n $query = DB_query($sql);\n\n //only perform work if we're not the first task already..\n if(DB_numRows($query) > 0){\n list ($previousID, $previousLID) = DB_fetchArray($query);\n\n $sql = \"UPDATE {$_TABLES['nftemplatedata']} set logicalID='$thisLid' WHERE id='$previousID'\";\n $result = DB_Query($sql);\n\n $sql = \"UPDATE {$_TABLES['nftemplatedata']} set logicalID='$previousLID' WHERE id='$taskid'\";\n $result = DB_Query($sql);\n\n if(DB_getItem($_TABLES['nftemplatedata'],'firstTask', \"id=\" . $previousID) == 1){\n $sql = \"UPDATE {$_TABLES['nftemplatedata']} set firstTask=1 WHERE id='$taskid'\";\n $result = DB_Query($sql);\n $sql = \"UPDATE {$_TABLES['nftemplatedata']} set firstTask=0 WHERE id='$previousID'\";\n $result = DB_Query($sql);\n }\n }\n}",
"public function UpdateAccountBalances () \r\n {\r\n $table = \"BALANCE\";\r\n $query = \"DROP TABLE IF EXISTS ${table}\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't remove old ${table} table\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"CREATE TEMPORARY TABLE ${table} SELECT ReceiptID AS AccountID, SUM(Total) As Receipts, (0) AS Payments FROM Transaction GROUP BY ReceiptID ORDER BY ReceiptID\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't compute ${table} table Receipts\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"INSERT INTO ${table} SELECT PaymentID AS AccountID, (0) AS Receipts, SUM(Total) AS Payments FROM Transaction GROUP BY PaymentID ORDER BY PaymentID\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't compute ${table} table Payments\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"UPDATE Account SET Receipts=(0.00), Payments=(0.00), Balance=(0.00)\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't clear Account table balances\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"UPDATE Account INNER JOIN ${table} ON ID=AccountID SET Account.Receipts=${table}.Receipts\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't update Account table Receipts\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"UPDATE Account INNER JOIN ${table} ON ID=AccountID SET Account.Payments=${table}.Payments\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't update Account table Payments\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"DROP TABLE IF EXISTS ${table}\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't remove new ${table} table\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n return (true);\r\n }",
"public function testFailNoCardAccountUpdate()\n {\n $config = new SinglePayConfig();\n $config->setServiceConfig(self::$testConfig);\n\n $data = new SinglePayData();\n $data->setCustomerNo('112')\n ->setExtras(array(\n 'method' => 'update'\n ));\n\n $transactionSetup = ExpressFactory::buildTransactionSetup($config, $data);\n }",
"protected function saveBase($base){\r\n\t\r\n\t$q = $this->id==0 ? \"INSERT INTO \"._SQLPREFIX_.$this->tableName.\" \": \"UPDATE \"._SQLPREFIX_.$this->tableName.\" SET \";\r\n\t \r\n\tif($this->id==0){\r\n\t\t\r\n\t\tforeach($base as $key => $item){\t\r\n\t\t\t$q .= $key>0 ? \",\".(string)$item->row->name: \"(\".(string)$item->row->name;\r\n\t\t}\r\n\t\t\r\n\t\tforeach($base as $key => $item){\t\r\n\t\t\t\r\n\t\t\tif((string)$item->row->attributes()->system_type=='bool'){\r\n\t\t\t\t$postvalue = !isset($this->sourceData['meta_value_'.(string)$item->row->name]) ? 0: 1;\r\n\t\t\t}elseif((string)$item->row->attributes()->system_type=='text' || ( (string)$item->row->attributes()->system_type=='blob' && (string)$item->row->attributes()->cleanup==1 ) ){\r\n\t\t\t\t$postvalue = Filter::makeSafeString($this->sourceData['meta_value_'.(string)$item->row->name]);\r\n\t\t\t}else{\r\n\t\t\t\t$postvalue = $this->sourceData['meta_value_'.(string)$item->row->name];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$value = DataValidator::saveData($postvalue, (string)$item->row->attributes()->system_type);\r\n\t\t\t$q .= $key>0 ? \"','\".Db::escapeField($value): \") VALUES ('\".Db::escapeField($value);\r\n\t\t}\r\n\t\t\r\n\t\t$q .= \"')\";\r\n\t\t\r\n\t}else{\r\n\t\tforeach($base as $key => $item){\t\r\n\t\t\t\r\n\t\t\tif((string)$item->row->attributes()->system_type=='bool'){\r\n\t\t\t\t$postvalue = !isset($this->sourceData['meta_value_'.(string)$item->row->name]) ? 0: 1;\r\n\t\t\t}elseif((string)$item->row->attributes()->system_type=='text' || ( (string)$item->row->attributes()->system_type=='blob' && (string)$item->row->attributes()->cleanup==1 ) ){\r\n\t\t\t\t$postvalue = Filter::makeSafeString($this->sourceData['meta_value_'.(string)$item->row->name]);\r\n\t\t\t}else{\r\n\t\t\t\t$postvalue = $this->sourceData['meta_value_'.(string)$item->row->name];\r\n\t\t\t}\r\n\r\n\t\t\t$value = DataValidator::saveData($postvalue, (string)$item->row->attributes()->system_type);\r\n\t\t\t$q .= $key>0 ? \", \".(string)$item->row->name.\" = '\".Db::escapeField($value).\"'\": (string)$item->row->name.\" = '\".Db::escapeField($value).\"'\";\r\n\t\t}\r\n\t\t\r\n\t\t$q .= \" WHERE \".$this->fieldName.\" = \".(int)$this->id;\r\n\t}\r\n\t\r\n\t//echo $q; \r\n\tDb::query($q);\r\n\tif($this->id == 0){\r\n\t\t$this->lastInsert = Db::get_last_id(_SQLPREFIX_.$this->tableName);\r\n\t}\r\n}",
"private function walledGardenData()\n {\n $this->rowsUpdated += $this->DBF->setChilliConfigSingle('nousergardendata', true);\n }",
"public function testUpdateSuperfund()\n {\n }",
"protected function _insert()\n\t{\n\t}",
"private static function updateTransaction($data)\n {\n global $db;\n\n try {\n $fields = implode(', ', array_map(\n function ($v, $k) {\n return sprintf(\"`%s` = '%s'\", $k, $v);\n },\n $data,\n array_keys(\n $data\n )\n ));\n\n $db->Execute(\"\n\t\t\t\tUPDATE\n\t\t\t\t\t`\" . static::$table_name . \"`\n\t\t\t\tSET\n\t\t\t\t\t\" . $fields . \"\n\t\t\t\tWHERE\n\t\t\t\t `unique_id` = '\" . $data['unique_id'] . \"'\n\t\t\t\");\n } catch (\\Exception $exception) {\n //$this->logEx($exception);\n }\n }",
"function UPDCAR()\n{\n $aropen_rows = db::fetchRows($sql, 'DTSDATA.AROPEN'); /* #539 */\n if ($aropen\n ) {\n if ($billpay->BPOIN_ < 0\n ) {\n $aropen->AROPPD += $billpay->BPPAY_; /* #544 */\n $aropen->ARONPD += $billpay->BPPAY_; /* #545 */\n $aropen->AROPDT = $billpay->BPPDAT; /* #546 */\n $aropen->update(); /* #547 update record */\n $receipts->CRCID = $aropen->AROCID; /* #549 */\n $receipts->CRPER = $PERIOD; /* #550 */\n $receipts->CRCUST = $aropen->AROCUS; /* #551 */\n $receipts->CRSLMN = $aropen->AROSLM; /* #552 */\n $receipts->CRDTPD = $billpay->BPPDAT; /* #553 */\n $receipts->CRDTIN = $aropen->AROIDT; /* #554 */\n $receipts->CRINV_ = $aropen->AROINV; /* #555 */\n $receipts->CRTYPE = '1'; /* #556 */\n $receipts->CRCHCK = $billpay->BPCONF; /* #557 */\n $receipts->CRGLDP = ''; /* #558 */\n $receipts->CRGLAC = ''; /* #559 */\n $receipts->CRDESC = ''; /* #560 */\n $receipts->CRPPD = $billpay->BPPAY_; /* #561 */\n $receipts->CRDUS = 0; /* #562 */\n $receipts->CRSTCM = ''; /* #563 */\n $receipts->CRSTGL = ''; /* #564 */\n $receipts->CRSTS = ''; /* #565 */\n $receipts->CRDST = ''; /* #566 */\n $receipts->insert(); /* #567 insert record */\n } /* #568 end if */\n if ($billpay->BPOIN_ === 0\n && $billpay->BPPAY_ < 0\n && $billpay->BPPRV_ > 0\n ) {\n $billpay->BPPAY_ *= -1; /* #573 */\n $aropen->AROAMT += $billpay->BPPAY_; /* #574 */\n $aropen->ARONAM += $billpay->BPPAY_; /* #575 */\n $aropen->AROPDT = $billpay->BPPDAT; /* #576 */\n $aropen->update(); /* #577 update record */\n $billpay->BPPAY_ *= -1; /* #579 */\n $receipts->CRCID = $aropen->AROCID; /* #580 */\n $receipts->CRPER = $PERIOD; /* #581 */\n $receipts->CRCUST = $aropen->AROCUS; /* #582 */\n $receipts->CRSLMN = $aropen->AROSLM; /* #583 */\n $receipts->CRDTPD = $billpay->BPPDAT; /* #584 */\n $receipts->CRDTIN = $aropen->AROIDT; /* #585 */\n $receipts->CRINV_ = $aropen->AROINV; /* #586 */\n $receipts->CRTYPE = '1'; /* #587 */\n $receipts->CRCHCK = $billpay->BPCONF; /* #588 */\n $receipts->CRGLDP = ''; /* #589 */\n $receipts->CRGLAC = ''; /* #590 */\n $receipts->CRDESC = ''; /* #591 */\n $receipts->CRPPD = $billpay->BPPAY_; /* #592 */\n $receipts->CRDUS = 0; /* #593 */\n $receipts->CRSTCM = ''; /* #594 */\n $receipts->CRSTGL = ''; /* #595 */\n $receipts->CRSTS = ''; /* #596 */\n $receipts->CRDST = ''; /* #597 */\n $receipts->insert(); /* #598 insert record */\n } /* #599 end if */\n if ($billpay->BPOIN_ === 0\n && $billpay->BPPAY_ > 0\n && $billpay->BPPRV_ < 0\n ) {\n $billpay->BPPAY_ *= -1; /* #604 */\n $aropen->AROAMT += $billpay->BPPAY_; /* #605 */\n $aropen->ARONAM += $billpay->BPPAY_; /* #606 */\n $aropen->AROPDT = $billpay->BPPDAT; /* #607 */\n $aropen->update(); /* #608 update record */\n $billpay->BPPAY_ *= -1; /* #610 */\n $receipts->CRCID = $aropen->AROCID; /* #611 */\n $receipts->CRPER = $PERIOD; /* #612 */\n $receipts->CRCUST = $aropen->AROCUS; /* #613 */\n $receipts->CRSLMN = $aropen->AROSLM; /* #614 */\n $receipts->CRDTPD = $billpay->BPPDAT; /* #615 */\n $receipts->CRDTIN = $aropen->AROIDT; /* #616 */\n $receipts->CRINV_ = $aropen->AROINV; /* #617 */\n $receipts->CRTYPE = '1'; /* #618 */\n $receipts->CRCHCK = $billpay->BPCONF; /* #619 */\n $receipts->CRGLDP = ''; /* #620 */\n $receipts->CRGLAC = ''; /* #621 */\n $receipts->CRDESC = ''; /* #622 */\n $receipts->CRPPD = $billpay->BPPAY_; /* #623 */\n $receipts->CRDUS = 0; /* #624 */\n $receipts->CRSTCM = ''; /* #625 */\n $receipts->CRSTGL = ''; /* #626 */\n $receipts->CRSTS = ''; /* #627 */\n $receipts->CRDST = ''; /* #628 */\n $receipts->insert(); /* #629 insert record */\n } /* #630 end if */\n if ($billpay->BPOIN_ > 0\n ) {\n $aropen->AROPPD += $billpay->BPPAY_; /* #633 */\n $aropen->ARONPD += $billpay->BPPAY_; /* #634 */\n $aropen->AROPDT = $billpay->BPPDAT; /* #635 */\n $aropen->update(); /* #636 update record */\n $receipts->CRCID = $aropen->AROCID; /* #638 */\n $receipts->CRPER = $PERIOD; /* #639 */\n $receipts->CRCUST = $aropen->AROCUS; /* #640 */\n $receipts->CRSLMN = $aropen->AROSLM; /* #641 */\n $receipts->CRDTPD = $billpay->BPPDAT; /* #642 */\n $receipts->CRDTIN = $aropen->AROIDT; /* #643 */\n $receipts->CRINV_ = $aropen->AROINV; /* #644 */\n $receipts->CRTYPE = '1'; /* #645 */\n $receipts->CRCHCK = $billpay->BPCONF; /* #646 */\n $receipts->CRGLDP = ''; /* #647 */\n $receipts->CRGLAC = ''; /* #648 */\n $receipts->CRDESC = ''; /* #649 */\n $receipts->CRPPD = $billpay->BPPAY_; /* #650 */\n $receipts->CRDUS = 0; /* #651 */\n $receipts->CRSTCM = ''; /* #652 */\n $receipts->CRSTGL = ''; /* #653 */\n $receipts->CRSTS = ''; /* #654 */\n $receipts->CRDST = ''; /* #655 */\n $receipts->insert(); /* #656 insert record */\n } /* #657 end if */\n } /* #659 end if */\n}",
"public function __reFill(){\n foreach ($this->data as $key=>$datum) {\n $name = @$this->struct['fieldsDB'][$key];\n if ($name!==null) $this->filled[$name] = true;\n }\n }",
"public function insertStockMovement($item_id, $quantity, $isInsert = true,$old_movement_quantity = 0){\n\n\n /*\n se o item_id nao existir entao vai ser insert senao vai ser update\n */\n\n $will_update = true;\n //$item = BaseStock::find($item_id);\n\n $stocksitem = DB::table('base_stocks')->where('item_id', $item_id)->first();\n \n\n if(!$stocksitem){\n $will_update = false;\n }\n \n if(!$will_update){\n \n \n $basestock = new BaseStock();\n $basestock->quantity = $quantity;\n $basestock->item_id = $item_id;\n $res = $basestock->save();\n\n }else{\n\n\n \n $current_quantity = $stocksitem->quantity;\n $new_quantity = 0;\n if($isInsert){\n $new_quantity = $current_quantity + $quantity;\n }else{\n \n $new_quantity = 0;\n\n $difference = 0;\n $subtract = false;\n $sum = false;\n if($old_movement_quantity > $quantity){\n $difference = $old_movement_quantity - $quantity;\n $subtract = true;\n }else if($old_movement_quantity < $quantity){\n $difference = $quantity - $old_movement_quantity;\n $sum = true;\n }else{\n $new_quantity = $current_quantity;\n }\n\n if($sum){\n $new_quantity = $current_quantity + $difference;\n }\n\n if($subtract){\n $new_quantity = $current_quantity - $difference;\n }\n \n\n }\n \n\n\n $res = DB::table('base_stocks')\n ->where('item_id', $item_id)\n ->update(['quantity' => $new_quantity]);\n\n \n \n \n }\n return $res;\n\n}",
"function updateshops() {\n\n\tif (rand(1,8)<2) {\t// shops replenish too fast - slow them down\n\t\t// for now let's just pick a random inventory item and increase it by 1 (up to max)\n\t\t// FIXME: cant get RAND to work with UPDATE !?!?\n\t\t// $result=mysql_query(\"UPDATE phaos_shop_inventory SET quantity=quantity+1 WHERE quantity<max ORDER BY RAND() LIMIT 1\");\n\n\t\t// this code will do it randomly, but in two steps. MySQL 4.x is needed for UPDATE with RAND\n\t\t$result=mysql_query(\"SELECT shop_id,type,item_id FROM phaos_shop_inventory WHERE quantity<max ORDER BY RAND() LIMIT 1;\");\n\t\tif ($row = mysql_fetch_array($result)) {\n\t\t\t$result=mysql_query(\"UPDATE phaos_shop_inventory\n\t\t\t\tSET quantity=quantity+1\n\t\t\t\tWHERE shop_id='$row[shop_id]' AND type='$row[type]' AND item_id='$row[item_id]' \");\n\t\t}\n\t}\n\n}",
"function setfixedHash($recCopy,$fields='')\t{\n\n\t\tif ($fields)\t{\n\t\t\t$fieldArr = t3lib_div::trimExplode(',',$fields,1);\n\t\t\treset($fieldArr);\n\t\t\twhile(list($k,$v)=each($fieldArr))\t{\n\t\t\t\t$recCopy_temp[$k]=$recCopy[$v];\n\t\t\t}\n\t\t} else {\n\t\t\t$recCopy_temp=$recCopy;\n\t\t}\n\t\t$rec='';\n\t\tif (is_array($recCopy)) {\n\t\t\t$rec=implode('|',$recCopy_temp);\n\t\t}\n\t\t$encStr = $rec.'|'.$this->conf['authcodeFields.']['addKey'].'|'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'];\n\t\t$hash = substr(md5($encStr),0,$this->codeLength);\n\t\treturn $hash;\n\t}",
"function insert_sqliTransaction($insert_query, $table, $expectedResult) {\n $connection = insertConnectionString();\n mysqli_autocommit($connection,FALSE);\n mysqli_query($connection,\"start transaction\"); \n \n $sql = \"Select * FROM $table\";\n $result = mysqli_query($connection,$sql); \n $rowsBefore = mysqli_num_rows($result);\n \n $queryresult = mysqli_query($connection, $insert_query) \n or die(mysqli_error($connection));\n $affectedRows = mysqli_affected_rows($connection);\n \n $sql = \"Select * FROM $table\";\n $result = mysqli_query($connection,$sql); \n $rowsAfter = mysqli_num_rows($result);\n \n if($rowsBefore != ($rowsAfter-$expectedResult) || $affectedRows != $expectedResult){\n include(\"logs/logsMail.php\");\n mysqli_query($connection,\"rollback\");\n }else{\n mysqli_query($connection,\"commit\");\n }\n mysqli_close($connection);\n return $queryresult;\n }",
"public function UpdateRelatedData($Ref_Data,$TableName){\n //echo \"<br>test: updating reference data to tablename={$TableName}<br>\";\n set_time_limit(0); \n include_once 'db_conn.php';\n include_once 'cls_codes.php';\n if(is_array($Ref_Data)){\n for($i=0;$i < count($Ref_Data);$i++){\n $LedgerTableName=cls_misc::ConvertToTableName($Ref_Data[$i]);\n $SQL_UpdateRelatedData=\"SELECT sum(pen_fee) as pen_fee,OR_num,OR_date,sum(bill_amnt) as bill_amnt,sum(total) as total,sum(loans_MLP) as loans_MLP,sum(loans_MF) as loans_MF,sum(misc) as misc_fee FROM {$LedgerTableName} where (OR_date is not null and OR_date <> '' and OR_date <> '0000-00-00') or (OR_num <> '' and OR_num is not null and OR_num <> '00000000') group by OR_num order by OR_num asc\";\n $e=new Exception();\n $QRY_UpdateRelatedData=mysql_query($SQL_UpdateRelatedData) or die(mysql_error().\"-\".$e->getFile().\"-\".$e->getLine());\n while($row_UpdateRelatedData=mysql_fetch_array($QRY_UpdateRelatedData)){\n $payee=$Ref_Data[$i];\n $or_date=$row_UpdateRelatedData['OR_date'];\n $or_num=$row_UpdateRelatedData['OR_num'];\n $pen_fee=$row_UpdateRelatedData['pen_fee'];\n $bill_amnt=$row_UpdateRelatedData['bill_amnt'];\n $loans_MLP=$row_UpdateRelatedData['loans_MLP'];\n $loans_MF=$row_UpdateRelatedData['loans_MF'];\n $misc_fee=$row_UpdateRelatedData['misc'];\n $total=$row_UpdateRelatedData['total'];\n $address_brgy=cls_user_get::ProfileValue('acct_no',$Ref_Data[$i],'address_brgy');\n //insert here to get OR duplication before entry\n $SQL_strCheckEntry=\"select * from {$TableName} where OR_num='{$or_num}'\";\n $e=new Exception();\n $QRY_strCheckEntry=mysql_query($SQL_strCheckEntry) or die(mysql_error());\n if(mysql_numrows($QRY_strCheckEntry)==0){\n //insert the data if no duplication\n $SQL_InsUpdateRelatedData=\"insert into {$TableName}(Payee,address_brgy,OR_date,OR_num,meter_fee,MLP,water_bill,penalty_fee,misc_fee,total)values('{$payee}','{$address_brgy}','{$or_date}','{$or_num}','{$loans_MF}','{$loans_MLP}','{$bill_amnt}','{$pen_fee}','{$misc_fee}','{$total}')\";\n $QRY_InsUpdateRelatedData=mysql_query($SQL_InsUpdateRelatedData) or die(\"Error:\".mysql_error().\"__Source File:\".$e->getFile().\"__Line:\".$e->getLine());\n }\n }\n //unset($QRY_UpdateRelatedData);\n //unset($QRY_InsUpdateRelatedData);\n }\n }\n}",
"public function commit() {\n\t$idAvailable = \\is_numeric($this->getId());\n\t//We're checking if the id is available and it's marked for delete. If not, we need to check if the id is available.\n\t//Finally, we need to make sure it hasn't been marked for delete. if it has and there's no id, nothing needs to be\n\t//done.\n\tif ($idAvailable && $this->_markForDelete) {\n\t $this->delete();\n\t}\n\telse if ($idAvailable) {\n\t $this->update();\n\t}\n\telse if (!$this->_markForDelete) {\n\t $this->insert();\n\t}\n }",
"function array_insert(array $original, array $new, $offset)\n {\n return array_slice($original, 0, $offset, true) + $new + array_slice($original, $offset, null, true);\n }"
] | [
"0.53040737",
"0.5119726",
"0.4988007",
"0.49752572",
"0.49496818",
"0.49425128",
"0.493808",
"0.4922531",
"0.49007097",
"0.48925826",
"0.4878174",
"0.4806692",
"0.4795725",
"0.4786006",
"0.4785005",
"0.4784033",
"0.47626936",
"0.47536066",
"0.47078437",
"0.47047314",
"0.46982068",
"0.4698003",
"0.4683721",
"0.46783558",
"0.4604555",
"0.45945626",
"0.45930907",
"0.45891005",
"0.45855916",
"0.457682",
"0.45728427",
"0.4570775",
"0.456343",
"0.45615262",
"0.4561002",
"0.45193046",
"0.4505712",
"0.44886556",
"0.44826105",
"0.44820532",
"0.44683877",
"0.44682214",
"0.44616738",
"0.44478577",
"0.44341123",
"0.4432205",
"0.44284487",
"0.44282928",
"0.44270614",
"0.44234365",
"0.44230714",
"0.4419452",
"0.4413605",
"0.44002384",
"0.43968177",
"0.43964845",
"0.43889523",
"0.43887347",
"0.43885148",
"0.43746266",
"0.43740594",
"0.4353482",
"0.43510926",
"0.43478838",
"0.43446803",
"0.43335265",
"0.43335265",
"0.43328604",
"0.43307015",
"0.43295044",
"0.43258157",
"0.43239805",
"0.43216234",
"0.43211856",
"0.43158442",
"0.43110272",
"0.43007144",
"0.4298619",
"0.4298321",
"0.42979106",
"0.42958966",
"0.42956543",
"0.42889374",
"0.42821288",
"0.428212",
"0.42796597",
"0.42761743",
"0.42712787",
"0.427116",
"0.4268754",
"0.42644218",
"0.42640477",
"0.42609984",
"0.42605254",
"0.4260207",
"0.42539138",
"0.42494395",
"0.424312",
"0.42311603",
"0.42284837",
"0.42275515"
] | 0.0 | -1 |
Verify the message signature | function lti_verify_key_and_secret($key, $secret) {
if ( ! ($key && $secret) ) return array("Missing key or secret", "");
$store = new DbTrivialOAuthDataStore();
$store->add_consumer($key, $secret);
$server = new OAuthServer($store);
$method = new OAuthSignatureMethod_HMAC_SHA1();
$server->add_signature_method($method);
$request = OAuthRequest::from_request();
$basestring = $request->get_signature_base_string();
try {
$server->verify_request($request);
return true;
} catch (Exception $e) {
return array($e->getMessage(), $basestring);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function validateInboundMessage(){\n\t\t$hashData = $this->timestamp . \"\" . $this->token;\n\t\t$computedSignature = hash_hmac(\"sha256\",$hashData , $this->MGAPIKEY);\n\t\t$providedSignature = $this->signature;\n\t\tif ($computedSignature == $providedSignature){\n\t\t\tif($this->validateSender()){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"abstract public function verify($data, $signature);",
"function verify_msg($data)\n\t{\n\t\t// we are using '-v' specifically to catch clear message\n\t\t// after signature verification is complete\n\t\t$body = $this->call(\"{$this->context} -v -d\", 'post', $data);\n\n\t\t$results = [\n\t\t\tfalse,\t// [0]\n\t\t\tnull,\t// [1]\n\t\t\tnull,\t// [2]\n\t\t\tnull,\t// [3]\n\t\t\t$body,\t// [4], always defined\n\t\t\t0,\t\t// [5]\n\t\t];\n\n\t\t// checking status codes of the verification operation\n\t\tif (false === $status = $this->get_status())\n\t\t{\n\t\t\t// something's wrong, aborting\n\t\t\t$results[0] = null;\n\t\t\treturn $results;\n\t\t}\n\t\telse foreach ($status as $code)\n\t\t{\n\t\t\tif ($code[0] == 'VALIDSIG')\n\t\t\t{\n\t\t\t\t// defining output elements for good sig\n\t\t\t\t$results[0] = true;\n\t\t\t\t$results[1] = $code[10];\n\t\t\t\t$results[2] = $code[3];\n\t\t\t}\n\t\t\telse if ($code[0] == 'BADSIG')\n\t\t\t{\n\t\t\t\t// in case of bad signature we return\n\t\t\t\t// long key_id, not a full FPR!\n\t\t\t\t$results[1] = $code[1];\n\t\t\t}\n\t\t\telse if ($code[0] == 'ERRSIG')\n\t\t\t{\n\t\t\t\t// signature verification error (no pubkey?).\n\t\t\t\t// only long key_id is returned!\n\t\t\t\t$results[0] = null;\n\t\t\t\t$results[1] = $code[1];\n\t\t\t\t$results[2] = $code[5];\n\t\t\t}\n\t\t\telse if ($code[0] == 'EXPKEYSIG')\n\t\t\t{\n\t\t\t\t// signature with expired key\n\t\t\t\t$results[5] = 1;\n\t\t\t}\n\t\t\telse if ($code[0] == 'EXPSIG')\n\t\t\t{\n\t\t\t\t// signature itself is expired\n\t\t\t\t$results[5] = 2;\n\t\t\t}\n\t\t\telse if ($code[0] == 'REVKEYSIG')\n\t\t\t{\n\t\t\t\t// signing key is revoked\n\t\t\t\t$results[5] = 3;\n\t\t\t}\n\t\t\telse if ($code[0] == 'SIG_ID')\n\t\t\t{\n\t\t\t\t// defining remaining output element: sigID\n\t\t\t\t// (if applicable)\n\t\t\t\t$results[3] = $code[1];\n\t\t\t}\n\t\t\telse if ($code[0] == 'ERROR' || $code[0] == 'NODATA')\n\t\t\t{\n\t\t\t\t// input error encountered, aborting\n\t\t\t\t$results[0] = null;\n\t\t\t\treturn $results;\n\t\t\t}\n\t\t}\n\n\t\treturn $results;\n\t}",
"public static function verifySignature($signature, $msg, $key) : bool\n {\n $verified = sodium_crypto_sign_verify_detached(\n sodium_hex2bin($signature),\n sodium_hex2bin(self::hashObject($msg)),\n sodium_hex2bin($key)\n );\n\n return is_bool($verified) && $verified == true;\n }",
"private function checkSignature()\n {\n\n\n\n if (!defined(\"self::TOKEN\")) {\n throw new \\Exception('TOKEN is not defined!');\n }\n\n $signature = $this->getRequest()->get('signature');\n $timestamp = $this->getRequest()->get('timestamp');\n $nonce = $this->getRequest()->get('nonce');\n\n $token = self::TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n $logger = $this->get('logger');\n $logger->error($signature.'==='.$tmpStr);\n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }",
"protected function checkSignature()\n {\n $headers = \\Yii::$app->request->headers;\n\n $signature = $headers->get('paypal-transmission-sig');\n if (!$signature)\n throw new BadRequestHttpException;\n\n $checkString = sprintf('%s|%s|%s|%s',\n $headers->get('paypal-transmission-id'),\n $headers->get('paypal-transmission-time'),\n $this->webHookId,\n crc32(\\Yii::$app->request->rawBody)\n );\n\n $certUrl = $headers->get('paypal-cert-url');\n if (!$certUrl)\n throw new BadRequestHttpException;\n\n $publicKey = $this->fetchPublicKey($certUrl);\n if (!$publicKey)\n throw new \\Exception('Certificate error');\n\n// $algo = ArrayHelper::getValue($headers, 'paypal-hash-algo');\n\n $result = openssl_verify($checkString, base64_decode($signature), $publicKey);\n return $result === 1;\n }",
"public function checkSignature()\n\t{\n\t\tif (!defined(\"TOKEN\")) {\n\t\t\tthrow new Exception('TOKEN is not defined!');\n\t\t}\n\t\n\t\t$signature = $_GET[\"signature\"];\n\t\t$timestamp = $_GET[\"timestamp\"];\n\t\t$nonce = $_GET[\"nonce\"];\n\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n\t\t// use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"private function checkSignature()\n {\n \tif (!defined(\"TOKEN\")) {\n \t\tthrow new Exception('TOKEN is not defined!');\n \t}\n\n \t$signature = $_GET[\"signature\"];\n \t$timestamp = $_GET[\"timestamp\"];\n \t$nonce = $_GET[\"nonce\"];\n\n \t$token = TOKEN;\n \t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n \tsort($tmpArr, SORT_STRING);\n \t$tmpStr = implode( $tmpArr );\n \t$tmpStr = sha1( $tmpStr );\n\n \tif( $tmpStr == $signature ){\n \t\treturn true;\n \t}else{\n \t\treturn false;\n \t}\n }",
"function checkSignature($encodingAesKey,$token,$corpId)\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"msg_signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n $echoStr = $_GET[\"echostr\"]; \n $token = TOKEN;\n $wxcpt = new WXBizMsgCrypt($token, $encodingAesKey, $corpId);\n $errCode = $wxcpt->VerifyURL($signature, $timestamp, $nonce, $echoStr, $sEchoStr);\n if ($errCode == 0) {\n //\n // 验证URL成功,将sEchoStr返回\n //HttpUtils.SetResponce($sEchoStr);\n echo $sEchoStr;\n return true;\n } else {\n print(\"ERR: \" . $errCode . \"\\n\\n\");\n return false;\n }\n }",
"function verifyMessage($certfile, $data, $signature) {\r\n\r\n // $data and $signature are assumed to contain the data and the signature\r\n $ok=0;\r\n // fetch public key from certificate and ready it\r\n $fp = fopen( \"security/\" . $certfile, \"r\");\r\n \r\n if(!$fp) {\r\n return false;\r\n }\r\n \r\n $cert = fread($fp, 8192);\r\n fclose($fp);\r\n $pubkeyid = openssl_get_publickey($cert);\r\n\r\n // state whether signature is okay or not\r\n $ok = openssl_verify($data, $signature, $pubkeyid);\r\n \r\n // free the key from memory\r\n openssl_free_key($pubkeyid);\r\n\r\n return $ok;\r\n\r\n }",
"public function checkSignature() {\n\t\tif (! defined ( \"TOKEN\" )) {\n\t\t\tthrow new Exception ( 'TOKEN is not defined!' );\n\t\t}\n\t\t\n\t\t$signature = $_GET [\"signature\"];\n\t\t$timestamp = $_GET [\"timestamp\"];\n\t\t$nonce = $_GET [\"nonce\"];\n\t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array (\n\t\t\t\t$token,\n\t\t\t\t$timestamp,\n\t\t\t\t$nonce \n\t\t);\n\t\t// use SORT_STRING rule\n\t\tsort ( $tmpArr, SORT_STRING );\n\t\t$tmpStr = implode ( $tmpArr );\n\t\t$tmpStr = sha1 ( $tmpStr );\n\t\t\n\t\tif ($tmpStr == $signature) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = $this->_token;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"private function checkSignature()\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n $token = TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }",
"private function checkSignature()\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \n $token = TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n \n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }",
"function verifymessage($address, $signature, $message) {\n // curve definition\n // http://www.secg.org/download/aid-784/sec2-v2.pdf\n $secp256k1 = new CurveFp(\n '0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F', '0', '7');\n $secp256k1_G = new Point($secp256k1,\n '0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798',\n '0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8',\n '0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141');\n\n\t// extract parameters\n\t$address = base58check_decode($address);\n\tif (strlen($address) != 21 || $address[0] != \"\\x0\") {\n\t\tthrow new Exception('invalid Bitcoin address');\n\t}\n\n\t$signature = base64_decode($signature, true);\n\tif ($signature === false) {\n\t\tthrow new Exception('invalid base64 signature');\n\t}\n\n\tif (strlen($signature) != 65) {\n\t\tthrow new Exception('invalid signature length');\n\t}\n\n\t$recoveryFlags = ord($signature[0]) - 27;\n\tif ($recoveryFlags < 0 || $recoveryFlags > 7) {\n\t\tthrow new Exception('invalid signature type');\n\t}\n\t$isCompressed = ($recoveryFlags & 4) != 0;\n\n\t// hash message, recover key\n\t$messageHash = hash('sha256', hash('sha256', \"\\x18Bitcoin Signed Message:\\n\" . numToVarIntString(strlen($message)).$message, true), true);\n\t$pubkey = recoverPubKey(bin2gmp(substr($signature, 1, 32)), bin2gmp(substr($signature, 33, 32)), bin2gmp($messageHash), $recoveryFlags, $secp256k1_G);\n\tif ($pubkey === false) {\n\t\tthrow new Exception('unable to recover key');\n\t}\n\t$point = $pubkey->getPoint();\n\n\t// see that the key we recovered is for the address given\n\tif (!$isCompressed) {\n\t\t$pubBinStr = \"\\x04\" . str_pad(gmp2bin($point->getX()), 32, \"\\x00\", STR_PAD_LEFT) .\n\t\t\t\t\t\t\t str_pad(gmp2bin($point->getY()), 32, \"\\x00\", STR_PAD_LEFT);\n\t} else {\n\t\t$pubBinStr =\t(isBignumEven($point->getY()) ? \"\\x02\" : \"\\x03\") .\n\t\t\t\t\t\t\t str_pad(gmp2bin($point->getX()), 32, \"\\x00\", STR_PAD_LEFT);\n\t}\n\t$derivedAddress = \"\\x00\". hash('ripemd160', hash('sha256', $pubBinStr, true), true);\n\n\treturn $address === $derivedAddress;\n}",
"private function checkSignature()\n\t{\n\t\tif (!defined(\"TOKEN\")) {\n\t\t\tthrow new Exception('TOKEN is not defined!');\n\t\t}\n\n\t\t$signature = $_GET[\"signature\"];\n\t\t$timestamp = $_GET[\"timestamp\"];\n\t\t$nonce = $_GET[\"nonce\"];\n\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n\t\t// use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"private function checkSignature()\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \n $token = TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n \n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }",
"private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function VerifySignature($signature) {\n return $this->signature->check_signature($this->request, $this->consumer, $this->token, $signature);\n }",
"private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function validate_signature($params) {\n\n $new_sig = Utils::generate_signature($params['data'], $params['secret']);\n\n if ($new_sig == $params['signature']) {\n return true;\n } else {\n return false;\n }\n\n }",
"private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n // 接收参数\n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\n // 把参数 压如数组\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n\n // use SORT_STRING rule\n // 字典序排序\n\t\tsort($tmpArr, SORT_STRING);\n\n // 切割数组\n\t\t$tmpStr = implode( $tmpArr );\n // 哈希加密\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n // 判断 加密后参数 对比 传递来的加密签名\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function verify(string $message, string $signature): string\n {\n return ParagonIE_Sodium_Compat::crypto_sign_verify_detached($signature, $message, $this->key);\n }",
"public function verify($message, $signature)\n {\n $jsonMessage = Util::toJson($message);\n return $this->verifyString($jsonMessage, $signature);\n }",
"private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n $logfile = fopen(\"./log/token_log\", \"a\");\n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function verifyMessageSignature(string $message, string $signature, string $publicKey): bool\n {\n try {\n $publicKey = sodium_hex2bin($publicKey);\n $signature = sodium_hex2bin($signature);\n if (strlen($publicKey) !== SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES) {\n throw new InvalidArgumentException('The key must be ' . SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES . ' long.');\n }\n\n if (strlen($message) === 0) {\n throw new InvalidArgumentException('The message must not be empty.');\n }\n\n if (strlen($signature) !== SODIUM_CRYPTO_SIGN_BYTES) {\n throw new InvalidArgumentException('The signature must be ' . SODIUM_CRYPTO_SIGN_BYTES . ' long.');\n }\n\n return sodium_crypto_sign_verify_detached($signature, $message, $publicKey);\n } catch (SodiumException $e) {\n throw new RuntimeException('Could not verify data', 0, $e);\n }\n }",
"function verify_signature($file) {\n $dds = new WebService_DigiDocService_DigiDocService();\n $file[\"content\"] = File::readLocalFile($file[\"tmp_name\"]);\n unlink($file[\"tmp_name\"]);\n\n if ($file[\"format\"] === \"bdoc\") {\n $ret = $dds->StartSession(\"\", base64_encode($file[\"content\"]), FALSE, \"\");\n } else {\n $parser = new DigiDoc_Parser($file[\"content\"]);\n $ret = $dds->StartSession(\"\", $parser->getDigiDoc(TRUE), FALSE, \"\");\n }\n\n if (PEAR::isError($ret)) {\n return \"ERROR: \" . $ret->getMessage();\n }\n $sig_info = $ret[\"SignedDocInfo\"]->SignatureInfo;\n if (is_array($sig_info)) {\n return \"ERROR: The claim can have only one signature.\";\n }\n\n if ($sig_info->Status !== \"OK\") {\n $error = $sig_info->Error;\n return \"ERROR: The signature is invalid - $error->Description ($error->Code).\";\n }\n return \"OK\";\n}",
"public function verify();",
"function verify_digital_signature($fname) {\n\n\tglobal $g;\n\n\treturn mwexec(\"/usr/bin/gzsig verify \" .\n\tescapeshellarg(\"{$g['etc_path']}/id_rsa.pub\") . \" \" .\n\tescapeshellarg($fname));\n}",
"function verify () {\n// $aop->alipayrsaPublicKey='MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjUzhXrdJ7GDsgJ59fMLlk7hyYrXkkeGwnYD/eO2HBZh39Y9gTfLJ61Yogc7keOn2uAnZY/zBlw3n+T6mb6/5JYFgvXQi8Qzeh6BkBrNnROu+k4PjhmSbORJFoLrrIxDnsYkQ995kYYhpbS0yf2Al++55v4SrD3/YoVBhWPcRg4xI0QD94FLwhCmcCkft/ILRtUxQk2QeVPLSesvMx2mmUK2L2x2hFA8ewRoGmUdG2Fu9YFIxk//16RI+H7KI8LaoXoVDqHobPae9p0ACE7k9G5vs/cYuikSMKu+lnxghte1jNO+CqrvTP4Pes/mW4e7CEMCTAmEnsXLUrQ6FpfKMcQIDAQAB';\n return $this->aop->rsaCheckV1($_POST, NULL, \"RSA2\");\n }",
"public function verify(array $message, $sig)\n {\n return $this->verifier->verify($message, $sig);\n }",
"private function checkSignature($token)\r\n {\r\n /*if (!defined(\"TOKEN\")) {\r\n throw new Exception('TOKEN is not defined!');\r\n }*/\r\n\r\n $signature = $_GET[\"signature\"];\r\n $timestamp = $_GET[\"timestamp\"];\r\n $nonce = $_GET[\"nonce\"];\r\n\r\n //$token = TOKEN;\r\n $tmpArr = array($token, $timestamp, $nonce);\r\n // use SORT_STRING rule\r\n sort($tmpArr, SORT_STRING);\r\n $tmpStr = implode( $tmpArr );\r\n $tmpStr = sha1( $tmpStr );\r\n\r\n if( $tmpStr == $signature ){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }",
"private function signedSealed ()\n {\n $signature = getenv('HTTP_X_DROPBOX_SIGNATURE');\n if ( $signature === null || empty( $signature ) ){\n return false;\n } else {\n $httpbody = file_get_contents('php://input');\n $hmac = hash_hmac( 'sha256', $httpbody, DBX_APP_SECRET );\n if ( dbx\\Security::stringEquals( $signature, $hmac ) ) {\n return true;\n } else {\n return false;\n }\n }\n }",
"public function verifyRequest(): void\n {\n $this->verifySignature();\n\n if (!$this->request->hasParameters(['entry.0.messaging.0.sender.id', 'entry.0.messaging.0.message'])) {\n throw new InvalidRequest('Invalid payload');\n }\n }",
"function simpleid_verify_signatures($request) {\n global $version;\n \n log_info('simpleid_verify_signatures');\n \n $is_valid = TRUE;\n \n $assoc = (isset($request['openid.assoc_handle'])) ? cache_get('association', $request['openid.assoc_handle']) : NULL;\n $stateless = (isset($request['openid.response_nonce'])) ? cache_get('stateless', $request['openid.response_nonce']) : NULL;\n \n if (!$assoc) {\n log_notice('simpleid_verify_signatures: Association not found.');\n $is_valid = FALSE;\n } elseif (!$assoc['assoc_type']) {\n log_error('simpleid_verify_signatures: Association does not contain valid assoc_type.');\n $is_valid = FALSE;\n } elseif (!isset($assoc['private']) || ($assoc['private'] != 1)) {\n log_warn('simpleid_verify_signatures: Attempting to verify an association with a shared key.');\n $is_valid = FALSE;\n } elseif (!$stateless || ($stateless['assoc_handle'] != $request['openid.assoc_handle'])) {\n log_warn('simpleid_verify_signatures: Attempting to verify a response_nonce more than once, or private association expired.');\n $is_valid = FALSE;\n } else {\n $mac_key = $assoc['mac_key'];\n $assoc_types = openid_association_types();\n $hmac_func = $assoc_types[$assoc['assoc_type']]['hmac_func'];\n \n $signed_keys = explode(',', $request['openid.signed']);\n $signature = openid_sign($request, $signed_keys, $mac_key, $hmac_func, $version);\n log_debug('***** Signature: ' . $signature);\n \n if ($signature != $request['openid.sig']) {\n log_warn('simpleid_verify_signatures: Signature supplied in request does not match the signatured generated.');\n $is_valid = FALSE;\n }\n \n cache_delete('stateless', $request['openid.response_nonce']);\n }\n \n return $is_valid;\n}",
"public function verifymessage($bitcoinaddress, $signature, $message)\n\t{\n\t\t$result = $this->connect('verifymessage', array((string) $bitcoinaddress, (string) $signature, (string) $message));\n\t\tif ( ! is_null($error = $this->_get_error($result)))\n\t\t{\n\t\t\treturn $error;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn (bool) $result;\n\t\t}\n\t}",
"public function verify()\r\n\t{\r\n\t\treturn ($this->verifyHeaders() && $this->verifyDataFormat() && $this->verifySignature());\r\n\t}",
"private function checkSignature($signature,$timestamp,$nonce)\n {\n $token = Yii::$app->params['wechat']['token'];\n if (!$token) {\n echo 'TOKEN is not defined!';\n } else {\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n\n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }\n }",
"public function verifymessage($address, $sig, $message){\n return $this->bitcoin->verifymessage($address, $sig, $message);\n }",
"protected function validHasSignature()\n {\n if (! $this->request->has('signature')) {\n throw new VanillaInvalidRequestException('Missing signature parameter.');\n }\n }",
"public function check_signature($request, $consumer, $token, $signature) {\n $built = $this->build_signature($request, $consumer, $token);\n return $built == $signature;\n }",
"public function isSignatureRequired();",
"private function checkSignature($signature,$timestamp,$nonce)\n {\n $token = Yii::$app->params['wechat']['token'];\n if (!$token) {\n echo 'TOKEN is not defined!';\n } else {\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n \n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }\n }",
"public function verifyString($message, $signature)\n {\n try {\n $signature = Base64Url::decode($signature);\n $verified = \\ParagonIE_Sodium_Compat::crypto_sign_verify_detached($signature, $message, $this->publicKey);\n } catch (\\Exception $e) {\n throw new CryptographicException(\"Cannot to verify signature.\");\n }\n\n if (!$verified) {\n throw new CryptographicException(\"Failed to verify signature.\");\n }\n\n return $verified;\n }",
"public function verifyXml(string $xmlContent): bool\n {\n if (!$this->publicKeyId) {\n throw new XmlSignatureValidatorException('No public key provided');\n }\n\n // Read the xml file content\n $xml = new DOMDocument();\n $xml->preserveWhiteSpace = true;\n $xml->formatOutput = false;\n $isValid = $xml->loadXML($xmlContent);\n\n if (!$isValid || !$xml->documentElement) {\n throw new XmlSignatureValidatorException('Invalid XML content');\n }\n\n $digestAlgorithm = $this->getDigestAlgorithm($xml);\n $signatureValue = $this->getSignatureValue($xml);\n $xpath = new DOMXPath($xml);\n $xpath->registerNamespace('xmlns', 'http://www.w3.org/2000/09/xmldsig#');\n\n /** @var DOMElement $signedInfoNode */\n foreach ($xpath->evaluate('//xmlns:Signature/xmlns:SignedInfo') as $signedInfoNode) {\n // Remove SignatureValue value\n $signatureValueElement = $this->xmlReader->queryDomNode($xpath, '//xmlns:SignatureValue', $signedInfoNode);\n $signatureValueElement->nodeValue = '';\n\n $canonicalData = $signedInfoNode->C14N(true, false);\n\n $xml2 = new DOMDocument();\n $xml2->preserveWhiteSpace = true;\n $xml2->formatOutput = true;\n $xml2->loadXML($canonicalData);\n $canonicalData = $xml2->C14N(true, false);\n\n $status = openssl_verify($canonicalData, $signatureValue, $this->publicKeyId, $digestAlgorithm);\n\n if ($status !== 1) {\n // The XML signature is not valid\n return false;\n }\n }\n\n return $this->checkDigest($xml, $xpath, $digestAlgorithm);\n }",
"public function verifySignature($data, $signature)\n {\n $resultStatus = openssl_verify($data, $signature, $this->opensslResource, $this->digest);\n if (-1 === $resultStatus) {\n throw new SignatureErrorException($this->type, $this->getOpenSslErrorString());\n } elseif (0 === $resultStatus) {\n throw new InvalidSignatureException($this->type, $this->getOpenSslErrorString());\n }\n\n return true;\n }",
"public function validate_webhook($params) {\n\n $sig = $params['signature'];\n unset($params['signature']);\n\n if (!isset($sig)) {\n return false;\n }\n\n $data = array(\n 'data' => $params,\n 'secret' => $this->account_details['app_secret'],\n 'signature' => $sig\n );\n\n return $this->validate_signature($data);\n\n }",
"protected function validateTokenSignature(): void\n {\n if ($this->header['alg'] !== 'RS256') {\n throw new OidcInvalidTokenException(\"Only RS256 signature validation is supported. Token reports using {$this->header['alg']}\");\n }\n\n $parsedKeys = array_map(function ($key) {\n try {\n return new OidcJwtSigningKey($key);\n } catch (OidcInvalidKeyException $e) {\n throw new OidcInvalidTokenException('Failed to read signing key with error: ' . $e->getMessage());\n }\n }, $this->keys);\n\n $parsedKeys = array_filter($parsedKeys);\n\n $contentToSign = $this->tokenParts[0] . '.' . $this->tokenParts[1];\n /** @var OidcJwtSigningKey $parsedKey */\n foreach ($parsedKeys as $parsedKey) {\n if ($parsedKey->verify($contentToSign, $this->signature)) {\n return;\n }\n }\n\n throw new OidcInvalidTokenException('Token signature could not be validated using the provided keys');\n }",
"public function validateUrlSignature()\n {\n /**\n * @var $validator Validator\n */\n $validator = app()->make('validator')->make($this->request->input(), [\n 'id' => 'required',\n 'expires' => 'required',\n 'hash' => 'required',\n 'signature' => 'required',\n ]);\n\n if($validator->passes()) {\n if(!$this->request->hasCorrectSignature($this->request, false)) {\n $this->apiResponse->setError(\"URL Signature is invalid.\");\n }\n\n if(!$this->request->signatureHasNotExpired($this->request)) {\n $this->apiResponse->setError(\"URL has expired.\");\n }\n\n /**\n * @var User|MustVerifyEmail $user\n */\n $user = User::find($this->request->input('id', null));\n\n if(!$user instanceof User) {\n $this->apiResponse->setError(\"No user found.\");\n } else {\n if (! hash_equals((string) $this->request->input('id'), (string) $user->getKey())) {\n throw new AuthorizationException;\n }\n\n if (! hash_equals((string) $this->request->input('hash'), sha1($user->getEmailForVerification()))) {\n throw new AuthorizationException;\n }\n\n $this->apiResponse->setSuccess(['email' => $user->getEmailForVerification()]);\n }\n } else {\n $this->apiResponse->handleErrors($validator);\n }\n\n return $this->apiResponse->returnResponse();\n }",
"public static function verifySignature($reqBody, $reqSignature, $webhookSecretKey)\n\t{\n\t\treturn CryptoUtil::validMAC($reqBody, $reqSignature, $webhookSecretKey);\n\t}",
"public function testValidSignature()\n {\n $authId = key($this->keys);\n $authSecret = reset($this->keys);\n $timestamp = 1432075982;\n\n $headers = [\n 'Content-Type' => 'text/plain',\n 'X-Authorization-Timestamp' => $timestamp,\n 'Authorization' => 'acquia-http-hmac realm=\"Pipet service\",'\n . 'id=\"' . $authId . '\",'\n . 'nonce=\"d1954337-5319-4821-8427-115542e08d10\",'\n . 'version=\"2.0\",'\n . 'headers=\"\",'\n . 'signature=\"MRlPr/Z1WQY2sMthcaEqETRMw4gPYXlPcTpaLWS2gcc=\"',\n ];\n $request = new Request(\n 'GET',\n 'https://example.acquiapipet.net/v1.0/task-status/133?limit=10',\n $headers\n );\n\n $authenticator = new MockRequestAuthenticator(\n new MockKeyLoader($this->keys),\n null,\n $timestamp\n );\n\n $key = $authenticator->authenticate($request);\n\n $this->assertInstanceOf(KeyInterface::class, $key);\n $this->assertEquals($authId, $key->getId());\n $this->assertEquals($authSecret, $key->getSecret());\n }",
"private function Sm2Verify($md, $PubKeyX, $PubKeyY, $VerfiySign,$generator)\r\n {\r\n $InSignBuf = array();\r\n\r\n $InSignBuf=Hex2ByteBuf::HexStringToByteArray($VerfiySign);\r\n\r\n\r\n $Kx = gmp_init($PubKeyX, 16);\r\n $Ky = gmp_init($PubKeyY, 16);\r\n\r\n $PubKey = $generator->getPublicKeyFrom($Kx,$Ky,null);\r\n $r = gmp_init(substr($VerfiySign,0, 64), 16);\r\n $s = gmp_init(substr($VerfiySign,64, 64), 16);\r\n\r\n $ecc_point_g=$generator->getCurve()->getPoint($generator->GetX(), $generator->GetY());\r\n\r\n $Sm2Ret=$this->sub_Sm2Verify($md, $PubKey , $r, $s,$ecc_point_g,$generator);\r\n\r\n if (gmp_cmp($r,$Sm2Ret)==0)\r\n {\r\n return true;\r\n }\r\n else\r\n return false;\r\n\r\n }",
"public function verifyRequest()\n\t{\n\t\t$this->verifyApplicationId();\n\t\t$this->verifyTimestamp();\n\t\t$this->verifySignatureCertificateUrl($this->getSignatureCertificateUrl());\n\n\t\t$certificate = $this->persistence->getCertificateForKey($this->certificate_url);\n\n\t\tif (! $certificate) {\n\t\t\t$certificate = new Certificate($this->certificate_url);\n\t\t}\n\n\t\t$this->verifyCertificate($certificate);\n\t}",
"public function verifyMessage($address, $sig, $message)\n {\n $body = ['sig' => $sig, 'message' => $message];\n $result = $this->newAPIRequest('GET', '/message/verify/'.$address, $body);\n return $result;\n }",
"public static function verify($secret, $payload, $signature) {\n [$algorithm, $user_string] = explode('=', $signature);\n $known_string = hash_hmac($algorithm, $payload, $secret);\n if (!hash_equals($known_string, $user_string)) {\n throw new WebhookMismatchSignatureException($user_string, $algorithm . '=' . $known_string, $payload);\n }\n return TRUE;\n }",
"public static function checkUnmarshalledVerifySigRequest( ThreeDSecureRequest $fromXmlRequest, PHPUnit_Framework_TestCase $testCase ) {\n\n\t\t$testCase->assertNotNull( $fromXmlRequest );\n\t\t$testCase->assertEquals( self::CARD_NUMBER, $fromXmlRequest->getCard()->getNumber() );\n\t\t$testCase->assertEquals( self::$CARD_TYPE->getType(), $fromXmlRequest->getCard()->getType() );\n\t\t$testCase->assertEquals( self::CARD_HOLDER_NAME, $fromXmlRequest->getCard()->getCardHolderName() );\n\t\t$testCase->assertEquals( self::CARD_EXPIRY_DATE, $fromXmlRequest->getCard()->getExpiryDate() );\n\n\t\t$testCase->assertEquals( self::ACCOUNT, $fromXmlRequest->getAccount() );\n\t\t$testCase->assertEquals( self::MERCHANT_ID, $fromXmlRequest->getMerchantId() );\n\t\t$testCase->assertEquals( ThreeDSecureType::VERIFY_SIG, $fromXmlRequest->getType() );\n\t\t$testCase->assertEquals( self::AMOUNT, $fromXmlRequest->getAmount()->getAmount() );\n\t\t$testCase->assertEquals( self::CURRENCY, $fromXmlRequest->getAmount()->getCurrency() );\n\t\t$testCase->assertEquals( self::TIMESTAMP, $fromXmlRequest->getTimeStamp() );\n\t\t$testCase->assertEquals( self::ORDER_ID, $fromXmlRequest->getOrderId() );\n\n\t\t$testCase->assertEquals( self::THREE_D_SECURE_PARES, $fromXmlRequest->getPares() );\n\t\t$testCase->assertEquals( self::THREE_D_SECURE_VERIFY_SIG_REQUEST_HASH, $fromXmlRequest->getHash() );\n\t}",
"function check_signature(){\n $nonce = $_GET['nonce'];\n $token = 'hello';\n $timestamp = $_GET['timestamp'];\n $signature = $_GET['signature'];\n $echostr = $_GET['echostr'];\n $arr = array($nonce,$token,$timestamp);\n sort($arr);\n $str = sha1(implode($arr));\n if($str == $signature && $echostr){\n echo $echostr;\n }else{\n response();\n }\n}",
"function checkSign($echoStr){\r\n if(wmpBasic::checkSignature($this->cfg)){\r\n die($echoStr); \r\n }else{\r\n die('Error: checkSignature');\r\n }\r\n }",
"private function checkSignature($str='')\n {\n $signature = isset($_GET[\"signature\"])?$_GET[\"signature\"]:'';\n $signature = isset($_GET[\"msg_signature\"])?$_GET[\"msg_signature\"]:$signature; //如果存在加密验证则用加密验证段\n $timestamp = isset($_GET[\"timestamp\"])?$_GET[\"timestamp\"]:'';\n $nonce = isset($_GET[\"nonce\"])?$_GET[\"nonce\"]:'';\n\n $token = $this->token;\n $tmpArr = array($token, $timestamp, $nonce,$str);\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n\n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }",
"public function needsVerificationMessage ();",
"public function validateParams($params)\n {\n $notificationSignature = null;\n\n if (isset($params['notificationSignature'])) {\n $notificationSignature = $params['notificationSignature'];\n unset($params['notificationSignature']);\n }\n\n $queryParams = http_build_query($params, '', '&');\n\n $computed = md5($queryParams . $this->getAuthorizationKey());\n\n if ($computed !== $notificationSignature) {\n Mage::throwException('Validate params: Signature and build hash do not match!');\n }\n }",
"private function signatureIsValid(Request $request)\n {\n $url = $request->path();\n\n // Recreate the original signature to compare it and check that it is valid\n $urlSignature = hash_hmac('sha256', $url, Crypt::getEncryptionKey());\n\n $originalSignature = $request->query('sig', '');\n\n return hash_equals($urlSignature, (string) $originalSignature);\n }",
"protected function checkVerification()\n {\n $verificationString = $this->getRequest()->getHeader('X-GCS-Webhooks-Endpoint-Verification');\n if ($verificationString) {\n $this->getResponse()->setHeader('Content-Type', 'text/plain');\n $this->getResponse()->setBody(\n $verificationString\n );\n\n return true;\n }\n\n return false;\n }",
"public function testSuccess()\n {\n $signatures = SmartwaiverTypes::createSignatures();\n $swSignatures = new SmartwaiverSignatures($signatures);\n\n $this->assertEquals($signatures['waiverId'], $swSignatures->waiverId);\n $this->assertEquals($signatures['templateId'], $swSignatures->templateId);\n $this->assertEquals($signatures['title'], $swSignatures->title);\n $this->assertEquals($signatures['createdOn'], $swSignatures->createdOn);\n\n $this->assertCount(count($signatures['signatures']['participants']), $swSignatures->participantSignatures);\n foreach($swSignatures->participantSignatures as $participantSignature) {\n $this->assertEquals('BASE64ENCODED', $participantSignature);\n }\n\n $this->assertCount(count($signatures['signatures']['guardian']), $swSignatures->guardianSignatures);\n foreach($swSignatures->guardianSignatures as $guardianSignature) {\n $this->assertEquals('BASE64ENCODED', $guardianSignature);\n }\n\n $this->assertCount(count($signatures['signatures']['bodySignatures']), $swSignatures->bodySignatures);\n foreach($swSignatures->bodySignatures as $bodySignature) {\n $this->assertEquals('BASE64ENCODED', $bodySignature);\n }\n\n $this->assertCount(count($signatures['signatures']['bodyInitials']), $swSignatures->bodyInitials);\n foreach($swSignatures->bodyInitials as $bodyInitial) {\n $this->assertEquals('BASE64ENCODED', $bodyInitial);\n }\n }",
"function verify_request ($body) {\n\tglobal $config;\n\treturn strpos($_SERVER['HTTP_USER_AGENT'], 'GitHub-Hookshot') !== false &&\n\t\thash_equals($_SERVER['HTTP_X_HUB_SIGNATURE'], 'sha1=' . hash_hmac('sha1', $body, $config->token));\n}",
"public static function verifySignature(string $certificatePem): int\n {\n /* In case we receive a DER file and have to convert it to PEM\n if (strpos($certificateDer, '-----BEGIN CERTIFICATE-----') === 0) {\n // this certificate is already a PEM file, no need to do anything else\n $pem = $certificateDer;\n } else {\n // this certificate is binary, we have to coerce it\n $pem = OpenSSLUtility::coerceBinaryCertificate($certificateDer);\n }\n */\n\n $certificateDer = self::certificatePemToDer($certificatePem);\n\n if (!$certificateDer) {\n // PEM reading failure\n return -1;\n }\n\n $certificate = openssl_x509_read($certificatePem);\n\n if ($certificate === false) {\n // X509 Read failure\n return -1;\n }\n\n $certificateParsed = openssl_x509_parse($certificate);\n\n if (!$certificateParsed) {\n // X509 Parse failure\n return -1;\n }\n\n\n try {\n /** @var Sequence $certificateAsn */\n $certificateAsn = ASNObject::fromBinary($certificateDer);\n } catch (\\Exception $e) {\n // Certificate ASN1 Parse failure\n return -1;\n }\n\n if ($certificateAsn->getNumberOfChildren() != 3) {\n // Certificate ASN1 invalid number of children, expecting 3\n return -1;\n }\n\n /** @var Sequence $certificateBodyAsn */\n $certificateBodyAsn = $certificateAsn->getChildren()[0];\n $certificateBodyBinary = $certificateBodyAsn->getBinary();\n\n /** @var BitString $certificateSignatureAsn */\n $certificateSignatureAsn = $certificateAsn->getChildren()[2];\n // The BitString implementation has 3 methods that are more or less the same:\n // - binary(): returns the complete node binary, including the \"headers\"\n // - binaryContent(): returns the content binary, but prepends a byte of \"unused bytes\", in this case, it's always 0\n // - content(): returns a _human-readable_ (hex) representation of the value.\n // The simplest method to extract the actual signature binary is to apply a hex2bin() to the content() returns\n $certificateSignatureBinary = hex2bin($certificateSignatureAsn->getContent());\n\n $signatureType = $certificateParsed['signatureTypeLN'];\n\n if ($signatureType !== 'sha256WithRSAEncryption') {\n // Invalid SignatureType, expecting 'sha256WithRSAEncryption'\n return -1;\n }\n\n // try each and every trusted CA key..\n self::loadCACertificates();\n\n $decrypted = false;\n $hashInSignature = null;\n foreach (self::$caCertificates as $c) {\n // attempt to decrypt the signature that was found in the body against the public keys of the known Local Trusted CAs\n $r = openssl_public_decrypt($certificateSignatureBinary, $decryptedSignatureBinary, $c['public_key']);\n\n if ($r) {\n // Decrypt success! attempt to parse the result\n\n try {\n /** @var Sequence $signatureAsn */\n $signatureAsn = ASNObject::fromBinary($decryptedSignatureBinary);\n } catch (\\Exception $e) {\n // Signature ASN1 Parse failure\n return -1;\n }\n\n if ($signatureAsn->getNumberOfChildren() != 2) {\n // Signature ASN1 invalid number of children, expecting 2\n return -1;\n }\n\n // Extract the Certificate Hash that was encrypted in the signature\n // See the explanation for $certificateSignatureBinary above\n $hashInSignature = hex2bin($signatureAsn->getChildren()[1]->getContent());\n $decrypted = true;\n\n break;\n }\n }\n\n if (!$decrypted) {\n // unable to decrypt the signature, this means none of the Local Trusted CA signed this certificate\n return 0;\n }\n\n // Compare the Certificate Body Hash to the Hash that was encrypted in the signature\n $certificateBodyHash = openssl_digest($certificateBodyBinary, 'SHA256', true);\n\n if ($certificateBodyHash == $hashInSignature) {\n return 1;\n } else {\n // hash mismatched\n return 0;\n }\n }",
"public function verifySignature(array $aData, $sVerificationSignature)\n\t{\n\t\treturn ($this->signRequest($aData) == $sVerificationSignature);\n\t}",
"public function isRequestSigned()\r\n\t{\r\n\t\t$headers = $this->getAllHeaders();\r\n\r\n\t\tif (!isset($headers[\"Authorization\"]))\r\n\t\t\treturn false;\r\n\r\n\t\tif (!isset($headers[\"Signature\"]))\r\n\t\t\treturn false;\r\n\r\n\t\tif (!($this->appId = $this->getApplicationId()))\r\n\t\t\treturn false;\r\n\r\n\t\t$this->secret = $this->appService->getApplicationSecret($this->appId);\r\n\r\n\t\tif (!$this->secret)\r\n\t\t\treturn false;\r\n\r\n\t\t$signature = $headers[\"Signature\"];\r\n\t\t$expected = $this->create();\r\n\r\n\t\treturn $this->compare($signature, $expected);\r\n\t}",
"public function isSignatureValid(string $response, string $signature, string $publicKey) : bool\n {\n if (\\strlen($publicKey) !== SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES) {\n throw new InvalidArgumentException(sprintf(\"Public key should be %d bytes.\", SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES));\n }\n\n if (\\strlen($signature) !== 64) {\n throw new InvalidArgumentException(sprintf(\"Signature %d bytes.\", 64));\n }\n\n try {\n return \\sodium_crypto_sign_verify_detached(\n $signature,\n $response,\n $publicKey\n );\n } catch (SodiumException $e) {\n throw new InvalidArgumentException($e->getMessage());\n }\n }",
"public function verifySignedMessage(string $signedMessage, string $publicKey): string\n {\n try {\n $publicKey = sodium_hex2bin($publicKey);\n $signedMessage = sodium_base642bin($signedMessage, SODIUM_BASE64_VARIANT_ORIGINAL);\n if (strlen($publicKey) !== SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES) {\n throw new InvalidArgumentException('The key must be ' . SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES . ' long.');\n }\n\n if (strlen($signedMessage) === 0) {\n throw new InvalidArgumentException('The message must not be empty.');\n }\n\n $result = sodium_crypto_sign_open($signedMessage, $publicKey);\n if ($result === false) {\n throw new RuntimeException('Could not verify message.');\n }\n return $result;\n } catch (SodiumException $e) {\n throw new RuntimeException('Could not verify data', 0, $e);\n }\n }",
"public function testVerify()\n {\n $this->assertFalse(\n SmsVerification::of($this->config)->verify('+456', 'TEST_SECRET')\n );\n\n // Assert false when the phone is not stored\n $this->assertFalse(\n SmsVerification::of($this->config)->verify('+123', 'CLIENT_SECRET')\n );\n\n // Assert true when the phone and secret are properly given\n $this->assertFalse(\n SmsVerification::of($this->config)->verify('+123', 'TEST_SECRET')\n );\n }",
"private function verify($fileName = \"\", $fileContent = \"\"){\n if (empty($fileName) && empty($fileContent)){\n throw new Exception(\"Filename and fileContent can not be empty simultaneously.\");\n }\n if (!empty($fileName) && !empty($fileContent)){\n throw new Exception(\"Filename and fileContent can not be passed simultaneously.\");\n }\n if (!empty($fileName) && !file_exists($fileName)){\n throw new Exception(\"File with given filename does not exist.\");\n }\n if (! file_exists($this->tmpDir) || ! is_writable($this->tmpDir)){\n throw new Exception(\"Tmp dir does not exist or is not writable.\");\n }\n\n $randomId = uniqid();\n if (!empty($fileContent)){\n $fileName = sprintf(\"%s/%s.pdf\", $this->tmpDir, $randomId);\n file_put_contents($fileName, $fileContent);\n }\n\n $file = file_get_contents($fileName);\n\n $filters = $this->getFilters($file);\n if (empty($filters)){\n throw new Exception(\"Filter section in given file was not found.\");\n }\n\n $byteRange = $this->getByteRange($file);\n if (empty($byteRange)){\n throw new Exception(\"ByteRange section in given file was not found.\");\n }\n\n $binarySignature = $this->getBinarySignature($file);\n if (empty($binarySignature)){\n throw new Exception(\"Signature section in given file was not found.\");\n }\n\n $extFile = sprintf(\"%s/%s.ext.pdf\", $this->tmpDir, $randomId);\n if (! $this->removeSigatureFromPdf($fileName, $extFile, $byteRange)){\n throw new Exception(\"Extracting a signature from given file was not successfull.\");\n }\n\n $certPem = sprintf(\"%s/%s.pem\", $this->tmpDir, $randomId);\n $certPkcs7 = sprintf(\"%s/%s.pkcs7\", $this->tmpDir, $randomId);\n if (! $this->createPKCS7FromSignature($binarySignature, $certPem, $certPkcs7)){\n throw new Exception(\"Creating a certificate from signature was not successfull.\");\n }\n\n $certDer = sprintf(\"%s/%s.der\", $this->tmpDir, $randomId);\n if (! $this->convertPKCS7ToDER($certPkcs7, $certDer)){\n throw new Exception(\"Conversion of a certificate from PKCS7 to DER was not successfull.\");\n }\n\n $countCertsSignature = $this->convertPKCS7ToPEM($certPkcs7, $certPem);\n if ($countCertsSignature <= 0){\n throw new Exception(\"Conversion of a certificate from PKCS7 to PEM was not successfull.\");\n }\n\n// if($countCertsSignature>1) $countCertsSignature = 1; //onma, je problem s vice certifikaty, v PDF je vetsinou hned prvni soukromy klic\n for ($pocet=0; $pocet<$countCertsSignature; $pocet++ ) {\n $parsedCert = $this->parseCert(sprintf(\"%s.%d\", $certPem, $pocet));\n $cislo = $parsedCert['subject']['serial'];\n if ($cislo<>'') $pocet = 999999; //vyskocime\n }\n// $parsedCert = $this->parseCert(sprintf(\"%s.%d\", $certPem, $countCertsSignature - 1));\n\n\n $digest = sprintf(\"%s/%s.dig.bin\", $this->tmpDir, $randomId);\n $digests = $this->extractSignedDigest($certDer, $digest);\n if (empty($digests) || (empty($digests[\"rsaEncoded\"]) && empty($digests[\"messageDigest\"]) && empty($digests[\"PKCS7Data\"]))){\n throw new Exception(\"Extracting of a signed digest from certificate was not successfull.\");\n }\n\n $publicKey = sprintf(\"%s/%s.pubkey.pem\", $this->tmpDir, $randomId);\n\n $fileHashes = array(\n \"sha256\" => hash_file(\"sha256\", $extFile),\n \"sha1\" => hash_file(\"sha1\", $extFile),\n \"md5\" => hash_file(\"md5\", $extFile)\n );\n $signedHashes = array();\n\n if(!empty($digests[\"rsaEncoded\"])){\n if (! $this->createPublicKeyFromPEM($certPem, $publicKey)){\n throw new Exception(\"Creating of a public key from certificate was not successfull.\");\n }\n\n foreach($digests[\"rsaEncoded\"] as $dg){\n if(!empty($dg)){\n $decDigest = sprintf(\"%s.dec\", $dg);\n if (! $this->decryptBinaryDigest($dg, $decDigest, $publicKey)){\n throw new Exception(\"Decryption of a signed digest from certificate was not successfull.\");\n }\n if(file_exists($decDigest)){\n $signedHashes[] = strtolower(substr(bin2hex(file_get_contents($decDigest)), self::MAGIC));\n }\n }\n }\n }\n\n if(!empty($digests[\"messageDigest\"])){\n foreach($digests[\"messageDigest\"] as $md){\n $signedHashes[] = strtolower($md);\n }\n }\n\n if(!empty($digests[\"PKCS7Data\"])){\n foreach($digests[\"PKCS7Data\"] as $md){\n $signedHashes[] = strtolower($md);\n }\n }\n\n if(self::ENABLE_CLEANING){\n $this->rm($extFile);\n $this->rm($certPem);\n $this->rm($certPkcs7);\n $this->rm($certDer);\n $this->rm($publicKey);\n $this->rm($digest);\n if($countCertsSignature > 0){\n for($i = 0; $i < $countCertsSignature; $i++){\n $this->rm(sprintf(\"%s.%d\", $certPem, $i));\n }\n }\n if(!empty($digests[\"rsaEncoded\"])){\n foreach($digests[\"rsaEncoded\"] as $rsa){\n $this->rm(sprintf(\"%s\", $rsa));\n $this->rm(sprintf(\"%s.dec\", $rsa));\n }\n }\n if(!empty($fileContent)){\n $this->rm($fileName);\n }\n }\n\n foreach ($fileHashes as $algo => $hash) {\n if(in_array($hash, $signedHashes)){\n $r = array(\n \"result\" => true,\n \"alg\" => $algo,\n \"hash\" => $hash\n );\n return array_merge($r, $parsedCert);\n }\n }\n\n return array(\n \"result\" => false,\n \"fileHashes\" => $fileHashes,\n \"signedHashes\" => $signedHashes\n );\n }",
"public static function validate_request($signed_request){\n list($encoded_sig, $encoded_data) = explode('.', $signed_request);\n\n $decoded_data = base64_decode(strtr($encoded_data, '-_', '+/'));\n\n $correct_decoded_sig = hash_hmac(\n 'sha256',\n $encoded_data,\n Configure::read('Opauth.Strategy.Truenth.client_secret'),\n true\n );\n $correct_encoded_sig = strtr(base64_encode($correct_decoded_sig), '+/', '-_');\n\n if ($correct_encoded_sig !== $encoded_sig){\n CakeLog::write(LOG_ERROR, 'Request signature invalid');\n return false;\n }\n return json_decode($decoded_data, true);\n }",
"public function validateSignature(array $request)\n {\n $this->assertRequestParamIsNotNull(\n $request, 'hmac', 'Expected signature in query params'\n );\n\n $hmac = $request['hmac'];\n\n return $this->generateSignature($request, '&') === $hmac;\n }",
"function verify($filePath, $publicKeys = array(), $fileSign = null){\n $payload = \"\";\n if($fileSign!=null){\n if(file_exists($fileSign))\n $payload = file_get_contents($fileSign);\n else{\n // if not file then it is a payload\n $payload = $fileSign;\n }\n }else{\n $payload = file_get_contents($filePath.'.jwt.sign');\n }\n if($publicKeys==null)\n $publicKeys = array();\n\n $result = array();\n $signs = explode(\"\\n\",str_replace(\"\\r\",'',$payload));\n\n foreach($signs as $temp){\n //sign array 0 is email 1 is jwt\n $sign = explode(\" \",$temp);\n //if it email then process\n if (filter_var($sign[0], FILTER_VALIDATE_EMAIL)) {\n //get public key from payload if publicKeys not provided\n if(!isset($publicKeys[$sign[0]])){\n $tmp = explode(\".\",$sign[1]);\n $data = json_decode(base64_decode($tmp[1]),true);\n $publicKey = $data['key'];\n }else{\n $publicKey = $publicKeys[$sign[0]];\n }\n try{\n $res = (array) JWT::decode($sign[1], $publicKey, array('RS256'));\n foreach($res as $k => $v){\n $result[$sign[0]][$k] = $v;\n }\n $path = ($filePath!=null && file_exists($filePath))? $filePath : $res['file'];\n if(!file_exists($path)){\n $result[$sign[0]]['verified'] = false;\n $result[$sign[0]]['error'] = 'File not found';\n }else{\n $result[$sign[0]]['sha256_verified'] = ($res['sha256']==hash_file(\"sha256\",$path));\n $result[$sign[0]]['sha1_verified'] = ($res['sha1']==sha1_file($path));\n $result[$sign[0]]['md5_verified'] = ($res['md5']==md5_file($path));\n if($result[$sign[0]]['sha256_verified'] && $result[$sign[0]]['sha1_verified'] && \n $result[$sign[0]]['md5_verified']){\n $result[$sign[0]]['verified'] = true;\n }else{\n $result[$sign[0]]['verified'] = false;\n }\n }\n }catch(\\Exception $e){\n $result[$sign[0]]['verified'] = false;\n $result[$sign[0]]['error'] = 'Signature invalid, '.$e->getMessage();\n }\n }\n }\n return $result;\n }",
"public function verify($secret)\n {\n if ($this->verified) {\n return $this;\n }\n $signature = $this->getSignature();\n if (!isset($signature)) {\n throw new WebhookMessageException('No X-Hub-Signature in the headers');\n }\n $parts = explode('=', $signature);\n $algo = $parts[0];\n $receivedHash = $parts[1];\n if (hash_hmac($algo, $this->getPayload(), $secret) !== $receivedHash) {\n throw new WebhookMessageException('Invalid X-Hub-Signature in the headers');\n }\n $this->verified = true;\n return $this;\n }",
"public function getSignature();",
"public function checkSig($sigfile) {\n\t\tif (!is_file($sigfile)) {\n\t\t\tthrow new \\Exception(sprintf(_(\"checkSig was given %s, which is not a file\"),$sigfile));\n\t\t}\n\n\t\t$out = $this->runGPG(\"--output - \".escapeshellarg($sigfile));\n\n\t\t// Check to see if we don't know about this signature..\n\t\tif (isset($out['status'][2]) && preg_match('/NO_PUBKEY (.+)/', $out['status'][2], $keyarr)) {\n\t\t\t// We don't. Try to grab it.\n\t\t\ttry {\n\t\t\t\t$this->getKey($keyarr[1]);\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\t// Couldn't download the key.\n\t\t\t\treturn array(\"status\" => self::STATE_INVALID);\n\t\t\t}\n\t\t\t// And now run the validation again.\n\t\t\t$out = $this->runGPG(\"--output - \".escapeshellarg($sigfile));\n\t\t}\n\n\t\t$status = $this->checkStatus($out['status']);\n\t\tif (!$status['trust']) {\n\t\t\t$longkey = substr($this->freepbxkey, -16);\n\t\t\t$sigout = $this->runGPG(\"--keyid-format long --with-colons --check-sigs \".$status['signedby']);\n\t\t\tif(preg_match('/^rev:!::1:'.$longkey.'/m',$sigout['stdout'])) {\n\t\t\t\treturn array(\"status\" => self::STATE_REVOKED, 'trustdetails' => array(\"Signed by Revoked Key\"));\n\t\t\t}\n\t\t\t$status['parsedout'] = @parse_ini_string($out['stdout'], true);\n\t\t\treturn $status;\n\t\t}\n\t\t// Silence warnings about '# not a valid comment'.\n\t\t// This should be removed after 12beta is finished.\n\t\t$modules = @parse_ini_string($out['stdout'], true);\n\t\t$modules['rawstatus'] = $status;\n\t\treturn $modules;\n\t}",
"public function verifyRequest()\n {\n }",
"public function check_signature($file, $signature) {\n if (!file_exists($file) || !file_exists($signature)) {\n return false;\n }\n\n $content = file_get_contents($file);\n $signContent = hex2bin(file_get_contents($signature));\n\n return openssl_verify($content, $signContent, $this->get_certificate()) == 1;\n }",
"function verify_webhook($data, $hmac_header)\n{\n $calculated_hmac = base64_encode(hash_hmac('sha256', $data, SHOPIFY_APP_SECRET, true));\n return hash_equals($hmac_header, $calculated_hmac);\n}",
"public function checkHash()\n {\n $config = $this->getDI()->get('config');\n $connect_string = sprintf('http://%s:%s@%s:%s/', $config->eunod->user, $config->eunod->pass, $config->eunod->host, $config->eunod->port);\n $coind = new jsonRPCClient($connect_string);\n\n return $coind->verifymessage($this->masternode_address, $this->signed_msg, $this->telegram_username);\n }",
"private function check_signature(&$request, $consumer, $token) {\n // this should probably be in a different method\n $timestamp = @$request->get_parameter('oauth_timestamp');\n $nonce = @$request->get_parameter('oauth_nonce');\n\n $this->check_timestamp($timestamp);\n $this->check_nonce($consumer, $token, $nonce, $timestamp);\n\n $signature_method = $this->get_signature_method($request);\n\n $signature = $request->get_parameter('oauth_signature');\n $valid_sig = $signature_method->check_signature(\n $request,\n $consumer,\n $token,\n $signature\n );\n\n if (!$valid_sig) {\n throw new OAuthException(\"Invalid signature\");\n }\n }",
"protected function checkSignature(PriceWaiter_NYPWidget_Controller_Endpoint_Request $request, $signature)\n {\n $secret = $this->getSharedSecret();\n\n if ($request->isSignatureValid($signature, $secret)) {\n return true;\n }\n\n throw new PriceWaiter_NYPWidget_Exception_Signature();\n }",
"public function verify($data, $signature, $alias, $options=array())\n {\n $ok = 0;\n $binSig = '';\n if ($this->isCertificateEntry($alias)) {\n \n $processedOpts = $this->_processAsymmetricOptions($options);\n $entry = $this->getEntry($alias);\n switch ($entry->getEntryType()) {\n case Crypt_KeyStore_BaseEntry::PRIVATEKEY_TYPE:\n $cert = $entry->getCertificate()->getEncoded();\n break;\n case Crypt_KeyStore_BaseEntry::TRUSTEDCERT_TYPE:\n $cert = $entry->getTrustedCertificate()->getEncoded();\n break;\n default:\n throw new Crypt_KeyStore_Exception(\"Invalid entry \"\n . \"type for signature\");\n break;\n }\n \n try {\n $binSig = pack('H*', $signature);\n // compute signature\n $ok = openssl_verify(\n $data, \n $binSig, \n $cert, \n $processedOpts[self::OPT_DIGEST]\n );\n }\n catch (Exception $e) {\n throw new Crypt_KeyStore_Exception($e);\n }\n } else {\n throw new Crypt_KeyStore_Exception(\n \"Entry $alias is not a valid entry for signatures\");\n }\n \n if ($ok < 0) {\n throw new Crypt_KeyStore_Exception(\"Failed to verify signature\");\n }\n \n return ($ok == 1);\n }",
"public function verify($token):bool;",
"public static function isSignature( $string )\n {\n return $string == pack( \"V\", self::magic );\n }",
"function openssl_spki_verify(string $spki): bool {}",
"function handle_claim() {\n $file = $_FILES[\"claim\"];\n\n if (!check_upload(&$file)) {\n header(\"HTTP/1.1 400 Bad Request\");\n echo \"Uploaded file missing or of wrong type!\\n\";\n return false;\n }\n\n if (($err = verify_signature(&$file)) !== \"OK\") {\n header(\"HTTP/1.1 400 Bad Request\");\n echo \"The claim's signature is invalid!\\n$err\\n\";\n return false;\n }\n\n extract_claim($file);\n return true;\n}",
"public function ChecksigVectors()\n {\n $ec = EcAdapterFactory::getAdapter(new Math(), EccFactory::getSecgCurves()->generator256k1());\n $privateKey = PrivateKeyFactory::fromHex('4141414141414141414141414141414141414141414141414141414141414141', false, $ec);\n\n $standard = ScriptFactory::defaultFlags();\n\n $vectors = [];\n\n // Pay to pubkey hash that succeeds\n $s0 = ScriptFactory::scriptPubKey()->payToPubKeyHash($privateKey->getPublicKey());\n $vectors[] = [\n true,\n $ec,\n $standard, // flags\n $privateKey, // privKey\n $s0,\n null, // redeemscript,\n ];\n\n // Pay to pubkey that succeeds\n $s1 = ScriptFactory::create()->push($privateKey->getPublicKey()->getBuffer())->op('OP_CHECKSIG')->getScript();\n $vectors[] = [\n true,\n $ec,\n $standard, // flags\n $privateKey, // privKey\n $s1,\n null, // redeemscript\n ];\n\n $rs = ScriptFactory::p2sh()->multisig(1, [$privateKey->getPublicKey()]);\n $vectors[] = [\n true,\n $ec,\n InterpreterInterface::VERIFY_P2SH |\n InterpreterInterface::VERIFY_WITNESS |\n InterpreterInterface::VERIFY_CLEAN_STACK\n ,\n $privateKey,\n $rs->getOutputScript(),\n $rs\n ];\n\n return $vectors;\n }",
"public function validateSignature(string $instance, string $apiKey, string $platform): bool\n {\n $payrexx = $this->getInterface($instance, $apiKey, $platform);\n try {\n $payrexx->getOne(new SignatureCheck());\n return true;\n } catch (\\Payrexx\\PayrexxException $e) {\n return false;\n }\n }",
"private function hash_validation() { //check hash\n\n\t\t$testMode = getRequest('ik_pw_via');\n\n\t\tif(isset($testMode) && $testMode == 'test_interkassa_test_xts'){\n\t\t\t$secretKey = $this->object->test_key;\n\t\t} else {\n\t\t\t$secretKey = $this->object->secret_key;\n\t\t}\n\n\t\t$data = array();\n\n\t\tforeach ($_REQUEST as $key => $value) {\n if (!preg_match('/ik_/', $key)) continue;\n $data[$key] = $value;\n }\n\n\t\t$ik_sign = $data['ik_sign'];\n\t\t$sign = $this->createSign($data,$secretKey);\n\n\t\t$this->wrlog(\"hash: \".$sign);\n\t\t$this->wrlog(\"ik_sign: \".$ik_sign);\n\t\treturn $sign == $ik_sign ? true : false;\n\t}",
"protected function checkRsaSignature($toCheck, $signature, $rsaKey, $useCache)\n {\n // First decode the signature\n $signature = base64_decode($signature);\n\n if (isset($this->_pubKeyCache[$rsaKey['modulo'].$rsaKey['exponent']])) {\n $openSslPubKey = $this->_pubKeyCache[$rsaKey['modulo'].$rsaKey['exponent']];\n $verified = openssl_verify($toCheck, $signature, $openSslPubKey);\n } else {\n // Initialize the public key to verify with\n $pubKey['n'] = base64_decode($rsaKey['modulo']);\n $pubKey['e'] = base64_decode($rsaKey['exponent']);\n\n $openSslPubKey = openssl_pkey_get_public($this->seclibToOpenSsl($pubKey));\n $verified = openssl_verify($toCheck, $signature, $openSslPubKey);\n\n // Keep caching the resource?\n if ($useCache) {\n $this->_pubKeyCache[$rsaKey['modulo'].$rsaKey['exponent']] = $openSslPubKey;\n } else {\n // PHP 8 automatically frees the key instance and deprecates the function\n if (\\PHP_VERSION_ID < 80000) {\n openssl_free_key($openSslPubKey);\n }\n } // else\n } // else\n\n return $verified;\n }",
"public function verifyPayload($payload, $signature, $secret, $tolerance = null)\n {\n $timestamp = $this->getTimestamp($signature);\n $value = $this->getValue($signature);\n\n $payload = is_string($payload) ? $payload : json_encode($payload);\n $timedPayload = \"$timestamp.$payload\";\n $expectedValue = $this->computeSignature($timedPayload, $secret);\n\n if ($this->util->secureCompare($expectedValue, $value) === false) {\n throw new SignatureVerificationException(\n \"Value mismatch the expected signature for payload\"\n );\n }\n\n // Check if timestamp is within tolerance\n if (($tolerance > 0) && ((time() - $timestamp) > $tolerance)) {\n throw new SignatureVerificationException(\n \"Timestamp outside the tolerance zone\"\n );\n }\n\n return true;\n }",
"public final function verify($token)\n {\n }",
"protected function verifySignature($key, string $dataToSign): bool\n {\n if (empty($this->signature)) {\n throw new InvalidSignatureException('Invalid signature.');\n }\n\n $method = 'verifyWith' . $this->algorithm;\n\n if (!method_exists($this, $method)) {\n throw new DomainException('Unsupported hashing algorithm.');\n }\n\n $verified = call_user_func_array(\n [$this, $method],\n [$key, $dataToSign, $this->signature]\n );\n\n if (!is_bool($verified)) {\n throw new RuntimeException(sprintf(\n 'Invalid return value given from \"%s\".',\n $method\n ));\n }\n\n return $verified;\n }",
"function openssl_cms_verify(string $input_filename, int $flags = 0, ?string $certificates, array $ca_info = [], ?string $untrusted_certificates_filename, ?string $content, ?string $pk7, ?string $sigfile, int $encoding = OPENSSL_ENCODING_SMIME): bool {}",
"public static function verifyDocumentSignature(\\DOMElement $signature, \\ass\\XmlSecurity\\Key $keyForSignature = null)\n {\n if (is_null($keyForSignature)) {\n $keyForSignature = self::getSecurityKey($signature);\n }\n\n $signedInfo = $signature->getElementsByTagNameNS(self::NS_XMLDSIG, 'SignedInfo')->item(0);\n if (!is_null($signedInfo)) {\n $canonicalizationMethod = $signedInfo->getElementsByTagNameNS(self::NS_XMLDSIG, 'CanonicalizationMethod')->item(0);\n if (!is_null($canonicalizationMethod)) {\n $canonicalizationAlgorithm = $canonicalizationMethod->getAttribute('Algorithm');\n $signatureValue = $signature->getElementsByTagNameNS(self::NS_XMLDSIG, 'SignatureValue')->item(0);\n if (!is_null($signatureValue)) {\n $canonicalizedData = self::canonicalizeData($signedInfo, $canonicalizationAlgorithm);\n $decodedSignatureValueFromSoapMessage = base64_decode($signatureValue->textContent);\n\n return $keyForSignature->verifySignature($canonicalizedData, $decodedSignatureValueFromSoapMessage);\n }\n }\n }\n\n return false;\n }",
"public static function verify($string){\n\t\t$homeDir = ConfigManager::getConfig(\"Crypto\",\"GPG\")->AuxConfig->gpgHomeDir;\n\t\t$gpg = new Crypt_GPG(array('homedir'=>$homeDir));\n\t\t$signatures = $gpg->verify($string);\n\t\t\n\t\tif ($signatures[0]->isValid()) {\n\t\t\treturn true;\n\t\t} \n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}"
] | [
"0.7428773",
"0.7361915",
"0.73293626",
"0.7200297",
"0.71124095",
"0.7044833",
"0.69791484",
"0.6973517",
"0.697022",
"0.69566286",
"0.69552964",
"0.69521046",
"0.6947767",
"0.69391763",
"0.69255495",
"0.69215876",
"0.68963456",
"0.6896077",
"0.6896077",
"0.6896077",
"0.6891761",
"0.68840516",
"0.6864215",
"0.6770654",
"0.67573696",
"0.66687727",
"0.6616421",
"0.6535283",
"0.6531687",
"0.64760244",
"0.64728165",
"0.6410081",
"0.6390019",
"0.6385195",
"0.6372549",
"0.6369398",
"0.6326328",
"0.6317353",
"0.62972397",
"0.6289956",
"0.6284789",
"0.6282836",
"0.6274037",
"0.622767",
"0.62249255",
"0.6218666",
"0.6209565",
"0.6152122",
"0.61498517",
"0.6147769",
"0.61477566",
"0.61142397",
"0.604126",
"0.6036553",
"0.60295403",
"0.602725",
"0.6025925",
"0.6017523",
"0.6002029",
"0.597331",
"0.59510267",
"0.59392285",
"0.59092456",
"0.5885942",
"0.58814406",
"0.58672136",
"0.5864682",
"0.5850815",
"0.58507866",
"0.5850524",
"0.5779512",
"0.5766565",
"0.5766082",
"0.57269394",
"0.5716614",
"0.571253",
"0.5709886",
"0.5706545",
"0.5698767",
"0.5694449",
"0.56681204",
"0.5667608",
"0.56588846",
"0.5657571",
"0.56496245",
"0.56458336",
"0.5645077",
"0.56360465",
"0.56336844",
"0.5620626",
"0.56109613",
"0.5606681",
"0.5584535",
"0.5584389",
"0.5584235",
"0.5575885",
"0.5568932",
"0.55608976",
"0.5540489",
"0.55316836",
"0.55277544"
] | 0.0 | -1 |
Return NULL if the nonce has not been used Return $nonce if the nonce was previously used | function lookup_nonce($consumer, $token, $nonce, $timestamp) {
// Should add some clever logic to keep nonces from
// being reused - for no we are really trusting
// that the timestamp will save us
return NULL;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNonce();",
"function lookup_nonce($consumer, $token, $nonce, $timestamp) {\n // Should add some clever logic to keep nonces from\n // being reused - for no we are really trusting\n // that the timestamp will save us\n return NULL;\n }",
"function get_nonce() {\n if (!empty($this->nonce)) {\n $nonce = $this->nonce;\n unset($this->nonce);\n return $nonce;\n }\n $mt = microtime();\n $rand = mt_rand();\n\n return md5($mt . $rand);\n }",
"private function get_nonce() {\r\n\t\t$i = ceil( time() / 600);\r\n\t\treturn $this->hash($i, 'nonce');\r\n\t}",
"abstract public function nonce_check();",
"function get_nonce(): ?string\n{\n return is_request() ? input_request('nonce') : input_get('nonce');\n}",
"public function getNonce(): int;",
"public function getNonce()\n {\n return $this->nonce;\n }",
"protected function getNonce()\n\t{\n\t\treturn self::NONCE;\n\t}",
"private function getNonce()\n {\n $ch = $this->createCurlConnection('/auth/nonce');\n\n $body = curl_exec($ch);\n $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n $result = null;\n\n if ($code == 200) {\n $result = json_decode($body, true);\n $result = $result['authNonce'];\n } elseif ($code == 403) {\n $result = 'ERROR403';\n }\n curl_close($ch);\n //fclose($fp);\n\n return $result;\n }",
"public function get_nonce() {\n\t\treturn $this->mt_nonce;\n\t}",
"function getNonce() {\n\t\t\t$time = ceil(time() / $this->nonceLife) * $this->nonceLife;\n\t\t\treturn md5(date('Y-m-d H:i', $time).':'.$_SERVER['REMOTE_ADDR'].':'.$this->privateKey);\n\t\t}",
"public function getCardNonce(): ?string\n {\n if (count($this->cardNonce) == 0) {\n return null;\n }\n return $this->cardNonce['value'];\n }",
"private function get_nonce () {\n return @$_COOKIE['sso_nonce'];\n }",
"public static function nonce()\n {\n // Using microtime() instead of time() because of the\n // need to chain successive API calls that would fail\n // due to nonce duplication.\n\n return (int) 10000 * microtime(true);\n }",
"protected function getNonce() {\n global $pagenow;\n if ($pagenow == 'tools.php' && isset($_GET['page']) && $_GET['page'] == __CLASS__ . '_opt_menu') {\n if (isset($_GET[__CLASS__ . '_nonce'])) {\n $nonce = $_GET[__CLASS__ . '_nonce'];\n\n if (wp_verify_nonce($nonce, __CLASS__)) {\n return $nonce;\n }\n }\n }\n }",
"public function setNonce($nonce) {}",
"public function getScriptNonce() {\n if (empty($this->nonce)) {\n $this->nonce = hash('sha256', SALT . rand(0, time()));\n }\n\n return $this->nonce;\n }",
"public function getNonce(): int\n {\n $time = explode(' ', microtime());\n\n return $time[1] . substr($time[0], 2, 6);\n }",
"public function getClientNonce(): string;",
"public function setNonce($nonce);",
"public function get_nonce_handle(): ?string {\n\t\treturn $this->nonce_handle;\n\t}",
"public function lookup_nonce($consumer, $token, $nonce, $timestamp)\n {\n // Should add some clever logic to keep nonces from\n // being reused - for no we are really trusting\n // that the timestamp will save us\n return !apc_add($consumer . $timestamp , $nonce,1800);\n }",
"public function getNonce()\n {\n return $this->event[\"link\"][\"nonce\"];\n }",
"public function getNonce($nonce, $opURL)\n {\n $sql = \"SELECT nonce FROM {$this->tableNames['nonce']}\n WHERE uri = ?\n AND nonce = ?\";\n\n $result = $this->prepareExecute($sql, array($opURL, $nonce));\n if (!$result->numRows()) {\n return false;\n }\n\n $row = $result->fetchRow(MDB2_FETCHMODE_ASSOC);\n $result->free();\n\n return $row['nonce'];\n }",
"public function verify_nonce( $nonce ) {\n\n\t\t$action = $this->nonce_action;\n\t\t$i = wp_nonce_tick();\n\n\t\t// Nonce generated 0-12 hours ago.\n\t\tif ( substr( wp_hash( $i . $this->nonce_action, 'nonce' ), - 12, 10 ) === $nonce ) {\n\t\t\treturn 1;\n\t\t}\n\n\t\t// Nonce generated 12-24 hours ago.\n\t\tif ( substr( wp_hash( ( $i - 1 ) . $this->nonce_action, 'nonce' ), - 12, 10 ) === $nonce ) {\n\t\t\treturn 2;\n\t\t}\n\n\t\t// Log that nonce was unable to be verified.\n\t\t$this->log_error( __METHOD__ . '(): Aborting. Unable to verify nonce.' );\n\n\t\treturn false;\n\n\t}",
"private function check_nonce($consumer, $token, $nonce, $timestamp) {\n if( ! $nonce )\n throw new OAuthException(\n 'Missing nonce parameter. The parameter is required'\n );\n\n // verify that the nonce is uniqueish\n $found = $this->data_store->lookup_nonce(\n $consumer,\n $token,\n $nonce,\n $timestamp\n );\n if ($found) {\n throw new OAuthException(\"Nonce already used: $nonce\");\n }\n }",
"private function _generateNonce()\n {\n return md5(uniqid(microtime()));\n }",
"function nonce_validate($method = 'get') {\n\tswitch($method) {\n\t\tcase 'post':\n\t\t\t$nonce = (!empty($_POST['nonce'])) ? $_POST['nonce'] : '';\n\t\tbreak;\n\n\t\tdefault:\n\t\t\t$nonce = (!empty($_GET['nonce'])) ? $_GET['nonce'] : '';\n\t\tbreak;\n\t}\n\treturn $_SESSION['nonce'] == $nonce && $_SESSION['nonce'];\n}",
"public function checkServerNonce ( $consumer_key, $token, $timestamp, $nonce ) { }",
"public function nonceStation() { return $this->_m_nonceStation; }",
"private function lookUpNonceInCache():bool\n {\n if (!$this->di->has('cache')) {\n throw new Exception(\n \"Nonce backend 'cache' requires cache service to be configured.\"\n );\n }\n return $this->cache->get($this->nonceCacheKey);\n }",
"private function lookUpNonce(string $nonce):bool\n {\n switch ($this->backend) {\n case 'file':\n $result = $this->lookUpNonceInFile($nonce);\n break;\n case 'database':\n case 'db':\n $result = $this->lookUpNonceInDatabase($nonce);\n break;\n case 'cache':\n $result = $this->lookUpNonceInCache();\n break;\n default:\n throw new Exception(\"Unknown nonce backend: {$this->backend}\");\n }\n return $result;\n }",
"public function checkNonce($nonce) {\n\t\tif($this->_mysqli->query(sprintf(\"SELECT * FROM tbl_nonces WHERE s_nonce = '%s'\", $this->_mysqli->real_escape_string($nonce))))\n\t\t\treturn true;\n\t\treturn false;\n\t}",
"private static function generate_nonce() {\n $mt = microtime();\n $rand = mt_rand();\n\n return md5($mt . $rand); // md5s look nicer than numbers\n }",
"private static function generate_nonce()\n {\n $mt = microtime();\n $rand = mt_rand();\n\n return md5($mt . $rand); // md5s look nicer than numbers\n }",
"final public function randomNonce() {\n\t\treturn Salt::randombytes(Salt::box_NONCE);\n\t}",
"private static function makeNonce():string {\r\n try {\r\n $randBytes = random_bytes(32);\r\n $b64random = base64_encode($randBytes);\r\n $nonce = preg_replace(\"/[^A-Za-z0-9 ]/\", '', $b64random); //strip out non-alphanumeric\r\n } catch (\\Exception $e) {\r\n $nonce = null;\r\n }\r\n\r\n return $nonce;\r\n }",
"public function nonceAp() { return $this->_m_nonceAp; }",
"protected function has_nonce_check( $stackPtr ) {\n\n\t\t/**\n\t\t * A cache of the scope that we last checked for nonce verification in.\n\t\t *\n\t\t * @var array {\n\t\t * @var string $file The name of the file.\n\t\t * @var int $start The index of the token where the scope started.\n\t\t * @var int $end The index of the token where the scope ended.\n\t\t * @var bool|int $nonce_check The index of the token where an nonce check\n\t\t * was found, or false if none was found.\n\t\t * }\n\t\t */\n\t\tstatic $last;\n\n\t\t$start = 0;\n\t\t$end = $stackPtr;\n\n\t\t$tokens = $this->phpcsFile->getTokens();\n\n\t\t// If we're in a function, only look inside of it.\n\t\t$f = $this->phpcsFile->getCondition( $stackPtr, T_FUNCTION );\n\t\tif ( $f ) {\n\t\t\t$start = $tokens[ $f ]['scope_opener'];\n\t\t}\n\n\t\t$in_isset = $this->is_in_isset_or_empty( $stackPtr );\n\n\t\t// We allow for isset( $_POST['var'] ) checks to come before the nonce check.\n\t\t// If this is inside an isset(), check after it as well, all the way to the\n\t\t// end of the scope.\n\t\tif ( $in_isset ) {\n\t\t\t$end = ( 0 === $start ) ? count( $tokens ) : $tokens[ $start ]['scope_closer'];\n\t\t}\n\n\t\t// Check if we've looked here before.\n\t\t$filename = $this->phpcsFile->getFilename();\n\n\t\tif (\n\t\t\t$filename === $last['file']\n\t\t\t&& $start === $last['start']\n\t\t) {\n\n\t\t\tif ( false !== $last['nonce_check'] ) {\n\t\t\t\t// If we have already found an nonce check in this scope, we just\n\t\t\t\t// need to check whether it comes before this token. It is OK if the\n\t\t\t\t// check is after the token though, if this was only a isset() check.\n\t\t\t\treturn ( $in_isset || $last['nonce_check'] < $stackPtr );\n\t\t\t} elseif ( $end <= $last['end'] ) {\n\t\t\t\t// If not, we can still go ahead and return false if we've already\n\t\t\t\t// checked to the end of the search area.\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// We haven't checked this far yet, but we can still save work by\n\t\t\t// skipping over the part we've already checked.\n\t\t\t$start = $last['end'];\n\t\t} else {\n\t\t\t$last = array(\n\t\t\t\t'file' => $filename,\n\t\t\t\t'start' => $start,\n\t\t\t\t'end' => $end,\n\t\t\t);\n\t\t}\n\n\t\t// Loop through the tokens looking for nonce verification functions.\n\t\tfor ( $i = $start; $i < $end; $i++ ) {\n\n\t\t\t// If this isn't a function name, skip it.\n\t\t\tif ( T_STRING !== $tokens[ $i ]['code'] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If this is one of the nonce verification functions, we can bail out.\n\t\t\tif ( isset( self::$nonceVerificationFunctions[ $tokens[ $i ]['content'] ] ) ) {\n\t\t\t\t$last['nonce_check'] = $i;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// We're still here, so no luck.\n\t\t$last['nonce_check'] = false;\n\n\t\treturn false;\n\t}",
"protected function getNonce($returnTo) {\n // Have to start the session after putting something into the session, or we don't actually start it!\n if (!$this->sessionManager->isStarted() && !isset($_SESSION['auth0_is_session_started'])) {\n $_SESSION['auth0_is_session_started'] = 'yes';\n $this->sessionManager->start();\n }\n\n $sessionStateHandler = new SessionStateHandler( new SessionStore() );\n $states = $this->tempStore->get(AuthController::STATE);\n if ( ! is_array( $states ) ) {\n $states = array();\n }\n $nonce = $sessionStateHandler->issue();\n $states[$nonce] = $returnTo === null ? '' : $returnTo;\n $this->tempStore->set(AuthController::STATE, $states);\n \n return $nonce;\n }",
"function nonce_generate() {\n\t$_SESSION['nonce'] = md5(uniqid(mt_rand(), true) + NONCE_KEY);\n}",
"public static function generateNonce()\n {\n self::$scriptNonce = hash('sha256',\n \\Zend_Crypt_Math::randBytes(512)\n );\n }",
"public function has_nonce(): bool {\n\t\treturn ! is_null( $this->get_nonce_handle() );\n\t}",
"public function get_nonce_field(): string {\n\t\treturn $this->nonce_field;\n\t}",
"private static function not_a_nonce( $uid, $tid ){\n\t\t$salt = self::mjj_get_salt();\n\t\t//because why not add a little string to it\n\t\t$string = $uid . $tid . \"user and topic ids\";\n\t\t$encrypted = hash_hmac( 'md5', $string, $salt );\n\t\treturn $encrypted;\n\n\t}",
"protected function _generateNonce() {\n\t\t// For example, a general cryptographic component\n\t\t$_nonce = base64_encode(openssl_random_pseudo_bytes(32));\n\t\t$nonce = preg_replace('/[^A-Za-z0-9]/', '', $_nonce);\n\t\treturn $nonce;\n\t}",
"protected function generate_nonce()\n\t{\n\t\treturn md5(uniqid(rand(), true));\n\t}",
"private static function check_nonce_and_referer( $nonce ) {\n\n\t\tif ( self::check_referer() ) {\n\t\t\treturn wp_verify_nonce( $nonce, self::$nonce_action );\n\n\t\t}\n\n\t}",
"function acf_verify_nonce($value)\n{\n}",
"private function cspGenerateNonce()\n {\n $nonce = base64_encode(\n openssl_random_pseudo_bytes(30, $isCryptoStrong)\n );\n\n if ( ! $isCryptoStrong)\n {\n $this->addError(\n 'OpenSSL (openssl_random_pseudo_bytes) reported that it did\n <strong>not</strong> use a cryptographically strong algorithm\n to generate the nonce for CSP.',\n\n E_USER_WARNING\n );\n }\n\n return $nonce;\n }",
"public function generate_nonce() {\n\t\tWP_CLI::line( AMP_Validation_Manager::get_amp_validate_nonce() );\n\t}",
"public function create_nonce() {\n\n\t\t$action = $this->nonce_action;\n\t\t$i = wp_nonce_tick();\n\n\t\treturn substr( wp_hash( $i . $action, 'nonce' ), - 12, 10 );\n\n\t}",
"public function get_nonce() {\n return wp_nonce_field( 'yith_wcbk_google_calendar_form', 'yith_wcbk_gcal_nonce', false, false );\n }",
"function wp_verify_nonce($nonce, $action = -1)\n {\n }",
"public static function generateNonce()\n {\n $nonce = random_bytes(SODIUM_CRYPTO_BOX_NONCEBYTES);\n\n return \\sodium_bin2hex($nonce);\n }",
"private function generate_nonce () {\n $c = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f' ];\n $count = count($c);\n $nonce = '';\n for ($i = 0; $i < 32; $i++) {\n $nonce .= $c[rand(0, $count)];\n }\n // save nonce as domain cookie\n // expires with current browser session\n setcookie('sso_nonce', $nonce, 0, '/');\n return $nonce;\n }",
"protected function getNonceSalt()\n {\n // Allow users to set their own nonce\n if (!is_null($this->getConfig('nonce'))) {\n return $this->request->generateNonceKey($this->getConfig('nonce'));\n // Use the entity if it is present\n } elseif (!is_null($this->associatedEntity)) {\n return $this->request->generateNonceKey($this->associatedEntity);\n }\n\n // Fallback to something custom for the Helper\n return $this->request->generateNonceKey();\n }",
"function signup_nonce_check($result)\n {\n }",
"public function generateNonce(): string\n {\n $nonce = $this->randomService->hex(32);\n\n return $nonce;\n }",
"function nonce_input() {\n\techo '<input type=\"hidden\" name=\"nonce\" id=\"form_key\" value=\"' . $_SESSION['nonce'] . '\">';\n}",
"public function ip($nonce) {\n $result = $this->_mysqli->query(sprintf(\"SELECT * FROM tbl_nonces WHERE s_nonce = '%s' LIMIT 1 \", $this->_mysqli->real_escape_string($nonce)));\n if($result) {\n $row = $result->fetch_assoc();\n if(isset($row['s_ip'])) {\n return $row['s_ip'];\n }\n }\n return false;\n }",
"public static function generate_nonce(){\n SUPER_Common::setClientData( array( 'name'=> 'sf_nonce', 'value'=>false ) );\n $sf_nonce = md5(uniqid(mt_rand(), true)) . md5(uniqid(mt_rand(), true)) . md5(uniqid(mt_rand(), true));\n SUPER_Common::setClientData( \n array( \n 'name' => 'sf_nonce', \n 'value' => $sf_nonce,\n 'expires' => 5*60, // nonce will expire after 30 sec. by default\n 'exp_var' => 60*60 // there is no need to refresh a nonce, so we set it's expire variant to a higher value\n )\n );\n return $sf_nonce;\n }",
"public function getPaymentMethodNonce()\n {\n return $this->getInfoInstance()->getAdditionalInformation('payment_method_nonce');\n }",
"private function checkNonce(Client $client, Token $token, $nonce, $timestamp)\n {\n if (!$nonce) {\n throw new OAuthException('Missing nonce parameter. The parameter is required');\n }\n\n // verify that the nonce is uniqueish\n $found = $this->data_store->lookupNonce($client, $token, $nonce, $timestamp);\n if ($found) {\n throw new OAuthException('Nonce already used: ' . $nonce);\n }\n }",
"public function verify_nonce( $nonce ) {\n\t\treturn wp_verify_nonce( $nonce, 'fffcf_submission_' . $this->id );\n\t}",
"public static function nonce($length=12){\n $characters = array_merge(range(0,9), range('A','Z'), range('a','z'));\n $length = $length > count($characters) ? count($characters) : $length;\n shuffle($characters);\n $prefix = microtime();\n $nonce = md5(substr($prefix . implode('', $characters), 0, $length));\n return $nonce;\n }",
"public function get_cart_nonce() {\n\n\t\treturn WC()->session->get( 'wc_braintree_paypal_cart_nonce', '' );\n\t}",
"public function get_nonce_action();",
"public function set_nonce() {\n\t\tif ( empty( $this->nonce ) ) {\n\t\t\t$this->nonce = wp_create_nonce( 'fffcf_submission_' . $this->id );\n\t\t}\n\t}",
"public function validate($nonce, $token, $now = null, $leeway = 0);",
"public function getClientNoncePad(): string;",
"public function setNonce($nonce)\n {\n $this->nonce = $nonce;\n return $this;\n }",
"static function generate_nonce($counter) {\n\t\treturn self::hash($counter);\n\t}",
"function test_verify_field_nonce() {\n $wpNonce = new \\Fazleelahhee\\Inpsyde\\WPNonce();\n $field = $wpNonce->getField('wp_nonce_test', 'wp_nonce_test', false, false);\n $xmlField = simplexml_load_string($field);\n $nonce = (string) $xmlField->attributes()['value'];\n $this->assertContains($wpNonce->verify($nonce, 'wp_nonce_test'), [1,2]);\n }",
"function esig_verify_nonce($value, $nonce) {\n if (function_exists('wc')) {\n global $woocommerce;\n if (!is_null(WC()->session) && sizeof($woocommerce->cart->cart_contents) > 0) {\n return true;\n }\n }\n if (wp_verify_nonce($value, 'esig-nonce-all' . $nonce)) {\n return true;\n }\n return false;\n }",
"public static function getFormNonce(string $data, bool $buffered = true): ?Nonce\n {\n\n $nonce = self::getNonce(self::NONCE_FORM);\n $nonce->setParam($data);\n $nonce->setBuffered($buffered);\n return $nonce;\n }",
"public function testWPVerifyNonceOOP1() {\n $nonceVerify = $this->nonceInstance->wp_verify_nonce('');\n $this->assertEquals(false, $nonceVerify);\n }",
"function dev_check_nonce( $nonce ) {\n\treturn wp_verify_nonce( $nonce, 'dev_custom_action' );\n}",
"public function is_valid_nonce( $nonce = 'mpp_ajax_nonce' ){\n if( ! isset( $_POST['ajax_nonce'] ) || ! wp_verify_nonce( $_POST['ajax_nonce'], $nonce ) ){\n return false;\n }\n return true;\n }",
"public static function makeNonce() {\r\n\t\treturn bin2hex(openssl_random_pseudo_bytes(16));\r\n\t}",
"function acf_nonce_input($nonce = '')\n{\n}",
"public function testWPVerifyNonceOOP2() {\n $nonceVerify = $this->nonceInstance->wp_verify_nonce('a192fc4204');\n $this->assertEquals(1, $nonceVerify);\n }",
"public function address($nonce, $ip) {\n $result = $this->_mysqli->query(sprintf(\"SELECT * FROM tbl_nonces WHERE s_nonce = '%s' AND s_ip = '%s' LIMIT 1 \", $this->_mysqli->real_escape_string($nonce), $this->_mysqli->real_escape_string($ip)));\n if($result) {\n $row = $result->fetch_assoc();\n if(isset($row['s_address']) && $row['s_address']!='') {\n $this->delete($nonce);\n return $row['s_address'];\n }\n }\n return false;\n }",
"public function testWPVerifyNonceOOP3() {\n $nonceVerify = $this->nonceInstance->wp_verify_nonce('b192fc4204');\n $this->assertEquals(2, $nonceVerify);\n }",
"protected function getNonceLength()\n {\n switch ($this->cipher) {\n case static::CIPHER_AES_256:\n return SODIUM_CRYPTO_AEAD_AES256GCM_NPUBBYTES;\n\n case static::CIPHER_CHACHA:\n return SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES;\n\n case static::CIPHER_CHACHA_IETF:\n return SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES;\n\n // documented here:\n // https://libsodium.gitbook.io/doc/secret-key_cryptography/aead/chacha20-poly1305/xchacha20-poly1305_construction\n case static::CIPHER_X_CHACHA_IETF:\n return 24;\n\n default:\n return 0;\n }\n }",
"public function delete($nonce) {\n return $this->_mysqli->query(sprintf(\"DELETE FROM tbl_nonces WHERE s_nonce = '%s' \", $this->_mysqli->real_escape_string($nonce)));\n }",
"private function get_nonce( $post ) {\n\t\t$nonce = array(\n\t\t\twp_nonce_field( 'formation_frontend_submission', 'formation_nonce', true, false ),\n\t\t);\n\n\t\t$reference_args = array(\n\t\t\t'value' => $post->ID,\n\t\t\t'slug' => self::FORM_ID_KEY,\n\t\t);\n\t\t$reference = new Field\\Hidden( $reference_args, $this->plugin, null );\n\t\t$nonce[] = $reference->render( $reference_args );\n\n\t\treturn $nonce;\n\t}",
"function wp_nonce_field($action = -1, $name = '_wpnonce', $referer = \\true, $display = \\true)\n {\n }",
"public function getNewTCE() {}",
"private function manageNonceFile(string $nonce)\n {\n $timestamp = date('U');\n $file = $this->config->hawk->get('nonce_dir', '/tmp') . '/' .\n $this->nonceFile;\n if (file_exists($file)) {\n /**\n * Manage recorded nonces\n */\n $lines = file($file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n $handle = fopen($file, 'w');\n foreach ($lines as $line) {\n $parts = explode(',', $line);\n if (sizeof($parts) === 2) {\n if ($parts[1] + $this->config->hawk->get('expire', 60)\n < $timestamp) {\n /**\n * Forget expired nonces\n */\n continue;\n }\n fwrite($handle, $line . \"\\n\");\n } else {\n throw new Exception(\"Malformed row in $file: $line\");\n }\n }\n } else {\n $handle = fopen($file, 'w');\n }\n // Record new nonce\n fwrite($handle, \"$nonce,$timestamp\\n\");\n fclose($handle);\n chmod($file, 0755);\n }",
"private function generateNonce()\n {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $string = '';\n $max = mb_strlen( $characters, '8bit' ) - 1;\n\n for ( $i = 0; $i < 32; ++$i )\n {\n $string .= $characters[random_int( 0, $max )];\n }\n\n return $string;\n }",
"function xgb_request_nonce_error() { ?>\n\t\t<div class=\"notice notice-error\">\n\t\t\t<p><?php _e( 'That request did not pass the necessary security checks. <br>Hint: Log out and login and try again or if this persists, <a class=\"dottedunderline\" href=\"http://www.millionclues.net/support/\">contact support</a>.', 'xgb' ); ?></p>\n\t\t</div> <?php\n}",
"function fetchAnnonce() {\n\t\t\n\t\t// Id of the annonce\r\n\t\t$id = $_REQUEST['id'];\r\n\t\t\r\n\t\t// Find it\r\n\t\t$request = new Annonce();\r\n\t\t$request->id = $id;\r\n\t\t$res = $request->find();\r\n\t\t\r\n\t\t// Should have only one result\r\n\t\tif (sizeof($res) != 1) {\r\n\t\t\tthrow new InternalError(\"Expected one result for Annonce(id=$id). Got \" . sizeof($res));\r\n\t\t}\n\t\t\r\n\t\t// Take first one\r\n\t\t$this->annonce = $res[0];\t\t\n\t}",
"private function lookUpNonceInDatabase(string $nonce):bool\n {\n if (!isset($this->config->hawk)\n || !isset($this->config->hawk->nonce_model)) {\n throw new Exception(\n \"Nonce backend 'database' requires nonce_model set in hawk \" .\n \"section in config file.\"\n );\n }\n\n $modelName = $this->config->hawk->nonce_model;\n\n if (!class_exists($modelName)) {\n throw new Exception(\"Nonce model not found: \" . $modelName);\n }\n\n $model = new $modelName;\n $metadata = $model->getModelsMetaData();\n\n if (!$metadata->hasAttribute($model, 'nonce')\n || !$metadata->hasAttribute($model, 'timestamp')) {\n throw new Exception(\n \"Nonce model must contain columns 'nonce' and 'timestamp'.\"\n );\n }\n $search = array(\"nonce=':nonce:'\", array('nonce' => $nonce));\n return $model->findFirst($search) ? true : false;\n }",
"public function getNextAvailableNonceRequest($blockchain, $network, $address, $context = null)\n {\n // verify the required parameter 'blockchain' is set\n if ($blockchain === null || (is_array($blockchain) && count($blockchain) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $blockchain when calling getNextAvailableNonce'\n );\n }\n // verify the required parameter 'network' is set\n if ($network === null || (is_array($network) && count($network) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network when calling getNextAvailableNonce'\n );\n }\n // verify the required parameter 'address' is set\n if ($address === null || (is_array($address) && count($address) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $address when calling getNextAvailableNonce'\n );\n }\n\n $resourcePath = '/blockchain-data/{blockchain}/{network}/addresses/{address}/next-available-nonce';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($context !== null) {\n if('form' === 'form' && is_array($context)) {\n foreach($context as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['context'] = $context;\n }\n }\n\n\n // path params\n if ($blockchain !== null) {\n $resourcePath = str_replace(\n '{' . 'blockchain' . '}',\n ObjectSerializer::toPathValue($blockchain),\n $resourcePath\n );\n }\n // path params\n if ($network !== null) {\n $resourcePath = str_replace(\n '{' . 'network' . '}',\n ObjectSerializer::toPathValue($network),\n $resourcePath\n );\n }\n // path params\n if ($address !== null) {\n $resourcePath = str_replace(\n '{' . 'address' . '}',\n ObjectSerializer::toPathValue($address),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('x-api-key');\n if ($apiKey !== null) {\n $headers['x-api-key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"private function lookUpNonceInFile(string $nonce):bool\n {\n $file = $this->config->hawk->get('nonce_dir', '/tmp') . '/' .\n $this->nonceFile;\n if (!file_exists($file)) {\n return false;\n }\n\n $lines = file($file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n foreach ($lines as $line) {\n $parts = explode(',', $line);\n if (sizeof($parts) === 2) {\n if ($parts[0] === $nonce) {\n return true;\n }\n } else {\n throw new Exception(\"Malformed row in $file: $line\");\n }\n }\n\n return false;\n }",
"public function getAccountToken(): ?string\n {\n return $this->accountToken;\n }",
"public function signupNonceFields() {\n if (function_exists(self::SIGNUP_NONCE_FIELDS) === FALSE) {\n return FALSE;\n } else {\n call_user_func(self::SIGNUP_NONCE_FIELDS);\n }\n }",
"public function testDefaultWPNonceFieldOOP() {\n $nonceField = $this->nonceInstance->wp_nonce_field();\n $this->assertEquals('<input type=\"hidden\" id=\"_wpnonce\" name=\"_wpnonce\" value=\"b192fc4204\" /><input type=\"hidden\" name=\"_wp_http_referer\" value=\"/index.php\" />', $nonceField);\n }"
] | [
"0.7324032",
"0.7302131",
"0.71870667",
"0.7122191",
"0.7113861",
"0.710596",
"0.7103019",
"0.7027895",
"0.7013568",
"0.69398165",
"0.69090134",
"0.6896057",
"0.6891277",
"0.68064433",
"0.66973156",
"0.66462255",
"0.6476608",
"0.64605916",
"0.64426684",
"0.64368564",
"0.64173436",
"0.63775027",
"0.63349855",
"0.62174296",
"0.62147653",
"0.61390924",
"0.6104219",
"0.6098194",
"0.60805666",
"0.60785",
"0.60358334",
"0.60125846",
"0.59493273",
"0.5946216",
"0.59439147",
"0.59431434",
"0.5924138",
"0.59240955",
"0.5917698",
"0.5863905",
"0.586359",
"0.5855996",
"0.58450556",
"0.58390695",
"0.57978326",
"0.57775795",
"0.5743436",
"0.57191247",
"0.57163143",
"0.5673063",
"0.56639725",
"0.56476957",
"0.562705",
"0.5620238",
"0.5599967",
"0.55885756",
"0.5577295",
"0.5535881",
"0.5493136",
"0.5489068",
"0.54767525",
"0.5461002",
"0.5452973",
"0.5436734",
"0.54240596",
"0.54070294",
"0.53872716",
"0.53745526",
"0.53722596",
"0.53672266",
"0.5334156",
"0.53100866",
"0.5309755",
"0.52764434",
"0.527088",
"0.52517754",
"0.5249722",
"0.5218459",
"0.5209392",
"0.51928204",
"0.5169712",
"0.5166818",
"0.5166611",
"0.51580375",
"0.5157968",
"0.5156728",
"0.5124793",
"0.5119508",
"0.50981385",
"0.5090811",
"0.50864977",
"0.5081802",
"0.50777006",
"0.50359434",
"0.50302696",
"0.5029464",
"0.5013924",
"0.50134957",
"0.49496096",
"0.49419472"
] | 0.7278735 | 2 |
protected $repayModel = [ '1' => 'FixRateRepayMode', '2' => 'MonthlyInterestRepayMode' ]; | public function __construct(array $project, array $orders)
{
$this->project = $project;
$this->orders = $orders;
$this->projectId = $this->project['project_id'];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setPayModel($model) {\n\t\tswitch ($model) {\n\t\tcase 'WEEKLY':\n\t\t\t$this->payModel = new PayModel('day', 7);\n\t\t\tbreak;\n\t\tcase 'BIWEEKLY':\n\t\t\t$this->payModel = new PayModel('day', 14);\n\t\t\tbreak;\n\t\tcase 'MONTHLY':\n\t\t\t$this->payModel = new PayModel('month', 1);\n\t\t\tbreak;\n\t\t}\n\t}",
"public function model()\n {\n return InvoiceReceivePayment::class;\n }",
"public function model()\n {\n return Taxrate::class;\n }",
"protected function getPaymentModel()\n {\n return Mage::getModel('paynow/payment');\n }",
"public function setModel()\n {\n return Invoice::class;\n }",
"public function model()\n {\n return TipsSetting::class;\n// return Businesses::class;\n }",
"function model()\n {\n return ShippingPrice::class;\n }",
"public function RateType()\n {\n return [\n 'erate' => 'Electronic Rate',\n 'tt' => 'Telegrafic Transfer',\n 'tc' => 'Travellers Cheque',\n 'bn' => 'Bank Notes',\n ];\n }",
"public function getPaymentType()\n {\n\n return 'IPAY';\n }",
"private function getPayrollModel()\n\t{\n\t\treturn $this->payrollModel = new PayrollModel();\n\t}",
"public function exchangeRate()\n {\n return $this->belongsTo(ExchangeRate::class);\n }",
"public function getModelName()\n {\n return self::$sprintPayModelName;\n }",
"public function getModel(){\n return $this->customAnswer;\n }",
"public function paymentMethod()\r\n {\r\n \treturn $this->belongsTo('App\\PaymentMethod');\r\n }",
"function model()\n {\n return 'Webkul\\Sales\\Contracts\\ShipmentItem';\n }",
"function model()\n {\n return 'App\\Models\\Components\\VoucherAdvanceSetting';\n }",
"public function getQuantite()\n{\nreturn $this->quantite;\n}",
"public function getInvoiceModel(){}",
"private static function getStatewiseReportModel()\n {\n $post = \\Yii::$app->request->post();\n $yearId1= $post['refYear1'];\n $year1 = \\common\\models\\CurrentYear::findOne(['_id'=>$yearId1]);\n $startDate1 = $year1->yearStartDate;\n $endDate1 = $year1->yearEndDate;\n $forYear1 = substr($startDate1,-4).' - '.substr($endDate1,-4);\n $data = ReportQueryManager::getMonthwiseMarksData($yearId1);\n $allocdata1 = AllocationManager::getAllocationStatewise($yearId1);\n $centreCities = AllocationManager::getCentreCities($data['keys']);\n if(!empty($post['refYear2'])):\n $yearId2= $post['refYear2'];\n $year2 = \\common\\models\\CurrentYear::findOne(['_id'=>$yearId2]);\n $startDate2 = $year2->yearStartDate;\n $endDate2 = $year2->yearEndDate;\n $forYear2 = substr($startDate2,-4).' - '.substr($endDate2,-4);\n\n $allocdata2 = AllocationManager::getAllocationStatewise($yearId2);\n $model = [ \n 'centreData'=>$data['centreData'],\n 'marksData'=>$data['marksData'],\n 'totalMarks'=>$data['totalMarks'],\n 'centreCodes'=>$data['keys'],\n 'centreCities'=>$centreCities,\n 'forYear1'=>$forYear1,\n 'forYear2'=>$forYear2,\n 'allocations1'=>$allocdata1['allocations'],\n 'totalStates1'=>$allocdata1['totalStates'],\n 'allocations2'=>$allocdata2['allocations'],\n 'totalStates2'=>$allocdata2['totalStates'],\n ];\n else:\n $model = [ \n 'centreData'=>$data['centreData'],\n 'marksData'=>$data['marksData'],\n 'totalMarks'=>$data['totalMarks'],\n 'centreCodes'=>$data['keys'],\n 'centreCities'=>$centreCities,\n 'forYear1'=>$forYear1,\n 'allocations1'=>$allocdata1['allocations'],\n 'totalStates1'=>$allocdata1['totalStates'],\n ]; \n endif; \n return $model;\n\n }",
"function setrates()\r\n {\r\n $this->set('suffix', 'shippingrates');\r\n $state = parent::_setModelState();\r\n $app = JFactory::getApplication();\r\n $model = $this->getModel( $this->get('suffix') );\r\n $ns = $this->getNamespace();\r\n foreach (@$state as $key=>$value)\r\n {\r\n $model->setState( $key, $value ); \r\n }\r\n\r\n $row = JTable::getInstance('ShippingMethods', 'TiendaTable');\r\n $row->load($model->getId());\r\n \r\n $model->setState('filter_shippingmethod', $model->getId());\r\n \r\n $view = $this->getView( 'shippingrates', 'html' );\r\n $view->set( '_controller', 'shippingmethods' );\r\n $view->set( '_view', 'shippingmethods' );\r\n $view->set( '_action', \"index.php?option=com_tienda&controller=shippingmethods&task=setrates&id={$model->getId()}&tmpl=component\" );\r\n $view->setModel( $model, true );\r\n $view->assign( 'state', $model->getState() );\r\n $view->assign( 'row', $row );\r\n $view->setLayout( 'default' );\r\n\t\t$view->setTask(true);\r\n $view->display();\r\n }",
"public function getModelOptions() {\n \t$models = array();\n\t\t$collection = Mage::getModel('aoe_scheduler/collection_crons');\n\t\tforeach ($collection as $item) {\n\t\t\t$models[$item->getModel()] = $item->getModel();\n\t\t}\n\t\treturn $models;\n }",
"public function getPayDateModel()\n\t\t{\n\t\t\tif ($this->paydate_model === NULL)\n\t\t\t{\n\t\t\t\t$model = $this->getModel();\n\t\t\t\t$this->paydate_model = Date_PayDateModel_1::getModel(\n\t\t\t\t\t\t\t\t$model->paydate_model,\n\t\t\t\t\t\t\t\t$model->day_of_week,\n\t\t\t\t\t\t\t\t$model->last_paydate,\n\t\t\t\t\t\t\t\t$model->day_of_month_1,\n\t\t\t\t\t\t\t\t$model->day_of_month_2,\n\t\t\t\t\t\t\t\t$model->week_1,\n\t\t\t\t\t\t\t\t$model->week_2);\n\t\t\t}\n\t\t\t\n\t\t\treturn $this->paydate_model;\n\t\t}",
"public function model()\n {\n return Purchase::class;\n\n }",
"public function setQuantite($quantite)\n{\n$this->quantite = $quantite;\n\nreturn $this;\n}",
"public function setModel()\n {\n return Cost::class;\n }",
"function model()\n {\n return 'App\\Models\\B1ConflittoInteressi';\n }",
"private function getPaymentModel() {\n if ($this->_paymentModel == NULL) {\n //$this->_paymentModel = new PaymentModel($this->mangopay);\n $this->_paymentModel = \\App::make('\\App\\PaymentModel');\n }\n return $this->_paymentModel;\n }",
"public static function payment_methods() {\n return array(\n CheckfrontModule::PaymentPayNow => 'Pay now',\n CheckfrontModule::PaymentPayLater => 'Pay later'\n );\n }",
"function getinvoicedatabyrefno($relation,$service_id )\n{\n\n$invoicemodel=Invoice::model()->findByAttributes(array('servicecall_id'=>$service_id));\n$a = explode( '|', $relation);\nreturn $invoicemodel[$a[1]];\n\n}",
"public function model()\n {\n return Purchase::class;\n }",
"public function toOptionArray()\n {\n return [\n [\n 'value' => self::DM_BILL_STR1,\n 'label' => 'HPP_BILLING_STREET1',\n ],\n [\n 'value' => self::DM_BILL_STR2,\n 'label' => 'HPP_BILLING_STREET2',\n ],\n [\n 'value' => self::DM_BILL_CITY,\n 'label' => 'HPP_BILLING_CITY',\n ],\n [\n 'value' => self::DM_BILL_POSTAL,\n 'label' => 'HPP_BILLING_POSTALCODE',\n ],\n [\n 'value' => self::DM_BILL_STATE,\n 'label' => 'HPP_BILLING_STATE',\n ],\n [\n 'value' => self::DM_BILL_COUNTRY,\n 'label' => 'BILLING_CO',\n ],\n [\n 'value' => self::DM_SHIPPING_FIRST,\n 'label' => 'HPP_SHIPPING_FIRSTNAME',\n ],\n [\n 'value' => self::DM_SHIPPING_LAST,\n 'label' => 'HPP_SHIPPING_LASTNAME',\n ],\n [\n 'value' => self::DM_SHIPPING_PHONE,\n 'label' => 'HPP_SHIPPING_PHONE',\n ],\n [\n 'value' => self::DM_SHIPPING_METHOD,\n 'label' => 'HPP_SHIPPING_SHIPPINGMETHOD',\n ],\n [\n 'value' => self::DM_SHIPPING_STR1,\n 'label' => 'HPP_SHIPPING_STREET1',\n ],\n [\n 'value' => self::DM_SHIPPING_STR2,\n 'label' => 'HPP_SHIPPING_STREET2',\n ],\n\n [\n 'value' => self::DM_SHIPPING_CITY,\n 'label' => 'HPP_SHIPPING_CITY',\n ],\n [\n 'value' => self::DM_SHIPPING_POSTAL,\n 'label' => 'HPP_SHIPPING_POSTALCODE',\n ],\n [\n 'value' => self::DM_SHIPPING_STATE,\n 'label' => 'HPP_SHIPPING_STATE',\n ],\n [\n 'value' => self::DM_SHIPPING_COUNTRY,\n 'label' => 'SHIPPING_CO',\n ],\n [\n 'value' => self::DM_CUSTOMER_ID,\n 'label' => 'HPP_CUSTOMER_ID',\n ],\n [\n 'value' => self::DM_CUSTOMER_DOB,\n 'label' => 'HPP_CUSTOMER_DATEOFBIRTH',\n ],\n [\n 'value' => self::DM_CUSTOMER_EMAIL_DOMAIN,\n 'label' => 'HPP_CUSTOMER_DOMAINNAME',\n ],\n [\n 'value' => self::DM_CUSTOMER_EMAIL,\n 'label' => 'HPP_CUSTOMER_EMAIL',\n ],\n [\n 'value' => self::DM_CUSTOMER_FIRST,\n 'label' => 'HPP_CUSTOMER_FIRSTNAME',\n ],\n [\n 'value' => self::DM_CUSTOMER_LAST,\n 'label' => 'HPP_CUSTOMER_LASTNAME',\n ],\n [\n 'value' => self::DM_CUSTOMER_PHONE,\n 'label' => 'HPP_CUSTOMER_PHONENUMBER',\n ],\n [\n 'value' => self::DM_PRODUCTS_TOTAL,\n 'label' => 'HPP_PRODUCTS_UNITPRICE',\n ],\n [\n 'value' => self::DM_FRAUD_HOST,\n 'label' => 'HPP_FRAUD_DM_BILLHOSTNAME',\n ],\n [\n 'value' => self::DM_FRAUD_COOKIES,\n 'label' => 'HPP_FRAUD_DM_BILLHTTPBROWSERCOOKIESACCEPTED',\n ],\n [\n 'value' => self::DM_FRAUD_BROWSER,\n 'label' => 'HPP_FRAUD_DM_BILLTOHTTPBROWSERTYPE',\n ],\n [\n 'value' => self::DM_FRAUD_IP,\n 'label' => 'HPP_FRAUD_DM_BILLTOIPNETWORKADDRESS',\n ],\n [\n 'value' => self::DM_FRAUD_TENDER,\n 'label' => 'HPP_FRAUD_DM_INVOICEHEADERTENDERTYPE',\n ],\n ];\n }",
"public function getModele()\n{\nreturn $this->modele;\n}",
"abstract public function getPaymentMethod();",
"public function model(){\n\t\treturn CategoryRevenue::class;\n\t}",
"public function getTypeAttribute(){\n return 'company';\n }",
"public function getModelDefinition(): array\n {\n return [\n 'countryCode' => [ 'model' => null, 'array' => false ],\n 'minimum' => [ 'model' => null, 'array' => false ],\n 'maximum' => [ 'model' => null, 'array' => false ],\n ];\n }",
"public function model()\n {\n return CurrencyArchive::class;\n }",
"private function getConfigModel()\n {\n return Mage::getSingleton('wallee_payment/system_config');\n }",
"public function model()\n {\n return 'Webkul\\Ecom\\Models\\EcomImportInterval';\n }",
"public function getPaymentMethod()\n {\n \n //Fill POST fields array\n $ipPostFields = [\n 'InvoiceAmount' => session()->get('total_price'),\n 'CurrencyIso' => 'KWD'\n ];\n \n //Call endpoint\n $paymentMethods = $this->initiatePayment($this->apiURL, $this->apiKey, $ipPostFields);\n \n \n return view('site.payment.checkout', compact('paymentMethods')); // redirect to the pay method in the service classe with the paymentmedthod id\n \n \n }",
"public function model() {\n return \\App\\Order::class;\n }",
"public function model()\n\t{\n\t\treturn BalanceOrder::class;\n\t}",
"protected function getTradeType()\n {\n return 'MICROPAY';\n }",
"public function actionApprove() {\n\n // $nextClearanceNo = str_pad(\n // substr( implode(\"\", Clearance::find()->select(['TOP 1 [No_]'])->orderBy(['[No_]' => SORT_DESC ])->asArray()->one() ),\n // 3 ) + 1, 4, '0', STR_PAD_LEFT );\n // // echo 'rrrr';\n // // exit;\n $params= Yii::$app->request->post();\n\n\n\n if (!empty($params)) {\n // print_r($model); exit;\n\n // $types = $model->getTableSchema()->columns;\n\n// foreach ($model AS $key => $value) {\n\n// $key1 = str_replace(\" \", \"_\", $key);\n// if (array_key_exists($key1, $params)) {\n// if ($key == 'No_') {\n \n// } else {\n// $model[$key] = $params[$key1];\n// }\n \n// } else if ($key == 'No_') {\n\n// } else {\n// if ($types[\"$key\"]->type == 'string') {\n// $model[$key] = ' ';\n// } else if (($types[\"$key\"]->type == 'integer') OR ($types[\"$key\"]->type == 'smallint') OR ($types[\"$key\"]->type == 'decimal')) {\n// $model[$key] = '0';\n// } else if ($types[\"$key\"]->type == 'datetime') {\n// // $time = new \\DateTime('now', new \\DateTimeZone('UTC'));\n// // // $time = new \\DateTime();\n// // //$time->format('Y-m-d H:i:s');\n// // // $time = date_create_from_format('Y-m-d:H:i:s', $time);\n// // // // $time->getTimestamp();\n// // $newtime = strtotime($time);\n\n// // $newformat = date('Y-m-d',$newtime);\n\n// $model[$key] = '1753-01-01 00:00:00.000';\n// }\n// }\n// }\n \n if ($params['Approval'] === 'REJECTED') {\n return $this->redirect('index');\n }\n\n\n\n $sid = $params['StudentNo_']; \n $model = Clearance::find()->where(\"[Student No_] = '$sid' \")->one();\n\n $dpt = $params['Clearance_Level_Code'];\n\n if ($dpt === 'FINANCE') {\n\n $remarks = $params['Finance_Clearance_Remarks'];\n\n $model['Finance Cleared'] = intval(1);\n $model['Fees Amount'] = $params['Fees_Amount'];\n\n } elseif ($dpt === 'LIBRARY') {\n\n $remarks = $params['LibraryClearanceRemarks'];\n\n $model['Library Cleared'] = intval(1);\n $model['Books Lost'] = $params['BooksLost'];\n $model['Library Amount'] = $params['LibraryAmount'];\n $model['Library Other Charges'] = $params['LibraryOtherCharges'];\n } \n \n\n $byid = ucfirst(strtolower($dpt)) . ' Clearance ID';\n $time = ucfirst(strtolower($dpt)) . ' Clearance Time';\n $date = ucfirst(strtolower($dpt)) . ' Clearance Date';\n $rmks = ucfirst(strtolower($dpt)) . ' Clearance Remarks';\n \n $connection = Yii::$app->getDb(); \n $req = 'select * from [CUEA$Clearance Approval Entries] where [Clearance Level Code] = '. \" '$dpt' AND [Student ID] = '$sid' \";\n $res = $connection->createCommand($req)->queryAll(); \n\n \n\n $request = 'UPDATE [CUEA$Clearance Approval Entries] SET Cleared = 1, Status = 1 WHERE [Student ID] = ' . \" '$sid' AND [Clearance Level Code] = '$dpt' \";\n $response = $connection->createCommand($request)->execute();\n\n // $request2 = 'UPDATE [CUEA$Clearance Header] SET Library Clearance Date = date(Y-m-d),Library Clearance Time= date('H:i:s') WHERE [Student ID] = ' . \" '$studentid' AND [Clearance Level Code] = 'LIBRARY' \";\n // $response = $connection->createCommand($request)->execute();\n\n\n if( count($res) == 0 ) {\n echo \"<p> Record Missing </p>\";\n exit();\n } else {\n \n $rec = $res[0];\n\n $model[$rmks] = $remarks;\n $model[$date] = date('Y-m-d');\n $model[$time] = date('H:i:s');\n $model[$byid] = $rec['Clear By ID'];\n $model['Status'] = intval(1);\n\n if ($model->save()) { \n\n \n return $this->redirect([\n 'view', \n 'id' => $model['No_'],\n 'StudentID' => $rec['Student ID'],\n 'ClearByID' => $rec['Clear By ID'],\n 'Department' => $rec['Department'],\n 'ClearanceLevelCode' => $rec['Clearance Level Code']\n ]);\n } else { }\n\n } \n\n }\n\n\n\n// print_r($model); exit;\n// // if (isset($_POST['action'])) {\n\n// $connection = Yii::$app->getDb();\n// $command = $connection->createCommand(\"UPDATE [Ritman Test\\$Clearance Approval Entries] SET Cleared = 1 WHERE [Student ID] = '2016/0017' AND [Clearance Level Code]='LIBRARY' \");\n// if($command->execute()){\n// $connection->createCommand()->insert('[CUEA$Clearance Header]', [\n// 'Student No_' => $params['StudentNo_'],\n// 'Library Clearance ID' => $params['LibraryClearanceID'],\n// 'Library Clearance Date'=> $params['LibraryClearanceDate'],\n// 'Library Clearance Time'=> $params['LibraryClearanceTime'],\n\n\n\n// ])->execute();\n\n // $command2 = $connection->createCommand(\"INSERT INTO [Ritman Test\\$Clearance Header] (\n\n // Student No_\n // ,Programme\n // ,Remarks\n // ,Library Clearance Remarks\n // ,Library Clearance ID\n // ,Library Clearance Date\n // ,Library Clearance Time\n // ,Sports Clearance Remarks\n // ,Sports Clearance ID\n // ,Sports Clearance Date\n // ,Sports Clearance Time\n // ,Finance Clearance Remarks\n // ,Finance Clearance ID\n // ,Finance Clearance Date\n // ,Finance Clearance Time\n // ,Faculty Clearance Remarks\n // ,[Faculty Clearance ID]\n // ,Faculty Clearance Date\n // ,Faculty Clearance Time\n // ,Status\n // ,Student Signature\n // ,Books Lost\n // ,Library Amount\n // ,Library Other Charges\n // ,Fees Amount\n // ,Library Cleared\n // ,Sports Cleared\n // ,Finance Cleared\n // ,Faculty Cleared\n // ,No_ Series) VALUES('$params['StudentNo_']','$params['Library Clearance ID']','$params['Library Clearance Date']','$params['Library Clearance Time']') \"));\n \n // }\n// $sql=\"UPDATE Clearance Approval Entries SET Cleared = 1 WHERE Student ID = '2016/0017' AND Clearance Level Code='LIBRARY'\";\n// $connection=Yii::app()->db; \n// $command=$connection->createCommand($sql);\n// $rowCount=$command->execute(); // execute the non-query SQL\n// $dataReader=$command->query(); // execute a query SQL\n//$sql=\"UPDATE Clearance Approval Entries SET Status = '1' WHERE Student ID = '2016/0017'\";\n\n // } \n \n }",
"public function payment_method()\n {\n return $this->belongsTo(PaymentMethod::class);\n }",
"public function getCartShippingMethod()\n {\n }",
"protected function _getInvoiceModel()\n {\n return Mage::getModel('innobyte_emag_marketplace/sales_invoice');\n }",
"public function run()\n {\n Rate::create([\n\n 'general_rate' => '1',\n 'lob' => 'HO3',\n 'cov_a' => '0.009',\n 'other_structures' => '0.009',\n 'loss_of_use' => '0.009',\n 'med_pay_1k' => '1.05',\n 'med_pay_2_5k' => '1',\n 'med_pay_5k' => '0.95',\n 'aop_ded_1' => '1.10',\n 'aop_ded_2' => '1.05',\n 'aop_ded_3' => '1',\n 'aop_ded_4' => '0.95',\n 'aop_ded_5' => '0.90',\n 'frame' => '1',\n 'jm' => '1.05',\n 'bv' => '0.95',\n 'masonry' => '0.009',\n 'protection_class_1' => '1.15',\n 'protection_class_2' => '1.10',\n 'protection_class_3' => '1.05',\n 'protection_class_4' => '1',\n 'protection_class_5' => '1.05',\n 'new_purchase' => '1',\n 'prior_carrier' => '0.9',\n 'prior_carrier_name' => '0.95',\n 'zero_two_losses' => '1.10',\n 'more_than_two_losses' => '1.20',\n ]);\n\n Rate::create([\n\n 'general_rate' => '1.10',\n 'lob' => 'DP3',\n 'cov_a' => '0.009',\n 'other_structures' => '0.009',\n 'loss_of_use' => '0.009',\n 'med_pay_1k' => '1.05',\n 'med_pay_2_5k' => '1',\n 'med_pay_5k' => '0.95',\n 'aop_ded_1' => '1.10',\n 'aop_ded_2' => '1.05',\n 'aop_ded_3' => '1',\n 'aop_ded_4' => '0.95',\n 'aop_ded_5' => '0.90',\n 'frame' => '1',\n 'jm' => '1.05',\n 'bv' => '0.95',\n 'masonry' => '0.009',\n 'protection_class_1' => '1.15',\n 'protection_class_2' => '1.10',\n 'protection_class_3' => '1.05',\n 'protection_class_4' => '1',\n 'protection_class_5' => '1.05',\n 'new_purchase' => '1',\n 'prior_carrier' => '0.9',\n 'prior_carrier_name' => '0.95',\n 'zero_two_losses' => '1.10',\n 'more_than_two_losses' => '1.20',\n ]);\n\n Rate::create([\n\n 'general_rate' => '1.20',\n 'lob' => 'DP3',\n 'cov_a' => '0.009',\n 'other_structures' => '0.009',\n 'loss_of_use' => '0.009',\n 'med_pay_1k' => '1.05',\n 'med_pay_2_5k' => '1',\n 'med_pay_5k' => '0.95',\n 'aop_ded_1' => '1.10',\n 'aop_ded_2' => '1.05',\n 'aop_ded_3' => '1',\n 'aop_ded_4' => '0.95',\n 'aop_ded_5' => '0.90',\n 'frame' => '1',\n 'jm' => '1.05',\n 'bv' => '0.95',\n 'masonry' => '0.009',\n 'protection_class_1' => '1.15',\n 'protection_class_2' => '1.10',\n 'protection_class_3' => '1.05',\n 'protection_class_4' => '1',\n 'protection_class_5' => '1.05',\n 'new_purchase' => '1',\n 'prior_carrier' => '0.9',\n 'prior_carrier_name' => '0.95',\n 'zero_two_losses' => '1.10',\n 'more_than_two_losses' => '1.20',\n ]);\n }",
"public function model()\n {\n return DianOrder::class;\n }",
"public function getRecurringProcessingModelAllowableValues()\n {\n return [\n self::RECURRING_PROCESSING_MODEL_CARD_ON_FILE,\n self::RECURRING_PROCESSING_MODEL_SUBSCRIPTION,\n self::RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE,\n ];\n }",
"public function getTypesOfPayersForRedeliveryAction(array $options = []): Model;",
"public function model()\n {\n return Plan::class;\n }",
"function model()\n {\n return 'Webkul\\CartRule\\Contracts\\CartRuleCouponUsage';\n }",
"function model() {\n return 'App\\OrderBid';\n }",
"public function model()\n {\n return RbaRincianSumberDana::class;\n }",
"public function getPaymentType(){\n return $this->payment_type;\n }",
"public function toOptionArray()\n\t{\n $payments = Mage::getModel('payment/config')->getActiveMethods();\n $methods = [];\n\n foreach ($payments as $paymentCode=>$paymentModel) \n {\n $paymentTitle = Mage::getStoreConfig('payment/'.$paymentCode.'/title');\n $methods[$paymentCode] = array(\n\n 'label' => $paymentTitle,\n 'value' => $paymentCode,\n );\n }\n return $methods;\n\t}",
"public function model(): string\n {\n return Invitation::class;\n }",
"public function model()\n {\n return InsuranceType::class;\n }",
"public static function contract_options() {\n return array(\n '' => '',\n 'RENT' => __( 'Rent', 'inventor-properties' ),\n 'SALE' => __( 'Sale', 'inventor-properties' ),\n );\n }",
"public function setDefaultActivePaymentMethod()\n {\n $criteria = new CDbCriteria;\n $criteria->select = 't.name, t.value';\n $criteria->condition = \"t.name LIKE 'payment_method_%' AND t.value = 1\";\n\n $data = Option::model()->findAll($criteria);\n\n $payment_method_options = array();\n\n foreach($data as $option) {\n if($option->name == 'payment_method_paypal') $payment_method_options[] = self::PAYMENT_METHOD_PAY_PAL;\n if($option->name == 'payment_method_skrill') $payment_method_options[] = self::PAYMENT_METHOD_MONEY_BOOKERS;\n if($option->name == 'payment_method_wiretransfer') $payment_method_options[] = self::PAYMENT_METHOD_WIRE_TRANSFER;\n if($option->name == 'payment_method_check') $payment_method_options[] = self::PAYMENT_METHOD_CHECK;\n if($option->name == 'payment_method_no_payment') $payment_method_options[] = self::PAYMENT_METHOD_NO_PAYMENT;\n }\n\n if(empty($payment_method_options))\n $payment_method_options[] = self::PAYMENT_METHOD_PAY_PAL;\n\n if(!in_array($this->payment_method, $payment_method_options))\n $this->payment_method = $payment_method_options[0];\n }",
"public function model()\r\n {\r\n \treturn 'Gis\\Models\\Entities\\SystemFertilizerDefinitionDetailPhotpho';\r\n }",
"public function definition()\n {\n\n return [\n 'code'=>'vtg230048'.rand(10,100),\n 'batch_num'=>20210924,\n 'prizes_name'=>$this->faker->word(),\n 'valid_period'=>Carbon::now()->addMinutes(4000),\n 'prizes_time'=>Carbon::now()->addMinutes(rand(1,100)),\n 'operator'=>'cjz',\n 'award_status'=>1\n ];\n }",
"public function getPayMethodAllowableValues()\n {\n return [\n self::PAY_METHOD_BANK_TRANSFER,\nself::PAY_METHOD_CHEQUE,\nself::PAY_METHOD_CREDIT_CARD,\nself::PAY_METHOD_GIRO_ACH,\nself::PAY_METHOD_OTHER, ];\n }",
"public function uniqueNumberDifferentiator(){\n \n $model = new PlatformSettings;\n \n return $model->uniqueNumberDifferentiator();\n \n }",
"public function paymentMethodRecord(){\n return $this->belongsTo('App\\PaymentMethodRecord');\n }",
"public function run()\n {\n TaxRate::create(['province' => 'Alberta', 'category' => 'flower','rate' => '16.8']);\n TaxRate::create(['province' => 'Alberta', 'category' => 'trim','rate' => '16.8']);\n TaxRate::create(['province' => 'Alberta', 'category' => 'seed','rate' => '16.8']);\n TaxRate::create(['province' => 'Alberta', 'category' => 'seedling','rate' => '16.8']);\n\n TaxRate::create(['province' => 'British Columbia', 'category' => 'flower','rate' => '0']);\n TaxRate::create(['province' => 'British Columbia', 'category' => 'trim','rate' => '0']);\n TaxRate::create(['province' => 'British Columbia', 'category' => 'seed','rate' => '0']);\n TaxRate::create(['province' => 'British Columbia', 'category' => 'seedling','rate' => '0']);\n\n TaxRate::create(['province' => 'Manitoba', 'category' => 'flower','rate' => '0']);\n TaxRate::create(['province' => 'Manitoba', 'category' => 'trim','rate' => '0']);\n TaxRate::create(['province' => 'Manitoba', 'category' => 'seed','rate' => '0']);\n TaxRate::create(['province' => 'Manitoba', 'category' => 'seedling','rate' => '0']);\n\n TaxRate::create(['province' => 'New Brunswick', 'category' => 'flower','rate' => '0']);\n TaxRate::create(['province' => 'New Brunswick', 'category' => 'trim','rate' => '0']);\n TaxRate::create(['province' => 'New Brunswick', 'category' => 'seed','rate' => '0']);\n TaxRate::create(['province' => 'New Brunswick', 'category' => 'seedling','rate' => '0']);\n\n TaxRate::create(['province' => 'Newfoundland and Labrador', 'category' => 'flower','rate' => '0']);\n TaxRate::create(['province' => 'Newfoundland and Labrador', 'category' => 'trim','rate' => '0']);\n TaxRate::create(['province' => 'Newfoundland and Labrador', 'category' => 'seed','rate' => '0']);\n TaxRate::create(['province' => 'Newfoundland and Labrador', 'category' => 'seedling','rate' => '0']);\n\n TaxRate::create(['province' => 'Northwest Territories', 'category' => 'flower','rate' => '0']);\n TaxRate::create(['province' => 'Northwest Territories', 'category' => 'trim','rate' => '0']);\n TaxRate::create(['province' => 'Northwest Territories', 'category' => 'seed','rate' => '0']);\n TaxRate::create(['province' => 'Northwest Territories', 'category' => 'seedling','rate' => '0']);\n\n TaxRate::create(['province' => 'Nova Scotia', 'category' => 'flower','rate' => '0']);\n TaxRate::create(['province' => 'Nova Scotia', 'category' => 'trim','rate' => '0']);\n TaxRate::create(['province' => 'Nova Scotia', 'category' => 'seed','rate' => '0']);\n TaxRate::create(['province' => 'Nova Scotia', 'category' => 'seedling','rate' => '0']);\n\n TaxRate::create(['province' => 'Nunavut', 'category' => 'flower','rate' => '19.3']);\n TaxRate::create(['province' => 'Nunavut', 'category' => 'trim','rate' => '19.3']);\n TaxRate::create(['province' => 'Nunavut', 'category' => 'seed','rate' => '19.3']);\n TaxRate::create(['province' => 'Nunavut', 'category' => 'seedling','rate' => '19.3']);\n\n TaxRate::create(['province' => 'Ontario', 'category' => 'flower','rate' => '3.9']);\n TaxRate::create(['province' => 'Ontario', 'category' => 'trim','rate' => '3.9']);\n TaxRate::create(['province' => 'Ontario', 'category' => 'seed','rate' => '3.9']);\n TaxRate::create(['province' => 'Ontario', 'category' => 'seedling','rate' => '3.9']);\n\n TaxRate::create(['province' => 'Prince Edward Island', 'category' => 'flower','rate' => '0']);\n TaxRate::create(['province' => 'Prince Edward Island', 'category' => 'trim','rate' => '0']);\n TaxRate::create(['province' => 'Prince Edward Island', 'category' => 'seed','rate' => '0']);\n TaxRate::create(['province' => 'Prince Edward Island', 'category' => 'seedling','rate' => '0']);\n\n TaxRate::create(['province' => 'Quebec', 'category' => 'flower','rate' => '0']);\n TaxRate::create(['province' => 'Quebec', 'category' => 'trim','rate' => '0']);\n TaxRate::create(['province' => 'Quebec', 'category' => 'seed','rate' => '0']);\n TaxRate::create(['province' => 'Quebec', 'category' => 'seedling','rate' => '0']);\n\n TaxRate::create(['province' => 'Saskatchewan', 'category' => 'flower','rate' => '6.45']);\n TaxRate::create(['province' => 'Saskatchewan', 'category' => 'trim','rate' => '6.45']);\n TaxRate::create(['province' => 'Saskatchewan', 'category' => 'seed','rate' => '6.45']);\n TaxRate::create(['province' => 'Saskatchewan', 'category' => 'seedling','rate' => '6.45']);\n\n TaxRate::create(['province' => 'Yukon', 'category' => 'flower','rate' => '0']);\n TaxRate::create(['province' => 'Yukon', 'category' => 'trim','rate' => '6.45']);\n TaxRate::create(['province' => 'Yukon', 'category' => 'seed','rate' => '6.45']);\n TaxRate::create(['province' => 'Yukon', 'category' => 'seedling','rate' => '6.45']);\n }",
"public function model()\n {\n return config('litecms.portfolio.portfolio.model.model');\n }",
"function payment_model()\n\t{\n\t\tparent::__construct();\t\t\n\t}",
"function InseMethod(){\n\treturn array('1'=>'Natural', '2'=>'Artificial Insemination');\n}",
"protected function createRateModel()\n {\n $class = '\\\\'.ltrim($this->rateModel, '\\\\');\n $model = new $class();\n return $model;\n }",
"private function getShopgateCondition()\n {\n return [\n 'label' => __('Shopgate Mobile App'),\n 'value' => ShopgateOrder::class,\n ];\n }",
"public function model()\n {\n return Contract::class;\n }",
"function choosePaymentMethod() {\n $booking = $this->Session->read('booking');\n // find all unpaid bookings\n $unpaid = $this->Payment->Booking->User->findUnpaid($this->Auth->user('id'));\n if ($booking) {\n // it's probably appropriate to save it at this point\n if ($this->Session->read('booking.saved') == false) {\n $bid = $this->Payment->Booking->saveBooking($booking, $this->Auth->user('id'));\n if ($bid === false) {\n $this->setFlash('Error: Could Not Save Booking');\n } else {\n $this->Session->write('booking.saved', true);\n $newbooking = $this->Payment->Booking->find('first', array(\n 'conditions' => array('Booking.id' => $bid),\n 'recursive' => '2'\n ));\n array_push($unpaid, $newbooking);\n }\n }\n }\n $this->set('unpaid', $unpaid);\n $this->set('allowedPaymentTypes', $this->allowedPaymentTypes);\n }",
"public function payment_type()\n {\n return $this->belongsTo('App\\PaymentType');\n }",
"public function model(){\n\t\treturn 'App\\SampleCriteria';\n\t}",
"private function isOnepay(){\r\n return $this->getPaymentMethod() == 5;\r\n }",
"public function model()\n {\n return Notificacao::class;\n }",
"public function paymentMethodType()\n {\n return $this->hasOne(\\Cot\\PaymentMethodType::class);\n }",
"public function model()\n {\n return 'App\\Models\\PresentationDeck';\n }",
"private function getPaymentMethod(){\r\n\r\n $paymentMethod = 1;\r\n switch($this->medio_pago){\r\n case 'webpay': {\r\n $paymentMethod = 1;\r\n break;\r\n }\r\n case 'servipag': {\r\n $paymentMethod = 2;\r\n break;\r\n }\r\n case 'multicaja': {\r\n $paymentMethod = 3;\r\n break;\r\n }\r\n case 'onepay': {\r\n $paymentMethod = 5;\r\n break;\r\n }\r\n case 'flow': {\r\n $paymentMethod = 9;\r\n break;\r\n }\r\n case 'webpay3c': {\r\n $paymentMethod = 13;\r\n break;\r\n }\r\n case 'mach': {\r\n $paymentMethod = 15;\r\n break;\r\n }\r\n default : {\r\n $paymentMethod = 1;\r\n break;\r\n } \r\n }\r\n\r\n return $paymentMethod;\r\n }",
"public function getTypesOfPayersAction(array $options = []): Model;",
"protected function getPaymentMethod(){\n return $this->method;\n }",
"public function rate(){\n $this->hasMany(Rate::class);\n }",
"function &getEverywhereModel() {\n return $this->Review;\n }",
"abstract public function getBookingModel(): string;",
"function model()\n {\n return 'Modules\\Velocity\\Contracts\\VelocityCustomerCompareProduct';\n }",
"public function numberPayments(){\n \treturn $this->belongsTo('Modules\\Plan\\Entities\\NumberPayments'); // this matches the Eloquent model\n }",
"protected function _paymentMethodFromArray($arr)\n\t{\n\t\t$PaymentMethod = new QuickBooks_Object_PaymentMethod();\n\t\t\n\t\t$map = array(\n\t\t\t'Name' => array( 'setName', 'Name' ), \n\t\t\t);\n\t\t\n\t\t$PaymentMethod = $this->_applyBaseMap($arr, $map, $PaymentMethod, QUICKBOOKS_OBJECT_PAYMENTMETHOD);\n\t\t\n\t\treturn $PaymentMethod;\n\t}",
"public function model()\n {\n return Order::class;\n }",
"public function model()\n {\n return Order::class;\n }",
"public function paymentFor()\r\n\t{\r\n\t\tswitch ($this->for)\r\n\t\t{\r\n\t\t\tcase 'membershipPlan':\r\n\t\t\t\t$model = 'MembershipPlan';\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'listingPlan':\r\n\t\t\t\t$model = 'ListingPlan';\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'listingHigh':\r\n\t\t\tcase 'listingFeat':\r\n\t\t\t\t$model = 'HighfeatPlan';\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn $this->belongsTo($model, 'for_id');\r\n\t}",
"private function _getCreateInvoiceOption()\n {\n return Mage::getStoreConfig('payment/paymentnetwork_pnsofortueberweisung/create_invoice', Mage::app()->getStore()->getStoreId());\n }",
"public function maybe_update_payment_history_add_revenue_model() {\n global $wpdb;\n\n $current_version = get_option( 'laterpay_version' );\n if ( version_compare( $current_version, '0.9.9', '<' ) ) {\n return;\n }\n\n $table = $wpdb->prefix . 'laterpay_payment_history';\n $columns = $wpdb->get_results( 'SHOW COLUMNS FROM ' . $table .';' );\n\n // before version 0.9.9 we had no 'revenue_model'\n $is_up_to_date = false;\n $modified = false;\n $passes_added = false;\n $code_added = false;\n\n foreach ( $columns as $column ) {\n if ( $column->Field === 'revenue_model' ) {\n $modified = strpos( strtolower( $column->Type ), 'enum' ) !== false;\n $is_up_to_date = true;\n }\n\n if ( $column->Field === 'pass_id' ) {\n $passes_added = true;\n }\n\n if ( $column->Field === 'code' ) {\n $code_added = true;\n }\n }\n\n $this->logger->info(\n __METHOD__,\n array(\n 'current_version' => $current_version,\n 'is_up_to_date' => $is_up_to_date ? 'yes' : 'no',\n )\n );\n\n // if the table needs an update, add the 'revenue_model' column and set the current values to 'ppu'\n if ( ! $is_up_to_date ) {\n // add the missing column to our table\n $wpdb->query( 'ALTER TABLE ' . $table . \" ADD revenue_model CHAR( 3 ) NOT NULL DEFAULT 'ppu';\" );\n // update the existing data\n $wpdb->query( 'UPDATE ' . $table . ' SET revenue_model = IF( ' . $table . \".price < 5, 'ppu', 'sis' )\" );\n }\n\n // modify revenue model column\n if ( ! $modified ) {\n $wpdb->query( 'ALTER TABLE ' . $table . \" MODIFY revenue_model ENUM('ppu', 'sis') NOT NULL DEFAULT 'ppu';\" );\n }\n\n // add pass id column for version >= 0.9.10\n if ( ! $passes_added && version_compare( $current_version, '0.9.10', '>=' ) ) {\n $wpdb->query( 'ALTER TABLE ' . $table . ' ADD pass_id INT( 11 ) NOT NULL DEFAULT 0;' );\n $wpdb->query( 'ALTER TABLE ' . $table . ' MODIFY post_id INT( 11 ) NOT NULL DEFAULT 0;' );\n }\n\n // add voucher code column for version >= 0.9.10\n if ( ! $code_added && version_compare( $current_version, '0.9.10', '>=' ) ) {\n $wpdb->query( 'ALTER TABLE ' . $table . ' ADD code VARCHAR(6) NULL DEFAULT NULL;' );\n }\n }",
"public function getPriceMode();",
"public function toArray()\n {\n return array(\n /*'v3' => Mage::helper('apruvepayment')->__('V3'),*/\n 'v4' => Mage::helper('apruvepayment')->__('V4'),\n );\n }",
"public function model()\n {\n return RequisitionItemDetail::class;\n }",
"public function getModel() {\n if ($this->model) {\n return $this->model; \n }\n if (is_array($this->rawData)) {\n foreach ($this->rawData as $value) { \n if (preg_match('/(^CP-.*)/', $value, $m)) {\n $this->model = str_replace(\" \",\"\",$m[1]); \n break; \n }\n } \n }\n return $this->model;\n }",
"public function getProductTypeAttribute()\n {\n return [self::LOAN, self::INSURANCE];\n }",
"protected function CltvoGetModelClass(){\n return \"App\\Models\\Shop\\BagStatus\";\n }",
"public function model()\n {\n return PassengerNationality::class;\n }"
] | [
"0.58674866",
"0.5851595",
"0.58113724",
"0.5746869",
"0.57153904",
"0.5601847",
"0.54841375",
"0.54212385",
"0.5386307",
"0.53749007",
"0.5373425",
"0.53603274",
"0.5318226",
"0.5308985",
"0.52798337",
"0.5214305",
"0.5202966",
"0.52014875",
"0.51986927",
"0.517927",
"0.5171378",
"0.51709676",
"0.5165134",
"0.5162948",
"0.5121297",
"0.5115121",
"0.510988",
"0.510526",
"0.50741744",
"0.5043088",
"0.5034991",
"0.5032719",
"0.5029881",
"0.5027244",
"0.50187474",
"0.50143546",
"0.49970934",
"0.49874622",
"0.49804947",
"0.49794614",
"0.49737847",
"0.49718708",
"0.4966534",
"0.49638498",
"0.49582452",
"0.49456632",
"0.4938757",
"0.49343234",
"0.49262884",
"0.4925186",
"0.49241287",
"0.48974302",
"0.48907351",
"0.48883665",
"0.48863795",
"0.48829022",
"0.48824406",
"0.48800635",
"0.4877545",
"0.48753604",
"0.48735344",
"0.48590198",
"0.48574033",
"0.4855076",
"0.48525068",
"0.48492783",
"0.48357916",
"0.4835498",
"0.48233354",
"0.4820269",
"0.4815797",
"0.48155922",
"0.48105428",
"0.48056647",
"0.48056322",
"0.4801747",
"0.48008403",
"0.4799065",
"0.47959763",
"0.47958153",
"0.4793266",
"0.47809434",
"0.47786605",
"0.47764608",
"0.4774936",
"0.4774177",
"0.47707823",
"0.4769037",
"0.47637907",
"0.47622517",
"0.47622517",
"0.47581393",
"0.47579265",
"0.47536865",
"0.4750588",
"0.47489664",
"0.4748403",
"0.47398812",
"0.47366345",
"0.47365955",
"0.47352606"
] | 0.0 | -1 |
INSERT INTO TWO TABLES | function insertTwoTables($table1, $data1, $table2, $data2)
{
$this->db->trans_start();
$this->db->insert($table1, $data1);
$this->db->insert($table2, $data2);
$this->db->trans_complete();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fromOneToTheOther($db1, $table1, $db2, $table2){\n\n\t$firstRecs = dbMassData(\"SELECT * FROM \".$db1.\".\".$table1.\" WHERE Package = 'Local' OR Package IS NULL\");\n\t$secRecs = dbMassData(\"SELECT * FROM \".$db2.\".\".$table2.\" WHERE Package = 'Local' OR Package IS NULL\");\n\t\n\t\n\n\t//print_r($firstRecs);\n\tfor($i=0; $i<count($firstRecs); $i++){\n\t\t$insertString = \"\";\n\t\t$insertString1 = \"\";\n\t\t$insertString2 = \"\";\n\t\t$allKeys = array();\n\t\t$allVals = array();\n\n\t\tforeach ($firstRecs[$i] as $key => $value){\n\n\n\t\t\tif(in_array($key, $allKeys) == false){\n\t\t\t\tarray_push($allKeys, $key);\n\t\t\t}\n\t\t\tarray_push($allVals, $value);\n\n\t\t\t\n\t\t}\n\n\t\t//construct insert string\n\t\tfor($j=0; $j <count($allKeys); $j++){\n\n\t\t\tif($j == 0){\n\t\t\t\t$insertString1 = $insertString1 . \"`\".$allKeys[$j].\"`\";\n\t\t\t\t$insertString2 = $insertString2 . \"'\".str_replace(\"'\", \"\\'\", $allVals[$j]).\"'\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$insertString1 = $insertString1 . \", `\". $allKeys[$j].\"`\";\n\t\t\t\t$insertString2 = $insertString2 . \", '\". str_replace(\"'\", \"\\'\", $allVals[$j]).\"'\";\n\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t$insertString = \"INSERT INTO \".$db2.\".\".$table2.\" ($insertString1) VALUES ($insertString2)\";\n\t\n\t\t//echo($insertString);\n\n\t\tdbQuery($insertString);\n\t}\n\n\n\n\t\n\n\n}",
"function clonTable1toTable2Inscritos($T_INSCRITOS,$PROVINCIA, $CLAVE, $TOMO, $FOLIO)\n{\n global $mysqli;\n $TINS = $T_INSCRITOS;\n $query = new Query($mysqli, \"INSERT INTO inscritostmp SELECT * FROM \".$TINS.\" WHERE provincia=? and clave=? and tomo=? and folio=?\");\n $parametros = array('ssss', &$PROVINCIA, &$CLAVE, &$TOMO, &$FOLIO);\n $data = $query->getresults($parametros);\n return true;\n}",
"public function insert($table);",
"public function insert($connection, $table, $rows);",
"function clonTable1toTable2Resultados($T_RESULTADOS,$PROVINCIA, $CLAVE, $TOMO, $FOLIO)\n{\n global $mysqli;\n $TRES = $T_RESULTADOS;\n $query = new Query($mysqli, \"INSERT INTO resultadostmp SELECT * FROM \".$TRES.\" WHERE provincia=? and clave=? and tomo=? and folio=?\");\n $parametros = array('ssss', &$PROVINCIA, &$CLAVE, &$TOMO, &$FOLIO);\n $data = $query->getresults($parametros);\n return true;\n}",
"public function insert($tables,$data){\n $this->db->insert($tables,$data);\n }",
"public function insert($tables,$data){\n $this->db->insert($tables,$data);\n }",
"public function insert($tables,$data){\n $this->db->insert($tables,$data);\n }",
"public function insert($tableName, $data);",
"public function insert($table, array $fields);",
"public function insert($table, array $data);",
"abstract public function insert_sql($tableName, $new_table = false);",
"public function insert($tblUpdate);",
"function insert($table, $columns);",
"public function insert($table_name, $fields_values = array())\r\n {\r\n }",
"public function insertDB(){\n // Query to input into customers table\n $this->qry_insert_customer = \"INSERT INTO customers (company, firstname, lastname, email, phone, description)\n VALUES ('$this->company','$this->firstname', '$this->lastname', '$this->email', '$this->phone', '$this->description')\";\n\n // Query to input into customers table\n $this->qry_insert_address = \"INSERT INTO addresses (address, city, country, postal_code)\n VALUES ('$this->street','$this->place','$this->country','$this->zipcode')\";\n\n //Execute both queries\n mysqli_query($this->db, $this->qry_insert_customer);\n mysqli_query($this->db, $this->qry_insert_address); \n }",
"function insertTabelaAssociativa($tabela, $cd_a, $cd_b, $value_a, $value_b){\n\tif(sizeof($value_b) > 1){\n\t\n\t\tforeach($value_b as $valor){\n\t\t\t// Monta a string sql\n\t\t\t$sql = \"insert into $tabela set $cd_a = $value_a, $cd_b = $valor\";\n\t\t\tmysql_query($sql);\n\t\t}\n\t\t\n\t}\n\telseif(sizeof($value_b) == 1){\n\n\t\t// Monta a string sql\n\t\t$sql = \"insert into $tabela set $cd_a = $value_a, $cd_b = $value_b[0]\";\n\t\tmysql_query($sql);\t\n\t\n\t}\n}",
"function insert($database,$tables,$values) {\n mad_mysql_connect();\n\n\t\t$pre = $GLOBALS[\"prefix\"];\n\t\t/* Get Database */\n\t\t$intodatabase = str_replace(\"[p]\", $pre, $database);\n\t\t\n\t\t/* Break Table into Chunks */\n\t\t$tablechunks = explode(\"|\", $tables);\n\t\t/* Count the Tables */\n\t\t$totaltables = count($tablechunks);\n\t\t\n\t\t/* Break Values into Chunks */\n\t\t$valuechunks = explode(\"|\", $values);\n\t\t/* Count the Values */\n\t\t$totalvalues = count($tablechunks);\n\t\t\n\t\t/* Check to see that the number of tables equals the number of values */\n\t\tif ($totaltables == $totalvalues) {\n\t\t\t$setcomma = $totaltables - 1;\n\t\t\t$i=0;\n\t\t\twhile ($i < $totaltables) {\n\t\t\t\t/* Set the Table Name */\n\t\t\t\t$table = $tablechunks[$i];\n\t\t\t\t/* Set the Value of the Table */\n\t\t\t\t$value = $valuechunks[$i];\n\t\t\t\t\n\t\t\t\t/* If this is the last entry, remove the comma */\n\t\t\t\tif ($i == $setcomma) {\n\t\t\t\t\t$comma = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$comma = \",\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$updatetables .= \"`{$table}`{$comma}\";\n\t\t\t\t$updatevalues .= \"'{$value}'{$comma}\";\n\t\t\t\t\n\t\t\t\t++$i;\n\t\t\t}\n\t\t\treturn mysql_query(\"insert into `{$intodatabase}` ({$updatetables}) values ({$updatevalues})\");\n\t\t}\n\t}",
"abstract protected function platformInsertStatement($table, array $keys, array $values);",
"function insertMulti($table, $fields, $values) {\n\t\t$table = $this->fullTableName($table);\n\t\tif (is_array($fields)) {\n\t\t\t$fields = implode(', ', array_map(array(&$this, 'name'), $fields));\n\t\t}\n\t\t$values = implode(', ', $values);\n\t\t$this->query(\"INSERT INTO {$table} ({$fields}) VALUES {$values}\");\n\t}",
"public function insert_update($table, array $values);",
"protected function createTables()\n {\n $sql = $this->create_table;\n $this->connection->query($sql);\n\n // create again in schema 2\n $sql = str_replace($this->table, \"{$this->schema2}.{$this->table}\", $sql);\n $this->connection->query($sql);\n }",
"function insertRow($table, $names, $values) {\n return mysql_query(sprintf('INSERT INTO %s (`%s`) VALUES (\"%s\")', $table, $names, $values));\n }",
"function insert($table, $insertNames, $values) {\n for($i = 0; $i < count($values); $i++) {\n $values[$i] = htmlspecialchars($values[$i]);\n }\n\n \n /**Kontrola stringu */\n if(!is_string($table)) {\n throw new Exception(\"Tabulka musí být string.\");\n }\n /**Kontorla poli */\n else if(!is_array($insertNames) || !is_array($values)) {\n throw new Exception(\"Hodnota musí být ve formátu pole.\");\n }\n /**Kontrola poctu nazvu atribtu s novymi hodnotami */\n else if(count($insertNames) !== count($values)){\n throw new Exception(\"Hodnoty se musí rovnat.\");\n }\n\n /**Pripojeni k databazi */\n $connect = NULL;\n try {\n $connect = require(\"connect.php\");\n }catch(Exception $e) {\n throw $e;\n }\n /**Formatovani a kontrola SQL utoku */\n $insertNames = implode(',', $insertNames);\n $value = '';\n for($i = 0; $i<count($values)-1; $i++) {\n $value .= '?,';\n }\n $value .= '?';\n /**Formatovani metody */\n $statement = $connect->prepare('INSERT INTO ' .$table .'('.$insertNames.') VALUES (' .$value.')');\n\n if(!$statement->execute($values)){\n throw new Exception(\"Chyba při INSERT dotazu\");\n }\n}",
"function add($table,$values){\n $conn=connectDB();\n $query=\"INSERT INTO $table VALUES ($values)\";\n //print($query);\n $conn->query($query);\n }",
"protected function _insert($table, $keys, $values) {\n\t\treturn $this->query('INSERT INTO '.$table.' ('.implode(', ', $keys).') VALUES ('.implode(', ', $values).')');\n\t}",
"public function testInsertSaftRegressionTest2()\n {\n $res = $this->fixture->query('INSERT INTO <http://localhost/Saft/TestGraph/> {<http://foo/1> <http://foo/2> <http://foo/3> . }');\n\n $res1 = $this->fixture->query('SELECT * FROM <http://localhost/Saft/TestGraph/> WHERE {?s ?p ?o.}');\n $this->assertEquals(1, count($res1['result']['rows']));\n\n $res2 = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n $this->assertEquals(1, count($res2['result']['rows']));\n\n $res2 = $this->fixture->query('SELECT ?s ?p ?o WHERE {?s ?p ?o.}');\n $this->assertEquals(1, count($res2['result']['rows']));\n }",
"function insert($conn,$table,$data)\n {\n }",
"public function insert($insValues) {\n $insValues = (array) $insValues;\n $docsTable = new GenericPVSWTable(\"docstax\");\n if (isset($insValues['ordnbr'])) {\n // Handle adding the salestax for a salesorder\n // HAVE TO HAVE -- Ordtype and bocntr and custid\n $ordnbr = $insValues['ordnbr'];\n $ordtype = $insValues['ordtype'];\n $bocntr = $insValues['bocntr'];\n $custid = $insValues['custid'];\n if ($ordtype == \"\" || $bocntr === \"\" || $custid == \"\") {\n throw new Exception(\"Must include custid, ordnbr, ordtype, and bocntr\\n\".var_export($insValues));\n }\n $deleteDocSql = \"delete from docstax \n where doctype = '$ordtype' and \n refnbr = '$ordnbr' and\n bocntr = $bocntr and\n custvendid = '$custid'\n \";\n $deleteDtlSql = \"delete from dtlstax \n where doctype = '$ordtype' and \n refnbr = '$ordnbr' and\n bocntr = $bocntr and\n custvendid = '$custid'\";\n $ret = $docsTable->directQuery($deleteDocSql, array());\n $ret = $docsTable->directQuery($deleteDtlSql, array());\n \n $insDocSql = \"\n insert into docstax \n ( doctype, refnbr, custvendid, taxtype, taxid1, taxid2, bocntr)\n select\n s.ordtype as doctype,\n s.ordnbr as refnbr,\n s.custid as custvendid,\n 'O' as taxtype,\n c.tax1 as taxid1,\n c.tax2 as taxid2,\n s.bocntr as bocntr\n From salesord s, customer c\n where ordnbr='$ordnbr' and ordtype='$ordtype' and bocntr=$bocntr and s.custid=c.custid\n \";\n $insDtlSql = \"\n insert into dtlstax \n (doctype, refnbr, custvendid, taxtype, tax1, tax2, bocntr, lineid, taxcat)\n select\n s.ordtype as doctype,\n s.ordnbr as refnbr,\n s.custid as custvendid,\n 'O' as taxtype,\n c.tax1 as tax1,\n c.tax2 as tax2,\n s.bocntr as bocntr,\n d.lineid,\n c.tax1 = '' ?? '' :: 'ALL'\n From salesord s, sodet d, customer c\n where s.ordnbr='$ordnbr' and s.ordtype='$ordtype' and s.bocntr=$bocntr and\n s.ordnbr=d.ordnbr and\n s.ordtype=d.ordtype and\n s.bocntr=d.bocntr and\n s.custid=c.custid\n \";\n $ret = $docsTable->directQuery($insDocSql, array());\n $ret = $docsTable->directQuery($insDtlSql, array());\n \n return $this->findWhere(array(\"refnbr\"=>$ordnbr,\"bocntr\"=>$bocntr, \"doctype\"=>$ordtype));\n }\n else {\n throw new Exception(\"Not ready for this yet\");\n }\n }",
"protected abstract function insertRow($tableName, $data);",
"function InsertM2MCurrOps ($tablename, $MtoM, $M2MValue, $P2P, $P2PValue) {\r\n//get database info\r\nglobal $db;\r\n$db = new mysqli(\"localhost\", \"root\", \"\", \"trading\");\r\n\r\n//Insert row into the M2M table\r\n$query = \"INSERT INTO $tablename ($MtoM, $P2P) VALUES ($M2MValue, $P2PValue)\";\r\n$db->query($query) or die (\"Oh well, we couldn't get yo uthat\");\r\n\t\r\n\t\r\n}",
"abstract public function insert();",
"public function insert($params){\n\t\t$DB = Registry::getInstance()->DB;\n\t\t$prefix = \"INSERT \";\n\t\t$p = $this->clean($params);\t\n\t\t$statement = $prefix.\" \".$params['tables'][0].\" \".$this->genSet($p['set']);\t\n\t\t$DB->exec($statement);\t\n\t}",
"function insert_table( $insert_data, $table ){\t\n\t\t$this->db->insert($table, $insert_data);\n\t}",
"function insert() {\n\t\t$sql = \"INSERT INTO \".$this->hr_db.\".hr_person_detail (psd_ps_id, psd_dp_id, psd_tax_no, psd_id_card_no, psd_passport_no, psd_picture, psd_blood_id, psd_reli_id, psd_nation_id, psd_race_id, psd_psst_id, psd_birthdate, psd_birth_pv_id, psd_gd_id, psd_account_no, psd_ba_id, psd_facebook, psd_twitter, psd_website, psd_email, psd_cellphone, psd_phone, psd_ex_phone, psd_work_phone, psd_lodge_id, psd_lodge_no, psd_lodge_phone, psd_addcur_no, psd_addcur_pv_id, psd_addcur_amph_id, psd_addcur_dist_id, psd_addcur_zipcode, psd_addhome_no, psd_addhome_pv_id, psd_addhome_amph_id, psd_addhome_dist_id, psd_addhome_zipcode)\n\t\t\t\tVALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t$this->hr->query($sql, array($this->psd_ps_id, $this->psd_dp_id, $this->psd_tax_no, $this->psd_id_card_no, $this->psd_passport_no, $this->psd_picture, $this->psd_blood_id, $this->psd_reli_id, $this->psd_nation_id, $this->psd_race_id, $this->psd_psst_id, $this->psd_birthdate, $this->psd_birth_pv_id, $this->psd_gd_id, $this->psd_account_no, $this->psd_ba_id, $this->psd_facebook, $this->psd_twitter, $this->psd_website, $this->psd_email, $this->psd_cellphone, $this->psd_phone, $this->psd_ex_phone, $this->psd_work_phone, $this->psd_lodge_id, $this->psd_lodge_no, $this->psd_lodge_phone, $this->psd_addcur_no, $this->psd_addcur_pv_id, $this->psd_addcur_amph_id, $this->psd_addcur_dist_id, $this->psd_addcur_zipcode, $this->psd_addhome_no, $this->psd_addhome_pv_id, $this->psd_addhome_amph_id, $this->psd_addhome_dist_id, $this->psd_addhome_zipcode));\n\t\t$this->last_insert_id = $this->hr->insert_id();\n\t}",
"Function donneefournisseurs()\r\n {\r\n echo \"copie des données de la table fournisseurs\";\r\n $req=\"INSERT INTO `\".Valorisation::$anneenouvelle.\"`.`fournisseurs` SELECT * FROM `\".Valorisation::$anneeancienne.\"`.`fournisseurs`\";\r\n Valorisation::$bddnew->query($req); \r\n }",
"public function insert($table, array $values, $ignore);",
"function fillTable(): void\n{\n $sql = '\n SET autocommit=0; \n SET unique_checks=0;\n SET foreign_key_checks=0;\n INSERT INTO `products` (name, price, color) VALUES ' . generateTableData(1000001) . ';\n SET unique_checks=1;\n SET foreign_key_checks=1;\n COMMIT;\n ';\n\n DB::getInstance()->query($sql);\n}",
"protected function fillTable()\n {\n $names = [\n 'Anna', 'Betty', 'Clara', 'Donna', 'Fiona',\n 'Gertrude', 'Hanna', 'Ione', 'Julia', 'Kara',\n ];\n\n $stm = \"INSERT INTO {$this->table} (name) VALUES (:name)\";\n foreach ($names as $name) {\n $this->connection->perform($stm, ['name' => $name]);\n }\n }",
"function copyTable($table, $new_table, $data = TRUE, $link = 0) {\n $this->link = $link ? $link : $this->link;\n $r = $this->query(\"CREATE TABLE `{$new_table}` LIKE `{$table}`;\", $link);\n return ($r && $data) ? $this->query(\"INSERT INTO `{$new_table}` SELECT * FROM `{$table}`;\", $link) : $r;\n }",
"public function _connection_table($table_a, $table_b) {\n\t\tif($table_a == $table_b) {\n\t\t\t$fields['$id_a'] = array(\n\t\t\t\t'Type' => 'number',\n\t\t\t\t'Null' => 'NO',\n\t\t\t\t'Key' => 'PRI',\n\t\t\t\t'Default' => NULL,\n\t\t\t\t'Extra' => ''\n\t\t\t);\n\n\t\t\t$fields['$id_b'] = array(\n\t\t\t\t'Type' => 'number',\n\t\t\t\t'Null' => 'NO',\n\t\t\t\t'Key' => 'PRI',\n\t\t\t\t'Default' => NULL,\n\t\t\t\t'Extra' => ''\n\t\t\t);\n\n\t\t\t$fields['$updated_timestamp'] = array(\n\t\t\t\t'Type' => 'timestamp',\n\t\t\t\t'Null' => 'YES',\n\t\t\t\t'Key' => '',\n\t\t\t\t'Default' => NULL,\n\t\t\t\t'Extra' => 'on update CURRENT_TIMESTAMP'\n\t\t\t);\n\t\t\t\n\t\t\t$fields['$flags'] = array(\n\t\t\t\t'Type' => 'bigint(20)',\n\t\t\t\t'Null' => 'NO',\n\t\t\t\t'Key' => '',\n\t\t\t\t'Default' => NULL,\n\t\t\t\t'Extra' => ''\n\t\t\t);\n\t\t\t\n\t\t\t$table = \"\\$connect $table_a\";\n\t\t\t\n\t\t\tif($this->_exists($table)) return false;\n\t\t\t\n\t\t\t$this->_create($table, $fields);\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Since we are obviously connecting two different tables go here\n\t\t */\n\t\t$fields['$'.$table_a.'_id'] = array(\n\t\t\t'Type' => 'number',\n\t\t\t'Null' => 'NO',\n\t\t\t'Key' => 'PRI',\n\t\t\t'Default' => NULL,\n\t\t\t'Extra' => ''\n\t\t);\n\t\t\n\t\t$fields['$'.$table_b.'_id'] = array(\n\t\t\t'Type' => 'number',\n\t\t\t'Null' => 'NO',\n\t\t\t'Key' => 'PRI',\n\t\t\t'Default' => NULL,\n\t\t\t'Extra' => ''\n\t\t);\n\t\t\t\t\n\t\t$fields['$updated_timestamp'] = array(\n\t\t\t'Type' => 'timestamp',\n\t\t\t'Null' => 'YES',\n\t\t\t'Key' => '',\n\t\t\t'Default' => 'CURRENT_TIMESTAMP',\n\t\t\t'Extra' => 'on update CURRENT_TIMESTAMP'\n\t\t);\n\t\t\n\t\t$fields['$flags'] = array(\n\t\t\t'Type' => 'bigint(20)',\n\t\t\t'Null' => 'NO',\n\t\t\t'Key' => '',\n\t\t\t'Default' => NULL,\n\t\t\t'Extra' => ''\n\t\t);\n\t\t\n\t\t$table1 = \"\\$connect $table_a $table_b\";\n\t\t$table2 = \"\\$connect $table_b $table_a\";\n\t\t\n\t\tif($this->_exists($table1)) return false;\n\t\tif($this->_exists($table2)) return false;\n\t\t\n\t\t$this->_create($table1 ,$fields);\n\t}",
"function inserir($tabela,$dados)\n\t{\n\t\t$this->conectar();\n\t\t$this->sql=\"\";\n\t\t\n\t\t// Dividimos o Array dentro de $dados em Chaves e Valores\n\t\t$campos = array_keys($dados);\n\t\t$valores = array_values($dados);\n\t\t\n\t\t//Executamos a Query \n\t\t$this->sql = \"INSERT INTO \".$tabela.\" (\".implode(', ', $campos).\") VALUES ('\" . implode('\\', \\'', $valores) . \"')\";\n\t\t\n\t\t//Verificamos se a Query foi executada corretamente\n\t\n\t\t\n\t\t$this->query = mysqli_query($this->conectar(),$this->sql) or die ($this->erro($this->sql));\n\t}",
"abstract public function insertRecord($tableName, $record);",
"public function queryInsert($table, $data) : bool;",
"public function create()\n {\n if (isset($_POST['add'])) {\n \n // pass bird info in the db\n $comName = $_POST['comName'];\n $sciName = $_POST['sciName'];\n $idbird = $_POST['idbird'];\n $birdRange = $_POST['birdRange'];\n $idlocation = $_POST['idlocation'];\n $locationName = $_POST['locationName'];\n $locationLat = $_POST['locationLat'];\n $locationLat = $_POST['locationLon'];\n\n // insert into two different tables, with 1 common value\n $sql = \"INSERT INTO birds (idbird, comName, sciName, birdRange, idlocation)\n VALUES (\\\"$idbird\\\", \\\"$comName\\\", \\\"$sciName\\\",\\\"$birdRange\\\", \\\"$idlocation\\\")\";\n var_dump($sql);\n\n $result = $this->databaseManager->connection->query($sql);\n // var_dump($result);\n // return $result;\n\n // insert into two different tables, with 1 common value\n $sql1 = \"INSERT INTO locations (idlocation, locationName, locationLat, locationLon)\n VALUES (\\\"$idlocation\\\", \\\"$locationName\\\", \\\"$locationLat\\\",\\\"$locationLon\\\")\";\n var_dump($sql1);\n\n $result = $this->databaseManager->connection->query($sql1);\n echo 'OK';\n \n }\n\n}",
"public abstract function insert();",
"public function bulkInsert()\n {\n DB::table($this->dbTable)\n ->insert($this->insertUpdateArray);\n }",
"function post_visibilite_insert_all($var1,$var2){\r\n \t return DB::GetInstance()->Set(\"INSERT INTO post_visibilite VALUES ($var1,$var2)\");\r\n }",
"public function maininsert($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid, $userid){\n $msg = \"Select _nID_ FROM _name_ WHERE _name_ = ?\"; # check if name exists\n $stmnt1 = $con->prepare($msg);\n $stmnt1->bind_param(\"s\",$name);\n $stmnt1->execute();\n $stmnt1->bind_result($nid);\n if($stmnt1->fetch()){ # proceed if name exists\n $stmnt1->close();\n $msg = \"Select _tID_ FROM _title_ WHERE _title_name_ = ?\"; # chech if title exists\n $stmnt2 = $con->prepare($msg);\n $stmnt2 -> bind_param(\"s\", $title);\n $stmnt2 -> execute();\n $stmnt2 -> bind_result($sid);\n if($stmnt2->fetch()){ # proceed if title exists\n $stmnt2->close();\n $this -> insertinto($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid, $userid);\n }else{ # proceed if title not exists\n $stmnt2->close();\n $this -> ifnottitle($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid, $userid);\n }\n }else{ # proceed if name not exists\n $stmnt1->close();\n $this -> ifnotname($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid, $userid);\n }\n }",
"function company_insert($table, $data) {\n\n global $devel, $tablas, $I;\n\n if (!$data) {\n print_r(get_defined_vars());\n throw new Exception(\"ERROR: No existen parámetros para INSERT en $table\");\n }\n\n $VALUES = values($data);\n $FIELDS = fields($data);\n\n $query = \"INSERT INTO `$table` ($FIELDS) VALUES ($VALUES)\";\n sql($query, $table, 'INSERT');\n $I++;\n}",
"protected function populateTable() {\n\t\t$query = \"\n\t\tINSERT INTO `items` VALUES (1, 'Candy', 'Crush', '1924 Sucka Drive', 'Stripper');\n\t\tINSERT INTO `items` VALUES (2, 'John', 'Smith', '9999 The Way', 'Unemployeed');\n\t\t\";\n\t\t$this->PDO->query($query);\n\t}",
"function inserter($cols, $args, $tname, $password){\n\t// inserts arguments into a new record of tname (tablename) at cols (columns)\n\t// Function by Laurens\n\t$username = \"steenplaat\";\n\t$dbnaam = \"steenplaat\";\n\t$servername = \"localhost\";\n\ttry {\n\t\t$conn = new PDO(\"mysql:host=$servername;dbname=$dbname\", $username, $password);\n\t\t// set the PDO error mode to exception\n\t\t$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t}\n\tcatch(PDOException $e){\n\t\techo \"Connection failed: \" . $e->getMessage();\n\t}\n\t$colstr = $cols[0];\n\tfor($i=1; $i<count($cols); $i++){\n\t\t$colstr = $colstr.\", \".$cols[$i];\n\t}\n\t$argstr = $args[0];\n\tfor($i=1; $i<count($args); $i++){\n\t\t$argstr = $argstr.\", \".$args[$i];\n\t}\n\t$sql = 'INSERT INTO '.$tname.'('.$colstr.') VALUES ('.$argstr.')';\n\t$result = $conn->query($sql);\n\t$result = $result->fetchAll();\n}",
"public function insert_into_table(){\n // VALUES ('$this->item_id', '$this->user_id', '$this->project_id', '$this->user2_id', '$this->post_id', '$this->type', '$this->activity', '$this->date_time')\";\n $query = \"INSERT INTO $this->table_name (item_id, user_id, project_id, user2_id, post_id, post_type, date_time) \n VALUES ('$this->item_id', '$this->user_id', '$this->project_id', '$this->user2_id', '$this->post_id', '$this->type', '$this->date_time')\";\n $result = mysql_query($query);\n\n $err = mysql_error();\n if($err){\n $file = 'errors.txt';\n file_put_contents($file, $err, FILE_APPEND | LOCK_EX);\n }\n }",
"public abstract function getInsertSQL($into, $data, $values);",
"public function MultiInsert($table, $data){\n $this->openConnection();\n $queries = $this->prepareForTransaction($table, $data);\n $this->db->beginTransaction();\n\n try{\n foreach ($queries as $item){\n // Attemnt to insert data record\n $q= $this->db->prepare($item);\n $q->execute();\n }\n\n $this->db->commit();\n }catch(Exception $e){\n print_r($e->getMessage());\n //Rollback the transaction.\n $this->db->rollBack(); exit;\n }\n return true;\n }",
"public function createTables()\r\n {\r\n $sql = \"\r\n CREATE TABLE IF NOT EXISTS coins\r\n (\r\n id INT NOT NULL AUTO_INCREMENT,\r\n playername VARCHAR(32) NOT NULL,\r\n coins INT NOT NULL,\r\n ip VARCHAR(32) NOT NULL,\r\n cid VARCHAR(64) NOT NULL,\r\n PRIMARY KEY (id)\r\n );\r\n \";\r\n self::update($sql);\r\n }",
"public function into(string $table);",
"function insert_into_database($journey_times, $dow, $hod) {\n $save_sql = \"INSERT INTO link_times_development (start_stopid,end_stopid,\"\n \t .\"hour,day,link_time) \"\n\t .\"VALUES (:start_stopid, :end_stopid, :hour, :day, :link_time)\";\n\n $save_time = $this->DBH->prepare($save_sql);\n\n foreach($journey_times as $entry) {\n $save_time->bindValue(':start_stopid', $entry['start'],PDO::PARAM_STR);\n $save_time->bindValue(':end_stopid', $entry['end'],PDO::PARAM_STR);\n $save_time->bindValue(':hour', $hod,PDO::PARAM_INT);\n $save_time->bindValue(':day', $dow,PDO::PARAM_INT);\n $save_time->bindValue(':link_time', $entry['average_time']);\n $save_time->execute();\n }\n }",
"function insert ($table_into, array $fields = array())\n\t{\t\n\t\tif (empty($table_into))\n\t\t\tthrow new Exception(\"Table not specified in call to 'insert'.\");\n\t\t\n\t\t// $fields might be an empty array,\n\t\t// but the insert will still be attempted.\n\t\t\n\t\t$columns_list = array();\n\t\t$values_list = array();\n\t\tforeach ($fields as $column => $value) {\n\t\t\t$columns_list[] = \"$column\";\n\t\t\tif ($value instanceof Db_Expression)\n\t\t\t\t$values_list[] = \"$value\"; else\n\t\t\t\t$values_list[] = \":$column\";\n\t\t}\n\t\t$columns_string = implode(', ', $columns_list);\n\t\t$values_string = implode(', ', $values_list);\n\t\t\n\t\t$clauses = array(\n\t\t\t'INTO' => \"$table_into ($columns_string)\", 'VALUES' => $values_string\n\t\t);\n\t\t\n\t\treturn new Db_Query_Mysql($this, Db_Query::TYPE_INSERT, $clauses, $fields);\n\t}",
"public function maininsert($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid){\n $msg = \"Select _nID_ FROM _name_ WHERE _name_ = ?\"; # check if name exists\n $stmnt1 = $con->prepare($msg);\n $stmnt1->bind_param(\"s\",$name);\n $stmnt1->execute();\n $stmnt1->bind_result($nid);\n if($stmnt1->fetch()){ # proceed if exists\n $stmnt1->close();\n $msg = \"Select _tID_ FROM _title_ WHERE _title_name_ = ?\"; # check if title exists\n $stmnt2 = $con->prepare($msg);\n $stmnt2 -> bind_param(\"s\", $title);\n $stmnt2 -> execute();\n $stmnt2 -> bind_result($sid);\n if($stmnt2->fetch()){ # proceed if title exists\n $stmnt2->close();\n $this -> insertinto($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid);\n }else{ # set new title\n $stmnt2->close();\n $this -> ifnottitle($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid);\n }\n }else{\n $stmnt1->close();\n $this -> ifnotname($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid);\n }\n }",
"function insertarPuertos($puerto,$bandera,$refdestinos) {\r\n$sql = \"insert into tbpuertos(idpuerto,puerto,bandera,refdestinos)\r\nvalues ('','\".($puerto).\"','\".($bandera).\"',\".$refdestinos.\")\";\r\n$res = $this->query($sql,1);\r\nreturn $res;\r\n}",
"public function fillTablesInDatabase($user_id){\n\t\t\n\t\t$db = static::getDB();\n\t\t\n\t\t$insert_Query2 = $db->exec(\"INSERT INTO expenses_category_assigned_to_users VALUES (null, '$user_id','Jedzenie'),(null, '$user_id', 'Mieszkanie'),(null, '$user_id','Transport'),(null, '$user_id','Telekomunikacja'),(null, '$user_id','Opieka zdrowotna'),(null, '$user_id','Ubranie'),(null, '$user_id','Higiena'),(null, '$user_id','Dzieci'),(null, '$user_id','Rozrywka'),(null, '$user_id','Wycieczka'),(null, '$user_id','Szkolenia'),(null, '$user_id','Książki'),(null, '$user_id','Oszczędności'),(null, '$user_id','Darowizna'),(null, '$user_id','Spłata długów'),(null, '$user_id','Na złotą jesien, czyli emeryturę'),(null, '$user_id','Inne wydatki')\");\n\t\t\t\t\t\n\t\t$insert_Query3 = $db->exec(\"INSERT INTO incomes_category_assigned_to_users VALUES (null, '$user_id','Wynagrodzenie'),(null, '$user_id','Odsetki bankowe'),(null, '$user_id','Sprzedaż na Allegro'),(null, '$user_id','Inne źródło')\");\n\t\t\t\t\t\n\t\t$insert_Query4 = $db->exec(\"INSERT INTO payment_methods_assigned_to_users VALUES (null, '$user_id','Gotówka'),(null, '$user_id','Karta Debetowa'),(null, '$user_id','Karta Kredytowa');\");\n\t}",
"protected function insert()\n\t{\n\t\t$query = $this->connection->prepare\n\t\t(\"\n\t\t\tinsert into\n\t\t\t\tBooth (BoothNum)\n\t\t\t\tvalues (?)\n\t\t\");\n\n\t\t$query->execute(array_values($this->fields));\n\n\t}",
"public function create_or_upgrade_tables() {\n\t\tif ( is_multisite() ) {\n\t\t\t$this->create_table( $this->ms_table );\n\t\t}\n\n\t\t$this->create_table( $this->table );\n\t}",
"function insertarExportacioncontenedores($refexportaciones,$contenedor,$tara,$precinto) {\r\n$sql = \"insert into dbexportacioncontenedores(idexportacioncontenedor,refexportaciones,contenedor,tara,precinto)\r\nvalues ('',\".$refexportaciones.\",'\".($contenedor).\"',\".$tara.\",'\".($precinto).\"')\";\r\n$res = $this->query($sql,1);\r\nreturn $res;\r\n}",
"public function insert(array $columns);",
"public function insert(array $columns);",
"public abstract function Insert();",
"function insert($table,$data){\n\t\t$j=0;\n\t\t$c=count($data);\n\t\tforeach($data as $key=>$value){\n\t\t\t$j++;\n\t\t\tif($c==$j){\n\t\t\t\t$line_1.='`'.$key.'`';\n\t\t\t\t$line_2.=\"'\".rce_remove_quotes(mysql_real_escape_string($value)).\"'\";\n\t\t\t} else {\n\t\t\t\t$line_1.='`'.$key.'`, ';\n\t\t\t\t$line_2.=\"'\".rce_remove_quotes(mysql_real_escape_string($value)).\"', \";\n\t\t\t}\n\t\t}\n\t\t$r=mysql_query(\"\n\t\t\tINSERT INTO `$table`\n\t\t\t(\".$line_1.\") VALUES\n\t\t\t(\".$line_2.\")\n\t\t\");\n\t\treturn $r;\n\t}",
"function inserir() {\n\t\t$this->sql = mysql_query(\"INSERT INTO suporte (user_cad, data_cad, id_regiao, exibicao, tipo, prioridade, assunto, mensagem, arquivo, status, status_reg,suporte_pagina)\n\t\t\t\t\t VALUES\t('$this->id_user_cad ','$this->data_cad','$this->id_regiao', '$this->exibicao', '$this->tipo','$this->prioridade', '$this->assunto', '$this->menssagem', '$this->tipo_arquivo','1','1','$this->pagina');\") or die(mysql_error());\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\n\t\t}",
"private function insert()\n {\n $this->query = $this->pdo->prepare(\n 'INSERT INTO ' . $this->table . ' (' .\n implode(', ', array_keys($this->data)) .\n ' ) VALUES (:' .\n implode(', :', array_keys($this->data)) .\n ')'\n );\n }",
"public function testInserting() {\n $this->getConnection()->getConnection()->exec(\"INSERT INTO `owners` (`name`, `email`) VALUES ('Donald Trump', '[email protected]');\");\n }",
"function test_insert_bulk($urabe, $body)\n{\n $bulk = $body->insert_bulk;\n if ($body->driver == \"PG\")\n $table_name = $body->schema . \".\" . $body->table_name;\n else\n $table_name = $body->table_name;\n return $urabe->insert_bulk($table_name, $bulk->columns, $bulk->values);\n}",
"public function addToInsertSQLArray();",
"public function insert(...$field_values);",
"function insert ($tablename, $newRow) \n\t{\n\t\t$lockfp = $this->getLock($tablename);\t\t\t\n\t\t$this->tables[$tablename][] = $newRow;\n\t\t$this->writeTable($tablename);\n\t\t$this->releaseLock($lockfp);\n\t}",
"public function insert() {\n \n $sql = \"INSERT INTO $this->table(\"\n . \"tb_user_id,\"\n . \"tb_user_directors_id,\"\n . \"tb_boleto_venc_boleto,\"\n . \"tb_boleto_hash_boleto,\"\n . \"tb_boleto_hash_nfe,\"\n . \"tb_boleto_hash_sla,\"\n . \"tb_boleto_status_boleto,\"\n . \"tb_boleto_date,\"\n . \"tb_boleto_hour)\"\n . \"VALUES (?,?,?,?,?,?,?,?,?)\";\n \n $stmt = DB::prepare($sql);\n \n $stmt->bindParam(1, $this->tb_user_id);\n $stmt->bindParam(2, $this->tb_user_directors_id);\n $stmt->bindParam(3, $this->tb_boleto_venc_boleto);\n $stmt->bindParam(4, $this->tb_boleto_hash_boleto);\n $stmt->bindParam(5, $this->tb_boleto_hash_nfe);\n $stmt->bindParam(6, $this->tb_boleto_hash_sla);\n $stmt->bindParam(7, $this->tb_boleto_status_boleto);\n $stmt->bindParam(8, $this->tb_boleto_date);\n $stmt->bindParam(9, $this->tb_boleto_hour);\n \n $stmt->execute();\n }",
"function insertToIS4C() {\n\n\tglobal $dbConn2;\n\n\tglobal $insertCustdata;\n\tglobal $insertMeminfo;\n\tglobal $insertMemContact;\n\tglobal $insertMemDates;\n\tglobal $insertMemberCards;\n\tglobal $insertStockpurchases;\n\n\tglobal $debug;\n\n//echo \"In insertToIS4C\\n\";\n\n\t$statements = array($insertMeminfo,\n\t\t$insertMemContact,\n\t\t$insertMemDates,\n\t\t$insertMemberCards);\n\t$statement = \"\";\n\n\tif ( count($insertCustdata) > 0 ) {\n\t\tforeach ($insertCustdata as $statement) {\n\t\t\tif ( $debug == 1) \n\t\t\t\techo $statement, \"\\n\";\n//continue;\n\t\t\t$rslt = $dbConn2->query(\"$statement\");\n\t\t\tif ( 1 && $dbConn2->errno ) {\n\t\t\t\treturn(sprintf(\"Error: Insert failed: %s\\n\", $dbConn2->error));\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\t//echo \"No custdata to insert.\\n\";\n\t\t1;\n\t}\n\n\tforeach ($statements as $statement) {\n\t\tif ( $statement != \"\" ) {\n\t\t\tif ( $debug == 1) \n\t\t\t\techo $statement, \"\\n\";\n//continue;\n\t\t\t$rslt = $dbConn2->query(\"$statement\");\n\t\t\tif ( 1 && $dbConn2->errno ) {\n\t\t\t\treturn(sprintf(\"Error: Insert failed: %s\\n\", $dbConn2->error));\n\t\t\t}\n\t\t}\n\t}\n\n\t// stockpurchases is in a different db.\n\n\treturn(\"OK\");\n\n// insertToIS4C\n}",
"public function inserir()\n {\n }",
"function migrateTable( $table ) {\n\n $query = \"SELECT * FROM \" . $table;\n\n $this->_externalDB->setQuery( $query );\n $object = $this->_externalDB->loadObjectList();\n\n\t\t$db =& JFactory::getDBO();\n $count = count($object);\n\n for ($i=0; $i<$count; $i++) {\n $db->insertObject($table, $object[$i]);\n\t\t\t//echo $db->errorMsg();\n }\n\n\t\t$ret = $db->getErrorNum();\n\n return $ret;\n }",
"private function create_tables()\n {\n global $wpdb;\n\n /* http://wiip.fr/content/choisir-le-type-de-colonne-de-ses-tables-mysql */\n $sql = '\n CREATE TABLE IF NOT EXISTS '.$this->tables['users'].'(\n id int(11) NOT NULL auto_increment,\n PRIMARY KEY (id),\n nom VARCHAR(255) NOT NULL,\n prenom VARCHAR(255) NOT NULL,\n email VARCHAR(320) NOT NULL,\n password VARCHAR(500) NOT NULL,\n adresse CHAR(255),\n codepostal CHAR(10),\n ville CHAR(60),\n pays CHAR(60),\n telephone_professionnel CHAR(20),\n dateinscription CHAR(20) NOT NULL,\n statut VARCHAR(15),\n evenement VARCHAR(255),\n date_evenement DATE,\n specialite VARCHAR(100),\n categorie VARCHAR(20),\n isUpdate VARCHAR(10),\n organisme_facturation CHAR(100),\n email_facturation CHAR(255),\n adresse_facturation CHAR(255),\n ville_facturation CHAR(60),\n codepostal_facturation CHAR(10),\n pays_facturation CHAR(50),\n contacts TEXT\n \n\n )';\n\n dbDelta($sql);\n\n $sql = '\n CREATE TABLE IF NOT EXISTS '.$this->tables['users_file'].'(\n id int(11) NOT NULL auto_increment,\n PRIMARY KEY (id),\n email VARCHAR(320) NOT NULL,\n fichier VARCHAR(500) NOT NULL,\n chemin VARCHAR(500) NOT NULL,\n date_enregistrement VARCHAR(500) NOT NULL,\n type_doc VARCHAR(100) NOT NULL\n \n )';\n\n dbDelta($sql);\n }",
"protected function _insert()\n\t{\n\t\t// INSERT INTO 'table'\n\t\t$this->_query = 'INSERT INTO '.$this->_table.' (';\n\n\t\t// * / row1, row2\n\t\t$first = true;\n\t\t$vals = '';\n\t\tforeach($this->_set as $key => $value) {\n\t\t\t$this->_query .= ($first) ? ('') : (', '); \n\t\t\t$vals .= ($first) ? ('') : (', '); \n\t\t\t$first = false;\n\n\t\t\t$this->_query .= $key;\n\t\t\t$vals .= \"'$value'\";\n\t\t} // foreach\n\n\t\t$this->_query .= \") VALUES ($vals);\";\n\n\t\treturn $this->_query;\n\t}",
"function sqlqueryinsert($tableName, $columns, $values, $redirect)\n\t\t{\n\t\t\t$sqlinsert = \"insert into $tableName($columns) values($values)\";\n\t\t\t$sqlinsertquery = mysql_query($sqlinsert);\n\t\t\theader(\"location:\".$redirect);\n\t\t\texit;\n\t\t}",
"function insertTable($table, $values){\n\t\n\t$insert = \"INSERT INTO \".$table.\" VALUES (\".$values.\")\";\n\t$insert_query = mysql_query($insert);\n\tif($insert_query){\n\t\t$insert_id = mysql_insert_id();\n\t\treturn $insert_id;\n\t}else{\n\t\treturn false;\n\t}\n}",
"public static function insertData($tablesInfo, $jtable)\n {\n foreach ($tablesInfo as $tableInfo) {\n $field = $tableInfo['associationName'];\n if (isset($jtable->$field)) {\n $data = $jtable->$field;\n $values = [];\n for ($k = 0; $k < count($data); $k++) {\n\n $values[] = $jtable->id . ', ' . $data[$k];\n\n }\n\n if (count($values) > 0) {\n $db = JFactory::getDbo();\n $query = $db->getQuery(true)\n ->insert($db->qn('#__' . $tableInfo['componentNameForAssociation'] . '_association_' . $tableInfo['associationName']))\n ->columns($db->qn(['book', 'id']))\n ->values($values);\n $db->setQuery($query);\n $db->execute();\n }\n\n }\n }\n }",
"function insert() {\n\t\t$sql = \"INSERT INTO \".$this->hr_db.\".hr_amphur (amph_name, amph_name_en, amph_pv_id, amph_active)\n\t\t\t\tVALUES(?, ?, ?, ?)\";\n\t\t$this->hr->query($sql, array( $this->amph_name, $this->amph_name_en, $this->amph_pv_id, $this->amph_active));\n\t\t$this->last_insert_id = $this->hr->insert_id();\n\t}",
"public function fillOutDb()\n {\n /* Fill out the Contacts table. BatchInsert is a good idea for that */\n $this->batchInsert('Contacts', ['name', 'surname', 'description'], self::InitialContacts);\n\n /* Prepare array for batchInsert request at first */\n $list = [];\n foreach(self::InitialPhoneNumbers as $name => $numbers){\n $query = new \\yii\\db\\Query();\n $contact_id = $query->select('id')->from('Contacts')->where(['name' => $name])->one();\n foreach($numbers as $number){\n $list[] = ['number' => $number, 'contact_id' => $contact_id['id']];\n }\n }\n\n /* Fill out the Numbers table */\n $this->batchInsert('Numbers', ['number', 'contact_id'], $list);\n }",
"public function Into(string $Table, array $Fields = []): IInsert;",
"public function insert($tableName, $data) {\n ksort($data);\n\n $fieldNames = implode('`, `', array_keys($data));\n $fieldValues = ':'.implode(', :', array_keys($data));\n\n $sth = $this->prepare(\"INSERT INTO $tableName (`$fieldNames`) VALUES ($fieldValues)\");\n\n foreach($data as $key => $value) {\n $sth->bindValue(\":$key\", $value);\n }\n\n $sth->execute();\n }",
"protected function migrateTables()\n {\n foreach ($this->tables as $table) {\n \\DB::getPdo()->exec(\"INSERT IGNORE INTO {$this->newDbName}.{$table} SELECT * FROM {$this->oldDbName}.{$table}\");\n }\n }",
"abstract protected function doInsert($subject, Statement $insertStatement);",
"abstract public function insert(string $table, array $row, array $options = []);",
"public function insert($perifericos);",
"public function insertSpecific($cols, $table) \n {\n $values = array();\n $prepReq = \"INSERT INTO \".$table.\"(\";\n foreach ($cols as $col) \n { \n $prepReq = $prepReq.\" \".$col[0].\",\"; \n }\n $prepReq = substr_replace($prepReq ,\"\",-1) . \")\"; //remove last coma and add contents\n\n $prepReq = $prepReq . \" VALUES(\";\n foreach ($cols as $col) \n { \n $prepReq = $prepReq.\" ?,\"; \n array_push($values, $col[1]);\n }\n $prepReq = substr_replace($prepReq ,\"\",-1) . \")\"; //remove last coma and add contents\n\n $req = $this->db->prepare($prepReq);\n $res = $req->execute($values);\n return $res;\n\n }",
"public function join($tables, $overwrite = false);",
"public function testInsertStmt()\n {\n $insert = $this->getConnection()\n ->insert()\n ('dummy_posts')\n (['blog_id', 'blog_title'])\n ([':id', ':title']);\n return $this->assertEquals($insert, \"INSERT INTO dummy_posts(blog_id, blog_title) VALUES (:id, :title)\");\n }",
"public function insertar($idordencompra, $nrofactura, $idproveedor, $idpersonal, $idsucursal, $idformapago, $idtipodoc, $iddeposito, \n $fecha_hora, $obs, $monto_compra, $idmercaderia, $cantidad, $precio, $total_exenta, $total_iva5, $total_iva10, $liq_iva5, $liq_iva10, $cuota){\n\n $sql = \"INSERT INTO compras (idordencompra, nrofactura, idproveedor, idpersonal, idsucursal, idformapago, idtipodocumento, iddeposito, fecha, obs, monto, cuotas, estado) \n VALUES ('$idordencompra', '$nrofactura', '$idproveedor', '$idpersonal', '$idsucursal', '$idformapago', '$idtipodoc', '$iddeposito', '$fecha_hora', '$obs', '$monto_compra', '$cuota', '1')\";\n \n $idcompranew = ejecutarConsulta_retornarID($sql);\n\n $num_elementos=0;\n $sw=true;\n\n while($num_elementos < count($idmercaderia)){\n\n $sql_detalle = \"INSERT INTO compras_detalle (idcompra, idmercaderia, cantidad, precio) \n VALUES ('$idcompranew', '$idmercaderia[$num_elementos]', '$cantidad[$num_elementos]', '$precio[$num_elementos]')\";\n ejecutarConsulta($sql_detalle) or $sw = false;\n\n $num_elementos =$num_elementos + 1;\n }\n\n //aca realimazamos la insercion en la tabla libro compras\n\n $sql2 = \"INSERT INTO libro_compras (idcompra, idproveedor, fecha, montoexenta, montoiva5, montoiva10, grabiva5, grabiva10, montopagado) \n VALUES ('$idcompranew', '$idproveedor', '$fecha_hora', '$total_exenta', '$total_iva5', '$total_iva10', '$liq_iva5', '$liq_iva10', '$monto_compra')\";\n\n ejecutarConsulta($sql2);\n\n //aca realizamos la insercion en la tabla cuentas a pagar \n\n if($idformapago == 1){\n $formaPago = 'CONTADO';\n }else{\n $formaPago = 'CREDITO';\n }\n\n $monto_cuota = $monto_compra / $cuota;\n\n $fecha = strtotime($fecha_hora);\n $fecha = date('Y-m-d H:i:s', $fecha);\n $cont = 0;\n\n for ($i=1; $i <= $cuota ; $i++) { \n\n if($i >= 2){\n $cont = $cont + 1;\n $fecha = date(\"Y-m-d H:i:s\", strtotime($fecha_hora. \"+ {$cont} month\"));\n }\n\n if($cuota == 1){\n $concepto = \"Cuota Nro. \". $i .\"/\". $cuota .\" \". $formaPago;\n }else{\n $concepto = \"Cuota Nro. \". $i .\"/\". $cuota .\" \". $formaPago .\" \". $cuota .\" MESES\";\n }\n\n $sql3 = \"INSERT INTO cuentas_a_pagar (idcompra, idproveedor, nrofactura, idnotacredidebi, totalcuota, nrocuota, montocuota, fechavto, obs, estado) \n VALUES ('$idcompranew', '$idproveedor', '$nrofactura', '0', '$cuota', '$i', '$monto_cuota', '$fecha','$concepto', '1')\";\n\n ejecutarConsulta($sql3);\n\n }\n\n $sql4 = \"UPDATE orden_compras SET estado = '2' WHERE idordencompra = '$idordencompra'\";\n ejecutarConsulta($sql4);\n\n return $sw;\n\n }",
"public function insertIntoFeeReceiptMaster($values){\n \t$query = \"INSERT INTO `fee_receipt_master` \n (feeReceiptId,bankId,instituteBankAccountNo,studentId,currentClassId,feeClassId,feeCycleId,concession,\n \t\t\t\t\t\t\thostelFees,hostelId,hostelRoomId,transportFees,busRouteId,busStopId,\n \t\t\t\t\t\t\tstatus,userId,instituteId,hostelFeeStatus,transportFeeStatus,dated,hostelSecurity,receiptGeneratedDate)\n \t\t\t\tVALUES $values\";\n \t\n \treturn SystemDatabaseManager::getInstance()->executeUpdateInTransaction($query);\n }",
"function db_multi_insert($table, $columns=array(),$values){\n if($table==\"\" || $values==\"\")return false;\n $columnstr=\"\";\n if(count($columns)>0){\n //add comma after each value in tghe column array\n $columnstr=implode(\",\", $columns);\n $columnstr=\"(\".$columnstr.\")\";\n }\n $sql = \"INSERT INTO \".$table.\" \".$columnstr.\" VALUES \";\n $valuesArr = array();\n foreach($values as $k=>$vald){\n $valuestr = '';\n foreach($vald as $key=>$val){\n if($valuestr !=\"\"){\n $valuestr.=\", '\".$this->con->real_escape_string($val).\"'\";\n }else{\n $valuestr=\"'\".$this->con->real_escape_string($val).\"'\";\n }\n }\n $valuesArr[] = '('.$valuestr.')';\n }\n $valuesData = implode(',',$valuesArr);\n $sql .= $valuesData;\n\n // print $sql;\n\n // In this line we will get the first inserted id of the last updated table\n if($this->con->query($sql)){\n return $this->con->insert_id;\n }else{\n return false;\n }\n }",
"public function testMultipleInserts()\n {\n $statement = $this->getQueryBuilderConnection()\n ->insert()\n ->into('querybuilder_tests')\n ->values(\n [\n [\n 'id' => 10,\n 'languageId' => 1,\n 'field' => 'mult1',\n ],\n [\n 'id' => 11,\n 'languageId' => 1,\n 'field' => 'mult2',\n ],\n ]\n )\n ->execute();\n\n $this->assertInstanceOf(\\PDOStatement::class, $statement);\n $this->assertEquals(2, $statement->rowCount());\n\n $result = $this->getQueryBuilderConnection()\n ->select('count(1) as counter')\n ->from('querybuilder_tests')\n ->getOneField('counter');\n\n $this->assertEquals(12, $result);\n }"
] | [
"0.62865627",
"0.6264757",
"0.6251418",
"0.6082616",
"0.6032613",
"0.6028603",
"0.6028603",
"0.6028603",
"0.6021217",
"0.60015815",
"0.59932166",
"0.5974147",
"0.59570485",
"0.59310013",
"0.5905858",
"0.5857635",
"0.58183163",
"0.58095086",
"0.5785111",
"0.57785124",
"0.5775509",
"0.57555884",
"0.5698174",
"0.56710577",
"0.56658417",
"0.5662416",
"0.5650112",
"0.5648243",
"0.5646405",
"0.56436",
"0.56431925",
"0.5638076",
"0.56221366",
"0.5619893",
"0.5591141",
"0.5589887",
"0.5582366",
"0.55727327",
"0.55614984",
"0.55590177",
"0.55484164",
"0.5544717",
"0.55442667",
"0.55350393",
"0.55349505",
"0.5528611",
"0.5520442",
"0.55115896",
"0.550759",
"0.5504001",
"0.55004317",
"0.55002624",
"0.5492186",
"0.5486404",
"0.54790944",
"0.54713553",
"0.5471263",
"0.5458228",
"0.54451966",
"0.5434401",
"0.5433398",
"0.542712",
"0.5426788",
"0.54189897",
"0.5409026",
"0.5405445",
"0.5405445",
"0.53999037",
"0.5396974",
"0.5391901",
"0.53913754",
"0.5388902",
"0.5385006",
"0.53808784",
"0.5380263",
"0.5378774",
"0.5372871",
"0.53708947",
"0.5366421",
"0.5360308",
"0.5357271",
"0.5352138",
"0.5345946",
"0.5343233",
"0.53347737",
"0.5334544",
"0.5333828",
"0.53293097",
"0.53100383",
"0.530765",
"0.5304402",
"0.5291751",
"0.5290568",
"0.5279268",
"0.5278699",
"0.5278116",
"0.52774614",
"0.5276325",
"0.52749187",
"0.52713233"
] | 0.7591835 | 0 |
Create a new command instance. | public function __construct()
{
parent::__construct();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }",
"public function createCommand()\r\n\t{\r\n\t\t$obj = new DbCommand($this,$this->dbms);\r\n\t\treturn $obj;\r\n\t}",
"public function createCommand() {\n\t\treturn new UnboxedCommand( $this );\n\t}",
"protected function createCommand($args) {\n $command = new Command();\n $command->id = ifseta($args, 'id');\n $command->name = ifseta($args, 'name');\n $command->url = ifseta($args, 'url');\n $command->description = ifseta($args, 'description');\n $command->uses = ifseta($args, 'uses');\n $command->creationDate = ifseta($args, 'creation_date');\n $command->lastUseDate = ifseta($args, 'last_use_date');\n $command->goldenEggDate = ifseta($args, 'golden_egg_date');\n return $command;\n }",
"static public function create($cmd = null, $args = null)\n {\n return new self($cmd, $args);\n }",
"public function createCommand($kernel, string $commandName = null, string $commandDescription = null): Command;",
"public function makeCommand() \n {\n if($this->CrontabCommandObject === NULL)\n {\n $this->CrontabCommandObject = new \\root\\library\\Crontab\\CrontabCommand\\CrontabCommand();\n }\n \n return $this->CrontabCommandObject;\n }",
"public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }",
"public function command(Command $command);",
"public function __construct($command)\n {\n $this->command = $command;\n }",
"public static function create(array $data)\n {\n $command = new static();\n $command->exchangeArray($data);\n return $command;\n }",
"protected function getCreateCommand()\n {\n $command = new IndexCreateCommand();\n $command->setContainer($this->getContainer());\n\n return $command;\n }",
"public function createCommand($string = '')\n {\n return $this->createStringable($string);\n }",
"public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }",
"public function __construct()\n {\n // We will go ahead and set the name, description, and parameters on console\n // commands just to make things a little easier on the developer. This is\n // so they don't have to all be manually specified in the constructors.\n if (isset($this->signature)) {\n $this->configureUsingFluentDefinition();\n } else {\n parent::__construct($this->name);\n }\n\n // Once we have constructed the command, we'll set the description and other\n // related properties of the command. If a signature wasn't used to build\n // the command we'll set the arguments and the options on this command.\n $this->setDescription((string) $this->description);\n\n $this->setHelp((string) $this->help);\n\n $this->setHidden($this->isHidden());\n\n if (! isset($this->signature)) {\n $this->specifyParameters();\n }\n }",
"public function make(string $name, PreprocessorInterface $preprocessor = null): CommandInterface;",
"private function _getCommandByClassName($className)\n {\n return new $className;\n }",
"public function newCommand($regex, $callable) {\n $cmd = new Command();\n $cmd->regex = $regex;\n $cmd->callable = $callable;\n return $this->addCommand($cmd);\n }",
"public static function create($commandID, ...$args)\n {\n $arguments = func_get_args();\n\n return new static(array_shift($arguments), $arguments);\n }",
"private function __construct($command = null)\n {\n $this->command = $command;\n }",
"public static function factory(string $command, string $before = '', string $after = ''): self\n {\n return new self($command, $before, $after);\n }",
"public function getCommand() {}",
"protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\ESCAPE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('tag', null, null, false))\n ->addArgument(new Argument($this->tag, null, null, true));\n\n return $command;\n }",
"public function testCanBeInstantiated()\n {\n $command = $this->createInstance();\n $this->assertInstanceOf('\\\\Dhii\\\\ShellInterop\\\\CommandInterface', $command, 'Command must be an interoperable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\ConfigurableCommandInterface', $command, 'Command must be a configurable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\MutableCommandInterface', $command, 'Command must be a mutable command');\n }",
"public function getCommand();",
"protected function createCommand($name, array $parameters = [])\n {\n return new Fluent(\n array_merge(\n compact('name'),\n $parameters)\n );\n }",
"public function testCanPassCommandStringToConstructor()\n {\n $command = new Command('/bin/ls -l');\n\n $this->assertEquals('/bin/ls -l', $command->getExecCommand());\n }",
"public function makeCommandInstanceByType(...$args): CommandInterface\n {\n $commandType = array_shift($args);\n\n switch ($commandType) {\n case self::PROGRAM_READ_MODEL_FETCH_ONE_COMMAND:\n return $this->makeFetchOneCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_COMMAND:\n return $this->makeFindCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_LITE_COMMAND:\n return $this->makeFindLiteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_TASK_COMMAND:\n return $this->makeItemCreateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_COMMAND:\n return $this->makeItemCreateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_TASK_COMMAND:\n return $this->makeItemUpdateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_COMMAND:\n return $this->makeItemUpdateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_TASK_COMMAND:\n return $this->makeItemDeleteTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_COMMAND:\n return $this->makeItemDeleteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_ADD_ID_COMMAND:\n return $this->makeItemAddIdCommand(...$args);\n\n default:\n throw new FactoryException(sprintf('Command bus for type `%s` not found!', (string) $commandType));\n }\n }",
"public function __construct($cmd)\n {\n $this->cmd = $cmd;\n }",
"public function getCommand()\n {\n }",
"public function command($class)\n {\n $runnable = $this->resolveClass($class);\n\n if ( ! $runnable instanceof Command) {\n throw new InvalidArgumentException(get_class($runnable).' must be an instance of '.Command::class.'.');\n }\n\n $command = $runnable;\n\n if ($runnable instanceof Taggable) {\n $command = new Cached($command, $this);\n }\n\n if ($runnable instanceof Transactional) {\n $command = new Transaction($command, $this, $this->makeFromContainer(ConnectionInterface::class));\n }\n\n if ($runnable instanceof Eventable) {\n $command = new Evented($command, $this);\n }\n\n return $this->newBuilder($command);\n }",
"protected function createCommandFactory(): CommandFactory\n {\n return new CommandFactory([\n 'CLOSE' => Command\\CLOSE::class,\n ]);\n }",
"public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}",
"public function addCommand($command);",
"public function add(Command $command);",
"abstract protected function getCommand();",
"public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}",
"protected function createCommand(string $name, array $parameters = []): Fluent\n {\n return new Fluent(array_merge(compact('name'), $parameters));\n }",
"public function __construct()\n {\n parent::__construct(static::NAME, static::VERSION);\n $this->add(new DefaultCommand());\n }",
"public function __construct()\n {\n parent::__construct();\n\n $this->command_name = config(\"custom-commands.command_name\");\n\n parent::__construct($this->signature = $this->command_name);\n\n $this->commands = (array) config(\"custom-commands.commands\");\n \n $this->table = config(\"custom-commands.table\");\n\n $this->row = config(\"custom-commands.row\");\n\n $this->changeEnv = (boolean) config(\"custom-commands.change_env\");\n\n }",
"protected function createCommandFile()\n {\n $command_file_full_path = $this->command_dir_path . DIRECTORY_SEPARATOR . $this->arg->getCommandFileName();\n\n // Check if the command already exists\n if (file_exists($command_file_full_path)) {\n throw new Exception('Command already exists.');\n }\n\n // Create the file for the new command\n $command_file = fopen($command_file_full_path, 'w');\n\n // TODO: Create Script Generator to generate the PHP scripts for the new command.\n\n fclose($command_file);\n\n $this->console->getOutput()->println('File created at: ' . $command_file_full_path);\n $this->console->getOutput()->success('Command ' . $this->arg->getSignature() . ' created successfully.');\n }",
"public static function create() {}",
"public static function create() {}",
"public static function create() {}",
"public static function create(InteropContainer $container)\n {\n $middleware = $container->get('cmd.middleware');\n return new CommandBusFactory($middleware);\n }",
"private function createCli() {\n $this->cli = new Cli();\n $this->commands = $this->commandParser->getAllCommands();\n\n foreach ($this->commands as $command) {\n if ($command->isDefault()) {\n $this->cli->command(\"*\");\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n if ($command->getName() != \"\") {\n $this->cli->command($command->getName())->description($command->getDescription());\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n }\n\n\n }",
"public function testInstantiation()\n {\n $this->assertInstanceOf('Contao\\ManagerBundle\\Command\\InstallWebDirCommand', $this->command);\n }",
"public function command(string $command): self\n {\n $this->addCommands[] = $command;\n\n return $this;\n }",
"public function create() {}",
"protected function createProcess($cmd)\n {\n return new Process(explode(' ', $cmd));\n }",
"public function create(){}",
"protected function getCommandFactory(): Command\\Factory\n {\n return new Command\\RedisFactory();\n }",
"public function __construct()\n {\n parent::__construct();\n\n $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);\n }",
"public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }",
"protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}",
"public function __construct($command, $config = [])\n {\n $this->command = $command;\n $this->_output = $this->getDefaultOutput();\n parent::__construct($config);\n }",
"public function __construct(){\n\n global $argv;\n\n if(!isset($argv[1])){\n echo 'You must supply a command!' . PHP_EOL;\n exit;\n }//if\n\n $args = $argv;\n\n $scriptName = array_shift($args);\n $method = array_shift($args);\n\n $method = explode('-',$method);\n foreach($method as $k => $v){\n if($k != 0){\n $method[$k] = ucwords($v);\n }//if\n }//foreach\n\n $method = implode('',$method);\n\n $resolved = false;\n\n if(method_exists($this,$method)){\n call_user_func(Array($this,$method), $args);\n $resolved = true;\n }//if\n else {\n foreach(static::$extendedCommands as $commandClass){\n if(method_exists($commandClass,$method)){\n call_user_func(Array($commandClass,$method), $args);\n $resolved = true;\n break;\n }//if\n }//foreach\n }//el\n\n if(!$resolved){\n echo \"`{$method}` is not a valid CLI command!\";\n }//if\n\n echo PHP_EOL;\n exit;\n\n }",
"public function forCommand($command)\n {\n $this->command = $command;\n $this->pipe = new NullPipe();\n $this->manager = new InteractiveProcessManager($this->userInteraction);\n\n return $this;\n }",
"public function __construct()\n {\n parent::__construct('pwman', '0.1.0');\n\n $getCommand = new Get();\n $this->add($getCommand);\n\n $setCommand = new Set();\n $this->add($setCommand);\n }",
"public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }",
"public function createCommand(?string $sql = null, array $params = []): Command;",
"public function __construct($command = NULL, $name = NULL)\n {\n $args = func_get_args();\n\n switch ($command) {\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n case self::CONSTR_CMD_POP_FROM_ARR:\n case self::CONSTR_CMD_POP_FROM_OBJ:\n case self::CONSTR_CMD_POP_FROM_DB:\n case self::CONSTR_CMD_NEW:\n $this->setup_name = $name;\n\n # shift off known args\n array_shift($args);\n array_shift($args);\n break;\n }\n\n switch ($command) {\n case self::CONSTR_CMD_POP_FROM_ARR:\n $this->applyArray($args[0]);\n break;\n case self::CONSTR_CMD_POP_FROM_OBJ:\n break;\n case self::CONSTR_CMD_POP_FROM_DB:\n break;\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n $this->applyArray($args[0]);\n $this->setAllLoaded();\n break;\n default:\n throw new OrmInputException('Guessing not supported, please explicitly specify construction type');\n self::constructGuess($args);\n }\n\n $this->ensureObjectInDb();\n }",
"public function generateCommands();",
"protected function newInstanceCommand($commandClass)\n {\n $class = new ReflectionClass($commandClass);\n\n return $class->newInstanceArgs($this->resolveCommandParameters($class));\n }",
"protected function buildCommand()\n {\n return $this->command;\n }",
"public function makeItemCreateCommand(string $processUuid, array $item): ItemCreateCommand\n {\n $processUuid = ProcessUuid::fromNative($processUuid);\n $uuid = Uuid::fromNative(null);\n $item = Item::fromNative($item);\n\n return new ItemCreateCommand($processUuid, $uuid, $item);\n }",
"public function __construct($commandName, $args = [], $description = '') {\n if (!$this->setName($commandName)) {\n $this->setName('--new-command');\n }\n $this->addArgs($args);\n\n if (!$this->setDescription($description)) {\n $this->setDescription('<NO DESCRIPTION>');\n }\n }",
"public function getCommand($name, array $args = array())\n {\n return parent::getCommand($name, $args)\n ->setRequestSerializer(RequestSerializer::getInstance());\n }",
"protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\DONT_ADD_SPACE_BEFORE_VALUE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('rev-parse'))\n ->addArgument(new Argument('HEAD'));\n\n return $command;\n }",
"protected function instantiateCommand(Request $request, $args)\n {\n $command = new DeletePackageCustomerCommand($args);\n\n $requestBody = $request->getParsedBody();\n\n $this->setCommandFields($command, $requestBody);\n\n return $command;\n }",
"public function createCommand($sql = null, $params = [])\n {\n $command = new Command([\n 'db' => $this,\n 'sql' => $sql,\n ]);\n\n return $command->bindValues($params);\n }",
"protected function setCommand($value) {\n\t\t$this->_command = trim($value);\n\t\treturn $this;\n\t}",
"public function setCommand($command)\n {\n $this->command = $command;\n\n return $this;\n }",
"public function buildCommand()\n {\n return parent::buildCommand();\n }",
"private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }",
"public function __construct()\n {\n parent::__construct();\n\n $this->currentDirectory = getcwd();\n $this->baseIndentLevel = 0;\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\HelpCommand\", \"help\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\InitializePlanetCommand\", \"init\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackAndPushUniToolCommand\", \"packpushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackLightPluginCommand\", \"packlightmap\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushCommand\", \"push\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushUniverseSnapshotCommand\", \"pushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\UpdateSubscriberDependenciesCommand\", \"updsd\");\n\n }",
"public function getCommand(string $command);",
"protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}",
"public function addCommand($command, $args = [], $data = [])\n {\n $item = new ScreenCommand();\n $item->screen_id = $this->id;\n $item->command = $command;\n $item->arguments = $args;\n $item->fill($data);\n $item->save();\n\n return $item;\n }",
"public function test_creating_command_from_container()\n {\n $now = new \\DateTime();\n $this->container->add('DateTime', $now);\n $command = 'Spekkionu\\DomainDispatcher\\Test\\Commands\\CommandWithConstructor';\n $result = $this->dispatcher->dispatch($command);\n $this->assertSame($now, $result);\n }",
"protected function createProcess(): Process\n {\n $command = [\n $this->settings['executable']\n ];\n\n $command[] = $this->from;\n $command[] = $this->to;\n\n // Set the margins if needed.\n if ($this->settings['marginsType'] !== self::MARGIN_TYPE_NO_MARGINS) {\n $command[] = '--marginsType=' . $this->settings['marginsType'];\n }\n\n // If we need to proxy with node we just need to prepend the $command with `node`.\n if ($this->settings['proxyWithNode']) {\n array_unshift($command, 'node');\n }\n\n // If there's no graphical environment we need to prepend the $command with `xvfb-run\n // --auto-servernum`.\n if (! $this->settings['graphicalEnvironment']) {\n array_unshift($command, '--auto-servernum');\n array_unshift($command, 'xvfb-run');\n }\n\n return new Process($command);\n }",
"private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }",
"public function __construct(string $command, string $before = '', string $after = '')\n {\n $this->command = $command;\n $this->before = $before;\n $this->after = $after;\n }",
"public function generateCommand($singleCommandDefinition);",
"public function create() {\n }",
"public function create() {\n }",
"public function create() {\r\n }",
"public function create() {\n\n\t}",
"private function getImportCommand()\n {\n return new IndexImportCommand(self::getContainer());\n }",
"public function __construct($command)\n {\n $this->command = $command;\n\n $this->command->line('Installing Images: <info>✔</info>');\n }",
"public function __construct()\n {\n self::$instance =& $this;\n\n $commanddir = Config::main('directory');\n $excludes = Config::main('exclude');\n\n if(is_null($commanddir))\n die('Could not find commands directory. It should be specified in the main config.');\n\n //The directory where commands reside should be relative\n //to the directory with the clip executable.\n $dir = realpath(__DIR__.\"/{$commanddir}\");\n\n $cmdfiles = scandir($dir);\n //Loop through each file in the commands directory\n foreach($cmdfiles as $file)\n {\n //Assume that each file uses the standard '.php' file extension.\n $command = substr($file, 0, -4);\n\n //Ignore the unnecessary directories as commands and anything that\n //has been marked for exclusion then attempt to include the valid ones.\n if($file !== '.' && $file !== '..' && array_search($command, $excludes) === false && include(\"{$dir}/{$file}\"))\n {\n if(class_exists($command, false))\n {\n $obj = new $command;\n //Only load commands that use the clip command interface\n if($obj instanceof Command)\n $this->commands[strtolower($command)] = $obj;\n }\n }\n }\n }",
"public function __construct($action, $command = null) {\n parent::__construct($action, self::NAME);\n\n $fieldFactory = FieldFactory::getInstance();\n\n $commandField = $fieldFactory->createField(FieldFactory::TYPE_STRING, self::FIELD_COMMAND, $command);\n\n $this->addField($commandField);\n }",
"public function createCommand($db = null, $action = 'get')\n {\n if ($db === null) {\n $db = Yii::$app->get(Connection::getDriverName());\n }\n $this->addAction($action);\n $commandConfig = $db->getQueryBuilder()->build($this);\n\n return $db->createCommand($commandConfig);\n }",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();"
] | [
"0.8010746",
"0.7333379",
"0.72606754",
"0.7164165",
"0.716004",
"0.7137585",
"0.6748632",
"0.67234164",
"0.67178184",
"0.6697025",
"0.6677973",
"0.66454077",
"0.65622073",
"0.65437883",
"0.64838654",
"0.64696646",
"0.64292693",
"0.6382209",
"0.6378306",
"0.63773245",
"0.6315901",
"0.6248427",
"0.6241929",
"0.6194334",
"0.6081284",
"0.6075819",
"0.6069913",
"0.60685146",
"0.6055616",
"0.6027874",
"0.60132784",
"0.60118896",
"0.6011778",
"0.5969603",
"0.59618074",
"0.5954538",
"0.59404427",
"0.59388787",
"0.5929363",
"0.5910562",
"0.590651",
"0.589658",
"0.589658",
"0.589658",
"0.58692765",
"0.58665586",
"0.5866528",
"0.58663124",
"0.5852474",
"0.5852405",
"0.58442044",
"0.58391577",
"0.58154446",
"0.58055794",
"0.5795853",
"0.5780188",
"0.57653266",
"0.57640004",
"0.57584697",
"0.575748",
"0.5742612",
"0.5739361",
"0.5732979",
"0.572247",
"0.5701043",
"0.5686879",
"0.5685233",
"0.56819254",
"0.5675983",
"0.56670785",
"0.56606543",
"0.5659307",
"0.56567776",
"0.56534046",
"0.56343585",
"0.56290466",
"0.5626615",
"0.56255764",
"0.5608852",
"0.5608026",
"0.56063116",
"0.56026554",
"0.5599553",
"0.5599351",
"0.55640906",
"0.55640906",
"0.5561977",
"0.5559745",
"0.5555084",
"0.5551485",
"0.5544597",
"0.55397296",
"0.5529626",
"0.552908",
"0.552908",
"0.552908",
"0.552908",
"0.552908",
"0.552908",
"0.552908",
"0.552908"
] | 0.0 | -1 |
Execute the console command. | public function handle()
{
$class = 'App\\' . studly_case($this->argument('booking-engine')) . '\\' . studly_case($this->argument('booking-engine'));
$this->bookingEngine = new $class();
//
$this->info($this->argument('booking-engine'));
$this->info($this->argument('dlm'));
$yesterday = date('Y-m-d', strtotime("-1 days"));
$today = date('Y-m-d');
$reservations = $this->bookingEngine->getReservations($yesterday, $today, $hotelId = null, $dlm = true);
$this->bookingEngine->saveReservations($reservations);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }",
"public function handle()\n {\n //get us the Converter class instance and call the convert() method on it.\n $this->info(\n \\Aregsar\\Converter\\ConverterFacade::convert($this->argument(\"currency\"))\n );\n }",
"public function handle()\n {\n $this->locale = $this->argument('locale');\n\n $this->loadGroupLines();\n\n $this->loadNameSpacedLines();\n\n $this->info('Complete');\n }",
"public function handle()\n {\n $this->importUser($this->argument('username'));\n $this->call('ldap:show-user', $this->arguments());\n }",
"public function handle() {\n $user = User::where('id', $this->argument('userId'))->first();\n $this->info($user->email);\n }",
"public function handle()\n {\n $translations = collect(json_decode(file_get_contents('https://raw.githubusercontent.com/getbible/Bibles/master/translations.json')))->flatten();\n switch($this->argument('action')) {\n case 'fetch':\n $this->fetchBibles($translations);\n break;\n case 'convert':\n $this->convertBibles($translations);\n break;\n }\n }",
"public function handle()\n {\n try {\n $evalstr = $this->evaluater->evaluate($this->argument('evalString'));\n $this->info($evalstr);\n } catch (ForbiddenSymbolsException $exception) {\n $this->error($exception->getMessage());\n } catch (IncorrectSymbolsException $exception) {\n $this->error($exception->getMessage());\n }\n }",
"public function handle()\n {\n\n $settings = Setting::fetch();\n $id = $this->argument('id');\n $this->scrape_game_data($id);\n }",
"public function handle()\n {\n // env('CALENDARINDEX_TOKEN', '6f2bd927201ba4b22bb57df08db0c517e51732de')\n $this->getData($this->argument('country'), $this->argument('region'));\n }",
"public function handle()\n {\n $email = $this->argument('email');\n $name = $this->argument('name');\n\n $this->info(\"starting to generate users details\");\n\n }",
"public function handle()\n {\n\t\t$this->info('Importing translations...');\n\n\t\t$this->manager->importTranslations(true);\n }",
"public function handle()\n {\n $user = null;\n\n if ($email = $this->option(\"email\", false)) {\n $user = $this->findByEmail($email);\n }\n\n if ($id = $this->option(\"id\", false)) {\n $user = $this->findById($id);\n }\n\n if (empty($user)) {\n $this->warn(\"User no found\");\n }\n else {\n $this->setRoleToUser($user);\n }\n }",
"public function handle()\n {\n $name = ucwords($this->argument('name'));\n $this->call('repository:contract', [ 'name' => $name ]);\n $this->call('repository:class', [ 'name' => $name, '--driver' => $this->option('driver') ]);\n }",
"public function handle()\n\t{\n\t\t// Superuser\n\t\tif( ! $this->option('no-superuser'))\n\t\t\t$this->call('setup:superuser');\n\n\t\t// Countries\n\t\tif( ! $this->option('no-countries'))\n\t\t\t$this->call('setup:countries', ['country' => array_filter(explode(',', $this->option('countries')))]);\n\n\t\t// Languages\n\t\tif( ! $this->option('no-languages'))\n\t\t\t$this->call('setup:languages', ['language' => array_filter(explode(',', $this->option('languages')))]);\n\n\t\t// Currencies\n\t\tif( ! $this->option('no-currencies'))\n\t\t\t$this->call('setup:currencies', ['currency' => array_filter(explode(',', $this->option('currencies')))]);\n\n\t\t// Clear cache\n\t\t$this->call('cache:clear');\n\t}",
"public function handle()\n\t{\n\t\t$name = $this->argument('name');\n\t\t\n\t\t$this->info(\"Searching eve api for {$name}\");\n\t\t$result = Corporation::searchEVEAPI($name);\n\n\t\t$this->info(\"results\");\n\t\tforeach($result as $corp)\n\t\t{\n\t\t\tprint $corp->name . \" \" . $corp->id . \"\\r\\n\";\n\t\t}\n\t}",
"public function handle()\n {\n $user = $this->argument('user');\n $this->info('Display this on the screen, user ' . $user);\n return 0;\n }",
"public function handle()\n {\n $this->userVectors->test($this->option('force'));\n }",
"public function handle()\n {\n $mapping = $this->formatMappingName((string)$this->argument('mapping'));\n \n $model = $this->option('model') ? $this->formatModelName($this->option('model')) : null;\n \n $this->filesystem->put(\n $this->buildMappingFilePath($mapping),\n $this->buildMapping(\n $this->getDefaultStub(),\n $mapping,\n $model\n )\n );\n \n $this->composer->dumpAutoloads();\n }",
"public function handle()\n {\n switch ($this->argument('type')) {\n case 'dns':\n $this->dnscheck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n case 'whois':\n $this->whoischeck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n }\n }",
"public function handle()\n {\n $option = $this->argument('option');\n\n if (! in_array($option, ['expired', 'all'])) {\n return $this->error('Invalid option supplied to command...');\n }\n\n $this->comment('Beginning pruning process...');\n\n $this->comment($this->pruneDatabase($option) . ' deleted from database...');\n\n $this->comment($this->pruneFiles($option) . ' deleted from files...');\n\n $this->info('Nonces pruned successfully!');\n }",
"public function handle()\n {\n $subscriptionUpdateService = new SubscriptionUpdateService();\n $subscriptionUpdateService->runUpdates();\n }",
"public function handle()\n\t{\n\t\t\n\t\t$source_directory = $this->argument( 'source_directory' );\n\t\t$target_directory = $this->argument( 'target_directory' );\n\t\t$template = (string) $this->option( 'template' );\n\n\t\t$statik = new \\App\\Statik\\Statik;\n\n\t\t$statik->generateHTMLFiles( $this, $source_directory, $target_directory, $template ) && $this->info( \"\\e[1;32mDONE!\" );\n\n\t}",
"public function handle()\n {\n if (!$this->argument('file')) {\n $this->info('Please specify file to call.');\n }\n\n $file = $this->argument('file');\n\n if (!$this->fileHandler->exists($file)) {\n $this->info('Wrong path or file not exist.');\n }\n\n $this->executeFile($file);\n }",
"public function handle()\n {\n $user = $this->argument('user');\n $this->scanner->setUserName($user);\n $this->scanner->scanUser();\n }",
"public function handle()\n {\n if ($this->argument('user')) {\n $userId = $this->argument('user');\n\n $this->info(\"Liquidate affiliate commission for user \" . $userId);\n\n $user = $this->userService->findById($userId);\n\n if ($user) {\n $this->walletService->liquidateUserBalance($user);\n } else {\n $this->error(\"User not found\");\n }\n\n $this->info(\"Done\");\n } else {\n $this->info(\"Liquidate all commissions\");\n\n $this->walletService->liquidateAllUsersBalance();\n\n $this->info(\"Done\");\n }\n }",
"public function handle()\n {\n $action = $this->choice('what action do you have on mind', [\n 'add-relation', 'remove-columns', 'column-type', 'rename-column'\n ]);\n switch ($action) {\n case 'add-relation':\n $this->addRelation();\n break;\n\n case 'remove-columns':\n $this->removeColumns();\n break;\n case 'column-type':\n $this->columnType();\n break;\n case 'rename-column':\n $this->renameColumn();\n break;\n default:\n $this->error('Unsupported action requested...');\n }\n $this->info('Command executed successfully');\n }",
"public function handle()\n {\n $arguments = $this->arguments();\n $storageDir = $arguments['storageDir'];\n $localStorageDir = $arguments['localStorageDir'];\n $url = $arguments['url'];\n $cmd = sprintf(\"./app/Console/Commands/ShellScripts/screen_shot.sh %s %s %s\", $storageDir, $localStorageDir, $url);\n\n while (true) {\n $result = shell_exec($cmd);\n print_r($result);\n sleep(3);\n }\n }",
"public function handle()\n {\n $city = $this->argument('city');\n\n $weatherService = new CurrentWeatherService();\n try {\n $weather = $weatherService->getByCity($city);\n } catch (WeatherException $e) {\n $this->error($e->getMessage());\n return;\n }\n\n $this->info('Weather for city '.$city);\n dump($weather->toArray());\n }",
"public function handle()\n {\n $this->getModels($this->argument('model'));\n $this->getLanguages($this->argument('locale'));\n $this->createMultiLanguageRecords();\n }",
"public function handle()\n {\n $this->processOptions();\n\n echo json_encode( $this->dateTimeRange ) . \"\\n\";\n\n $this->dispatch( new ProcessNewActionsJob(\n $this->dateTimeRange ,\n str_random( 16 ),\n $this->option('runtime-threshold')\n ) );\n }",
"public function handle()\n {\n $fightId = $this->argument('fight_id');\n $metricId = $this->argument('metric_id');\n //$strategyName = 'App\\\\'.$this->argument('metric_name');\n\n $metric = BossMetric::find($metricId);\n if ($metric === null) {\n $this->error(\"Error: no metric with id: $metricId found!\");\n return;\n }\n\n $fight = Fight::find($fightId);\n\n if ($fight === null) {\n $this->error(\"Error: no fight with id: $fightId found!\");\n return;\n }\n\n $strategy = $metric->getStrategy();\n $strategy->setFight($fight);\n $strategy->run();\n }",
"public function handle()\n {\n\t\t$this->call('vendor:publish');\n\t\t$this->call('migrate');\n\t\t$this->call('db:seed');\n\t\t$this->call('factotum:storage');\n\t\t$this->call('factotum:storage');\n }",
"public function handle()\n {\n $user_id = $this->argument('user') ?? null;\n\n if (is_null($user_id)) {\n $users = User::all();\n\n foreach ($users as $user) {\n $this->showUserBalance($user);\n }\n } else {\n $user = User::find($user_id);\n\n $this->showUserBalance($user);\n }\n }",
"public function handle()\n {\n $this->capsuleService->getAll();\n $this->line('Command Worked');\n }",
"public function handle()\n {\n $platform_wechat_id = $this->argument('id');\n $customer_id = $this->argument('customer_id');\n $this->info(\"Starting at \".date('Y-m-d H:i:s').\". Running initial for 【{$this->signature}】\");\n $this->getUserInfoList($platform_wechat_id,$customer_id);\n $this->info(\"End at \".date('Y-m-d H:i:s').\". over for 【{$this->signature}】\");\n }",
"public function handle()\n {\n $this->publishAssets();\n $this->call('twill:flush-manifest');\n $this->call('view:clear');\n }",
"public function handle()\n {\n \n $argument = $this->argument('data');\n \n $this->prepare( $argument );\n \n $this->make();\n \n $this->info( 'migration has been created : '. $this->fileName );\n \n }",
"public function handle()\n {\n chdir(resource_path('assets/ts'));\n $path = $this->argument(\"path\");\n if(isset($path))\n {\n Logger::info('execute '.$path);\n Command::executeRaw('tsc', [\"-p\", $path]);\n }else\n Logger::info('execute tsc');\n Command::executeRaw('tsc');\n }",
"public function handle()\n {\n $this->info('Starting date change command.');\n\n Word::where('language_id', 1)->update(array('created_at' => '1970-01-01 00:00:01'));\n Word::where('language_id', 2)->update(array('created_at' => '1970-01-01 00:00:01'));\n\n $this->info('Dates have been changed to 1970-01-01 00:00:01');\n }",
"public function handle()\n {\n $this->info($this->slugger->encode($this->argument('id')));\n }",
"public function handle()\n {\n $this->line(static::$logo);\n $this->line('Neat admin current version:' . Neat::version());\n\n $this->comment('');\n $this->comment('Available commands:');\n\n $this->listAvailableCommands();\n }",
"public function handle()\n {\n $this->revisions->updateListFiles();\n }",
"public function handle(): void\n {\n // Set argument\n $this->url = $this->argument(self::URL_ARGUMENT);\n\n // Handler takes care of computation\n (new CommandHandler($this))->compute();\n }",
"public function handle()\n {\n try\n {\n $filename = $this->argument('filename');\n Excel::import(new ObjectsImport, $filename);\n\n $this->info('Data import is now completed');\n }\n catch(Exception $ex)\n {\n $this->error($ex->getMessage());\n }\n }",
"public function handle() {\n $entity = $this->validateEntity($this->argument('entity'));\n $job = new DataProcessingJob($entity, str_random(16));\n $this->dispatch($job);\n }",
"public function handle()\n {\n $isProductionMode = 'prod' == $this->argument('mode');\n\n if ($isProductionMode) {\n if (!$this->confirm('Are you sure to run in production mode? Running this command may cause critical issues?')) {\n exit(1);\n }\n }\n\n $this->_recalculate($isProductionMode);\n }",
"public function handle()\n {\n if(!$this->verify()) {\n $rank = $this->createRankSuperAdmin();\n $user = $this->createUserSuperAdmin();\n $user->Ranks()->attach($rank);\n $this->line('Felicitaciones');\n } else {\n $this->error('No se puede ejecutar');\n }\n }",
"public function handle()\n {\n // Get CLI Input\n $user_id = $this->option(\"uid\");\n\n // User Products\n ( new CommandManager() )->showUserProducts( $user_id );\n }",
"public function handle()\n {\n $force = $this->option('force');\n\n if($this->option('without-bulk')){\n $this->withoutBulk = true;\n }\n\n if ($this->generateClass($force)){\n $this->info('Generating permissions for '.$this->modelBaseName.' finished');\n }\n }",
"public function handle()\n {\n $tournaments = Tournament::all()->toArray();\n foreach ($tournaments as $tournament) {\n $slug = $this->tournamentRepoObj->generateSlug($tournament['name'].Carbon::createFromFormat('d/m/Y', $tournament['start_date'])->year,'');\n DB::table('tournaments')\n ->where('id', $tournament['id'])\n ->update([\n 'slug' => $slug\n ]);\n }\n $this->info('Script executed.');\n }",
"public function handle()\n {\n $userId = $this->argument('user');\n\n /** @var User $user */\n $user = User::findOrFail($userId);\n\n // Get token.\n $info = (new Client())->auth();\n\n // Save to db.\n $user->access_token = $info['access_token'];\n $user->access_secret = $info['access_secret'];\n $user->save();\n\n $this->line(\"Saved access token and secret for user: {$user->email}\");\n }",
"public function handle()\n {\n $m = new MemberFromText;\n $m->train();\n $id = $m->predict($this->argument('text'));\n dump(Miembro::find($id)->toArray());\n }",
"public function handle()\n {\n $this->generator\n ->setConsole($this)\n ->run();\n }",
"public function handle()\n {\n $this->createController();\n $this->createServiceDir();\n\n exit;\n $args = [\n '--provider' => TestProvider::class\n ];\n $className = $this->argument('className');\n if (!$className) {\n $className = 'MethodsList';\n }\n $className = ucwords($className);\n $this->call('vendor:publish', $args);\n $this->info('Display this on the screen ' . $className);\n }",
"public function handle()\n {\n $this->createDirectories();\n\n $this->publishTests();\n\n $this->info('Authentication tests generated successfully.');\n }",
"public function handle()\n {\n $this->setDbConnection(\n $this->input->getOption('database') ?: config('ghost-database.default_connection')\n );\n\n $native = $this->input->getOption('native-import') ?: config('ghost-database.use_native_importer');\n\n $snapshot = $this->import($native);\n\n $this->info(\"Snapshot `{$snapshot->name}` loaded!\");\n }",
"public function handle()\n {\n $exec = $this->argument('exec');\n\n switch ($exec) {\n case 'download' :\n $this->download();\n break;\n\n case 'generate' :\n $this->generate();\n break;\n\n default :\n echo \"Choose 'download' or 'generate' for this command\";\n break;\n }\n }",
"public function handle()\n {\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-admin.js', '--group' => 'admin']);\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-frontend.js', '--group' => 'frontend']);\n $this->call(TranslationsGenerateCommand::class);\n }",
"public function handle()\n {\n $tenantName = $this->argument('tenant');\n\n $tenant = Tenant::where('name', $tenantName)->orWhere('subdomain', $tenantName)->first();\n\n if ($tenant) {\n $tenant->setActive();\n \\Artisan::call('tinker');\n } else {\n $this->error('Error: Tenant not found');\n }\n }",
"public function handle()\n {\n try {\n if (!empty($userId = $this->argument('user'))) {\n $user = User::find($userId);\n } else {\n $user = User::inRandomOrder()->first();\n }\n\n if (empty($user)) {\n throw new \\Exception('User not found');\n }\n\n echo JWTAuth::fromUser($user);\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n }",
"public function handle()\n {\n $this->fetchAndSetToken();\n $imagesToDownload = $this->peekImages(WatchedApp::pluck('package_name'));\n $this->fetchImages($imagesToDownload);\n\n if ($this->option('dont-optimize')) {\n return;\n }\n\n $this->runOptimizeCommand();\n }",
"public function handle()\n {\n $this->setCryptIVFromUrl($this->argument('url'));\n\n $participant = URLParser::parseByName('santa.index', $this->argument('url'))->participant;\n if($participant) {\n $draw = $participant->draw;\n } else {\n $draw = URLParser::parseByName('organizer.index', $this->argument('url'))->draw;\n }\n\n $this->table(\n ['ID', 'Name', 'Email'],\n $draw->participants()->get(['id', 'name', 'email'])->toArray()\n );\n }",
"public function handle()\n {\n // if you are on the local environment\n if (!(app()->isLocal() || app()->runningUnitTests())) {\n $this->error('This command is only available on the local environment.');\n return;\n }\n\n $fqdn = $this->argument('fqdn');\n if ($tenant = Tenant::retrieveBy($fqdn)){\n $tenant->delete($fqdn);\n $this->info(\"Tenant {$fqdn} successfully deleted.\");\n }else {\n $this->error('This fqdn doesn\\'t exist.');\n }\n\n }",
"public function handle()\n {\n $user_from = $this->option('from');\n $user_to = $this->option('to');\n $sum = $this->option('sum');\n\n CreateTransaction::dispatch($this->usersRepository->getByID($user_from), $this->usersRepository->getByID($user_to), $sum, true);\n $this->transactionsRepository->getAll()->each(function ($transaction){\n \tExecuteTransaction::dispatch($transaction);\n });\n }",
"public function handle()\n {\n $this->warn('Starting Retrieve Data');\n\n PeopleService::retrieveData();\n\n $this->info('Retrieve Data Completed');\n }",
"public function handle()\n {\n \n $period = $this->option('period');\n \n switch ($period) {\n\n case 'half_month':\n $this->info('Grabing Half Month Income...');\n $this->halfMonth();\n break;\n\n case 'monthly':\n $this->info('Grabing Monthly Income...');\n $this->monthly();\n break;\n \n default:\n $this->info('Grabing Daily Income...');\n $this->daily();\n break;\n\n }\n\n \n }",
"public function handle()\n {\n $countryFiles = $this->getFiles();\n\n foreach ($countryFiles as $fileName) {\n $this->seed($fileName);\n }\n\n $this->info('End.');\n }",
"public function fire()\n {\n $entityName = $this->argument('entityName');\n $startEntityId = $this->argument('startEntityId');\n $endEntityId = $this->argument('endEntityId');\n $depth = $this->argument('depth');\n\n $this->fixturePath = $this->option('outputPath');\n\n $this->info(\"Generating fixtures for $entityName in {$this->fixturePath}...\");\n \n $this->generateFixtures($entityName, $startEntityId, $endEntityId, $depth);\n }",
"public function handle()\n {\n $check = PublishTraitsService::publishTraits();\n\n if ($check)\n {\n $this->info('All files have been published');\n }\n\n $this->info('Failed to publish');\n }",
"public function handle()\n {\n $user = User::where('username', $this->argument('user'))\n ->orWhere('email', $this->argument('user'))\n ->first();\n\n if ($user != null) {\n $user->assign('admin');\n $this->line(\"{$user->email} was successfully made an admin.\");\n } else {\n $this->line(\"No user found where username or email is '{$this->argument('user')}'\");\n }\n }",
"public function handle()\n {\n event( 'laraview:compile' );\n $this->checkForSelectedViewGeneration();\n\n app( RegisterBlueprint::class )\n ->console( $this )\n ->generate();\n }",
"public function handle()\n {\n $project = Project::with(['team.admins', 'team.members'])->findOrFail($this->option('project-id'));\n $user = User::findOrFail($this->option('user-id'));\n if ($this->option('admin')) {\n $project->team->admins()->syncWithoutDetaching($user);\n } else {\n $project->team->members()->syncWithoutDetaching($user);\n }\n return Command::SUCCESS;\n }",
"public function handle() {\n try {\n $this->roomService->loadRoomOccupations();\n Log::notice('untis:occupations executed successfully.');\n $this->line('Loaded room occupations from WebUntis.');\n } catch (Exception $e) {\n Log::error('Error loading room occupations.', ['exception' => $e]);\n $this->error('Error loading room occupations: ' . $e->getMessage());\n }\n }",
"public function handle()\n {\n $this->loadIxList();\n $this->loadIxMembersList();\n $this->updateIxInfo();\n $this->updateIxMembersInfo();\n }",
"public function handle()\n {\n $this->call('vendor:publish', [\n '--provider' => \"Qoraiche\\MailEclipse\\MailEclipseServiceProvider\",\n ]);\n }",
"public function handle()\n\t{\n\t\tif ($this->option('dev')) {\n\t\t\tsystem('php '.base_path('.deploy/deploy-dev.php'));\n\t\t} else {\n\t\t\tsystem('php '.base_path('.deploy/deploy.php'));\n\t\t}\n\t}",
"public function handle(Command $command);",
"public function handle(Command $command);",
"public function handle()\n {\n $date_from = $this->argument('date_from');\n\t\t$date_to = $this->argument('date_to');\n\t\tif(!$date_from) {\n\t\t\t$date_from = Carbon::today()->subDays(5);\n\t\t}\n\t\tif(!$date_to) {\n\t\t\t$date_to = Carbon::yesterday();\n\t\t}\n\t\tStats::computeMembers($this->argument('venue_id'), $date_from, $date_to);\n }",
"public function handle()\n {\n switch ($this->argument('type')){\n case 'fih':\n $scrapper = new Scrappers\\FederationScrapper();\n $scrapper->get($this->option('level'));\n print $scrapper->message();\n break;\n }\n }",
"public function handle()\n {\n Log::info(\"seed:dash Command is working fine!\");\n $this->info('Dashboard Database seeding completed successfully.');\n }",
"public function handle()\n {\n $originalId = $this->argument('original_id');\n\n $status = true;\n if ($this->option('status') === 'false') {\n $status = false;\n }\n\n if ($video = Video::where('original_id', $originalId)->first()) {\n $video->dmca_claim = $status;\n $video->save();\n\n $this->info('Video\\'s dmca_claim set to: ' . json_encode($status));\n return ;\n }\n\n $this->error('No video found with original_id of: ' . $originalId);\n return;\n }",
"public function handle()\n {\n $this->call('config:clear');\n\n $this->call('config:update');\n\n $this->info('Configuration cached successfully!');\n }",
"public function handle()\n {\n //\n $modelName = $this->argument('model');\n $column = $this->argument('column');\n $this->generateMutation($modelName, $column);\n\n }",
"public function handle()\n {\n $filePath = 'public/' . $this->argument('fileName');\n $count = $this->argument('count');\n \n $fileData = array_slice(file($filePath), 0, $count);\n $this->info(implode('', $fileData));\n }",
"public function handle()\n {\n $email = $this->argument('email');\n\n Mail::to($email)->send(new SendMailable('Test Mail'));\n\n if (Mail::failures()) {\n $this->info('Email failed to send');\n } else {\n $this->info('Email successfully sent');\n }\n }",
"public function handle()\n {\n $this->call('route:trans:clear');\n\n $this->cacheRoutesPerLocale();\n\n $this->info('Routes cached successfully for all locales!');\n }",
"public function handle()\n {\n $this->info('Welcome to command for Bantenprov\\WilayahIndonesia package');\n }",
"public function handle()\n {\n if($this->hasOption('no_dump') && $this->option('no_dump')){\n $this->composer_dump = false;\n }\n $this->readyDatas();\n $this->datas['startSymbol']='{{';\n $this->datas['endSymbol']='}}';\n $this->create();\n }",
"public function handle()\n {\n $repository = new OglasiCrawlerRepository();\n $ads = $repository->getAds();\n $repository->saveAds($ads);\n\n echo 'Ads were successfully retrieved' . PHP_EOL;\n }",
"public function handle()\n {\n $this->makeDir($this->basePath . $this->kebabPlural());\n\n $this->exportViews();\n\n $this->info('Resource views generated successfully.');\n }",
"public function handle()\n {\n $movies = \\App\\Models\\Movie::whereNull('meta')->take(40)->orderBy('id')->get();\n $movies->each(function($movie){ sleep(1); $movie->getMeta(); });\n return Command::SUCCESS;\n }",
"public function handle()\n {\n $this->packageGenerator->setConsole($this)\n ->setPackage($this->argument('package'))\n ->setType('shipping')\n ->setForce($this->option('force'))\n ->generate();\n }",
"public function handle()\n {\n $test = $this->argument('test');\n\n $dir = config('speed-test.dir');\n\n $className = ucfirst(\\Str::camel($test));\n\n $namespace = config('speed-test.namespace');\n\n $class = class_entity($className)\n ->namespace($namespace);\n\n $class->method('speed1')\n ->line($this->option('line'))->doc(function ($doc) use ($className) {\n /** @var DocumentorEntity $doc */\n $doc->tagCustom('times', $this->option('times'));\n $doc->description($this->option('description') ?: \"{$className} Speed 1\");\n });\n\n if (! is_dir($dir)) {\n mkdir($dir, 0777, 1);\n }\n\n file_put_contents(\n $dir.'/'.$className.'.php',\n $class->wrap('php')\n );\n\n $this->info('Speed created!');\n\n return 0;\n }",
"public function handle()\n {\n $message = $this->GenerateRandomUser($this->argument('count'));\n $this->info($message);\n }",
"public function handle()\n {\n $host = Cache::get('executingHost', null);\n $this->info(\"Host: ${host}\");\n\n if ($host === null) {\n $this->info('実行するホストが選択されていません');\n return;\n }\n\n if (Schema::hasTable('companies') && Company::count() !== 0) {\n $this->info('マイグレーションが既に1回以上実行されています');\n return;\n }\n\n $should_execute = $host === $this->argument('executingHost');\n\n if ($should_execute) {\n Artisan::call('migrate:fresh', ['--seed' => true]);\n $this->info('マイグレーションが完了しました');\n\n Cache::forget('executingHost');\n } else {\n $this->info('別ホストにてマイグレーションが行われます');\n }\n }",
"public function handle()\n {\n // Configuration...\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-config']);\n\n // Migrations\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-migrations']);\n\n $this->info('Model Login resources published.');\n }",
"public function handle()\n {\n if ($this->validation()) {\n $money = $this->argument('money');\n Cache::increment('amount', $money);\n }\n }",
"public function handle()\n {\n $this->info('Publishing stuff..');\n\n $this->publishFiles();\n\n $this->info('Setup complete. Enjoy!');\n }",
"public function handle()\n {\n $this->publishConfig();\n $this->publishClassStub();\n $this->generateAndStoreKey();\n\n $this->info('Use the details below for your \"Lead delivery options\" in Google Ads.');\n $this->info('Webhook URL: ' . route('GoogleAdsLeadExtensionController@index'));\n $this->info('Key: ' . $this->generated_key);\n }",
"public function handle()\n {\n $opts = $this->options();\n $args = $this->arguments();\n #print_r($opts);\n #print_r($args);\n\n # Redundant as argument validation handled by Laravel\n #\n if (!isset($args['destination'])) {\n printf(\"Usage: php artisan %s\\n\", $this->signature);\n exit(1);\n }\n\n # Default to normal message type\n #\n if (!isset($opts['type'])) {\n $opts['type'] = 'normal';\n }\n\n $uac = new UserApiController();\n\n if ($opts['type'] == 'normal') {\n if (!isset($opts['message'])) {\n printf(\"Usage: php artisan %s\\n\\n\", $this->signature);\n printf(\"ERROR: Message must be specified for type 'normal'\\n\");\n exit(1);\n }\n $result = $uac->sendSms(\n $args['destination'],\n $opts['message'],\n $opts['route']\n );\n }\n else if ($opts['type'] == 'otp') {\n $result = $uac->sendVerificationSms(\n $args['destination'],\n '<code>',\n '<name>',\n $opts['route'],\n '<appName>'\n );\n }\n\n if ($result === true) {\n printf(\"INFO: SMS message to %s sent successfully (%s)\\n\",\n $args['destination'], $opts['type']);\n }\n else {\n printf(\"INFO: SMS message to %s failed to send (%s)\\n\", \n $args['destination'], $opts['type']);\n printf(\"ERROR: %s\\n\", $result);\n }\n\n return;\n }"
] | [
"0.6469962",
"0.6463639",
"0.64271367",
"0.635053",
"0.63190264",
"0.62747604",
"0.6261977",
"0.6261908",
"0.6235821",
"0.62248456",
"0.62217945",
"0.6214421",
"0.6193356",
"0.61916095",
"0.6183878",
"0.6177804",
"0.61763877",
"0.6172579",
"0.61497146",
"0.6148907",
"0.61484164",
"0.6146793",
"0.6139144",
"0.61347336",
"0.6131662",
"0.61164206",
"0.61144686",
"0.61109483",
"0.61082935",
"0.6105106",
"0.6103338",
"0.6102162",
"0.61020017",
"0.60962653",
"0.6095482",
"0.6091584",
"0.60885274",
"0.6083864",
"0.6082142",
"0.6077832",
"0.60766655",
"0.607472",
"0.60739267",
"0.607275",
"0.60699606",
"0.6069931",
"0.6068753",
"0.6067665",
"0.6061175",
"0.60599935",
"0.6059836",
"0.605693",
"0.60499364",
"0.60418284",
"0.6039709",
"0.6031963",
"0.6031549",
"0.6027515",
"0.60255647",
"0.60208166",
"0.6018581",
"0.60179937",
"0.6014668",
"0.60145515",
"0.60141796",
"0.6011772",
"0.6008498",
"0.6007883",
"0.60072047",
"0.6006732",
"0.60039204",
"0.6001778",
"0.6000803",
"0.59996396",
"0.5999325",
"0.5992452",
"0.5987503",
"0.5987503",
"0.5987477",
"0.5986996",
"0.59853584",
"0.5983282",
"0.59804505",
"0.5976757",
"0.5976542",
"0.5973796",
"0.5969228",
"0.5968169",
"0.59655035",
"0.59642595",
"0.59635514",
"0.59619296",
"0.5960217",
"0.5955025",
"0.5954439",
"0.59528315",
"0.59513766",
"0.5947869",
"0.59456027",
"0.5945575",
"0.5945031"
] | 0.0 | -1 |
Constructs a new TaxRateForm object. | public function __construct(QueryFactory $query_factory) {
$this->queryFactory = $query_factory;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function createComponentRateForm()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addText('tarif', 'Tarifní sazba:')\r\n\t\t\t\t->setRequired('Uveďte tarifní hodinovou sazbu.')\r\n\t\t\t\t->setAttribute('class', 'cislo')\r\n\t\t\t\t->addFilter(array('Nette\\Forms\\Controls\\TextBase', 'filterFloat'))\r\n\t\t\t\t\t->controlPrototype->autocomplete('off')\r\n\t\t\t\t->addCondition($form::FILLED)\r\n\t\t\t\t\t\t->addRule($form::FLOAT, 'Hodnota musí být celé nebo reálné číslo.');\r\n\t\t\r\n\t\t$form->addText('hodnota', 'Kalkulační hodnota:')\r\n\t\t\t\t->setRequired('Uveďte kalkulační hodnotu tarifu.')\r\n\t\t\t\t->setAttribute('class', 'cislo')\r\n\t\t\t\t->addFilter(array('Nette\\Forms\\Controls\\TextBase', 'filterFloat'))\r\n\t\t\t\t\t->controlPrototype->autocomplete('off')\r\n\t\t\t\t->addCondition($form::FILLED)\r\n\t\t\t\t\t\t->addRule($form::FLOAT, 'Hodnota musí být celé nebo reálné číslo.');\r\n\r\n\t\t$form->addHidden('id_set_tarifu');\r\n\t\t$form->addHidden('id_typy_tarifu');\r\n\r\n\t\t$form->addSubmit('save', 'Uložit')->setAttribute('class', 'default');\r\n\t\t$form->addSubmit('cancel', 'Storno')->setValidationScope(FALSE);\r\n\t\t$form->onSuccess[] = callback($this, 'rateFormSubmitted');\r\n\r\n\t\t$form->addProtection(self::MESS_PROTECT);\r\n\t\treturn $form;\r\n\t}",
"protected function form() {\n\t\t$form = new Form(new Payment);\n\n\t\t$form->text('user.nickname', __('用户'))->disable();\n\t\t// $form->number('app_id', __('App id'));\n\t\t$form->decimal('price', __('金额'));\n\t\t$form->text('transaction_id', __('三方订单号'));\n\t\t$form->text('out_trade_no', __('平台订单号'))->disable();\n\t\t$form->radio('type', __('订单类型'))->options(['20' => '商城订单']);\n\t\t$form->radio('status', __('状态'))->options(['0' => '未支付', '1' => '已支付'])->default('0');\n\t\t// $form->text('other', __('Other'));\n\t\t$form->datetime('payment_at', __('支付时间'))->default(date('Y-m-d H:i:s'));\n\t\treturn $form;\n\t}",
"protected function form()\n {\n $form = new Form(new Order());\n\n $form->switch('paid', __('Paid'));\n $form->datetime('reservation_expires', __('Reservation expires'))->default(date('Y-m-d H:i:s'));\n $form->decimal('price', __('Price'));\n\n $form->tools(function (Form\\Tools $tools) {\n $tools->disableView();\n });\n\n\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new CouponCode());\n\n $form->text('name', __('Name'));\n $form->text('code', __('Code'));\n $form->text('type', __('Type'));\n $form->decimal('value', __('Value'));\n $form->number('total', __('Total'));\n $form->number('used', __('Used'));\n $form->decimal('min_amount', __('Min amount'));\n $form->datetime('not_before', __('Not before'))->default(date('Y-m-d H:i:s'));\n $form->datetime('not_after', __('Not after'))->default(date('Y-m-d H:i:s'));\n $form->switch('enabled', __('Enabled'));\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new CouponCode);\n\n $form->text('name', __('Name'));\n $form->text('code', __('Code'));\n $form->text('type', __('Type'));\n $form->decimal('value', __('Value'));\n $form->number('total', __('Total'));\n $form->number('used', __('Used'));\n $form->decimal('min_amount', __('Min amount'));\n $form->datetime('not_before', __('Not before'))->default(date('Y-m-d H:i:s'));\n $form->datetime('not_after', __('Not after'))->default(date('Y-m-d H:i:s'));\n $form->switch('enabled', __('Enabled'));\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new AgeModel);\n\n $form->text('tag_name', 'Tag name');\n $form->number('lable_id', 'Lable id');\n $form->number('add_time', 'Add time');\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new WithdrawDepositOrder);\n\n $form->number('apply_amount', __('Apply amount'));\n $form->number('transfer_amount', __('Transfer amount'));\n $form->number('master_id', __('Master id'));\n $form->switch('status', __('Status'));\n $form->textarea('comment', __('Comment'));\n\n return $form;\n }",
"public function paymentForm() {\n return new PaymentRequestForm();\n }",
"public function form()\n {\n $this->select('type', '计算类型')\n ->options(Interest::$typeMap)\n ->default(Interest::TYPE_FUTURE)->required();\n\n $this->number('value', '计算值')->required();\n $this->number('years', '存入年限')->required();\n $this->rate('rate', '年化利率')->required();\n }",
"protected function form()\n {\n $form = new Form(new FinancialPrizeModel);\n\n $form->display('id', 'ID');\n $form->select('user_id', '用户名')->options(UserModel::getAllUsersPluck())->rules('required');\n $form->select('type', '类型')->options(FinancialPrizeModel::getCommonPluck())->rules('required');\n $form->month('date', '所属月份')->format('YYYY-MM')->rules('required');\n $form->number('money', '金额');\n $form->text('mark', '简要说明')->help('奖项具体名称等,最多输入100字');\n $form->hidden('year', 'year');\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n\n $form->saving(function (Form $f) {\n $f->year = substr($f->date, 0, 4);\n $f->date = $f->date . '-01';\n });\n\n return $form;\n }",
"public function addTaxRate()\n {\n $this->taxRates[] = [\n 'id' => null,\n 'name' => null,\n 'priority' => count($this->taxRates) + 1,\n 'amounts' => $this->taxClasses->map(function ($taxClass) {\n return [\n 'id' => null,\n 'tax_class_id' => $taxClass->id,\n 'tax_class_name' => $taxClass->name,\n 'percentage' => 0,\n ];\n })->toArray(),\n ];\n }",
"protected function form()\n {\n $form = new Form(new StudentsBooksRent);\n\n $form->number('private_book_id', __('Private book id'));\n $form->text('renter_name', __('Renter name'));\n $form->text('lender_name', __('Lender name'));\n $form->text('shared_book_name', __('Shared book name'));\n $form->text('shared_book_cover', __('Shared book cover'));\n $form->switch('statement', __('Statement'))->default(1);\n $form->datetime('rend_applied_at', __('Rend applied at'))->default(date('Y-m-d H:i:s'));\n $form->datetime('rend_allowed_at', __('Rend allowed at'))->default(date('Y-m-d H:i:s'));\n $form->datetime('rend_rejected_at', __('Rend rejected at'))->default(date('Y-m-d H:i:s'));\n $form->datetime('return_applied_at', __('Return applied at'))->default(date('Y-m-d H:i:s'));\n $form->datetime('return_confirm_at', __('Return confirm at'))->default(date('Y-m-d H:i:s'));\n $form->number('cast_beans', __('Cast beans'));\n $form->number('over_limit_days', __('Over limit days'));\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new Order);\n\n $form->text('no', __('No'));\n $form->number('user_id', __('User id'));\n $form->textarea('address', __('Address'));\n $form->decimal('total_amount', __('Total amount'));\n $form->textarea('remark', __('Remark'));\n $form->datetime('paid_at', __('Paid at'))->default(date('Y-m-d H:i:s'));\n $form->text('payment_method', __('Payment method'));\n $form->text('payment_no', __('Payment no'));\n $form->text('refund_status', __('Refund status'))->default('pending');\n $form->text('refund_no', __('Refund no'));\n $form->switch('closed', __('Closed'));\n $form->switch('reviewed', __('Reviewed'));\n $form->text('ship_status', __('Ship status'))->default('pending');\n $form->textarea('ship_data', __('Ship data'));\n $form->textarea('extra', __('Extra'));\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new Order);\n\n $form->text('no', 'No');\n $form->number('user_id', 'User id');\n $form->textarea('address', 'Address');\n $form->decimal('total_amount', 'Total amount');\n $form->textarea('remark', 'Remark');\n $form->datetime('paid_at', 'Paid at')->default(date('Y-m-d H:i:s'));\n $form->text('payment_method', 'Payment method');\n $form->text('payment_no', 'Payment no');\n $form->text('refund_status', 'Refund status')->default('pending');\n $form->text('refund_no', 'Refund no');\n $form->switch('closed', 'Closed');\n $form->switch('reviewed', 'Reviewed');\n $form->text('ship_status', 'Ship status')->default('pending');\n $form->textarea('ship_data', 'Ship data');\n $form->textarea('extra', 'Extra');\n\n return $form;\n }",
"public function getTaxRate();",
"protected function form()\n {\n return Form::make(new UserTransferVoucher(), function (Form $form) {\n\n });\n }",
"protected function form()\n {\n $form = new Form(new Order);\n\n $form->text('currency', __('Currency'));\n $form->number('amount', __('Amount'));\n $form->number('state', __('State'));\n $form->number('game_id', __('Game id'));\n $form->number('user_id', __('User id'));\n $form->text('product_id', __('Product id'));\n $form->text('product_name', __('Product name'));\n $form->text('cp_order_id', __('Cp order id'));\n $form->text('callback_url', __('Callback url'));\n $form->text('callback_info', __('Callback info'));\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new Withdrawal());\n\n\n\n return $form;\n }",
"public function getForm ()\n {\n return new QuoteSettingsForm();\n }",
"protected function form()\n {\n $form = new Form(new MethodPrice);\n\n $form->display('id');\n $form->select('entity','Сущность')->options(Pest::all()->pluck('name','id'));\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new Regional());\n\n $form->image('logo', 'Logo');\n $form->text('name', 'Regional');\n $form->text('address', 'Alamat');\n $form->image('image', 'Gambar');\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new Purchase());\n if ($form->isCreating()) {\n $form->select('consumer_id', \"客户\")->options(Consumer::all()->pluck('full_name', 'id'))->required();\n $form->select('house_id', \"购买房源\")->options(House::purchasable()->pluck('readable_name', 'id'))->required();\n }\n $form->datetime('started_at', \"生效日期\");\n $form->datetime('ended_at', \"结束日期\");\n $form->select('sell_type', \"出售方式\")->options(Purchase::$type)->required();\n $form->currency('price', \"成交价格\")->symbol('¥')->required();\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new Drug);\n\n $form->text('street_name', '«Уличное» название');\n $form->text('city', 'Город');\n $form->text('active_substance', 'Активное вещество');\n $form->text('symbol', 'Символ');\n $form->text('state', 'Состояние');\n $form->text('color', 'Цвет');\n $form->text('inscription', 'Надпись');\n $form->text('shape', 'Форма');\n $form->text('weight', 'Вес таблетки');\n $form->text('weight_active', 'Вес действующего вещества');\n $form->text('description', 'Описание');\n $form->text('negative_effect', 'Негативный эффект');\n $form->switch('confirm', 'Подтверждение');\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new LotteryCode());\n\n $form->text('code', __('Code'));\n $form->number('batch_num', __('Batch num'));\n $form->text('prizes_name', __('Prizes name'));\n $form->datetime('valid_period', __('Valid period'))->default(date('Y-m-d H:i:s'));\n $form->datetime('prizes_time', __('Prizes time'))->default(date('Y-m-d H:i:s'));\n $form->text('operator', __('Operator'));\n $form->switch('award_status', __('Award status'));\n\n return $form;\n }",
"public function form()\n {\n $this->number('month', '贷款月数')\n ->min(1)\n ->max(360)\n ->required();\n $this->number('total', '贷款总额')\n ->required();\n $this->rate('rate', '贷款利率')\n ->required();\n $this->radio('type', '还款方式')\n ->options(Loan::$typeMap)\n ->required();\n\n $this->html('等额本金法与等额本息法并没有很大的优劣之分,大部分是根据每个人的现状和需求而定的。');\n $this->html('<a target=\"_blank\" href=\"https://zhuanlan.zhihu.com/p/61140535\">等额本息和等额本金的区别!</a>');\n }",
"protected function form()\n {\n $form = new Form(new Customer);\n\n $form->text('code', '客户编号');\n $form->text('name', '客户名称');\n// $form->text('openid', '客户openid');\n $form->text('contactor', '联系人');\n $form->text('tel', '联系电话');\n $form->email('email', '邮箱');\n $form->text('address', '地址');\n $form->decimal('receivables', '应收账款数字')->default(0.00);\n $form->text('fax', '传真');\n $form->switch('is_delete', '是否删除');\n\n return $form;\n }",
"protected function createComponentTarifForm()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addText('name', 'Jméno:')\r\n\t\t\t->setRequired('Zadej jméno.');\r\n\r\n\t\t$form->addText('apicode', 'API Code:');\r\n\r\n\t\t$form->addText('price', 'Cena:')\r\n\t\t ->addRule(Form::INTEGER, 'Cena musí být číslo')\r\n\t\t\t->setRequired('Zadej cenu.');\r\n\t\t\r\n\t\t$form->addText('description', 'Popis:');\r\n\t\t\t\r\n\t\t$form->addSubmit('save', 'Uložit')\r\n\t\t\t->setAttribute('class', 'default')\r\n\t\t\t->onClick[] = $this->tarifFormSucceeded;\r\n\r\n\t\t$form->addSubmit('cancel', 'Cancel')\r\n\t\t\t->setValidationScope(NULL)\r\n\t\t\t->onClick[] = $this->formCancelled;\r\n\r\n\t\t$form->addProtection();\r\n\t\treturn $form;\r\n\t}",
"protected function form()\n {\n $form = new Form(new Order);\n\n\n\n return $form;\n }",
"public static function create($taxRateData = [])\n {\n $httpClient = self::getHttpClient();\n $merchantId = self::getMerchantId();\n $version = self::VERSION;\n\n $taxRate = $httpClient->post(\"$version/merchants/$merchantId/tax_rates\", [\n 'json' => $taxRateData,\n ]);\n\n return $taxRate;\n }",
"protected function form()\n {\n $form = new Form(new MoneyOut);\n\n $form->display('id', __('ID'));\n $form->display('created_at', __('Created At'));\n $form->display('updated_at', __('Updated At'));\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new Barang());\n\n $form->text('nama', __('Nama'));\n $form->currency('harga', __('Harga Beli'))->symbol('Rp');\n $form->currency('harga_jual', __('Harga Jual'))->symbol('Rp');\n $form->select('satuan_id', __('Satuan id'))->options(\n Satuan::get()->pluck('nama', 'id')\n );\n $form->number('jumlah_unit', __('Jumlah Unit'));\n $form->select('parent_id', 'Parent Barang')->options(\n Barang::where('satuan_id', 1)->get()->pluck('nama', 'id')\n );\n $form->currency('b_pengiriman', __('Pengiriman'))->symbol('Rp');\n $form->currency('b_keamanan', __('Keamanan'))->symbol('Rp');\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new rechargeOnline());\n\n $form->text('accountName', ___('AccountName'));\n $form->text('orderNo', ___('OrderNo'));\n $form->text('rechargeAmount', ___('RechargeAmount'));\n $form->text('rechargeWay', ___('RechargeWay'));\n $form->datetime('rechargeTime', ___('RechargeTime'));\n $form->text('rechargeSource', ___('RechargeSource'));\n $form->text('rechargeStatus', ___('RechargeStatus'));\n $form->text('nickName', ___('NickName'));\n $form->text('rechargeSubsidy', ___('RechargeSubsidy'));\n $form->text('payWay', ___('PayWay'));\n $form->text('orderStatus', ___('OrderStatus'));\n $form->text('orderDesc', ___('OrderDesc'));\n $form->datetime('orderTime', ___('OrderTime'))->default(date('Y-m-d H:i:s'));\n $form->datetime('orderCompleteTime', ___('OrderCompleteTime'))->default(date('Y-m-d H:i:s'));\n\n return $form;\n }",
"private function createMyForm()\n {\n $form = $this->Form();\n\n $form->setElement(\n 'select',\n 'paypalPlusCountries',\n array(\n 'label' => 'Länder bei denen „PayPal PLUS“ angezeigt wird',\n 'value' => array(2),\n 'store' => 'base.Country',\n 'multiSelect' => true,\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP,\n )\n );\n $form->setElement(\n 'boolean',\n 'paypalHidePaymentSelection',\n array(\n 'label' => 'Zahlungsart-Auswahl im Bestellabschluss ausblenden (Shopware 4)',\n 'value' => true,\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP,\n )\n );\n $form->setElement(\n 'text',\n 'paypalPlusDescription',\n array(\n 'label' => 'Zahlungsart-Bezeichnung überschreiben',\n 'value' => 'PayPal, Lastschrift oder Kreditkarte',\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP,\n )\n );\n $form->setElement(\n 'text',\n 'paypalPlusAdditionalDescription',\n array(\n 'label' => 'Zahlungsart-Beschreibung ergänzen',\n 'value' => 'Zahlung per Lastschrift oder Kreditkarte ist auch ohne PayPal-Konto möglich.',\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP,\n )\n );\n }",
"function create($formvars = array(), $table = null, $langue = true) {\n $taxe = new Taxe;\n $formvars['bon_achat_prix'] = $taxe->getPrixHt($formvars['bon_achat_prix'], $formvars['taxe_id']);\n $formvars['bon_achat_prix_min'] = $taxe->getPrixHt($formvars['bon_achat_prix_min'], $formvars['taxe_id']);\n\n return parent::create($formvars, $table, $langue);\n }",
"protected function form()\n {\n $form = new Form(new Cate());\n\n $form->text('name', __('Name'));\n $form->url('link', __('Link'));\n $form->text('thumb', __('Thumb'));\n $form->switch('status', __('Status'));\n $form->number('sort', __('Sort'));\n $form->datetime('createtime', __('Createtime'))->default(date('Y-m-d H:i:s'));\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new ScanRechargeOrder());\n $form->select('scan_recharge_channel_id', __('scan-recharge::order.scan_recharge_channel_id'))\n ->options(ScanRechargeChannel::select('id', 'name')->pluck('name', 'id'))\n ->required();\n $form->text('user_id', __('scan-recharge::order.user_id'))\n ->required()\n ->help(__('scan-recharge::order.user_id_help'));\n $form->currency('amount', __('scan-recharge::order.amount'))->symbol('¥')\n ->default(0)\n ->required();\n $form->textarea('desc', __('scan-recharge::order.desc'))\n ->required()\n ->help(__('scan-recharge::order.desc_help'));\n $form->textarea('reply', __('scan-recharge::order.reply'))\n ->help(__('scan-recharge::order.reply_help'));\n $form->select('status', __('scan-recharge::order.status'))\n ->options(__('scan-recharge::order.status_value'));\n $form->saving(function (Form $form) {\n if ($form->status == 1 && $form->model()->id) {\n RechargeSuccessUserAccountJob::dispatch(ScanRechargeOrder::find($form->model()->id));\n }\n });\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new Code());\n\n $form->mobile('phone', __('Phone'));\n $form->number('code', __('Code'));\n $form->ip('ip', __('IP'));\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new Subscribe());\n\n $form->text('number', __('商品编号'));\n $form->text('name', __('商品名称'));\n $form->text('subtitle', __('商品副标题'));\n $form->multipleImage('images', __('商品图片'))->removable();\n $form->text('price', __('单价'));\n $form->number('quantity', __('库存'));\n $form->text('valid_period', __('有效期'));\n $form->radio('status', __('状态'))->options([\n 1 => \"正常\",\n 10 => \"下架\",\n ])->default(1);\n $form->editor('content','内容');\n $form->number('integral', __('返还碳积分'));\n $form->text('emission', __('返还碳减排'));\n $form->text('place', __('地点'));\n $form->text('maintenance', __('养护'));\n $form->switch('recommend', __('是否推荐'));\n\n return $form;\n }",
"protected function form()\n {\n $chainIds = Chain::query()->pluck(\"title\", \"chainId\")->toArray();\n\n return Form::make(new Pair(), function (Form $form) use ($chainIds) {\n $form->display('id');\n $form->select('fromChain')\n ->options($chainIds)\n ->required();\n $form->select('toChain')->options($chainIds)->required();\n $form->text('name')->required();\n $form->text('title')->required();\n $form->text('decimal')->required()->default(0);\n $form->text('fromToken')\n ->default(\"0x0000000000000000000000000000000000000000\")\n ->placeholder(\"如果是主网币跨出请输入 0x0000000000000000000000000000000000000000\");\n $form->text('toToken')->required();\n $form->text('tokenFee')\n ->placeholder(\"资产本身转账需要扣除的手续费\")\n ->default(0);\n $form->text('bridgeFee')\n ->placeholder(\"资产跨链需要扣除的手续费\")\n ->default(0);\n $form->switch('isMain')->default(0);\n $form->switch('isNative')->default(0);\n $form->switch('isStop')->default(0);\n $form->text('minValue')->default(0);\n $form->text('limit')->default(0);\n $form->image('icon');\n $form->text('sort')->default(0);\n });\n }",
"protected function form()\n {\n $form = new Form(new TaskOrder);\n\n $form->display('ID');\n $form->text('eid',\"快递单号\");\n $form->text('sname','客服名称');\n $form->select('store','快递网点')->options(storedatas(1));\n $form->select('etype','快递公司')->options(edatas());\n $form->display('Created at');\n $form->display('Updated at');\n\n return $form;\n }",
"protected function form()\n {\n $ctl = $this;\n $country = new CountryProvince();\n $form = new Form(new ShipmentTemplatePlan);\n\n $form->tools(function (Form\\Tools $tools) use($ctl) {\n $tools->disableDelete();\n $tools->disableList();\n $tools->disableView();\n\n $tools->append('<div class=\"btn-group pull-right\" style=\"margin-right: 5px\">\n <a href=\"' . route('admin.shipment_template_plans.index', ['tid' => $ctl->template_id]) . '\" class=\"btn btn-sm btn-default\">\n <i class=\"fa fa-backward\"></i> 返回</a>\n </div>');\n\n });\n\n $form->hidden('shipment_template_id')->default(request()->input('tid'));\n $form->listbox('country_provinces', 'To Provinces')->options($country->province_options($this->template_id, $this->id))->rules('required');;\n\n $form->text('base_unit', '首件(/包)以内')->setWidth(2)->default(1);\n $form->currency('base_price', '首件(/包)以内费用')->symbol('$')->default(1.00);\n $form->currency('join_price', '续件(/包)费用')->symbol('$')->default(1.00);\n\n return $form;\n }",
"public function model()\n {\n return Taxrate::class;\n }",
"protected function form()\n {\n return Form::make(new CostProduct(), function (Form $form) {\n $form->disableViewButton();\n $form->display('id')->disable();\n $form->text('amount')->rules('min:0');\n $form->text('product_id')->rules('required|unique:cost_products');\n $form->hidden('status');\n //$form->display('created_at');\n //$form->display('updated_at');\n });\n }",
"protected function form()\n {\n $form = new Form(new Terrace());\n\n $form->image('image', __('平台图片'))->rules('required', ['required' => '平台图片不能为空']);\n $form->text('name', __('平台名称'))->rules('required', ['required' => '平台名称不能为空']);\n $form->text('path', __('外链'))->rules('required', ['required' => '平台外链不能为空']);\n $form->text('notice_info', __('提示语'))->rules('required', ['required' => '平台提示语不能为空']);\n $form->radio('status','状态')->options(['1' => '未推荐', '2'=> '已推荐'])->default(1);\n\n return $form;\n }",
"public function getTaxRate()\n {\n if (is_null($this->taxRate)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_TAX_RATE);\n if (is_null($data)) {\n return null;\n }\n\n $this->taxRate = TaxRateModel::of($data);\n }\n\n return $this->taxRate;\n }",
"public function create()\n {\n return view('tax.create');\n }",
"protected function form()\n {\n $form = new Form(new Direction());\n\n $form->text('name', __(trans('hhx.name')));\n $form->text('intro', __(trans('hhx.intro')));\n $form->image('Img', __(trans('hhx.img')))->move('daily/direction')->uniqueName();\n $form->select('status', __(trans('hhx.status')))->options(config('hhx.status'));;\n $form->number('order_num', __(trans('hhx.order_num')));\n $form->hidden('all_num', __(trans('hhx.all_num')))->default(0.00);\n $form->decimal('stock', __(trans('hhx.stock')));\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new BlogSubscribe);\n $form->email('email', __('邮箱名称'))->creationRules('required|unique:blog_subscribes,email');\n $pass_status = [1 => '审核中', 2 => '审核通过', 3 => '冻结封禁'];\n $form->radio('is_pass', __('审核状态'))->options($pass_status)->default(1);\n $form->hidden('add_mode')->default(2);\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new EnterPlan);\n\n $form->date('enter_time', __('进线时间'))->default(date('Y-m-d'));\n $form->text('a1', __('1'));\n $form->text('a2', __('1A'));\n $form->text('a3', __('2'));\n $form->text('a4', __('2A'));\n $form->text('a5', __('3'));\n $form->text('a6', __('5'));\n $form->text('a7', __('10'));\n $form->text('a8', __('11'));\n $form->text('a9', __('11A'));\n $form->text('a10', __('12'));\n $form->text('a11', __('13'));\n $form->text('a12', __('15'));\n $form->text('a13', __('16'));\n $form->text('a14', __('16A'));\n $form->text('a15', __('17'));\n $form->text('a16', __('18'));\n $form->text('a17', __('19'));\n// $form->text('a18', __('A18'));\n// $form->text('a19', __('A19'));\n// $form->text('a20', __('A20'));\n// $form->text('a21', __('A21'));\n// $form->text('a22', __('A22'));\n// $form->text('a23', __('A23'));\n// $form->text('a24', __('A24'));\n// $form->text('a25', __('A25'));\n// $form->text('a26', __('A26'));\n// $form->text('a27', __('A27'));\n// $form->text('a28', __('A28'));\n// $form->text('a29', __('A29'));\n// $form->text('a30', __('A30'));\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new Book());\n\n $form->select('author_id', __('Author id'))\n ->options(collect(Author::all())->mapWithKeys(function ($v){\n return [$v->id => $v->name];\n }));\n\n $form->text('title', __('Title'));\n $form->textarea('description', __('Description'));\n $form->text('year', __('Year'));\n\n return $form;\n }",
"public function setTariffRateFormula(?string $tariffRateFormula): self\n {\n $this->initialized['tariffRateFormula'] = true;\n $this->tariffRateFormula = $tariffRateFormula;\n\n return $this;\n }",
"private function _getRateTaxRequest(Quote $quote)\n {\n $rateTaxRequest = $this->taxCalculator->getRateRequest(\n $quote->getShippingAddress(),\n $quote->getBillingAddress(),\n $quote->getCustomerTaxClassId(),\n $quote->getStore(),\n $quote->getCustomerId()\n );\n return $rateTaxRequest;\n }",
"protected function form()\n {\n return Form::make(new CouponCode(), function (Form $form) {\n $form->text('name')->rules('required');\n $form->text('code')->rules('nullable|unique:coupon_codes');\n $form->radio('type')->options(CouponCode::$typeMap)->rules('required')->default(CouponCode::TYPE_FIXED);\n $form->text('value')->rules(function ($form) {\n if (request()->input('type') === CouponCode::TYPE_PERCENT) {\n // 如果选择了百分比折扣类型,那么折扣范围只能是 1 ~ 99\n return 'required|numeric|between:1,99';\n } else {\n // 否则只要大等于 0.01 即可\n return 'required|numeric|min:0.01';\n }\n });\n $form->text('total')->rules('required|numeric|min:0');\n $form->text('min_amount')->rules('required|numeric|min:0');\n $form->datetime('start_time');\n $form->datetime('end_time');\n $form->radio('status')->options(['1' => '是','0' => '否'])->default(0);\n \n $form->saving(function (Form $form) {\n if (!$form->code) {\n $form->code = CouponCode::findAvailableCode();\n }\n });\n });\n }",
"public function setTax(?float $tax): self\n {\n $this->initialized['tax'] = true;\n $this->tax = $tax;\n\n return $this;\n }",
"protected function form()\n {\n $form = new Form(new BoxOrder);\n\n\n return $form;\n }",
"public function setTaxRateKey($taxRateKey);",
"protected function form()\n {\n $form = new Form(new TagModel);\n\n $form->text('tag_name', 'Tag name');\n $form->number('tag_id', 'Tag id');\n\n return $form;\n }",
"protected function _prepareForm()\n {\n $model = $this->_coreRegistry->registry('current_amasty_shiprules_rule');\n /** @var \\Magento\\Framework\\ObjectManagerInterface $om */\n $om = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $hlp = $om->get('Amasty\\Shiprules\\Helper\\Data');\n\n /** @var \\Magento\\Framework\\Data\\Form $form */\n $form = $this->_formFactory->create();\n $form->setHtmlIdPrefix('rule_');\n\n $fldRate = $form->addFieldset('rate', array('legend'=> __('Rates')));\n $fldRate->addField('calc', 'select', array(\n 'label' => __('Calculation'),\n 'name' => 'calc',\n 'options' => $hlp->getCalculations(),\n ));\n $fldRate->addField('rate_base', 'text', array(\n 'label' => __('Base Rate for the Order'),\n 'name' => 'rate_base',\n ));\n $fldRate->addField('rate_fixed', 'text', array(\n 'label' => __('Fixed Rate per Product'),\n 'name' => 'rate_fixed',\n ));\n\n $fldRate->addField('weight_fixed', 'text', array(\n 'label' => __('Rate per unit of weight'),\n 'name' => 'weight_fixed',\n 'note' => __(\"Enter the surcharge or discount amount that'll be automatically multiplied by the product's weight to create a shipping rate.\"),\n ));\n\n $fldRate->addField('rate_percent', 'text', array(\n 'label' => __('Percentage per Product'),\n 'name' => 'rate_percent',\n 'note' => __('Percentage of original product cart price is taken, without discounts.'),\n ));\n\n $fldRate->addField('handling', 'text', array(\n 'label' => __('Handling Percentage'),\n 'name' => 'handling',\n 'note' => __('The percentage will be added or deducted from the shipping rate. If it is 10% and UPS Ground is $25, the total shipping cost will be $27.5'),\n ));\n\n $fldRate->addField('rate_min', 'text', array(\n 'label' => __('Minimal rate change'),\n 'name' => 'rate_min',\n 'note' => __('This is the minimal amount, which will be added or deducted by this rule.'),\n ));\n\n $fldRate->addField('rate_max', 'text', array(\n 'label' => __('Maximal rate change'),\n 'name' => 'rate_max',\n 'note' => __('This is the maximum amount, which will be added or deducted by this rule.'),\n ));\n\n $fldRate->addField('ship_min', 'text', array(\n 'label' => __('Minimal rate'),\n 'name' => 'ship_min',\n 'note' => __('Minimal total rate after the rule is applied.'),\n ));\n\n $fldRate->addField('ship_max', 'text', array(\n 'label' => __('Maximal total rate'),\n 'name' => 'ship_max',\n 'note' => __('Maximal total rate after the rule is applied.'),\n ));\n\n\n\n $form->setValues($model->getData());\n $form->addValues(['id'=>$model->getId()]);\n $this->setForm($form);\n return parent::_prepareForm();\n }",
"protected function form() {\n\t\t$form = new Form(new Country);\n\n\t\t// $form->number('continent_id', __('洲 id'));\n\t\t$form->text('cname', __('中文名'));\n\t\t$form->text('name', __('英文名称'));\n\t\t$form->text('full_name', __('英文全称'));\n\t\t$form->text('country_code', __('国家地区代码'));\n\t\t$form->text('full_cname', __('中文全称'));\n\t\t$form->text('lower_name', __('英全称小写'));\n\t\t$form->select('continent_id', '洲名')->options(Continent::where('parent_id', 0)->pluck('cn_name', 'id'));\n\t\t$form->multipleSelect('continentlocation', '地理位置')->options(Continent::where('parent_id', '>', '0')->pluck('cn_name', 'id'));\n\n\t\t$form->textarea('remark', __('概况'));\n\t\t$form->switch('is_island', __('海岛'));\n\t\t$form->switch('active', __('激活'))->default(1);\n\t\t$form->switch('promotion', __('推荐'));\n\n\t\treturn $form;\n\t}",
"public function paymentForm() {\n return new GooglePayForm();\n }",
"protected function form()\n {\n $form = new Form(new Movie());\n\n $form->text('title', __('名字'));\n $form->number('director', __('导演'));\n $form->text('describe', __('简介'));\n $form->number('rate', __('评价'));\n $form->switch('released', __('是否上映'));\n $form->datetime('release_at', __('发行时间'))->default(date('Y-m-d H:i:s'));\n\n return $form;\n }",
"public function create() {\r\n\t\r\n\t$form = new Form();\r\n\t$form->setTranslator($this->translator);\r\n\treturn $form;\r\n }",
"protected function form()\n {\n $form = new Form(new V_MRQC_SSBRModel);\n\n $form->display('id', __('ID'));\n $form->display('created_at', __('Created At'));\n $form->display('updated_at', __('Updated At'));\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new Good);\n\n $form->hidden('group_id')->value(session('group_id'));\n $form->text('name', __('Наименование'));\n $form->text('size', __('Объем/кол-во'));\n $form->decimal('price', __('Цена'))->default(0);\n $form->image('file', 'Фото');\n\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new JournalVoucher);\n\n $form->saved(function(Form $form){\n self::postToLedger($form->model());\n });\n\n $form->date('date', __('Date'))->default(date('Y-m-d'));\n \n \\App\\Helpers\\SelectHelper::buildAjaxSelect(\n $form, \n 'project_id', \n __('Project'), \n 'admin/projects/create', \n '\\App\\Project')\n ->rules('required');\n\n \\App\\Helpers\\SelectHelper::buildAjaxSelect(\n $form, \n 'phase_id', \n __('Phase'), \n 'admin/phases/create', \n '\\App\\Phase')\n ->rules('required');\n\n $form->hasMany('journalVoucherDetails', __('Entries'), function (Form\\NestedForm $form) {\n \n \\App\\Helpers\\SelectHelper::buildAjaxSelect(\n $form, \n 'account_head_id', \n __('Account Head'), \n 'admin/account-heads/create', \n '\\App\\AccountHead')\n ->rules('required');\n \n $form->text('description', __('Description'))->rules('required');\n\n $form->decimal('debit', __('Debit'));\n \n $form->decimal('credit', __('Credit'));\n\n \\App\\Helpers\\SelectHelper::buildAjaxSelect(\n $form, \n 'person_id', \n __('Person (Optional)'), \n '', \n '\\App\\Person');\n\n \\App\\Helpers\\SelectHelper::buildAjaxSelect(\n $form, \n 'property_file_id', \n __('Property File (Optional)'), \n '', \n '\\App\\PropertyFile');\n\n\n })->mode('table');\n\n return $form;\n }",
"public function create_tax_rate( $rate ) {\n\t\t// Create the tax class.\n\n\t\t$this->tax_classes[] = WC_Tax::create_tax_class( \"${rate}percent\", \"${rate}percent\" );\n\n\t\t// Set tax data.\n\t\t$tax_data = array(\n\t\t\t'tax_rate_country' => '',\n\t\t\t'tax_rate_state' => '',\n\t\t\t'tax_rate' => $rate,\n\t\t\t'tax_rate_name' => \"Vat $rate\",\n\t\t\t'tax_rate_priority' => 1,\n\t\t\t'tax_rate_compound' => 0,\n\t\t\t'tax_rate_shipping' => 1,\n\t\t\t'tax_rate_order' => 1,\n\t\t\t'tax_rate_class' => \"${rate}percent\",\n\t\t);\n\t\treturn WC_Tax::_insert_tax_rate( $tax_data );\n\t}",
"protected function form()\n {\n $form = new Form(new Reservation());\n\n $form->select('user_id',__('Pet Owner'))->options(User::all()->pluck('name','id'))->rules('required');\n $form->select('pet_id',__('Pet Name'))->options(Pet::all()->pluck('name','id'))->rules('required');\n $form->select('service_id',__('Service'))->options(Service::all()->pluck('name','id'));\n $form->datetime('date', __('Date'))->default(date('Y-m-d H:i:s'))->rules('required|min:3');\n $form->select('status',__('Status'))->options([\n 'pending' => 'Pending',\n 'completed' => 'completed',\n 'canceled' => 'Canceled',\n ])->default('pending');\n\n return $form;\n }",
"public function DiscountForm()\n {\n $fields = new FieldList(\n TextField::create(\n \"DiscountCode\",\n _t(\"Checkout.DiscountCode\", \"Discount Code\")\n )->setAttribute(\n \"placeholder\",\n _t(\"Checkout.EnterDiscountCode\", \"Enter a discount code\")\n )\n );\n\n $actions = new FieldList(\n FormAction::create('doAddDiscount', _t('Checkout.Add', 'Add'))\n ->addExtraClass('btn')\n ->addExtraClass('btn-blue btn-info')\n );\n\n $form = Form::create($this, \"DiscountForm\", $fields, $actions)\n ->addExtraClass(\"forms\");\n\n $this->extend(\"updateDiscountForm\", $form);\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new UsersOpenclose);\n\n $form->text('srvkey', __('srvkey'));\n $form->text('KtvBoxid', __('机器码'));\n $form->datetime('opendate', __('开房时间'))->default(date('Y-m-d H:i:s'));\n $form->datetime('closedate', __('关房时间'))->default(date('Y-m-d H:i:s'));\n $form->select('feesmode', __('收费模式'))->options([0=>'非扫码收费',1=>'扫码收费']);\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new StockProduct);\n\n // $form->number('product_id', __('Product id'));\n $grouped = Product::query()->pluck('product_name', 'id')->all();\n $form->select('product_id', __('Product Id'))->options($grouped);\n\n $form->number('moq', __('OEM Moq'));\n $form->number('quantity', __('In Stock Quantity'));\n $form->decimal('price', __('Selling Price'));\n $form->text('note', __('Note'));\n\n return $form;\n }",
"public function __construct(Money $rate)\n {\n $this->rate = $rate;\n }",
"protected function form()\n {\n $form = new Form(new userWhitelist());\n\n $form->text('accountId', ___('AccountId'));\n $form->text('accountName', ___('AccountName'));\n $form->text('nickName', ___('NickName'));\n\n return $form;\n }",
"public function getTax(): Tax {\n\t\t\treturn Tax::fromArray( $this->value );\n\t\t}",
"protected function form()\n {\n return new Form(new Attention);\n }",
"protected function form()\n {\n $form = new Form(new Enseignant());\n\n $form->text('matricule', __('Matricule'));\n $form->text('nom', __('Nom'));\n $form->text('postnom', __('Postnom'));\n $form->text('prenom', __('Prenom'));\n $form->text('sexe', __('Sexe'));\n $form->text('grade', __('Grade'));\n $form->text('fonction', __('Fonction'));\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new Emailtpls());\n\n $form->text('tpl_name', __('Tpl name'));\n $form->textarea('tpl_content', __('Tpl content'));\n $form->text('tpl_token', __('Tpl token'));\n $form->footer(function ($footer) {\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n });\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`查看`按钮\n $tools->disableView();\n });\n return $form;\n }",
"protected function form()\n {\n $categories = Category::get()->pluck('name', 'id')->toArray();\n\n $form = new Form(new Plan);\n\n $form->select(Plan::CATEGORY_ID, 'Категория')\n ->options($categories)\n ->default(request()->input(Plan::CATEGORY_ID))\n ->required();\n\n $form->text(Plan::COUNT, __('Количество'))->required();\n $form->month('month', __('Месяц'))->default(now()->month)->required();\n $form->year('year', __('Год'))->default(now()->year)->required();\n\n $form->footer(function ($footer) {\n\n // disable `View` checkbox\n $footer->disableViewCheck();\n\n // disable `Continue editing` checkbox\n $footer->disableEditingCheck();\n\n // disable `Continue Creating` checkbox\n $footer->disableCreatingCheck();\n\n });\n\n return $form;\n }",
"public function getExternalTaxRate()\n {\n return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate;\n }",
"public function validator()\n {\n\n return TaxrateValidator::class;\n }",
"public function init_form_fields() {\n $this->form_fields = require( dirname(__FILE__) . '/../class/midtrans-admin-settings.php' );\n // Currency conversion rate if currency is not IDR\n if (get_woocommerce_currency() != 'IDR') {\n $this->form_fields['to_idr_rate'] = array(\n 'title' => __(\"Current Currency to IDR Rate\", 'midtrans-woocommerce'),\n 'type' => 'text',\n 'description' => 'The current currency to IDR rate',\n 'default' => '10000',\n );\n }\n }",
"protected function form()\n {\n $form = new Form(new Dictionary());\n $form->disableViewCheck();\n $form->disableEditingCheck();\n $form->disableCreatingCheck();\n\n\n $form->select('type', __('Type'))->options(Dictionary::TYPES);\n $form->text('option', __('Title'))->required();\n $form->text('slug', __('Slug'))->rules('nullable|regex:/(\\w\\d\\_)*/', [\n 'regex' => 'Только латинские буквы и знаки подчеркивания',\n ]);\n $form->text('alternative', __('Alternative'));\n $form->switch('approved', __('Approved'))->default(1);\n $form->number('sort', __('Sort'));\n\n $form->saving(function (Form $form) {\n if ($form->slug === null) {\n $form->slug = Str::slug($form->option);\n }\n });\n return $form;\n }",
"function form() {\n\tglobal $cert_amt_tbl;\n\t\n\t$certificates_form = table_form_header('* indicates required field');\n\t$certificates_form .= table_form_field('Sort:','<input name=\"crtamt_sort\" type=\"text\" size=\"5\" maxlength=\"12\" value=\"'.$cert_amt_tbl->crtamt_sort.'\">');\n\t$certificates_form .= table_form_field('<span class=\"required\">*Discount Amount:</span>','<input name=\"discount_amount\" type=\"text\" size=\"5\" maxlength=\"15\" value=\"'.$cert_amt_tbl->discount_amount.'\">');\n\t$certificates_form .= table_form_field('Discount Cost:','<input name=\"cost\" type=\"text\" size=\"5\" maxlength=\"12\" value=\"'.$cert_amt_tbl->cost.'\">');\n\t$certificates_form .= table_form_field('Min Spend Amounts:','<input name=\"min_spend_amts\" type=\"text\" size=\"30\" value=\"'.$cert_amt_tbl->min_spend_amts.'\">');\n\t$certificates_form .= table_span_form_field('<center><input name=\"id\" type=\"hidden\" value=\"'.$cert_amt_tbl->id.'\"><input name=\"submit\" type=\"submit\" value=\"Submit\"></center>');\n\t\n return $certificates_form;\n }",
"protected function form()\n {\n $form = new Form(new Goods);\n\n $form->text('title', trans('admin.title'))->required()->rules('required');\n $form->text('slogan', trans('admin.slogan'))->required()->rules('required');\n $form->text('name', trans('admin.name'))->required()->rules('required');\n $form->decimal('price', trans('admin.price'))->required()->rules('required');\n $form->display('created_at', trans('admin.created_at'));\n $form->display('updated_at', trans('admin.updated_at'));\n return $form;\n }",
"public function get_donation_form() {\r\n\t\tif ( ! isset( $this->donation_form ) ) {\r\n\r\n\t\t\t$form_class = apply_filters( 'charitable_donation_form_class', 'Charitable_Donation_Form', $this );\r\n\t\t\t\r\n\t\t\t$this->donation_form = new $form_class( $this );\r\n\t\t}\r\n\r\n\t\treturn $this->donation_form;\r\n\t}",
"protected function createComponentDeleteRate()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n\t\t$form->addSubmit('cancel', 'Storno');\r\n\t\t$form->onSuccess[] = callback($this, 'deleteRateSubmitted');\r\n\t\t$form->addProtection(self::MESS_PROTECT);\r\n\t\treturn $form;\r\n\t}",
"protected function form()\n {\n $form = new Form(new Activity());\n\n $form->text('name', __('Name'));\n $form->image('image', __('Image'));\n $form->text('intro', __('Intro'));\n $form->UEditor('details', __('Details'));\n $form->datetime('start_at', __('Start at'))->default(date('Y-m-d H:i:s'));\n $form->datetime('end_at', __('End at'))->default(date('Y-m-d H:i:s'));\n $form->text('location', __('Location'));\n $form->decimal('fee', __('Fee'))->default(0.00);\n $form->number('involves', __('Involves'));\n $form->number('involves_min', __('Involves min'));\n $form->number('involves_max', __('Involves max'));\n $form->switch('status', __('Status'));\n $form->text('organizers', __('Organizers'));\n $form->number('views', __('Views'));\n $form->switch('is_stick', __('Is stick'));\n\n return $form;\n }",
"public function QuestionnaireForm(){\n\t\t$fields = new FieldList();\n\n\t\t$options = array(\n\t\t\t'Information' => \"I'm trying to find a specific piece of information\",\n\t\t\t'Question' => \"I'm looking for the answer to a particular question\",\n\t\t\t'Topic' => \"I'm researching a particular topic\",\n\t\t\t\"I'm just browsing\"\n\t\t\t);\n\n\t\t$fields->push(new OptionsetField('Purpose', 'What is the purpose of your visit to the IGF website today?', $options));\n\n\t\t// $fields->push()\n\n\t\t$fields->push($field = new TextAreaField('Information', 'What information are you looking for?'));\n\t\t$fields->push($field = new TextAreaField('Question', 'What question are you trying to find an answer to?'));\n\t\t$fields->push($field = new TextAreaField('Topic', 'What topic are you researching?'));\n\t\t$fields->push($field = new TextAreaField('Research', 'What is the purpose of your research?'));\n\t\t\n\n\t\t$actions = new FieldList(new FormAction('submit', 'Next'));\n\n\t\treturn new Form($this, 'QuestionnaireForm', $fields, $actions);\n\t}",
"protected function form()\n {\n $form = new Form(new Procurement);\n\n $form->number('u_id', 'U id');\n $form->number('brand', 'Brand');\n $form->number('type', 'Type');\n $form->number('models', 'Models');\n $form->number('material', 'Material');\n $form->decimal('area', 'Area');\n $form->radio('status', '审核')->options(['0' => '待审核', '1'=> '通过','2'=>'未通过'])->default('0');\n $form->number('room_city', 'Room city');\n $form->text('address', 'Address');\n $form->number('brick_time', 'Brick time')->default(1);\n $form->text('images', 'Images');\n $form->number('ctime', 'Ctime');\n $form->number('utime', 'Utime');\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new Setting());\n\n $form->decimal('member_fee', __('会员年费'))->required();\n $form->decimal('task_rate', __('任务佣金抽成比例'))->required()->help('将扣除对应比例,比例范围0-1');\n $form->tools(function (Form\\Tools $tools) {\n\n // 去掉`列表`按钮\n $tools->disableList();\n\n // 去掉`删除`按钮\n $tools->disableDelete();\n\n // 去掉`查看`按钮\n $tools->disableView();\n });\n\n $form->footer(function ($footer) {\n\n // 去掉`重置`按钮\n $footer->disableReset();\n\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n\n //保存后回调\n $form->saved(function (Form $form) {\n $success = new MessageBag([\n 'title' => '提示',\n 'message' => '保存成功',\n ]);\n\n return back()->with(compact('success'));\n });\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new Task);\n\n $form->text('eid', 'Eid');\n $form->text('store', 'Store');\n $form->text('etype', 'Etype');\n $form->text('uid', 'Uid');\n $form->text('uname', 'Uname');\n $form->text('qq', 'Qq');\n $form->number('qtype', 'Qtype');\n $form->number('times', 'Times')->default(1);\n $form->textarea('content', 'Content');\n $form->text('deadline', 'Deadline');\n $form->file('file', 'File');\n $form->number('isok', 'Isok');\n $form->number('istag', 'Istag');\n $form->text('sid', 'Sid');\n $form->text('sname', 'Sname');\n $form->text('score', 'Score');\n\n return $form;\n }",
"public function getTaxRatesSelectConfig($formValues)\n {\n $config = [\n 'is_entity_editable' => true,\n 'selected_values' => isset($formValues['tax_rate']) ? $formValues['tax_rate'] : []\n ];\n\n return $config;\n }",
"protected function form()\n {\n $form = new Form(new Category());\n \n $form->text('erp_id', __('ID(ERP用)'));\n $form->select('parent_id', __('中分類'))->options(\n\n Category::Mid()->pluck('name', 'id')\n\n )->required();\n \n $form->text('name', __('小分類名稱'));\n $form->hidden('type', __('Type'))->default(3);\n\n return $form;\n }",
"public function create()\n {\n $title = \"New Service Rates Form\";\n return view('rates.create', compact('title') );\n }",
"protected function newReviewListForm() {\n $form = new ReviewListForm(\n $this->logger,\n $this->dateFormatter,\n $this->urlGenerator,\n $this->reviewApi,\n $this->agencyBranchService\n );\n $form->setStringTranslation($this->translation);\n\n $request_stack = new RequestStack();\n $request_stack->push(new Request());\n $form->setRequestStack($request_stack);\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new BorrowComment);\n\n $form->text('shared_book_name', __('Shared book name'));\n $form->text('student_name', __('Student name'));\n $form->image('student_avatar', __('Student avatar'));\n $form->textarea('content', __('Content'));\n\n return $form;\n }",
"public function getExternalTaxRate();",
"protected function form()\n {\n return Form::make(new Order(), function (Form $form) {\n $form->display('id');\n $form->text('order_no');\n $form->text('user_id');\n $form->text('address');\n $form->text('total_amount');\n $form->text('remark');\n $form->text('paid_at');\n $form->text('payment_method');\n $form->text('payment_no');\n $form->text('refund_status');\n $form->text('refund_no');\n $form->text('closed');\n $form->text('reviewed');\n $form->text('ship_status');\n $form->text('ship_data');\n $form->text('extra');\n\n $form->display('created_at');\n $form->display('updated_at');\n });\n }",
"protected function createRateModel()\n {\n $class = '\\\\'.ltrim($this->rateModel, '\\\\');\n $model = new $class();\n return $model;\n }",
"protected function form()\n {\n $form = new Form(new NewEnergy());\n\n $form->number('user_id', __('User id'));\n $form->text('car_id', __('车辆ID'));\n $form->image('start_mileage', __('开始'));\n $form->image('end_mileage', __('介绍'));\n $form->decimal('mileage', __('里程 / 时间'));\n $form->select('type', __('类型'))->options([\n \"1\" => \"电动车\",\n \"2\" => \"燃油车\",\n ]);\n $form->select('status', __('状态'))->options([\n \"1\" => \"审核中\",\n \"10\" => \"审核拒绝\",\n \"20\" => \"审核撤销\",\n \"30\" => \"审核通过\"\n ]);\n $form->text('remark', __('Remark'));\n\n return $form;\n }",
"public function create()\n {\n return view('admin.rates.add');\n }",
"protected function form()\n {\n $form = new Form(new User());\n\n $form->text('name', __('Name'));\n $form->email('email', __('Email'));\n $form->datetime('email_verified_at', __('Email verified at'))->default(date('Y-m-d H:i:s'));\n $form->password('password', __('Password'));\n $form->text('remember_token', __('Remember token'));\n $form->decimal('point', __('Point'))->default(0.000);\n $form->switch('status', __('field.status'));\n\n return $form;\n }"
] | [
"0.675483",
"0.60450006",
"0.60081",
"0.59609365",
"0.5952224",
"0.5837575",
"0.5834054",
"0.5782088",
"0.5738462",
"0.5738112",
"0.57292634",
"0.57201415",
"0.56973237",
"0.5658746",
"0.5651545",
"0.55983025",
"0.55938613",
"0.5587249",
"0.5579244",
"0.5572768",
"0.5567635",
"0.5544354",
"0.5536361",
"0.5533594",
"0.553185",
"0.5516608",
"0.5497629",
"0.5483562",
"0.54680914",
"0.5459718",
"0.5456886",
"0.5447547",
"0.54098433",
"0.5404519",
"0.5390889",
"0.5368837",
"0.5367759",
"0.5340328",
"0.5334987",
"0.52991146",
"0.5297827",
"0.5283943",
"0.5269258",
"0.526785",
"0.5264252",
"0.5262577",
"0.52541494",
"0.5252224",
"0.5234372",
"0.52311987",
"0.5227616",
"0.5216183",
"0.52118176",
"0.5204594",
"0.5199419",
"0.51873106",
"0.51762927",
"0.51422334",
"0.5140733",
"0.51371026",
"0.5126144",
"0.51257855",
"0.51245797",
"0.5123766",
"0.512112",
"0.5108665",
"0.51007503",
"0.5088829",
"0.5074652",
"0.50733155",
"0.5064512",
"0.50516975",
"0.5044678",
"0.503613",
"0.50349516",
"0.50229704",
"0.5018621",
"0.50183684",
"0.50106287",
"0.49930683",
"0.4989505",
"0.49843678",
"0.49835682",
"0.49795416",
"0.49763286",
"0.49718168",
"0.4950783",
"0.49313617",
"0.49303088",
"0.49241424",
"0.4922628",
"0.49207214",
"0.49178928",
"0.49146524",
"0.49117303",
"0.49077225",
"0.49065495",
"0.49044818",
"0.48952886",
"0.48922163",
"0.48919687"
] | 0.0 | -1 |
Determines if the tax rate already exists. | public function exists($id, array $element) {
return (bool) $this->queryFactory
->get('commerce_tax_rate')
->condition('id', $element['#field_prefix'] . $id)
->execute();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function newTaxTableExists() {\n \n static $alreadyChecked = false;\n static $tableExists = false; // remember result of check if already done (prevents multiple checks per script execution)\n \n if ($alreadyChecked == false) {\n $tableExists = tx_pttools_div::dbTableExists($this->getTableName('BHSTEUER'), $this->gsaDbObj);\n $alreadyChecked = true;\n }\n \n return $tableExists; \n \n }",
"public function hasRate() : bool\n {\n return isset($this->rate);\n }",
"public function oldTaxTableExists() {\n \n static $alreadyChecked = false;\n static $tableExists = false; // remember result of check if already done (prevents multiple checks per script execution)\n \n if ($alreadyChecked == false) {\n $tableExists = tx_pttools_div::dbTableExists($this->getTableName('STEUER'), $this->gsaDbObj);\n $alreadyChecked = true;\n }\n \n return $tableExists; \n \n }",
"public function hasTax()\r\n {\r\n return $this->item->getParentObject()->getOrder()->getProxy()->hasTax();\r\n }",
"public function hasTaxes()\n {\n return !empty($this->taxes);\n }",
"public function hasRates()\n {\n return $this->getInvoker()->getNbRates() > 0;\n }",
"function IfExists($ratecode) {\r\n $conn = conn();\r\n $sql = \"SELECT * FROM `paymentrates` WHERE RateCode='$ratecode'\";\r\n $stmt = $conn->prepare($sql);\r\n $stmt->execute();\r\n $result = $stmt->fetchAll();\r\n if (!empty($result)) {\r\n return 1;\r\n }\r\n return 0;\r\n $conn = NULL;\r\n }",
"public function issetTaxAmount($index)\n {\n return isset($this->taxAmount[$index]);\n }",
"protected function isAutomaticTaxEnabled()\n {\n return Cashier::$calculatesTaxes;\n }",
"function hasVAT( )\n {\n if ( $this->HasTax == 1 )\n return true;\n else\n return false;\n }",
"function exists()\n {\n return false;\n }",
"public function needNewRequest($rate)\n {\n $k = $this->getKey($rate);\n if (empty($this->adjustments[$k])) {\n return false;\n }\n\n return (count($this->adjustments[$k]['ids']));\n }",
"public static function IncludesTax()\n {\n if (class_exists('Catalogue')) {\n return Catalogue::config()->price_includes_tax;\n }\n\n return true;\n }",
"function exists() {\n\t\tif ($this->exists) return true;\n\t\treturn false;\n\t}",
"protected function hasExceptionTaxes()\n {\n return DataObject::get_one(\n GSTTaxModifierOptions::class,\n ['DoesNotApplyToAllProducts' => 1]\n ) ? false : true;\n }",
"public function issetApplicableTradeTax($index)\n {\n return isset($this->applicableTradeTax[$index]);\n }",
"public static function runPayrollStatus(){\n if(TaxPerson::first()){\n return true;\n }\n else{\n return false;\n }\n }",
"public function addTaxRate()\n {\n $this->taxRates[] = [\n 'id' => null,\n 'name' => null,\n 'priority' => count($this->taxRates) + 1,\n 'amounts' => $this->taxClasses->map(function ($taxClass) {\n return [\n 'id' => null,\n 'tax_class_id' => $taxClass->id,\n 'tax_class_name' => $taxClass->name,\n 'percentage' => 0,\n ];\n })->toArray(),\n ];\n }",
"public function isIncludingTax()\n {\n $session = Mage::getSingleton(\"core/session\", array(\"name\"=>\"frontend\"));\n $showincl = $session->getData(\"inclexcltaxswitch_showincl\");\n $val = 1;\n \n if ( $showincl===true ) {\n $val = 2;\n }elseif ( $showincl===false ) {\n $val = 1;\n }else{\n $val = Mage::getStoreConfig('tax/display/type');\n }\n \n if (!$this->getData('is_including_tax')) {\n $this->setData('is_including_tax', $val);\n }\n\n return $this->getData('is_including_tax');\n }",
"function exists(){\n\t\t$sql = 'SELECT barcode FROM barcodes\n\t\t\t\tWHERE barcode = \"'.$this->code.'\"';\n\t\t$this->DB->query($sql);\n\t\tif(!$this->DB->isEmpty())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->error = 'The barcode <strong>'.$this->code.'</strong> was not properly pre-registered. Please put this wristband aside, and distribute a new one.';\n\t\t\treturn false;\n\t\t}\n\t}",
"function CheckIfCurrencyExists($currency_code) {\n $query = \"SELECT * FROM conversion_rates WHERE currency='$currency_code';\";\n $result = mysqli_num_rows($GLOBALS['conn']->query($query));\n\n return ($result != 0) ? true : false;\n }",
"private function displayPriceIncludingTax()\n {\n try {\n $product = $this->requisitionListItemProduct->getProduct($this->getItem());\n $adjustment = $product->getPriceInfo()->getAdjustment(\\Magento\\Tax\\Pricing\\Adjustment::ADJUSTMENT_CODE);\n return $adjustment->isIncludedInDisplayPrice();\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n return false;\n }\n }",
"function is_taxable() {\n\t\tif (isset($this->data['tax_status']) && $this->data['tax_status']=='taxable') return true;\n\t\treturn false;\n\t}",
"public function exists()\n {\n return false;\n }",
"public function hasNcbiTaxonId(){\n return $this->_has(7);\n }",
"function check_term($term, $tax) {\n\t$term_link = get_term_link( $term, $tax );\n \n // If there was an error, insert term.\n if ( is_wp_error( $term_link ) ) {\n\t\twp_insert_term($term, $tax);\n\t}\n}",
"public function is_tax($taxonomy = '', $term = '')\n {\n }",
"function term_exists( $term, $taxonomy = '', $parent = 0 ) {\n\t\tif ( function_exists( 'term_exists' ) ) { // 3.0 or later\n\t\t\treturn term_exists( $term, $taxonomy, $parent );\n\t\t} else {\n\t\t\treturn is_term( $term, $taxonomy, $parent );\n\t\t}\n\t}",
"protected function isTieringNew(Request $request)\n {\n # regardless of what's requested, we can determine that\n # if the rating is requested and there is no tier, we need to create it\n return $request->is_tiering_needed and empty($request->tier_id);\n }",
"public function hasAmount(): bool\n {\n return isset($this->amount);\n }",
"public static function exists(string $symbol): bool;",
"public function isRecurring()\n {\n return $this->getIsRecurring() == '1';\n }",
"public function isLowestTaxMultipleAssignmentMethod()\n {\n return ($this->getMultipleAssignmentMethodCode() == 'lowest_tax') ? true : false;\n }",
"protected function getTaxType($rates)\n {\n $taxType = $this\n ->getMockBuilder('CommerceGuys\\Tax\\Model\\TaxType')\n ->getMock();\n $taxType->expects($this->any())\n ->method('getRates')\n ->will($this->returnValue($rates));\n\n return $taxType;\n }",
"public function isExists(){\n\t\treturn file_exists($this->getFullName());\n\t}",
"public function hasNcbiTaxonId(){\n return $this->_has(4);\n }",
"public function hasAmount()\n {\n return isset($this->amount);\n }",
"function agst_region_tax_check()\n{\n\t//check request and session\n\tif(isset($_REQUEST['taxregion']))\n\t{\n\t\t//update the session var\n\t\t$_SESSION['taxregion'] = $_REQUEST['taxregion'];\t\n\t\t\n\t\t//not empty? setup the tax function\n\t\tif(!empty($_REQUEST['taxregion']))\n\t\t\tadd_filter(\"pmpro_tax\", \"agst_pmpro_tax\", 10, 3);\n\t}\n\telseif(!empty($_SESSION['taxregion']))\n\t{\n\t\t//add the filter\n\t\tadd_filter(\"pmpro_tax\", \"agst_pmpro_tax\", 10, 3);\n\t}\n\telse\n\t{\n\t\t//check state and country\n\t\tif(!empty($_REQUEST['bcountry']))\n\t\t{\t\t\t\n\t\t\t$bcountry = trim(strtolower($_REQUEST['bcountry']));\n\t\t\tif($bcountry == \"au\")\n\t\t\t{\n\t\t\t\t//billing address is in AU\n\t\t\t\tadd_filter(\"pmpro_tax\", \"agst_pmpro_tax\", 10, 3);\n\t\t\t}\n\t\t}\n\t}\n}",
"function IfSpecialExists($ratecode, $holidaycode) {\r\n $conn = conn();\r\n $sql = \"SELECT * FROM `specialrates` WHERE `RateCode`='$ratecode' AND `HolidayCode`='$holidaycode'\";\r\n $stmt = $conn->prepare($sql);\r\n $stmt->execute();\r\n $result = $stmt->fetchAll();\r\n if (!empty($result)) {\r\n return 1;\r\n }\r\n return 0;\r\n $conn = NULL;\r\n }",
"public function hasDiscount()\n {\n $time = new \\DateTime('now');\n $today = $time->format('Y-m-d');\n\n $discounts = \\common\\models\\Discounts::find()\n ->where(['iid' => $this->id])\n ->andWhere(['<=', 'start_at', $today])\n ->andWhere(['>', 'stop_at', $today])\n ->all();\n\n if (count($discounts) === 1) {\n return true;\n } else {\n return false;\n };\n \n }",
"public function exists()\n {\n }",
"public function exists()\n {\n }",
"public function checkIfTermExist($term_name){\n\t\t\t$query = $this->connection()->prepare(\"SELECT name FROM termz WHERE name='$term_name'\");\n\t\t\t$query->execute();\n\t\t\treturn $query->rowCount();\n\t\t}",
"public function is_transaction_exist() {\n\n $transaction = $this->ci->generic_model->retrieve_one(\n \"transaction_general\",\n array(\n \"package_id\" => $this->ci->input->post(\"package_id\"),\n \"package_type\" => $this->ci->input->post(\"package_type\")\n )\n );\n\n if ($transaction) { // there exists an object.\n return TRUE;\n } else { // object is not found.\n $this->ci->form_validation->set_message(\"is_transaction_exist\", \"Paket belum dibeli.\");\n return FALSE;\n }\n }",
"public function canApplyTax(){\n\t\tif(Mage::getStoreConfig(self::XML_LOGICBORKER_EDI_APPLY_TAX)==0){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public function exists(){\n\t\treturn ($this->count() > 0);\n\t}",
"function IfExists($travelcode) {\r\n $conn = conn();\r\n $sql = \"SELECT * FROM `travelrates` WHERE TravelCode='$travelcode'\";\r\n $stmt = $conn->prepare($sql);\r\n $stmt->execute();\r\n $result = $stmt->fetchAll();\r\n if (!empty($result)) {\r\n return 1;\r\n }\r\n return 0;\r\n $conn = NULL;\r\n }",
"private function does_publication_exist() : bool {\n\t\t$publication = get_term( $this->publication, 'publication' );\n\n\t\tif ( ! $publication || is_wp_error( $publication ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->publication_term = $publication;\n\n\t\treturn true;\n\t}",
"public function exists()\n {\n return true;\n }",
"static function recordExists($index)\n {\n global $objDatabase;\n\n if (empty($index)) return false;\n list($code, $customer_id) = explode('-', $index);\n if (empty($code)) return false;\n $query = \"\n SELECT 1\n FROM `\".DBPREFIX.\"module_shop\".MODULE_INDEX.\"_discount_coupon`\n WHERE `code`='\".addslashes($code).\"'\n AND `customer_id`=\".intval($customer_id);\n $objResult = $objDatabase->Execute($query);\n if (!$objResult) {\n // Failure! Assume that the Coupon exists.\n return true;\n }\n if ($objResult->EOF) {\n // None found\n return false;\n }\n // Exists\n return true;\n }",
"public function exists(): bool\n {\n return ! empty($this->awb);\n }",
"public function keyExists($key) {\n return array_key_exists($key, $this->_ratings);\n }",
"public function isUnitValueTaxed(): bool\n\t{\n\t\treturn $this->unitValueIsTaxed;\n\t}",
"public function exists($template)\n {\n return $this->plates->exists($template);\n }",
"public function Exists();",
"protected function exists() {}",
"public function checkStickerExist()\n {\n if (!file_exists($this->stickerDir . $this->getDriverLogoImageName())) {\n return false;\n }\n\n return true;\n }",
"public function hasDiscount(){\n return $this->_has(9);\n }",
"public function exists()\r\n {\r\n }",
"public function isExists()\n\t{\n\t\treturn $this->storage->isExists() && $this->dictionary->isExists();\n\t}",
"public function isRecurring() {\n\t\treturn $this->isRecurring;\n\t}",
"public function getTaxRate();",
"public function is_duplicate() {\n\n\t\t$post = $this->input->post();\n\n\t\t// Filter by name.\n\t\t$this->db->where( 'name', trim( $post['name'] ) );\n\n\t\t// Filter by church.\n\t\t$this->db->where( 'church', (int) $post['church'] );\n\n\t\t// Filter by age.\n\t\tif ( ! empty( $post['age'] ) ) {\n\t\t\t$this->db->where( 'age', (int) $post['age'] );\n\t\t}\n\n\t\t// Filter by gender.\n\t\tif ( ! empty( $post['gender'] ) ) {\n\t\t\t$this->db->where( 'gender', $post['gender'] );\n\t\t}\n\n\t\t$query = $this->db->get( 'registration' );\n\n\t\treturn $query->num_rows() > 0;\n\n\t}",
"public function hasTiers()\n {\n return (\\count($this->arrTiers) > 1);\n }",
"public function hasNewPrice(){\n return $this->_has(16);\n }",
"public function exists() {\n\t\treturn !isset($userData);\n\t}",
"private function _checkTXNTableExists() {\n $curTable = readSetting( $this->settings['DataFile'], 'txnTable' );\n $txnTable = $this->settings['txnTable'];\n $rVal = false;\n\n // If the Transaction Table is Not the Same as Expected, then Create It\n if ( $curTable != $txnTable ) {\n $sqlStr = $this->_readTXNTableDefinitions();\n if ( $sqlStr ) {\n $rslt = doSQLExecute( $sqlStr );\n }\n\n // Confirm the Table Exists, and Save the TXN Name if Appropriate\n if ( $this->_confirmTXNTables() ) {\n $rVal = saveSetting( $this->settings['DataFile'], 'txnTable', $txnTable );\n writeNote( \"Saved Transaction Table Record: \" . BoolYN($rVal) );\n }\n }\n\n // Return the Boolean Response\n return $rVal;\n }",
"public function exists(): bool;",
"public function exists(): bool;",
"public function exists(): bool;",
"public function alreadyExists()\n\t{\n\t\tif(file_exists($this->getSavePath())) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"function get_tax_number()\n {\n if (!empty($this->business_center_id)) {\n $tax_number = $this->db->query_field(DISTRIBUTOR_TAX_NUMBER_SQL, array($this->business_center_id));\n if (!empty($tax_number)) {\n return $tax_number;\n }\n }\n return false;\n }",
"public static function hasRecurringItem()\n {\n $items = Cart::getCart();\n foreach($items as $key => $item) {\n $object = Template::loadItemByType($item['type'], $item['item_id']);\n if($object->recurring) return true;\n }\n \n return false;\n }",
"public function getFileExists()\n {\n return Yii::$app->storage->fileSystemExists($this->filter_id . '_' . $this->file->name_new_compound);\n }",
"public function nrExists ($nr) {\n\n return $this->fetchAll(\n $this->select()\n ->where(\"`nr` = ?\", $nr)\n )->count() > 0;\n\n }",
"public function is_recurring(){\n\t\treturn ! empty( $this->payment['recurring_period'] );\n\t}",
"public static function symbolExists($symbol) {\n\t\t$query = Connection::getFpdo()->from('symbols')->where('value', $symbol)->execute();\n\t\tif ($query->fetchAll()) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function hasTiers()\n {\n return (count($this->arrTiers) > 1);\n }",
"public function addTaxrate($taxrate)\n {\n if ((is_numeric($taxrate)) && ($taxrate > 0) && ($taxrate < 1)) {\n $this->_taxrate = $taxrate;\n }\n }",
"public static function isMissing($_path)\r\n {\r\n return !$this->exists($_path);\r\n }",
"function isPhoneExists($cellphone)\n {\n \n $query=$this->db->query(\"SELECT * FROM xl_account WHERE cellphone='{$cellphone}' AND register_user=1\");\n\n if ($query->num_rows()>0) {\n #if exist return true\n return TRUE;\n }\n\n return FALSE; \n }",
"public function checkForAnuallyRecurring()\n {\n // not supported\n }",
"function dd_in_tax($tax, $term, $_post = NULL) {\n // if neither tax nor term are specified, return false\n if ( !$tax || !$term ) { return FALSE; }\n // if post parameter is given, get it, otherwise use $GLOBALS to get post\n if ( $_post ) {\n $_post = get_post( $_post );\n } else {\n $_post =& $GLOBALS['post'];\n }\n // if no post return false\n if ( !$_post ) { return FALSE; }\n // check whether post matches term belongin to tax\n $return = is_object_in_term( $_post->ID, $tax, $term );\n // if error returned, then return false\n if ( is_wp_error( $return ) ) { return FALSE; }\n return $return;\n}",
"public function isNotExists()\n {\n return $this->getCode() === '91' && $this->isHashMatch();\n }",
"public function hasBaseFleeRate()\n {\n return $this->base_flee_rate !== null;\n }",
"public function set_manual_tax($tax_data = FALSE)\r\n\t{\r\n\t\tif (is_array($tax_data) && ! empty($tax_data))\r\n\t\t{\r\n\t\t\t// Loop through data and set to cart session summary.\r\n\t\t\tforeach($tax_data as $column => $column_value)\r\n\t\t\t{\r\n\t\t\t\t// Any submitted rate must be a number with no '%' sign - Example: 12.5% = 12.5.\r\n\t\t\t\tif ($column == 'rate' && $this->non_negative($column_value))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->flexi->cart_contents['settings']['tax']['rate'] = $column_value;\r\n\t\t\t\t}\r\n\t\t\t\telse if ($column == 'name')\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->flexi->cart_contents['settings']['tax']['name'] = $column_value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t\t\r\n\t\treturn FALSE;\r\n\t}",
"public function hasRating()\n\t{\n\t\t$this->getReview();\n\n\t\treturn $this->review->length > 0;\n\t}",
"public function create_tax_rate( $rate ) {\n\t\t// Create the tax class.\n\n\t\t$this->tax_classes[] = WC_Tax::create_tax_class( \"${rate}percent\", \"${rate}percent\" );\n\n\t\t// Set tax data.\n\t\t$tax_data = array(\n\t\t\t'tax_rate_country' => '',\n\t\t\t'tax_rate_state' => '',\n\t\t\t'tax_rate' => $rate,\n\t\t\t'tax_rate_name' => \"Vat $rate\",\n\t\t\t'tax_rate_priority' => 1,\n\t\t\t'tax_rate_compound' => 0,\n\t\t\t'tax_rate_shipping' => 1,\n\t\t\t'tax_rate_order' => 1,\n\t\t\t'tax_rate_class' => \"${rate}percent\",\n\t\t);\n\t\treturn WC_Tax::_insert_tax_rate( $tax_data );\n\t}",
"protected function shouldAddPayment(): bool\r\n {\r\n return DocumentTypes::hasPayments($this->documentType);\r\n }",
"function exists() {\n\t\t$ret = (bool) (\n\t\t\t$this->getAddLine1() ||\n\t\t\t$this->getAddLine2() ||\n\t\t\t$this->getTown() ||\n\t\t\t$this->getPostalCode() ||\n\t\t\t$this->getLat() ||\n\t\t\t$this->getLng()\n\t\t);\n\t\treturn $ret;\n\t}",
"public function setTaxRateKey($taxRateKey);",
"private function checkIsExists(): bool\n {\n $where = [\n $this->table. '.vendorId' => $this->vendorId,\n $this->table. '.campaign' => $this->campaign,\n ];\n\n if (!is_null($this->id)) {\n $where[$this->table. '.id !='] = $this->id;\n }\n\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => $where\n ]);\n\n return !is_null($id);\n }",
"public function exists()\n {\n return $this->count() > 0;\n }",
"public function hasQuota(){\n return $this->_has(12);\n }",
"public function getExternalTaxRate();",
"abstract public function getTaxType();",
"public function hasTrip(): bool\n {\n return $this->trips()->first() !== null;\n }",
"public function isExist(){\n\t\t\tif(file_exists($this->_nameFile)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"protected function logoExists()\n {\n return Storage::exists($this->salon()->logo) && $this->salon()->logo != 'public/logos/default.png';\n }",
"function addTaxRates ( ) {\r\n\r\n\t\t$taxratekeys = $this->cart->lookupProductTaxRates( true );\r\n\r\n\t\t$this->glmsg .= '<tax-tables>'\r\n\t\t \t . '<default-tax-table>'\r\n \t\t . '<tax-rules>'\r\n \t\t . '<default-tax-rule>'\r\n \t\t . '<rate>0</rate>'\r\n \t\t . '<tax-area><world-area/></tax-area>'\r\n \t\t . '</default-tax-rule>'\r\n \t\t . '</tax-rules>'\r\n \t\t . '</default-tax-table>'\r\n\t\t\t\t\t . '<alternate-tax-tables>';\r\n\r\n\t\tif( is_array( $taxratekeys ) ) {\r\n\t\t\tforeach( $taxratekeys as $key ) {\r\n\t\t\t\t$this->glmsg .= '<alternate-tax-table standalone=\"true\" name=\"' . htmlspecialchars( $key, ENT_NOQUOTES) . '\">'\r\n\t\t\t\t\t\t\t . '<alternate-tax-rules>'\r\n\t\t\t\t\t\t\t . \t'<alternate-tax-rule>'\r\n\t\t\t\t\t\t\t . \t\t'<rate>' . strval( $this->cart->lookupTaxPerc( $key ) ) . '</rate>'\r\n\t\t\t\t\t\t\t . \t\t'<tax-area><world-area/></tax-area>'\r\n\t\t\t\t\t\t\t . \t'</alternate-tax-rule>'\r\n\t\t\t\t\t\t\t . '</alternate-tax-rules>'\r\n\t\t\t\t\t\t\t . '</alternate-tax-table>';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif( $this->cart->getShippingHandlingTotal() != 0 ) {\r\n\t\t\t$this->glmsg .= '<alternate-tax-table standalone=\"true\" name=\"shipping\">'\r\n\t\t\t\t\t\t . '<alternate-tax-rules>'\r\n\t\t\t\t\t\t . \t'<alternate-tax-rule>'\r\n\t\t\t\t\t\t . \t\t'<rate>' . $this->cart->lookupTaxPercSpecial( 'Shipping' ) . '</rate>'\r\n\t\t\t\t\t\t . \t\t'<tax-area><world-area/></tax-area>'\r\n\t\t\t\t\t\t . \t'</alternate-tax-rule>'\r\n\t\t\t\t\t\t . '</alternate-tax-rules>'\r\n\t\t\t\t\t\t . '</alternate-tax-table>';\r\n\t\t}\r\n\r\n\r\n\t\t$this->glmsg .= '</alternate-tax-tables>'\r\n\t\t\t\t\t . '</tax-tables>';\r\n\t}"
] | [
"0.6818214",
"0.6493418",
"0.63413227",
"0.6319636",
"0.6013663",
"0.5909951",
"0.5746791",
"0.5736184",
"0.5569659",
"0.55317444",
"0.5499227",
"0.54986525",
"0.542487",
"0.5392176",
"0.53241813",
"0.53150344",
"0.5310918",
"0.53097093",
"0.5305918",
"0.530474",
"0.5296228",
"0.5286758",
"0.52750754",
"0.5262709",
"0.52259606",
"0.52256936",
"0.522292",
"0.52206093",
"0.5218884",
"0.5209615",
"0.52044654",
"0.5176349",
"0.5164211",
"0.51537746",
"0.51246446",
"0.5124149",
"0.512147",
"0.5112537",
"0.5109407",
"0.5109252",
"0.5091512",
"0.50913805",
"0.5081223",
"0.50754684",
"0.50721776",
"0.5070324",
"0.50501376",
"0.5046628",
"0.5041071",
"0.5034652",
"0.50294423",
"0.5025494",
"0.5022344",
"0.5007459",
"0.50071996",
"0.5000863",
"0.49912483",
"0.49901918",
"0.49895304",
"0.4985393",
"0.49823892",
"0.4979358",
"0.49633864",
"0.49608135",
"0.49310148",
"0.49308863",
"0.49268264",
"0.4922956",
"0.4922956",
"0.4922956",
"0.49126673",
"0.4911728",
"0.48972744",
"0.48846185",
"0.48812908",
"0.48787943",
"0.48737705",
"0.48725745",
"0.4862339",
"0.48566884",
"0.48487988",
"0.48414496",
"0.48350158",
"0.4834695",
"0.4834411",
"0.48276922",
"0.4825046",
"0.48243642",
"0.48237",
"0.48229972",
"0.48207814",
"0.48148265",
"0.48082933",
"0.4808103",
"0.4806535",
"0.48042527",
"0.4800716",
"0.47957733",
"0.47940725",
"0.47929746"
] | 0.5586102 | 8 |
Gets the metadata id | public function getId()
{
return $this->id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getIdentifier()\n {\n return $this->getAttribute('metadata.name', null);\n }",
"public function id()\n {\n return $this->read($this->metadata['pk']->name);\n }",
"function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}",
"function getMetadataId($reviewObjectTypeId, $key) {\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT metadata_id FROM review_object_metadata WHERE review_object_type_id = ? AND metadata_key = ? ORDER BY seq',\n\t\t\tarray((int) $reviewObjectTypeId, $key)\n\t\t);\n\t\t$returner = isset($result->fields[0]) ? $result->fields[0] : false;\n\t\t$result->Close();\n\t\treturn $returner;\n\t}",
"public function getId()\n {\n return $this->file->get('id');\n }",
"public function GetId()\n {\n return $this->GetAttribute(self::ATTR_ID);\n }",
"public static function meta_id_field() { return 'id'; }",
"public function getId() {\n\t\treturn (string) $this->photo['id'];\n\t}",
"function getID() {\n\t\treturn $this->data_array['artifact_id'];\n\t}",
"public function id()\n\t{\n\t\treturn $this->get($this->meta()->primary_key);\n\t}",
"function getId() {\n\t\treturn $this->getData('id');\n\t}",
"function getId() {\n\t\treturn $this->getData('id');\n\t}",
"public function getID() {\n return array_key_exists($this->_key_field, $this->_data) ? $this->_data[$this->_key_field] : null;\n }",
"function get_id()\n {\n return $this->get_default_property(self :: PROPERTY_ID);\n }",
"public function getID()\n {\n return $this->formattedData['id'];\n }",
"function get_id() {\n return $this->get_mapped_property('id');\n }",
"public static function id(){\n return self::info('id');\n }",
"public function getId()\n {\n return isset($this->attrs['id']) ? $this->attrs['id'] : 0;\n }",
"function getID() {\n\t\treturn $this->data_array['id'];\n\t}",
"function get_id()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_ID);\r\n }",
"public function getId()\n {\n return isset($this->id) ? $this->id : '';\n }",
"public function getId()\n {\n return isset($this->id) ? $this->id : '';\n }",
"public function id()\n {\n return $this->getFromCache(\n ['type' => 'id']\n );\n }",
"public function identifier()\n {\n return $this->id;\n }",
"public function getId()\n {\n return $this->getData(self::ID);\n }",
"public function getId()\n {\n return $this->__get(\"id\");\n }",
"public function getId()\n {\n return $this->__get(\"id\");\n }",
"public function getId()\n {\n return $this->__get(\"id\");\n }",
"public function getId() : string\n {\n $rtn = $this->data['id'];\n\n return $rtn;\n }",
"public function getId()\n {\n $rtn = $this->data['id'];\n\n return $rtn;\n }",
"public function getId() {\n\t\treturn $this -> data['id'];\n\t}",
"public function getId()\n {\n return $this->identifier;\n }",
"public function getId()\n {\n return $this->getValue('id');\n }",
"public function id()\n {\n return $this->resource->getKey();\n }",
"public function getId() {\n return ($this->isInit()) ? $this->id : null;\n }",
"public function getId()\n {\n $attributes = $this->getAttributes();\n\n if ( ! isset($attributes['id'])) return null;\n\n return $attributes['id'];\n }",
"static function id()\n\t{\n\t\treturn self::data('id');\n\t}",
"public function getID()\n {\n return $this->getKey();\n }",
"public function get_id();",
"public function get_id();",
"public function getIdentifier()\n {\n return $this->id;\n }",
"private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}",
"private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}",
"private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}",
"public function getId()\n {\n if (array_key_exists(\"id\", $this->_propDict)) {\n return $this->_propDict[\"id\"];\n } else {\n return null;\n }\n }",
"function getInsertId() {\n\t\treturn parent::getInsertId('review_object_metadata', 'metadata_id');\n\t}",
"public function getId(): int\n {\n return $this->getIdentityData('id');\n }",
"public function id()\n {\n return $this->_getAuthId();\n }",
"public function getID();",
"public function getID();",
"public function getID();",
"public function getId() {\n\t\treturn $this->response['id'] ?: NULL;\n\t}",
"public function getMediaId();",
"public function pId()\n {\n static $id = null;\n\n if (!is_null($id)) {\n return $id;\n }\n\n $id = $this->property('id');\n\n if (strpos($id, 'http') === 0) {\n $path = explode('/', parse_url($id, PHP_URL_PATH));\n\n if ($path[1] == 'gallery') {\n $id = $path[2];\n }\n elseif ($path[1] == 'a') {\n $id = 'a/'.$path[2];\n }\n else {\n $id = $path[1];\n }\n }\n\n return $id;\n }",
"public function getId()\n {\n return $this->get(self::_ID);\n }",
"public function getId()\n {\n return $this->get(self::_ID);\n }",
"public function getId()\n {\n return $this->get(self::_ID);\n }",
"public function getId()\n {\n return $this->get(self::_ID);\n }",
"public function getId()\n {\n return $this->get(self::_ID);\n }",
"public function getId()\n {\n return $this->get(self::_ID);\n }",
"public function getId()\n {\n return $this->get(self::_ID);\n }",
"public function getId()\n {\n return $this->get(self::_ID);\n }",
"public function getId()\n {\n return $this->get(self::_ID);\n }",
"public function getId()\n {\n return $this->get(self::_ID);\n }",
"public function getId()\n {\n return $this->get(self::_ID);\n }",
"public function getId()\n {\n return $this->get(self::_ID);\n }",
"public function getId()\n {\n return $this->get(self::_ID);\n }",
"public function getId()\n {\n return $this->get(self::_ID);\n }",
"public function getId()\n {\n return $this->get(self::_ID);\n }",
"public function getId()\n {\n return $this->get(self::_ID);\n }",
"public function getId()\n {\n return $this->get(self::_ID);\n }",
"public function getId()\n {\n return $this->get(self::_ID);\n }",
"public function getId()\n {\n return $this->get(self::_ID);\n }",
"public function getId()\n {\n return isset($this->attributes['id']) ? $this->attributes['id'] : null;\n }",
"static function getId()\n {\n return isset(self::$_data[self::KEY_ID]) ? self::$_data[self::KEY_ID] : 0;\n }",
"public function getId() {\r\n\t\treturn $this->data['id'];\r\n\t}",
"public function getId()\n {\n return $this->response['id'] ?: null;\n }",
"public function getId()\n {\n return $this->response['id'] ?: null;\n }",
"public function getId()\n {\n return isset($this->id) ? $this->id : 0;\n }",
"public function getId()\n {\n return isset($this->id) ? $this->id : 0;\n }",
"public function getId()\n {\n return isset($this->id) ? $this->id : 0;\n }",
"public function getId()\n {\n if ($this->id === null) {\n return $this->getMyName();\n }\n\n return $this->id;\n }",
"public function getID()\n {\n return isset($this->ID) ? $this->ID : null;\n }",
"public function getId()\n {\n return $this->getEntityValue('id', '');\n }",
"public function getID() {\n \n return $this->id;\n }",
"public function getId()\n {\n return $this->elasticaResult->getId();\n }",
"public function id() : ?string\n {\n return (isset($this->data['id'])) ? $this->data['id'] : null;\n }",
"public function getId()\n {\n return $this->get('id', 0);\n }",
"public function getid()\n {\n return $this->id;\n }",
"public function getid()\n {\n return $this->id;\n }",
"public function getId()\n {\n return $this->getAttribute('id');\n }",
"public function getId()\n {\n $value = $this->get(self::ID);\n return $value === null ? (string)$value : $value;\n }",
"protected function getID() {\n return $this->id;\n }",
"private function GetID()\n\t\t{\n\t\t\treturn $this->id;\n\t\t}",
"public static function id()\n {\n return self::$id;\n }",
"public static function getID()\n {\n return self::getInstance()->_getID();\n }",
"private function getIdentifierFromMetadata(ClassMetadataInfo $metadata)\n {\n if (count($metadata->identifier) > 1) {\n throw new Exception('CreateDatatableCommand::getIdentifierFromMetadata(): The Datatable generator does not support entities with multiple primary keys.');\n }\n\n return $metadata->identifier;\n }",
"public function determineId() {}",
"public function get_id() {\n\t\tif ( ! empty( $this->data->id ) )\n\t\t\treturn $this->data->id;\n\t\telse\n\t\t\treturn false;\n\t}",
"public function get_id() {\n\t\t\treturn $this->id;\n\t\t}",
"public function get_id() {\n\n\t\treturn $this->id;\n\t}"
] | [
"0.7453046",
"0.739482",
"0.73295367",
"0.7139801",
"0.7039341",
"0.70247954",
"0.69432646",
"0.69291705",
"0.6909349",
"0.68890905",
"0.68766534",
"0.68766534",
"0.6870952",
"0.68680376",
"0.6824485",
"0.6821804",
"0.681454",
"0.6807134",
"0.680452",
"0.6769718",
"0.6741655",
"0.6741655",
"0.67323875",
"0.67287856",
"0.6728427",
"0.6692743",
"0.6692743",
"0.6692743",
"0.66820604",
"0.66769874",
"0.6649392",
"0.661639",
"0.66123575",
"0.6611954",
"0.65926087",
"0.6588313",
"0.658356",
"0.65808487",
"0.65723515",
"0.65723515",
"0.65707177",
"0.6567332",
"0.6567332",
"0.6567332",
"0.65669304",
"0.65668696",
"0.6556407",
"0.65452874",
"0.6532148",
"0.6532148",
"0.6532148",
"0.6530786",
"0.6525494",
"0.65227413",
"0.6520336",
"0.6520336",
"0.6520336",
"0.6520336",
"0.6519274",
"0.6519274",
"0.6519274",
"0.6519274",
"0.6519274",
"0.6519274",
"0.6519274",
"0.6519274",
"0.6519274",
"0.6519274",
"0.6519274",
"0.6519274",
"0.6519274",
"0.6519274",
"0.6519274",
"0.651475",
"0.6508643",
"0.65082526",
"0.65026873",
"0.65026873",
"0.6492796",
"0.6492796",
"0.6492796",
"0.64894366",
"0.6486431",
"0.6482918",
"0.6479244",
"0.6476113",
"0.6470834",
"0.646305",
"0.6456003",
"0.6456003",
"0.6455042",
"0.64543146",
"0.64530176",
"0.64521265",
"0.64352846",
"0.6432471",
"0.64309573",
"0.642842",
"0.64275336",
"0.6427012",
"0.6425655"
] | 0.0 | -1 |
Responsable for auto load the model | public function __construct()
{
parent::__construct();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract function load(Model $model);",
"public function loadModel() : void\n {\n $model = $this->newModel();\n\n $model->loadModel($this->modelPath);\n $model->printModel();\n\n $this->fm = FunctionMap::loadFunctionMap();\n }",
"public function loadModel()\n {\n $data = Contest::find($this->modelId);\n $this->title = $data->title;\n $this->description = $data->description;\n $this->image = $data->image;\n $this->featured_image = $data->featured_image;\n\n }",
"function loadModel($model){\n $url='models/'.$model.'model.php';//models/alumnomodel.php\n //validando que el modelo exista\n if(file_exists($url)){\n //si axiste lo llamamos\n require $url;\n $modelName=$model.'Model';\n //instancia de la clase del modelo recibido\n $this->model=new $modelName;\n }\n }",
"function __autoload($modelname){\n\tif(Model::exists($modelname)){\n\t\tinclude Model::getFullPath($modelname);\n\t} \n}",
"public function loadForView();",
"public function loadModel()\n {\n $data = ModelsPegawai::find($this->dataId);\n $this->name = $data->name;\n $this->email = $data->email;\n $this->username = $data->username;\n $this->password = $data->password;\n $this->level = $data->level;\n\n }",
"abstract function getModel();",
"public function load() { }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"abstract protected function getModel();",
"public function loadModel()\n {\n if ($this->_modelName == null) {\n $this->_modelName = $this->_controllerName . '_Model';\n $this->load->model($this->_modelName);\n }\n }",
"protected abstract function model();",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"private function loadModel() {\n // name as requested resource.\n $name = $this->name.'Model';\n $path = str_replace(kPlaceholder, $this->version, kModelsFolder);\n $path = $path . $name . \".php\";\n // If it does not exist, go with\n // the default Model class.\n if (!file_exists($path)) {\n return new Model();\n } else {\n if (!class_exists($name)) {\n include $path;\n }\n\n return new $name();\n }\n }",
"abstract public function getModel();",
"public function loadModel(){\n $this->load->model('Data_Model');\n return new Data_Model($this->used_table,$this->used_db);\n }",
"public function populateModels()\n {\n }",
"private function _load_default_model(){\n\n\t\t$default_model_name = strtolower(get_class($this)) . '_model';\n\n\t\tif(file_exists(APPPATH . 'models/' . $default_model_name . '.php')){\n\n\t\t\t$this->load->model($default_model_name, strtolower(get_class($this)));\n\t\t\t$this->_default_model = strtolower(get_class($this));\n\t\t}\n\n\t}",
"private function loadModel()\n {\n require_once APP . '/model/User.php';\n // create new \"model\" (and pass the database connection)\n $this->model = new User($this->db);\n }",
"abstract protected function model();",
"abstract protected function model();",
"public abstract function model();",
"abstract public function model();",
"abstract public function model();",
"abstract public function model();",
"abstract public function model();",
"public function loadModel(){\n\t\t$className = get_class($this);\n\t\tforeach(func_get_args() as $model){\n\t\t\t$entity = EntityManager::getEntityInstance($model);\n\t\t\tself::$_settingLock[$className] = true;\n\t\t\t$this->$model = $entity;\n\t\t\tself::$_settingLock[$className] = false;\n\t\t}\n\t}",
"function loadModel($name){\n\t\t$dir = APP . \"Entity\" . DS;\n\n\t\t$file = str_replace([$dir,\".php\"], [\"\",\"\"], $name);\n\n\t\tif(!isset($this->$file)){\n\t\t\trequire_once $name;\n\t\t\t$this->$file = new $file();\n\t\t\tif(isset($this->Form)){\n\t\t\t\t$this->$file->Form = $this->Form; \n\t\t\t}\n\t\t}\n\n\n\t}",
"public function model();",
"public function model();",
"public function loadModel($name) {\n echo \"new view was called\";\n $path = MODELS_PATH . DS . $name . '_model.php';\n\n if (file_exists($path)) {\n require MODELS_PATH . DS . $name . '_model.php';\n $modelName = $name . '_Model';\n $this->model = new $modelName();\n }\n }",
"protected static function model()\n {\n foreach (self::fetch('resources/models', false) as $file) {\n Bus::need($file);\n }\n }",
"public function getModel(){ }",
"public function model()\n {\n //use model\n }",
"function post_model_init($from_cache = FALSE)\n {\n }",
"public function __load();",
"function autoload_model($class_name) {\n $filename = strtolower($class_name) . '.php';\n $file = __site_path . '/app/models/' . $filename;\n\n if (!is_readable($file))\n {\n\t\tthrow new Exception('Invalid model path: ' . $file);\n return false;\n }\n\t\n\tinclude ($file);\n}",
"protected final function Teadaze_ModelLoadingInterface($obj) {\n\t\t$obj->setModelLoader($this->modelLoader);\n\t}",
"abstract function model();",
"abstract function model();",
"abstract function model();",
"abstract function model();",
"function loadModel($model = null) {\n\t\tif ($model && $this->$model == null) {\n\t\t\tApp::import('Model',\"Seo.$model\");\n\t\t\t$this->$model = ClassRegistry::init(\"Seo.$model\");\n\t\t}\n\t}",
"private function loadModels()\n {\n $this->use = ( ! isset($this->use)) ? [$this->class] : $this->use;\n\n if ($this->use) {\n foreach ($this->use as $model) {\n self::load('model', $model);\n }\n }\n }",
"function __construct()\n {\n // load model\n Load::loadModel(\"helpDesk\");\n }",
"function loadModel ($name){\n $file = ROOT.DS.'models'.DS.$name.'.php';\n require_once($file);\n\n if(!isset($this->name)){\n $this->$name = new $name();\n }\n }",
"function loadModel($modelName,$negocio){\r\n\tif($modelName=='database'){\r\n\t\t$modelPath = '../Config/'.$negocio.'_'.$modelName.'.php';\r\n\t\tif(is_file($modelPath)){\r\n\t\t\tif (!class_exists($modelName)) {\r\n\t\t\t\trequire_once($modelPath);\r\n\t\t\t}\t\t\r\n\t\t}else{\r\n\t\t\techo 'No existe la conexion'.$modelPath;\r\n\t\t\texit();\r\n\t\t}\r\n\t\t$model = new $modelName();\r\n\t\treturn $model;\t\r\n\t}else{\r\n\t\t$modelPath = '../Model/'.$modelName.'.php';\r\n\t\tif(is_file($modelPath)){\r\n\t\t\tif (!class_exists($modelName)) {\r\n\t\t\t\trequire_once($modelPath);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\techo 'No existe este modelo '.$modelPath;\r\n\t\t\texit();\r\n\t\t}\r\n\t\t$model = new $modelName();\r\n\t\tif($negocio != 'null'){\r\n\t\t\t$model->negocio = $negocio;\r\n\t\t}\t\t\r\n\t\treturn $model;\r\n\t}\r\n}",
"private function _load_models()\r\n {\r\n foreach ($this->models as $model)\r\n {\r\n $this->load->model($this->_model_name($model), $model);\r\n }\r\n }",
"private static function model()\n {\n $files = ['ORM_', 'CRUD', 'ORM', 'Collection', 'ModelArray'];\n $folder = static::$root.'MVC/Model'.'/';\n\n self::call($files, $folder);\n\n $files = ['ForeingKeyMethodException', 'ColumnNotEmptyException', 'ManyPrimaryKeysException', 'TableNotFoundException', 'ModelNotFoundException', 'PrimaryKeyNotFoundException'];\n $folder = static::$root.'MVC/Model/Exceptions'.'/';\n\n self::call($files, $folder);\n }",
"function __autoload($classe){\n\n require_once'../modelo/'.$classe.'.php';\n\n}",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"function post_model_init($from_cache = FALSE)\n\t{\n\t}",
"private function _load_models()\n {\n foreach ($this->models as $model)\n {\n $this->load->model($this->_model_name($model), $model);\n }\n }",
"public static function preModel(){\n\t\t\n\t}",
"public function load(){\n\t\treturn parent::load();\n\t}",
"function __autoload($model_name) {\n $filename = strtolower($model_name) . '.model.php';\n $file = __SITE_PATH . '/model/' . $filename;\n\n if (!file_exists($file)) {\n return false;\n }\n include_once $file;\n}",
"abstract protected function getModelClass();",
"public function model() {\n require_once \"../app/models/model.php\";\n $this->model = new Model($this->db);\n }",
"function __autoload( $arquivo ){\n if(file_exists(MODELS.$arquivo.\".php\")){\n require_once(MODELS.$arquivo.\".php\");\n } else {\n echo \"Erro: O Model '\".$arquivo.\"' não foi encontrado!\";\n exit;\n }\n}",
"private static function _loadModels(){\n if (self::$_models == null){\n $sql = 'SELECT id, uuid, name, description, version_id, created FROM v_model WHERE 1';\n $models = Mysql::query($sql);\n if ($models){\n $_models = array();\n foreach($models as $model){\n $sql = \"SELECT id, model_id, uuid, name, description, type, list, instance_model_id, version_id, created FROM v_property WHERE model_id = '{$model->id}'\";\n $properties = Mysql::query($sql);\n if ($properties){\n $model->properties = $properties;\n $_models[] = $model;\n }\n }\n self::$_models = $_models;\n }\n }\n }",
"abstract protected function getDefaultModel();",
"public function __construct()\n{\nparent::__construct();\n\n//load database libray manually\n$this->load->database();\n\n//load Model\n$this->load->model('welcomemodel');\n}",
"function loadModelFile($fileName){\n $modelPath = $this->modelBasePath . $fileName . $this->suffix;\n if(file_exists($modelPath)){\n require $modelPath;\n }\n }",
"private function getModel(): void\n {\n $model = config(\"cart.{$this->driver}.model\");\n\n if (class_exists($model)) {\n $this->model = new $model;\n }\n }",
"abstract public function getModel($name);",
"function __construct()\n {\n // load model\n Load::loadModel(\"group\");\n }",
"protected function cliModelInit()\n {\n }",
"public function __construct() {\n parent::__construct();\n $this->load->model(\"modelo_base\");\n \n }",
"private function modelLoader( $className ) {\r\n\t\t// $className = trim( str_replace(\"_\", \"/\", $className), \"/\" );\r\n\t\t@include_once CORE_MODEL . $className .'.php';\r\n\t\t\r\n\t}",
"protected function _initAutoload() {\r\n// \t\t\t'basePath' => APPLICATION_PATH,\r\n// \t\t\t'namespace' => '',\r\n// \t\t\t'resourceTypes' => array(\r\n// \t\t\t\t'model' => array(\r\n// \t\t\t\t\t'path' => 'models/',\r\n// \t\t\t\t\t'namespace' => 'Model_'\r\n// \t\t\t\t)\r\n// \t\t\t)\r\n// \t\t));\r\n\r\n\t\tZend_Loader::loadFile('Respon.php', LIBRARY_PATH . '/Base');\r\n\r\n\t}",
"public function models();",
"public function load_model( $model_name = false ) {\n\t\tif ( ! $model_name ) return;\n\n\t\t$model_name = strtolower( $model_name );\n\t\t$model_path = ABSPATH . '/models/' . $model_name . '.php';\n\n\t\tif ( file_exists( $model_path ) ) {\n\t\t\trequire_once $model_path;\n\n\t\t\t// Pega só o nome final do caminho\n\t\t\t$model_name = explode('/', $model_name);\n\t\t\t$model_name = end( $model_name );\n\t\t\t$model_name = preg_replace( '/[^a-zA-Z0-9]/is', '', $model_name );\n\n\t\t\t// Retorna um objeto da classe\n\t\t\tif ( class_exists( $model_name ) ) {\n\t\t\t\treturn new $model_name( $this->db, $this );\n\t\t\t}\n\n\t\t\treturn;\n\t\t} // load_model\n\n\t}",
"public abstract function load();",
"function __autoload($className) {\n require_once \"../model/\" . $className . '.php';\n}",
"public function __construct()\n {\n parent:: __construct();\n $this->load->model('api/Lootel_model');\n }",
"public function DoctrineLoad()\n {\n // and call __load method\n }",
"public function load($model, $post) {\n // empty implementation. \n }",
"function autoload($classe)\n{\n //echo dirname(__FILE__).\"\\\\Models\\\\\".$classe.\".php\";\n require dirname(__FILE__).\"\\\\model\\\\\".$classe.\".php\";\n}",
"function __autoload($class) {\n $arrPart = explode('\\\\', $class);\n $strClassName = strtolower(end($arrPart));\n require 'model/'. $strClassName. '.php';\n}",
"public function __construct(){\n get_instance()->load->model('lists');\n }",
"public function __construct()\n {\n parent::__construct();\n $this->app->loadClass('date');\n $this->loadModel('task');\n $this->loadModel('order', 'crm');\n $this->loadModel('customer');\n }",
"protected function getDefaultModelObject() : void\n {\n return;\n }",
"public function loadModel($name)\r\n\t\t{\r\n\r\n\t\t\t$path = 'application\\models\\\\'.ucfirst($name);\r\n\t\t\tif (class_exists($path))\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\treturn new $path;\r\n\t\t\t}\r\n\t\t}"
] | [
"0.73569614",
"0.7226171",
"0.71065754",
"0.70976245",
"0.6962086",
"0.6960654",
"0.68762434",
"0.68691206",
"0.6864177",
"0.6863162",
"0.6863162",
"0.6860825",
"0.6851759",
"0.6827567",
"0.6824793",
"0.6824145",
"0.68238336",
"0.68238336",
"0.68238336",
"0.6813459",
"0.68022203",
"0.6776428",
"0.6744521",
"0.67441833",
"0.6742349",
"0.6737553",
"0.6737553",
"0.6725414",
"0.67198217",
"0.67198217",
"0.67198217",
"0.67198217",
"0.67140335",
"0.6706144",
"0.6698513",
"0.6698513",
"0.6673639",
"0.66494036",
"0.6639418",
"0.66369385",
"0.66189235",
"0.6605485",
"0.6577458",
"0.65744555",
"0.65733093",
"0.65733093",
"0.65733093",
"0.65733093",
"0.65555775",
"0.65388775",
"0.6531153",
"0.6526767",
"0.65035534",
"0.6501375",
"0.649527",
"0.64717996",
"0.64679974",
"0.64679974",
"0.64679974",
"0.64679974",
"0.64679974",
"0.64679974",
"0.64679974",
"0.64679974",
"0.64679974",
"0.64679974",
"0.64679974",
"0.64679974",
"0.64679974",
"0.6460736",
"0.6460235",
"0.6442567",
"0.6430601",
"0.64040315",
"0.63998485",
"0.6399821",
"0.63912326",
"0.63814235",
"0.6356757",
"0.6346398",
"0.6339516",
"0.631163",
"0.6308286",
"0.6302964",
"0.62980515",
"0.62926936",
"0.62889844",
"0.62877715",
"0.62750876",
"0.62596947",
"0.62551826",
"0.6255107",
"0.6252157",
"0.624221",
"0.62293935",
"0.6218448",
"0.621225",
"0.6204684",
"0.61967504",
"0.6195836",
"0.6186971"
] | 0.0 | -1 |
Create CRUD operations Takes in the crud.yaml file from the installation directory, and creates the necessary views, data table, and form components to handle CRUD operations for the given database table. | public function create(string $file):array
{
// Load YAML file
try {
$vars = Yaml::parseFile($file);
} catch (ParseException $e) {
throw new ApexException('error', tr("Unable to parse YAML file for CRUD creation. Message: {1}", $e->getMessage()));
}
// Set variables
$this->package = $vars['package'] ?? '';
$this->dbtable = $vars['dbtable'] ?? '';
$this->alias = $vars['alias'] ?? preg_replace("/^" . $this->package . "_/", "", $this->dbtable);
$views = $vars['views'] ?? [];
$admin_uri = $views['admin'] ?? '';
// Get singular alias
$inflector = new EnglishInflector();
$single = $inflector->singularize($this->alias);
$this->alias = is_array($single) ? $single[0] : $single;
// Get plural alias
$plural = $inflector->pluralize($this->alias);
$this->alias_plural = is_array($plural) ? $plural[0] : $plural;
// Perform checks
$this->perform_checks();
// Get columns
$this->columns = db::show_columns($this->dbtable, true);
if (isset($this->columns['id'])) { unset($this->columns['id']); }
// Create form
$form = $vars['form'] ?? [];
$this->create_form($form);
// Create table
$table = $vars['table'] ?? [];
$this->create_table($table, $admin_uri);
// Create admin view
if ($admin_uri != '') {
$form_exclude = $form['exclude'] ?? [];
$this->create_view_admin($admin_uri, $form_exclude);
}
// Return
return array($this->alias, $this->package, $this->created_files);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function crud(){\n DB::table('crud_route_groups')->truncate();\n foreach($this->tables as $table){\n $params = $this->prepareParams($table);\n $this->line('CRUD for '.$table->table_name);\n (new Controller($params))->build();\n (new Router($params))->build();\n (new Model($params))->build();\n (new ModelFactory($params))->build();\n (new UnitTest($params))->build();\n }\n $this->call('make:swagger');\n $this->info('OpenApi annotations created successfully');\n $this->newLine();\n }",
"protected function setupCreateOperation()\n {\n CRUD::setValidation(UserRequest::class);\n\n $this->crud->setOperationSetting('contentClass', 'col-md-12 bold-labels');\n $this->crud->addFields([\n [ \n 'name' => 'name',\n 'label' => 'Name',\n 'type' => 'text',\n ],\n [ \n 'name' => 'password',\n 'label' => 'Password',\n 'type' => 'password',\n ],\n [ \n 'name' => 'email',\n 'label' => 'Email',\n 'type' => 'email',\n ],\n [ // radio\n 'name' => 'type_id', // the name of the db column\n 'label' => 'Type', // the input label\n 'type' => 'radio',\n 'options' => [\n // the key will be stored in the db, the value will be shown as label; \n 0 => \"Collector\",\n 1 => \"Administrator\"\n ],\n 'inline' => true, // show the radios all on the same line?\n ],\n ]);\n }",
"public function setup() {\n\t\t/*\n\t\t|--------------------------------------------------------------------------\n\t\t| BASIC CRUD INFORMATION\n\t\t|--------------------------------------------------------------------------\n\t\t*/\n $this->crud->setModel(\"App\\Models\\CoursEnLigne\");\n $this->crud->setRoute(\"admin/coursenligne\");\n $this->crud->setEntityNameStrings('cours en ligne', 'cours en ligne');\n\t\t/*\n\t\t|--------------------------------------------------------------------------\n\t\t| COLUMNS AND FIELDS\n\t\t|--------------------------------------------------------------------------\n\t\t*/\n\t\t// ------ CRUD COLUMNS\n $this->crud->setColumns(['titre', ['label' => \"Nom du formateur\",\n \t\t 'type' => 'select',\n 'name' => 'formateur_id',\n \t\t 'entity' => 'formateur',\n \t\t 'attribute' => 'full_name',\n \t\t 'model' => \"App\\Models\\Formateur\"\n \t\t\t ]\n ]);\n\t\t// ------ CRUD FIELDS\n $this->crud->addField([\n\t\t\t'name' => 'titre',\n\t\t\t'label' => \"Titre*\"\n\t\t]);\n\t\t$this->crud->addField([ // SELECT\n 'label' => \"Formateur*\",\n 'type' => 'select2',\n 'name' => 'formateur_id',\n 'entity' => 'formateur',\n 'attribute' => 'full_name',\n 'model' => \"App\\Models\\Formateur\",\n ]);\n $this->crud->addField([\n\t\t\t'name' => 'texte',\n\t\t\t'label' => \"Texte\",\n\t\t\t'type' => 'wysiwyg'\n\t\t]);\n\t\t$this->crud->addField([ // date_picker\n\t\t 'name' => 'date',\n\t\t 'type' => 'date_picker',\n\t\t 'label' => 'Date',\n\t\t // optional:\n\t\t 'date_picker_options' => [\n\t\t 'todayBtn' => true,\n\t\t 'format' => 'dd-mm-yyyy',\n\t\t 'language' => 'fr'\n\t\t ],\n\t\t]);\n\n\t\t$this->crud->addField([ // Time\n \t\t 'name' => 'heure',\n \t\t'label' => 'Heure',\n \t\t'type' => 'time'\n\t\t]);\n\t\t$this->crud->addField([\n\t\t\t'name' => 'prix',\n\t\t\t'label' => \"Prix*\",\n\t\t\t'type' => 'number'\n\t\t]);\n\t\t$this->crud->addField([\n\t\t\t'name' => 'stock',\n\t\t\t'label' => \"En stock\",\n\t\t\t'type' => 'checkbox'\n\t\t]);\n\n }",
"protected function setupCreateOperation()\n {\n CRUD::setValidation(ArticleCategoryRequest::class);\n\n //Tab Main Info\n $this->crud->addFields([\n [\n 'name' => 'status',\n 'label' => _('Publish status'),\n 'type' => 'checkbox',\n 'tab' => _('Main info'),\n ],\n [\n 'name' => 'title',\n 'title' => _('Title'),\n 'type' => 'text',\n 'hint' => _('For admin panel & slug generator'),\n 'tab' => _('Main info'),\n ],\n [\n 'name' => 'slug',\n 'title' => _('Slug'),\n 'type' => 'text',\n 'hint' => _('auto generate'),\n 'tab' => _('Main info'),\n ],\n [\n 'name' => 'thumbnail',\n 'label' => _('Preview'),\n 'type' => 'browse',\n 'mime_types' => ['image'],\n 'tab' => _('Main info'),\n ]\n ]);\n $this->crud->addField([\n 'label' => _(\"Tags\"),\n 'type' => 'select2_multiple',\n 'name' => 'tags', // the method that defines the relationship in your Model\n 'entity' => 'tags', // the method that defines the relationship in your Model\n 'attribute' => 'name', // foreign key attribute that is shown to user\n 'pivot' => true, // on create&update, do you need to add/delete pivot table entries?\n 'tab' => _('Main info'),\n ]);\n\n\n\n //Tab Locale Info\n $this->crud->addFields([\n [\n 'name' => 'name',\n 'label' => _('name'),\n 'type' => 'text',\n 'tab' => _('Localization'),\n ],\n [\n 'name' => 'seo_title',\n 'label' => _('SEO title'),\n 'type' => 'text',\n 'tab' => _('Localization'),\n ],\n [\n 'name' => 'seo_h1',\n 'label' => _('SEO H1'),\n 'type' => 'text',\n 'tab' => _('Localization'),\n ],\n [\n 'name' => 'seo_description',\n 'label' => _('SEO description'),\n 'type' => 'text',\n 'tab' => _('Localization'),\n ],\n [\n 'name' => 'seo_keywords',\n 'label' => _('SEO keywords'),\n 'type' => 'text',\n 'tab' => _('Localization'),\n ],\n [\n 'name' => 'short_description',\n 'label' => _('Short description'),\n 'type' => 'ckeditor',\n 'tab' => _('Localization'),\n ],\n [\n 'name' => 'content',\n 'label' => _('Content'),\n 'type' => 'ckeditor',\n 'tab' => _('Localization'),\n ],\n ]);\n\n\n /**\n * Fields can be defined using the fluent syntax or array syntax:\n * - CRUD::field('price')->type('number');\n * - CRUD::addField(['name' => 'price', 'type' => 'number']));\n */\n }",
"protected function setupCreateOperation()\n {\n CRUD::setValidation(CustomerRequest::class);\n\n $this->crud->setOperationSetting('contentClass', 'col-md-12 bold-labels');\n $this->crud->addFields([\n [ \n 'name' => 'name',\n 'label' => 'Name',\n 'type' => 'text',\n 'wrapper' => ['class' => 'form-group col-md-6'],\n\n\n ],\n [ \n 'name' => 'national_id',\n 'label' => 'National ID',\n 'type' => 'text',\n 'wrapper' => ['class' => 'form-group col-md-6'],\n\n ],\n [ \n 'name' => 'trademark',\n 'label' => 'Trademark',\n 'type' => 'text',\n\n ],\n [ \n 'name' => 'district',\n 'label' => 'District',\n 'type' => 'text',\n 'wrapper' => ['class' => 'form-group col-md-6'],\n ],\n [ \n 'name' => 'address',\n 'label' => 'Address',\n 'type' => 'text',\n 'wrapper' => ['class' => 'form-group col-md-6'],\n ],\n [ \n 'name' => 'mobile_one',\n 'label' => 'Mobile 1',\n 'type' => 'text',\n 'wrapper' => ['class' => 'form-group col-md-6'],\n ],\n [ \n 'name' => 'mobile_two',\n 'label' => 'Mobile 2',\n 'type' => 'text',\n 'wrapper' => ['class' => 'form-group col-md-6'],\n ],\n [ \n 'name' => 'target',\n 'label' => 'Target',\n 'type' => 'number',\n ],\n [ // relationship\n 'type' => \"relationship\",\n 'name' => 'user_id', // the method on your model that defines the relationship\n 'label' => \"Collector\",\n 'attribute' => \"name\", // foreign key attribute that is shown to user (identifiable attribute)\n 'placeholder' => \"Select a Collector\", // placeholder for the select2 input\n 'entity' => 'User', // the method that defines the relationship in your Model\n\n // OPTIONALS:\n // 'attribute' => \"name\", // foreign key attribute that is shown to user (identifiable attribute)\n // 'model' => \"App\\Models\\Category\", // foreign key Eloquent model\n ],\n ]);\n }",
"protected function setupCreateOperation()\n {\n CRUD::setValidation(CommunicationRequest::class);\n $this->crud->setCreateContentClass('col-md-12');\n // $this->crud->addField([\n // 'label' => 'Case Number',\n // 'type' => 'text',\n // 'name' => 'code',\n // 'wrapper' => [\n // 'class' => 'form-group col-md-6'\n // ]\n // ]);\n $this->crud->addField([\n 'label' => 'Owner',\n 'type' => 'select',\n 'name' => 'user_id',\n 'attribute' =>'name',\n 'entity' => 'user',\n 'model' => 'App\\Models\\user',\n 'wrapper' => [\n 'class' => 'form-group col-md-6'\n ]\n ]);\n $this->crud->addField([\n\n 'label' => 'Company',\n 'type' => 'hidden',\n 'name' => 'person_id',\n 'attribute' =>'company_name',\n 'attributes' => [\n 'readonly' => 'readonly',\n ],\n 'default' => request()->input('person_id', ''),\n\n ]);\n $this->crud->addField([\n 'label' => 'Type',\n 'type' => 'select',\n 'name' => 'communication_types_id',\n 'type' => 'select_from_array',\n 'options' => [\n 'Out Of Stock' => 'Out Of Stock',\n 'Out Of List' => 'Out Of List',\n 'Complaint' => 'Complaint',\n 'Price' => 'Price',\n 'Evaluation' => 'Evaluation',\n ],\n 'allows_null' => true,\n 'wrapper' => [\n 'class' => 'form-group col-md-6'\n ]\n ]);\n $this->crud->addField([\n 'label' => 'Communication',\n 'type' => 'select_from_array',\n 'name' => 'communication_ways_id',\n 'allows_null' => true,\n 'options' => [\n 'Phone' => 'Phone',\n 'Telegram' => 'Telegram',\n 'Physical' => 'Physical',\n 'E-Mail' => 'E-Mail',\n 'Facebook' => 'Facebook',\n ],\n 'wrapper' => [\n 'class' => 'form-group col-md-6'\n ]\n ]);\n $this->crud->addField([\n 'label' => 'All Day(If Complaint)',\n 'type' => 'radio',\n 'name' => 'comp_type',\n 'options' => [\n 0 => \"product\",\n 1 => \"Service\",\n ],\n 'wrapper' => [\n 'class' => 'form-group col-md-6'\n ]\n ]);\n $this->crud->addField([\n 'label' => 'Product',\n 'type' => 'text',\n 'name' => 'product',\n 'wrapper' => [\n 'class' => 'form-group col-md-6'\n ]\n ]);\n $this->crud->addField([\n 'label' => 'Quantity',\n 'type' => 'number',\n 'name' => 'quantity',\n 'wrapper' => [\n 'class' => 'form-group col-md-6'\n ]\n ]);\n $this->crud->addField([\n 'label' => 'Second',\n 'type' => 'number',\n 'name' => 'second',\n 'wrapper' => [\n 'class' => 'form-group col-md-6'\n ]\n ]);\n $this->crud->addField([\n 'label' => 'Remarks',\n 'type' => 'textarea',\n 'name' => 'remarks',\n 'wrapper' => [\n 'class' => 'form-group col-md-12'\n ]\n ]);\n\n }",
"public function setup()\n {\n $this->crud->setModel('App\\Models\\Bio');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/bio');\n $this->crud->setEntityNameStrings('bio', 'bio');\n\n /*\n |--------------------------------------------------------------------------\n | CrudPanel Configuration\n |--------------------------------------------------------------------------\n */\n\n // TODO: remove setFromDb() and manually define Fields and Columns\n $this->crud->setColumns(['first_name', 'other_name', 'last_name', 'bio_description', 'gender', 'date_of_birth', 'residential_address', 'current_location', 'state_of_origin', 'nationality', 'profile_picture', 'email', 'phone_number', 'user_id']);\n\n $this->crud->addField( [\n 'name' => 'first_name',\n 'label' => 'First name',\n 'type' => 'text',\n 'placeholder' => 'First name'\n ], 'update/create/both');\n\n $this->crud->addField( [\n 'name' => 'other_name',\n 'label' => 'Other name',\n 'type' => 'text',\n 'placeholder' => 'Other name'\n ], 'update/create/both');\n\n $this->crud->addField( [\n 'name' => 'last_name',\n 'label' => 'Last name',\n 'type' => 'text',\n 'placeholder' => 'Last name'\n ], 'update/create/both');\n\n $this->crud->addField( [\n 'name' => 'bio_description',\n 'label' => 'Description',\n 'type' => 'summernote'\n ], 'update/create/both');\n\n $this->crud->addField( [\n 'name' => 'gender',\n 'label' => 'Gender',\n 'type' => 'radio',\n 'options' => [\n 'Male' => 'Male',\n 'Female' => 'Female'\n ]\n ], 'update/create/both');\n\n $this->crud->addField( [\n 'name' => 'date_of_birth',\n 'label' => 'Birthday',\n 'type' => 'date_picker',\n 'date_picker_options' => [\n 'format' => 'dd-mm-yyyy',\n 'language' => 'en'\n ]\n ], 'update/create/both');\n\n $this->crud->addField( [\n 'name' => 'residential_address',\n 'label' => 'Home Address',\n 'type' => 'address',\n 'store_as_json' => true\n ], 'update/create/both');\n\n $this->crud->addField( [\n 'name' => 'current_location',\n 'label' => 'Current location',\n 'type' => 'address',\n 'store_as_json' => true\n ], 'update/create/both');\n\n $this->crud->addField( [\n 'name' => 'state_of_origin',\n 'label' => 'State Of Origin',\n 'type' => 'address',\n 'store_as_json' => true\n ], 'update/create/both');\n\n $this->crud->addField( [\n 'name' => 'nationality',\n 'label' => 'Nationality',\n 'type' => 'text',\n 'store_as_json' => true\n ], 'update/create/both');\n\n $this->crud->addField( [\n 'name' => 'profile_picture',\n 'label' => 'Profile Picture',\n 'type' => 'image',\n 'upload' => true,\n 'crop' => true,\n 'prefix' => 'images/profile_pictures/'\n ], 'update/create/both');\n\n $this->crud->addField( [\n 'name' => 'email',\n 'label' => 'Email address',\n 'type' => 'email'\n ], 'update/create/both');\n\n $this->crud->addField( [\n 'name' => 'phone_number',\n 'label' => 'Phone number',\n 'type' => 'number'\n ], 'update/create/both');\n\n $this->crud->addField( [\n 'name' => 'user_id',\n 'label' => 'User',\n 'type' => 'select',\n 'entity' => 'user',\n 'attribute' => 'name',\n 'model' => 'Backpack\\Base\\app\\Models\\BackpackUser'\n ], 'update/create/both');\n\n // add asterisk for fields that are required in TagRequest\n $this->crud->setRequiredFields(StoreRequest::class, 'create');\n $this->crud->setRequiredFields(UpdateRequest::class, 'edit');\n }",
"protected function setupCreateOperation()\n {\n CRUD::setValidation(TaskRequest::class);\n\n // CRUD::setFromDb(); // fields\n\n /**\n * Fields can be defined using the fluent syntax or array syntax:\n * - CRUD::field('price')->type('number');\n * - CRUD::addField(['name' => 'price', 'type' => 'number'])); \n */\n CRUD::addField(['label' => \"Name\",\n 'name' => 'name',]\n );\n CRUD::addField([ // Select\n 'label' => \"Project\",\n 'type' => 'select',\n 'name' => 'project_id', // the db column for the foreign key\n \n // optional \n // 'entity' should point to the method that defines the relationship in your Model\n // defining entity will make Backpack guess 'model' and 'attribute'\n 'entity' => 'project', \n \n // optional - manually specify the related model and attribute\n 'model' => \"App\\Models\\Project\", // related model\n 'attribute' => 'name', // foreign key attribute that is shown to user\n \n // optional - force the related options to be a custom query, instead of all();\n ]);\n\n }",
"protected function setupCreateOperation()\n {\n $this->addUserFields();\n $this->crud->setValidation(StoreRequest::class);\n// CRUD::setValidation(UserRequest::class);\n//\n// CRUD::setFromDb(); // fields\n\n /**\n * Fields can be defined using the fluent syntax or array syntax:\n * - CRUD::field('price')->type('number');\n * - CRUD::addField(['name' => 'price', 'type' => 'number']));\n */\n }",
"public function setup()\n {\n $this->crud->setModel('App\\Models\\Fat');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/fat');\n $this->crud->setEntityNameStrings('FAT', 'FAT');\n\n /*\n |--------------------------------------------------------------------------\n | BASIC CRUD INFORMATION\n |--------------------------------------------------------------------------\n */\n $this->crud->addField([\n 'label' => __('Name'),\n 'name' => 'name',\n 'type' => 'text',\n ]);\n $this->crud->addField([\n 'label' => __('Email'),\n 'name' => 'email',\n 'type' => 'email',\n ]);\n $this->crud->addField([\n 'label' => __('Phone'),\n 'name' => 'phone',\n 'type' => 'text',\n 'attributes' => [\n 'type' => 'tel',\n 'maxlength' => '14',\n ],\n ]);\n\n $this->crud->addField([\n 'label' => ucfirst(__('territory')),\n 'name' => 'territory_id',\n 'type' => 'select2_from_array',\n 'options' => api()->territoryList(),\n 'allows_null' => true,\n ]);\n\n if (is('admin')) {\n $this->crud->addField([\n 'label' => ucfirst(__('headquarter')),\n 'type' => 'select2_multiple_data_source',\n 'name' => 'headquarters',\n 'attribute' => 'name',\n 'model' => api()->headquarterSearch(),\n 'pivot' => true,\n ]);\n\n $this->crud->addField([\n 'label' => ucfirst(__('volunteer')),\n 'name' => 'user_id',\n 'type' => 'select2_from_ajax',\n 'entity' => 'user',\n 'attribute' => 'name',\n 'model' => '\\App\\User',\n 'placeholder' => '',\n 'minimum_input_length' => 2,\n 'data_source' => null,\n 'attributes' => [\n 'disabled' => 'disabled',\n ],\n ]);\n }\n\n $this->crud->addField([\n 'label' => __('Notes'),\n 'name' => 'notes',\n 'type' => 'textarea',\n ]);\n\n $this->separator();\n\n // ------ CRUD COLUMNS\n $this->crud->addColumns(['id', 'name', 'email', 'phone', 'user_id']);\n\n $this->crud->setColumnDetails('id', [\n 'label' => 'ID',\n ]);\n\n $this->crud->setColumnDetails('name', [\n 'label' => __('Name'),\n ]);\n\n $this->crud->setColumnDetails('email', [\n 'label' => __('Email'),\n 'type' => 'email',\n ]);\n\n $this->crud->setColumnDetails('phone', [\n 'label' => __('Phone'),\n ]);\n\n $this->crud->setColumnDetails('user_id', [\n 'label' => ucfirst(__('volunteer')),\n 'type' => 'model_function',\n 'limit' => 120,\n 'function_name' => 'getUserLinkAttribute',\n\n 'orderable' => true,\n 'orderLogic' => function ($query, $column, $direction) {\n return $query->selectRaw('fats.*')\n ->leftJoin('users', 'users.id', '=', 'fats.user_id')\n ->orderBy('users.name', $direction);\n },\n ]);\n\n if (is('admin')) {\n $this->crud->addColumn([\n 'label' => ucfirst(__('headquarter')),\n 'type' => 'select',\n 'entity' => 'headquarters',\n 'attribute' => 'name',\n 'model' => \"App\\Models\\Headquarter\",\n ]);\n }\n\n // Filtrers\n if (is('admin')) {\n $this->crud->addFilter([\n 'name' => 'user',\n 'type' => 'select2_ajax',\n 'label' => ucfirst(__('volunteer')),\n 'placeholder' => __('Select a volunteer'),\n ],\n url('admin/user/ajax/filter/' . User::ROLE_VOLUNTEER),\n function ($value) {\n $this->crud->addClause('where', 'user_id', $value);\n });\n\n $this->crud->addFilter([\n 'name' => 'headquarter_id',\n 'type' => 'select2_multiple',\n 'label' => ucfirst(__('headquarter')),\n 'placeholder' => __('Select a headquarter'),\n ],\n $this->wantsJSON() ? null : api()->headquarterList(),\n function ($values) {\n $this->crud->addClause('whereHas', 'headquarters', function ($query) use ($values) {\n $query->whereIn('headquarter_id', json_decode($values) ?: []);\n })->get();\n });\n }\n\n // ------ CRUD ACCESS\n $this->crud->enableDetailsRow();\n $this->crud->allowAccess('details_row');\n\n if (!is('admin', 'adoptions')) {\n $this->crud->denyAccess(['list', 'create', 'update']);\n }\n\n if (!is('admin')) {\n $this->crud->denyAccess(['delete']);\n\n $this->crud->addClause('whereHas', 'headquarters', function ($query) {\n $headquarters = restrictToHeadquarters();\n $query->whereIn('headquarter_id', $headquarters ?: []);\n });\n }\n\n // ------ ADVANCED QUERIES\n $this->crud->addClause('with', ['user']);\n\n $this->crud->addClause('orderBy', 'id', 'DESC');\n\n // Add asterisk for fields that are required\n $this->crud->setRequiredFields(StoreRequest::class, 'create');\n $this->crud->setRequiredFields(UpdateRequest::class, 'edit');\n }",
"public function setup()\n {\n $this->crud->setModel('App\\Models\\Category');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/category');\n $this->crud->setEntityNameStrings('category', 'categories');\n\n /*\n |--------------------------------------------------------------------------\n | CrudPanel Configuration\n |--------------------------------------------------------------------------\n */\n\n // TODO: remove setFromDb() and manually define Fields and Columns\n// $this->crud->setFromDb();\n $arr=\n [\n [\n 'name'=>'orderBy',\n 'label'=>'Order',\n 'type'=>'number'\n ]\n , [\n 'name'=>'name',\n 'label'=>'Name',\n 'type'=>'text'\n ]\n ,[\n 'name' => 'image', // The db column name\n 'label' => \"Category image\", // Table column heading\n 'type' => 'upload',\n 'prefix'=>'uploads/category',\n 'height'=>'150px',\n 'width'=>'150px',\n 'upload' => true,\n ]\n ];\n $this->crud->addFields([\n [\n 'name'=>'orderBy',\n 'label'=>'orderBy',\n 'type'=>'number'\n ],\n [\n 'name'=>'name',\n 'label'=>'Name',\n 'type'=>'text'\n ]\n ,[\n 'name' => 'image', // The db column name\n 'label' => \"Category image\", // Table column heading\n 'type' => 'upload',\n 'prefix'=>'uploads/',\n 'upload' => true,\n ],\n [\n 'name' => 'active',\n 'label' => 'Active',\n 'type' => 'checkbox'\n ]\n ]);\n\n $this->crud->addColumns([\n [\n 'name'=>'orderBy',\n 'label'=>'Order',\n 'type'=>'number'\n ],\n [\n 'name'=>'name',\n 'label'=>'Name',\n 'type'=>'text'\n ]\n ,[\n 'name' => 'image', // The db column name\n 'label' => \"Category image\", // Table column heading\n 'type' => 'image',\n 'prefix'=>'uploads/',\n 'height'=>'300px',\n 'width'=>'300px',\n ],\n [\n 'name' => 'active',\n 'label' => 'Active',\n 'type' => 'boolean'\n ]\n ]);\n\n $this->crud->enableBulkActions();\n $this->crud->addBulkDeleteButton();\n// $this->crud->enableDetailsRow();\n// $this->crud->allowAccess('details_row');\n $this->crud->allowAccess('show');\n $this->crud->enableExportButtons();\n // add asterisk for fields that are required in CategoryRequest\n $this->crud->setRequiredFields(StoreRequest::class, 'create');\n $this->crud->setRequiredFields(UpdateRequest::class, 'edit');\n }",
"protected function setupCreateOperation()\n {\n CRUD::setValidation(StudentRequest::class);\n CRUD::addField([\n 'name' => 'candidate_name',\n 'wrapper' => ['class' => 'form-group col-md-6'],\n ]);\n CRUD::addField([\n 'name' => 'father_name',\n 'wrapper' => ['class' => 'form-group col-md-6'],\n ]);\n CRUD::addField([\n 'name' => 'phone',\n 'wrapper' => ['class' => 'form-group col-md-6'],\n ]);\n CRUD::addField([\n 'name' => 'address',\n 'wrapper' => ['class' => 'form-group col-md-6'],\n ]);\n CRUD::addField([\n 'name' => 'cnic',\n 'wrapper' => ['class' => 'form-group col-md-6'],\n ]);\n CRUD::addField([\n 'label' => 'School Roll Number',\n 'name' => 'school_rollnumber',\n 'wrapper' => ['class' => 'form-group col-md-6'],\n ]);\n CRUD::addField([\n 'name' => 'religion',\n 'wrapper' => ['class' => 'form-group col-md-6'],\n ]);\n $this->crud->addField([ // select_from_array\n 'name' => 'gender',\n 'wrapper' => ['class' => 'form-group col-md-6'],\n 'label' => \"Gender\",\n 'type' => 'select_from_array',\n 'options' => ['male' => 'Male', 'female' => 'Female'],\n 'allows_null' => false,\n 'default' => 'male',\n // 'allows_multiple' => true, // OPTIONAL; needs you to cast this to array in your model;\n ]);\n $this->crud->addField(\n [ // date_picker\n 'name' => 'date_of_birth',\n 'type' => 'date_picker',\n 'label' => 'Date',\n 'wrapper' => ['class' => 'form-group col-md-6'],\n // optional:\n 'date_picker_options' => [\n 'todayBtn' => 'linked',\n 'format' => 'dd-mm-yyyy',\n 'language' => 'en'\n ],\n ],\n );\n if (auth()->user()->can('manage_all_student')) {\n $this->crud->addField([\n 'label' => 'School',\n 'wrapper' => ['class' => 'form-group col-md-6'],\n 'type' => 'relationship',\n 'name' => 'school_id', // the db column for the foreign key\n 'entity' => 'school', // the method that defines the relationship in your Model\n 'attribute' => 'name', // foreign key attribute that is shown to user\n 'model' => 'App\\Models\\School',\n\n ]);\n } else {\n $this->crud->addField([\n 'label' => 'School',\n 'wrapper' => ['class' => 'form-group col-md-6'],\n 'type' => 'hidden',\n 'name' => 'school_id', // the db column for the foreign key\n 'value' => auth()->user()->school->id,\n\n ]);\n }\n\n $this->crud->addField([\n 'label' => \"Student Image\",\n 'name' => \"image\",\n 'type' => 'image',\n 'crop' => true, // set to true to allow cropping, false to disable\n 'aspect_ratio' => 0, // ommit or set to 0 to allow any aspect ratio\n // 'disk' => 's3_bucket', // in case you need to show images from a different disk\n // 'prefix' => 'uploads/images/profile_pictures/' // in case your db value is only the file name (no path), you can use this to prepend your path to the image src (in HTML), before it's shown to the user;\n ]);\n $this->crud->addFields(static::getFieldsArrayForLoginTab());\n\n\n /**\n * Fields can be defined using the fluent syntax or array syntax:\n * - CRUD::field('price')->type('number');\n * - CRUD::addField(['name' => 'price', 'type' => 'number']));\n */\n }",
"protected function setupCreateOperation()\n {\n CRUD::setValidation(LocationRequest::class);\n\n CRUD::field('name');\n CRUD::field('bookinglink')->label('Booking URL');\n CRUD::field('phone')->label('Booking Phone');\n CRUD::field('provider_url')->label('Provider URL');\n CRUD::field('provider_phone');\n CRUD::field('address')\n ->type('textarea');\n CRUD::field('alternate_addresses')\n ->label('Alternate Addresses (first line of additional addresses for matching purposes only; one per line)')\n ->type('textarea');\n //CRUD::field('address2');\n //CRUD::field('city');\n //CRUD::field('state');\n CRUD::field('zip');\n CRUD::field('serves');\n CRUD::field('vaccinesoffered');\n CRUD::field('siteinstructions');\n CRUD::field('daysopen');\n CRUD::field('county');\n CRUD::field('latitude');\n CRUD::field('longitude');\n CRUD::field('system_type');\n CRUD::addField([\n 'name' => 'appointmentTypes',\n 'entity' => 'appointmentTypes',\n 'type' => 'relationship',\n 'attribute' => 'name',\n ]);\n CRUD::addField([\n 'name' => 'location_type_id',\n 'entity' => 'type',\n 'type' => 'relationship',\n 'attribute' => 'name',\n ]);\n CRUD::addField([\n 'name' => 'location_type_id',\n 'entity' => 'type',\n 'type' => 'relationship',\n 'attribute' => 'name',\n ]);\n CRUD::addField([\n 'name' => 'location_source_id',\n 'entity' => 'locationSource',\n 'type' => 'relationship',\n 'attribute' => 'name',\n ]);\n CRUD::addField([\n 'name' => 'data_update_method_id',\n 'entity' => 'dataUpdateMethod',\n 'type' => 'relationship',\n 'attribute' => 'name',\n ]);\n CRUD::addField([\n 'name' => 'collector_user_id',\n 'entity' => 'collectorUser',\n 'type' => 'relationship',\n 'attribute' => 'name',\n ]);\n CRUD::field('tags');\n\n /**\n * Fields can be defined using the fluent syntax or array syntax:\n * - CRUD::field('price')->type('number');\n * - CRUD::addField(['name' => 'price', 'type' => 'number'])); \n */\n }",
"public function setup() {\n $this->crud->setModel('App\\Models\\Logistics');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/logistics');\n $this->crud->setEntityNameStrings('logistics', 'logistics');\n $this->crud->setColumns(['cedula', 'nombres', 'apellido1', 'apellido2', 'fecha_nacimiento', 'genero', 'fecha_ingreso', 'numero_empleado', 'cargo', 'jefe', 'zona', 'municipio', 'departamento', 'ventas_2019', 'email', 'password', 'imagen', 'celular']);\n $this->crud->addField([\n 'name' => 'cedula',\n 'type' => 'number',\n 'label' => \"Cedula\"\n ]);\n $this->crud->addField([\n 'name' => 'nombres',\n 'type' => 'text',\n 'label' => \"Nombres\"\n ]);\n $this->crud->addField([\n 'name' => 'apellido1',\n 'type' => 'text',\n 'label' => \"Primer Apellido\"\n ]);\n $this->crud->addField([\n 'name' => 'apellido2',\n 'type' => 'text',\n 'label' => \"Segundo Apellido\"\n ]);\n $this->crud->addField([\n 'name' => 'fecha_nacimiento',\n 'type' => 'date',\n 'label' => \"Fecha Nacimiento\"\n ]);\n $this->crud->addField([\n 'name' => 'genero',\n 'type' => 'text',\n 'label' => \"Sexo\"\n ]);\n $this->crud->addField([\n 'name' => 'fecha_ingreso',\n 'type' => 'date',\n 'label' => \"Fecha Ingreso\"\n ]);\n $this->crud->addField([\n 'name' => 'numero_empleado',\n 'type' => 'number',\n 'label' => \"Numero Empleados\"\n ]);\n $this->crud->addField([\n 'name' => 'cargo',\n 'type' => 'text',\n 'label' => \"Cargo\"\n ]);\n $this->crud->addField([\n 'name' => 'jefe',\n 'type' => 'text',\n 'label' => \"Jefe\"\n ]);\n $this->crud->addField([\n 'name' => 'zona',\n 'type' => 'text',\n 'label' => \"Zona\"\n ]);\n $this->crud->addField([\n 'name' => 'municipio',\n 'type' => 'text',\n 'label' => \"Municipio\"\n ]);\n $this->crud->addField([\n 'name' => 'departamento',\n 'type' => 'text',\n 'label' => \"Departamento\"\n ]);\n $this->crud->addField([\n 'name' => 'ventas_2019',\n 'type' => 'number',\n 'label' => \"Ventas\"\n ]);\n $this->crud->addField([\n 'name' => 'email',\n 'type' => 'email',\n 'label' => \"Correo Electronico\"\n ]);\n $this->crud->addField([\n 'name' => 'password',\n 'type' => 'password',\n 'label' => \"Contraseña\"\n ]);\n $this->crud->addField([\n 'name' => 'imagen',\n 'type' => 'text',\n 'label' => \"Imagen\"\n ]);\n $this->crud->addField([\n 'name' => 'celular',\n 'type' => 'number',\n 'label' => \"Numero Celular\"\n ]);\n\n /*\n |--------------------------------------------------------------------------\n | CrudPanel Configuration\n |--------------------------------------------------------------------------\n */\n\n // TODO: remove setFromDb() and manually define Fields and Columns\n $this->crud->setFromDb();\n\n // add asterisk for fields that are required in LogisticsRequest\n// $this->crud->setRequiredFields(StoreRequest::class, 'create');\n// $this->crud->setRequiredFields(UpdateRequest::class, 'edit');\n $this->crud->enableExportButtons();\n }",
"public function setup()\n {\n $this->crud->setModel('App\\Models\\ActionsOption');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/actions-options');\n $this->crud->setEntityNameStrings(trans('fields.action_option'), trans('fields.action_options'));\n\n /*\n |--------------------------------------------------------------------------\n | CrudPanel Configuration\n |--------------------------------------------------------------------------\n */\n\n\n $this->crud->removeButton('delete');\n\n $this->crud->addButtonFromView('line', 'delete-mandatory', 'delete-mandatory', 'end');\n\n\n $this->crud->setColumns([\n [\n // 1-n relationship\n 'label' => trans('fields.event'),\n 'type' => \"select\",\n 'name' => 'event_id', // the column that contains the ID of that connected entity;\n 'entity' => 'event', // the method that defines the relationship in your Model\n 'attribute' => \"name\", // foreign key attribute that is shown to user\n 'model' => \"App\\Models\\Event\", // foreign key model\n ],\n [\n // 1-n relationship\n 'label' => trans('fields.device'),\n 'type' => \"select\",\n 'name' => 'device_id', // the column that contains the ID of that connected entity;\n 'entity' => 'device', // the method that defines the relationship in your Model\n 'attribute' => \"name\", // foreign key attribute that is shown to user\n 'model' => \"App\\Models\\Device\", // foreign key model\n ],\n [ // Enum\n 'name' => 'type',\n 'label' => trans('fields.type'),\n 'type' => 'enum'\n ],\n [\n 'name' => 'key',\n 'label' => trans('fields.key'),\n 'type' => 'number',\n ],\n [\n 'name' => 'name',\n 'label' => trans('fields.name'),\n 'type' => 'text',\n ],\n ]);\n\n // Fields\n $this->crud->addFields([\n [\n 'name' => 'name',\n 'label' => trans('fields.name'),\n 'type' => 'text',\n ],\n [\n 'name' => 'key',\n 'label' => trans('fields.key'),\n 'type' => 'number',\n ],\n [ // Select2\n 'label' => trans('fields.event'),\n 'type' => 'select2',\n 'name' => 'event_id', // the db column for the foreign key\n 'entity' => 'event', // the method that defines the relationship in your Model\n 'attribute' => 'name', // foreign key attribute that is shown to user\n 'model' => \"App\\Models\\Event\", // foreign key model\n ],\n [ // Enum\n 'name' => 'type',\n 'label' => trans('fields.type'),\n 'type' => 'enum'\n ],\n [ // Select2\n 'label' => trans('fields.device'),\n 'type' => 'select2',\n 'name' => 'device_id', // the db column for the foreign key\n 'entity' => 'device', // the method that defines the relationship in your Model\n 'attribute' => 'name', // foreign key attribute that is shown to user\n 'model' => \"App\\Models\\Device\", // foreign key model\n ],\n [\n 'name' => 'company_id',\n 'type' => 'hidden',\n 'value' => backpack_user()->company->id\n ],\n ]);\n\n // add asterisk for fields that are required in EmployeeActionOptionRequest\n $this->crud->setRequiredFields(StoreRequest::class, 'create');\n $this->crud->setRequiredFields(UpdateRequest::class, 'edit');\n }",
"public function setup()\n {\n $this->crud->setModel('App\\Models\\User');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/user');\n $this->crud->setEntityNameStrings('user', 'users');\n\n // TODO: remove setFromDb() and manually define Fields and Columns\n\n // add asterisk for fields that are required in UserRequest\n\n $this->crud->addColumns([\n 'title',\n 'name',\n [\n 'name' => 'email', // The db column name\n 'label' => \"Email Address\", // Table column heading\n 'type' => 'email',\n ],\n [\n 'name' => 'isActive',\n 'label' => 'Active',\n 'type' => 'boolean',\n // optionally override the Yes/No texts\n 'options' => [1 => 'Active', 0 => 'Inactive']\n\n\n ],\n [\n 'name' => \"bdate\", // The db column name\n 'label' => \"Birthday\", // Table column heading\n 'type' => \"date\",\n ],\n [\n 'name' => 'image', // The db column name\n 'label' => \"Profile image\", // Table column heading\n 'type' => 'image',\n 'prefix'=>'uploads/'\n ],\n ]);\n\n\n $this->crud->addFields([\n [\n 'name' => 'title',\n 'label' => 'Title',\n 'type' => 'text'\n ],\n [\n 'name' => 'name',\n 'label' => 'Name',\n 'type' => 'text'\n ],\n [\n 'name' => 'email',\n 'label' => 'Email Address',\n 'type' => 'email'\n ],\n [\n 'name' => 'des',\n 'label' => 'Description',\n 'type' => 'textarea'\n ],\n [ // date_picker\n 'name' => 'bdate',\n 'type' => 'date',\n 'label' => 'Birthday',\n // optional:\n 'date_picker_options' => [\n 'todayBtn' => 'linked',\n 'format' => 'dd-mm-yyyy',\n 'language' => 'fr'\n ],\n ],\n [\n 'label' => \"Profile Image\",\n 'name' => 'image',\n 'type' => 'upload',\n 'upload' => true,\n ],\n [ // Password\n 'name' => 'password',\n 'label' => 'Password',\n 'type' => 'password'\n ],\n [ // Password\n 'name' => 'password_confirmation',\n 'label' => 'password Confirmation',\n 'type' => 'password'\n ],\n [\n 'name' => 'isActive',\n 'label' => \"Active\",\n 'type' => 'select2_from_array',\n 'options' => [1 => 'Active', 0 => 'not Active'],\n 'allows_null' => false,\n 'default' => 1,\n ],\n [\n 'name' => 'is_admin',\n 'label' => \"Admin\",\n 'type' => 'select2_from_array',\n 'options' => [0 => 'User',1 => 'Admin'],\n 'allows_null' => false,\n 'default' => 0,\n ]\n ]);\n $this->crud->enableBulkActions();\n $this->crud->addBulkDeleteButton();\n// $this->crud->enableDetailsRow();\n// $this->crud->allowAccess('details_row');\n $this->crud->allowAccess('show');\n $this->crud->enableExportButtons();\n// $this->crud->allowAccess('clone');\n $this->crud->setRequiredFields(StoreRequest::class, 'create');\n $this->crud->setRequiredFields(UpdateRequest::class, 'edit');\n }",
"public function setup()\n {\n $this->crud->setModel('App\\Models\\Sala');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/sala');\n $this->crud->setEntityNameStrings('sala', 'salas');\n\n /*\n |--------------------------------------------------------------------------\n | CrudPanel Configuration\n |--------------------------------------------------------------------------\n */\n\n // TODO: remove setFromDb() and manually define Fields and Columns\n $this->crud->setFromDb();\n $this->crud->modifyField(\n 'nome',\n [\n 'name' => 'nome',\n 'label' => 'Nome da Sala',\n 'type' => 'text',\n 'attributes' => [\n 'maxlength' => '50',\n ]\n ]\n );\n\n $this->crud->modifyField(\n 'capacidade',\n [\n 'name' => 'capacidade',\n 'label' => 'Capacidade da Sala',\n 'type' => 'textnumeric',\n 'max' => '9'\n ]\n );\n // add asterisk for fields that are required in SalaRequest\n $this->crud->setRequiredFields(StoreRequest::class, 'create');\n $this->crud->setRequiredFields(UpdateRequest::class, 'edit');\n }",
"public function run()\n {\n Category::create([\n 'id' => 1,\n 'name' => 'laptops'\n ]);\n Category::create([\n 'id' => 2,\n 'parent_id' => 1,\n 'name' => 'lenovo'\n ]);\n\n \\App\\Models\\CategoryField::create([\n 'id' => 1,\n 'category_id' => 1,\n 'field' => 'ram',\n 'type' => 'string',\n 'required' =>true\n ]);\n\n \\App\\Models\\Product::create([\n 'id' => 1,\n 'category_id' => 1,\n 'name' => 'g505',\n 'image' => 'aaaa',\n 'price' =>500\n ]);\n\n \\App\\Models\\ProductValue::create([\n 'id' => 1,\n 'product_id' => 1,\n 'field_id' => 1,\n 'value' => 'aaaa'\n ]);\n }",
"protected function setupCreateOperation()\n {\n CRUD::setValidation(UserRequest::class);\n\n CRUD::field('first_name');\n CRUD::field('last_name');\n CRUD::field('username');\n CRUD::field('email');\n CRUD::field('password');\n CRUD::field('status');\n\n // $password = bcrypt('Password');\n // CRUD::field($password);\n\n /**\n * Fields can be defined using the fluent syntax or array syntax:\n * - CRUD::field('price')->type('number');\n * - CRUD::addField(['name' => 'price', 'type' => 'number'])); \n */\n }",
"function crud_generate() {\n try {\n $app = Slim\\Slim::getInstance();\n\n $gii = new easyuigii;\n $gii->app_name = $app->request->params('app_name');\n $gii->app_folder = $app->request->params('app_folder');\n $gii->table_name = $app->request->params('table_name');\n $gii->model_from_json = $app->request->params('model_from_json');\n $gii->table_model = $app->request->params('model');\n\n $gii->html_prefix = $app->request->params('html_prefix');\n $gii->crud = $app->request->params('crud');\n $gii->pagination = $app->request->params('pagination');\n $gii->pagination_list = $app->request->params('pagination_list');\n $gii->pagination_size = $app->request->params('pagination_size');\n $gii->dg_inline = $app->request->params('dg_inline');\n $gii->width_form = $app->request->params('width_form');\n $gii->height_form = $app->request->params('height_form');\n $gii->form_full = $app->request->params('form_full');\n $gii->row_num = $app->request->params('row_num');\n $gii->ck_title = $app->request->params('ck_title');\n $gii->title = $app->request->params('title');\n $gii->filter_base = $app->request->params('filter_base');\n $gii->ck_custom_sql = $app->request->params('ck_custom_sql');\n $gii->custom_sql = $app->request->params('custom_sql');\n $gii->ck_custom_sql2 = $app->request->params('ck_custom_sql2');\n $gii->custom_sql2 = $app->request->params('custom_sql2');\n $gii->ck_global_var = $app->request->params('ck_global_var');\n $gii->global_var = $app->request->params('global_var');\n $gii->ck_row_styler = $app->request->params('ck_row_styler');\n $gii->row_styler = $app->request->params('row_styler');\n $gii->group_col = $app->request->params('group_col');\n $gii->lock_col = $app->request->params('lock_col');\n $gii->ck_load_dg = $app->request->params('ck_load_dg');\n $gii->ck_model_xls = $app->request->params('ck_model_xls');\n $gii->model_xls = $app->request->params('model_xls');\n\n $gii->build_app_crud();\n\n $app->render(200, ['success' => true, 'msg' => \"eseguito\"]);\n\n ($gii->debug_on_file) ? error_log(logTime() . basename(__FILE__) . \" \" . __FUNCTION__ . PHP_EOL, 3, 'logs/fn.log') : false;\n } catch (Exception $e) {\n $app->render(200, ['isError' => true, 'msg' => $e->getMessage()]);\n error_log(LogTime() . $e->getMessage() . PHP_EOL, 3, 'logs/error.log');\n }\n}",
"private function scaffold()\n {\n if (isset($this->args['extra']))\n {\n $extra = $this->args['extra'];\n unset($this->args['extra']);\n }\n else\n {\n $extra = array();\n }\n\n $this->args['name'] = Inflector::pluralize($this->args['name']);\n $this->args['filename'] = $this->args['name'] . '.php';\n $this->args['extra'] = array('index', 'create', 'view', 'edit', 'delete');\n $this->extra = $this->generate_controller_actions($this->args['name'], $this->args['extra']);\n $this->controller();\n\n $this->args['name'] = Inflector::singularize($this->args['name']);\n $this->args['filename'] = $this->args['name'] . '.php';\n $this->args['extra'] = $extra;\n $this->extra = $this->generate_migration_statement($this->args['name'], $this->args['extra']);\n $this->model();\n }",
"public function index()\n\t{\n\n\t\t$this->_crud->set_table('ent_cr_recipes');\n\t\t$this->_crud->set_subject('Recipe');\n\n\t\t/*\n\t\t * Setting relation betweent category & story table and accessing name field to use\n\t\t*/\n\t\t$this->_crud->set_relation('ent_cr_categories_id','ent_cr_categories','title');\n\n\t\t/*\n\t\t * Setting text to display for more readablity\n\t\t*/\n\t\t$this->_crud->display_as('ent_cr_categories_id','Recipe Category')\n\t\t->display_as('name', 'Name of recipe submitter')\n\t\t->display_as('title', 'Title of Recipe');\n\n\t\t/*\n\t\t * Defining fields that show on Add & Edit forms if you want different then use add_fields & edit_fields\n\t\t*/\n\t\t$this->_crud->fields('title', 'description', 'name', 'email', 'status','ent_cr_categories_id');\n\n\t\t/*\n\t\t * setting rules for the Grocery CRUD to look for\n\t\t*/\n\t\t$this->_crud->set_rules('email', 'Email of submitter', 'trim|valid_email');\n\n\t\t/*\n\t\t * Setting required field for CRUD operation, can also be replaced by set_rules method;\n\t\t* But most of the fields are requred, so this method is easier\n\t\t*/\n\t\t$this->_crud->required_fields('title', 'description', 'name', 'email', 'ent_cr_categories_id');\n\t\tstatic::$data['name'] = 'crud';\n\t\tstatic::$data['content_replace'] = $this->_crud->render();\n\n\t\t$this->_crud_output('main', static::$data);\n\t}",
"public function setup()\n {\n $this->crud->setModel('App\\Models\\Manufacturer');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/manufacturer');\n $this->crud->setEntityNameStrings('manufacturer', 'manufacturers');\n\n $this->crud->logFrom = 'manufacturer';\n $this->crud->addButtonFromView('line','showLog','show_log','end');\n\n /*\n |--------------------------------------------------------------------------\n | CrudPanel Configuration\n |--------------------------------------------------------------------------\n */\n\n // TODO: remove setFromDb() and manually define Fields and Columns\n $this->crud->addFields\n ([\n [\n 'label' => 'Название',\n 'type' => 'text',\n 'name' => 'title'\n ],\n [\n 'label' => 'Описание',\n 'type' => 'summernote',\n 'name' => 'description'\n ],\n [\n 'label' => 'Мета H1',\n 'type' => 'text',\n 'name' => 'h1'\n ],\n [\n 'label' => 'Мета title',\n 'type' => 'text',\n 'name' => 'meta_title'\n ],\n [\n 'label' => 'Мета description',\n 'type' => 'text',\n 'name' => 'meta_description'\n ],\n [\n 'label' => 'Фото',\n 'type' => 'browse_custom',\n 'name' => 'image'\n ],\n [\n 'label' => 'Порядок сортировки',\n 'type' => 'number',\n 'name' => 'sort_order',\n 'default' => 0\n ],\n [\n 'label' => 'Статус',\n 'type' => 'select_from_array',\n 'name' => 'active',\n 'options' => [\n 0 => 'Выкл',\n 1 => 'Вкл'\n ]\n ],\n [\n 'label' => 'Поле object_type таблицы urls',\n 'name' => 'object_type',\n 'type' => 'hidden',\n 'entity' => 'url',\n 'model' => 'App\\Models\\Url',\n 'value' => 'manufacturer'\n ],\n [\n 'label' => 'SEO Url товара',\n 'name' => 'url',\n 'type' => 'text',\n 'entity' => 'url',\n 'model' => 'App\\Models\\Url',\n ],\n ]);\n\n $this->crud->getCurrentEntry();\n if($this->crud->entry && $this->crud->entry->url->url){\n $this->crud->addfield([\n 'label' => 'Ссылка',\n 'name' => 'href',\n 'type' => 'href',\n 'value' => url($this->crud->entry->url->url),\n ]);\n }\n\n $this->crud->addColumn([\n 'label' => 'Название',\n 'type' => 'text',\n 'name' => 'title'\n ]);\n\n // add asterisk for fields that are required in ManufacturerRequest\n $this->crud->setRequiredFields(StoreRequest::class, 'create');\n $this->crud->setRequiredFields(UpdateRequest::class, 'edit');\n }",
"public function setup()\n {\n\n /*\n |--------------------------------------------------------------------------\n | CrudPanel Basic Information\n |--------------------------------------------------------------------------\n */\n $this->crud->setModel('App\\Models\\Application');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/application');\n $this->crud->setEntityNameStrings('application', 'applications');\n $this->crud->orderBy('id', 'DESC');\n $this->crud->enableExportButtons();\n $this->crud->denyAccess('create');\n $this->crud->allowAccess('show');\n /*\n |--------------------------------------------------------------------------\n | CrudPanel Configuration\n |--------------------------------------------------------------------------\n */\n $this->crud->addColumns([\n [\n 'name' => 'id',\n 'label' => 'ID'\n ],\n [\n 'name' => 'full_name',\n 'label' => 'Full Name'\n ],\n [\n 'name' => 'phone',\n 'label' => 'Phone'\n ],\n [\n 'name' => 'email',\n 'label' => 'Email'\n ],\n [\n 'name' => 'status',\n 'type' => 'text',\n ],\n ]);\n $this->crud->addFields([\n [\n 'name' => 'full_name',\n 'label' => 'Full Name',\n 'wrapperAttributes' => [\n 'class' => 'form-group col-md-6',\n ],\n 'attributes' => [\n 'disabled' => 'disabled',\n ],\n ],\n [\n 'name' => 'phone',\n 'label' => 'Phone',\n 'wrapperAttributes' => [\n 'class' => 'form-group col-md-6',\n ],\n 'attributes' => [\n 'disabled' => 'disabled',\n ],\n ],\n\n [\n 'name' => 'message',\n 'type' => 'textarea',\n 'label' => 'Message',\n 'wrapperAttributes' => [\n 'class' => 'form-group col-md-12',\n ],\n 'attributes' => [\n 'style' => \"resize: none;\",\n 'rows' => 5,\n 'disabled' => 'disabled',\n ],\n ],\n [\n 'name' => 'email',\n 'label' => 'Email',\n 'type' => 'text',\n 'wrapperAttributes' => [\n 'class' => 'form-group col-md-8',\n ],\n 'attributes' => [\n 'disabled' => 'disabled',\n ],\n ],\n [\n 'name' => 'status',\n 'label' => 'Status',\n 'type' => 'enum',\n 'wrapperAttributes' => [\n 'class' => 'form-group col-md-4',\n ],\n ],\n\n [\n 'name' => 'admin_note',\n 'type' => 'textarea',\n 'label' => 'Admin note',\n 'wrapperAttributes' => [\n 'class' => 'form-group col-md-12',\n ],\n 'attributes' => [\n 'style' => \"resize: none;\",\n 'rows' => 5,\n ],\n ],\n ]);\n\n // add asterisk for fields that are required in ApplicationRequest\n $this->crud->setRequiredFields(StoreRequest::class, 'create');\n $this->crud->setRequiredFields(UpdateRequest::class, 'edit');\n }",
"public function setup()\n {\n $this->crud->setModel('App\\Models\\Trip');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/trip');\n $this->crud->setEntityNameStrings('trip', 'trips');\n\n /*\n |--------------------------------------------------------------------------\n | CrudPanel Configuration\n |--------------------------------------------------------------------------\n */\n\n $this->crud->addButtonFromView('line', 'risk_assessment', 'risk_assessment', 'end');\n $this->crud->addButtonFromView('top', 'download_assessment_form','download_assessment_form','end');\n\n $this->crud->addColumns([\n [\n 'name' => 'user_id',\n 'type' => 'select',\n 'label' => 'Traveller',\n 'entity' => 'user',\n 'model' => User::class,\n 'attribute' => 'name',\n ],\n [\n 'name' => 'start_date',\n 'type' => 'date',\n 'label' => 'Start Date'\n ],\n [\n 'name' => 'end_date',\n 'type' => 'date',\n 'label' => 'End Date'\n ],\n [\n 'name' => 'destination',\n 'type' => 'text',\n 'label' => 'Destination'\n ],\n [\n 'name' => 'itinerary',\n 'type' => 'upload_multiple',\n 'label' => 'Itenerary Docs',\n 'disk' => 'public',\n ],\n [\n 'name' => 'local_contact',\n 'type' => 'Text',\n 'label' => 'Local Contact Info',\n ],\n [\n 'name' => 'status',\n 'type' => 'text',\n 'label' => 'Risk Assessment Status',\n ],\n [\n 'name' => 'risk_assessment',\n 'type' => 'upload_multiple',\n 'label' => 'Risk Assessment Docs',\n 'disk' => 'public',\n ],\n [\n 'name' => 'carbon',\n 'type' => 'number',\n 'label' => 'Carbon Emissions in Tons',\n 'suffix' => ' Tons',\n 'decimals' => 2,\n ],\n [\n 'name' => 'compensation',\n 'type' => 'number',\n 'prefix' => '£',\n\n 'label' => 'Estimated offset cost (£)',\n 'decimals' => 2,\n ],\n ]);\n\n\n\n // add asterisk for fields that are required in TripRequest\n $this->crud->setRequiredFields(StoreRequest::class, 'create');\n $this->crud->setRequiredFields(UpdateRequest::class, 'edit');\n }",
"public function setup()\n {\n $this->crud->setModel('App\\Models\\ItemCategories');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/itemcategories');\n $this->crud->setEntityNameStrings('Item Category', 'Item Categories');\n\n /*\n |--------------------------------------------------------------------------\n | COLUMNS AND FIELDS\n |--------------------------------------------------------------------------\n */\n\n $this->crud->allowAccess('reorder');\n $this->crud->enableReorder('name', 2);\n\n // ------ CRUD COLUMNS\n $this->crud->addColumn([\n 'name' => 'name',\n 'label' => 'Name',\n ]);\n $this->crud->addColumn([\n 'name' => 'slug',\n 'label' => 'Slug',\n ]);\n $this->crud->addColumn([\n 'label' => 'Parent',\n 'type' => 'select',\n 'name' => 'parent_id',\n 'entity' => 'parent',\n 'attribute' => 'name',\n 'model' => \"App\\Models\\ItemCategories\",\n ]);\n\n // ------ CRUD FIELDS\n $this->crud->addField([\n 'name' => 'name',\n 'label' => 'Name',\n ]);\n $this->crud->addField([\n 'name' => 'slug',\n 'label' => 'Slug (URL)',\n 'type' => 'text',\n 'hint' => 'Will be automatically generated from your name, if left empty.',\n // 'disabled' => 'disabled'\n ]);\n $this->crud->addField([\n 'label' => 'Parent',\n 'type' => 'select',\n 'name' => 'parent_id',\n 'entity' => 'parent',\n 'attribute' => 'name',\n 'model' => \"App\\Models\\ItemCategories\",\n ]);\n }",
"public function run()\r\n {\r\n //\r\n DB::table('category_services')->updateOrInsert([\r\n\r\n 'name'=>'Site',\r\n ]);\r\n DB::table('category_services')->updateOrInsert([\r\n\r\n 'name'=>'Envio automático de e-mails',\r\n ]);\r\n DB::table('category_services')->updateOrInsert([\r\n\r\n 'name'=>'Painel de controle do site',\r\n ]);\r\n DB::table('category_services')->updateOrInsert([\r\n\r\n 'name'=>'Formulário de cadastro',\r\n ]);\r\n DB::table('category_services')->updateOrInsert([\r\n\r\n 'name'=>'Controle administrativo de clientes',\r\n ]);\r\n DB::table('category_services')->updateOrInsert([\r\n\r\n 'name'=>'Controle financeiro',\r\n ]);\r\n DB::table('category_services')->updateOrInsert([\r\n\r\n 'name'=>'Controle de produtos',\r\n ]);\r\n }",
"public function setup()\n {\n $this->crud->setModel('App\\Models\\ProductSpec');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/product-spec');\n $this->crud->setEntityNameStrings('product-spec', 'product speces');\n\n /*\n |--------------------------------------------------------------------------\n | CrudPanel Configuration\n |--------------------------------------------------------------------------\n */\n // TODO: remove setFromDb() and manually define Fields and Columns\n\n $this->crud->addColumn([\n 'name'=>'name',\n 'label'=>'Name',\n ]);\n $this->crud->addColumn([\n 'name'=>'price',\n 'label'=>'Price',\n 'type'=>'enum',\n ]);\n $this->crud->addColumn([\n 'name'=>'cost',\n 'label'=>'Cost',\n 'type'=>'enum',\n ]);\n $this->crud->addColumn([\n 'name'=>'status',\n 'label'=>'Status',\n 'type'=>'enum',\n ]);\n $this->crud->addColumn([\n 'name'=>'image',\n 'label'=>'Image',\n 'type'=>'enum',\n ]);\n\n $this->crud->addColumn([\n 'label'=>'Category',\n 'type'=>'select',\n 'name'=>'categories',//categories ជាឈ្មោះfuntionដែលមានក្នុង Modelsរបស់spec ខុសពីុធម្មតា\n 'entity'=>'categories',\n 'attribute'=>'name',//name is category name from product_categories\n 'model'=>'App\\Models\\ProductSpec'\n\n ]);\n\n $this->crud->addField([\n 'name'=>'name',\n 'label'=>'Name',\n 'wrapperAttributes'=>[\n 'class'=>'form-group col-md-4'\n ]\n ]);\n $this->crud->addField([\n 'name'=>'price',\n 'label'=>'Price',\n 'type'=>'enum',\n 'wrapperAttributes'=>[\n 'class'=>'form-group col-md-4'\n ]\n ]);\n $this->crud->addField([\n 'name'=>'cost',\n 'label'=>'Cost',\n 'type'=>'enum',\n 'wrapperAttributes'=>[\n 'class'=>'form-group col-md-4'\n ]\n ]);\n $this->crud->addField([\n 'name'=>'image',\n 'label'=>'Image',\n 'type'=>'enum',\n 'wrapperAttributes'=>[\n 'class'=>'form-group col-md-4'\n ]\n\n ]);\n $this->crud->addField([\n 'name'=>'status',\n 'label'=>'Status',\n 'type'=>'enum',\n 'wrapperAttributes'=>[\n 'class'=>'form-group col-md-4'\n ]\n ]);\n\n $this->crud->addField([\n 'label'=>'Category',\n 'type'=>'select2_multiple',\n 'name'=>'categories',//categories ជាឈ្មោះfuntionដែលមានក្នុង Modelsរបស់spec ខុសពីុធម្មតា\n 'entity'=>'categories',\n 'attribute'=>'name',\n 'model'=>'App\\Models\\ProductCategory',//ខុសពី addColumn ។ វាជាModelរបស់tabel មួយទៀតដែលមានទំនាក់ទំនងជាមួយវា\n 'placeholder'=>\"\",\n 'minimum_input_length'=>0,\n 'pivot'=> true,\n 'wrapperAttributes'=>[\n 'class'=>'form-group col-md-4'\n ]\n ]);\n\n\n\n\n $this->crud->setFromDb();\n\n // add asterisk for fields that are required in ProductSpecRequest\n $this->crud->setRequiredFields(StoreRequest::class, 'create');\n $this->crud->setRequiredFields(UpdateRequest::class, 'edit');\n }",
"public function run()\n {\n FormDefination::create([\n \"name\"=>\"PRODUCT\",\n \"form_json\"=>'{\"PRODUCT NAME\":\"text\",\"PRODUCT CODE\":\"text\",\"PRODUCT COLOR\":\"text\",\"PRODUCT DESCRIPTION\":\"textarea\",\"PRODUCT PRICE\":\"number\",\"PRODUCT IMAGES\":\"file\",\"col\":\"2\",\"col_1\":\"2\",\"row\":\"3\",\"save\":\"Y\",\"cancel\":\"Y\",\"update\":\"Y\",\"delete\":\"Y\"}',\n ]);\n FormDefination::create([\n \"name\"=>\"CATEGORY\",\n \"form_json\"=>'{\"CATEGORY NAME\":\"text\",\"CATELOGUE NAME\":\"text\",\"CATTEGORY DESCRIPTION\":\"textarea\",\"col\":\"1\",\"col_1\":\"2\",\"row\":\"3\",\"save\":\"Y\",\"cancel\":\"Y\",\"update\":\"Y\",\"delete\":\"Y\"}',\n ]);\n FormDefination::create([\n \"name\"=>\"CATELOGUE\",\n \"form_json\"=>'{\"CATELOGUE NAME\":\"text\",\"CATELOGUE DESCRIPTION\":\"textarea\",\"col\":\"2\",\"col_1\":\"2\",\"row\":\"1\",\"save\":\"Y\",\"cancel\":\"Y\",\"update\":\"Y\",\"delete\":\"Y\"}',\n ]);\n }",
"public function run()\n {\n tbl_company::create([\n 'name' => 'company',\n 'email' => '[email protected]',\n 'phone' =>'09-111111111',\n 'address'=>'yangon',\n 'ref_initials'=>'ADM',\n ]);\n }",
"protected function setupListOperation()\n {\n // $this->crud->setFromDb();\n $name = $this->textCol('name', ' Name');\n $email = $this->emailCol('email', 'Email');\n CRUD::addColumns([$name, $email]);\n }",
"protected function setupListOperation()\n {\n // $this->crud->setFromDb();\n $this->crud->addColumns([\n ['name' => 'name', 'type' => 'text', 'label' => 'Name'],\n ['name' => 'description', 'type' => 'text', 'label' => 'Description'],\n ['name' => 'location' , 'type' => 'text' , 'label' => 'Location'],\n ['name' => 'date' , 'type' => 'date' , 'label' => 'Date'],\n [\n 'label' => \"Image\",\n 'name' => \"image\",\n 'type' => 'image',\n 'upload' => true,\n 'crop' => false,\n 'aspect_ratio' => 0,\n ],\n [ // Select\n 'label' => \"Instructor\",\n 'type' => 'select',\n 'name' => 'user_id', // the db column for the foreign key\n 'entity' => 'user', // the method that defines the relationship in your Model\n 'attribute' => 'name', // foreign key attribute that is shown to user\n ]\n ]);\n // $this->crud->addButton();\n $this->crud->filters();\n }",
"public function setup()\n {\n $this->crud->setModel('App\\Models\\User');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/user');\n $this->crud->setEntityNameStrings('user', 'users');\n\n /*\n |--------------------------------------------------------------------------\n | CrudPanel Configuration\n |--------------------------------------------------------------------------\n */\n\n ## Custom columns;\n $this->crud->addColumn([\n 'name' => 'name',\n 'label' => \"Name\",\n ]);\n $this->crud->addColumn([\n 'name' => 'surname',\n 'label' => \"Surname\",\n ]);\n $this->crud->addColumn([\n 'name' => 'email',\n 'label' => \"Email\",\n 'type' => 'email'\n ]);\n\n ## Custom fields\n $this->crud->addField([\n 'name' => 'name',\n 'label' => \"Name\"\n ]);\n $this->crud->addField([\n 'name' => 'surname',\n 'label' => \"Surname\"\n ]);\n $this->crud->addField([\n 'name' => 'birthday',\n 'label' => \"Birthday\",\n 'type' => 'date_picker',\n ]);\n $this->crud->addField([\n 'name' => 'gender',\n 'label' => \"Gender\",\n 'type' => 'select_from_array',\n 'options' => ['null' => 'Select Gender', 'male' => 'Male', 'female' => 'Female'],\n 'allows_null' => false,\n ]);\n $this->crud->addField([\n 'name' => 'phone',\n 'label' => \"Phone\"\n ]);\n $this->crud->addField([\n 'name' => 'address',\n 'label' => \"Address\"\n ]);\n $this->crud->addField([\n 'name' => 'password',\n 'label' => \"Password\"\n ]);\n $this->crud->addField([\n 'name' => 'email',\n 'label' => \"Email\",\n 'type' => 'email'\n ]);\n $this->crud->addField([ // Upload\n 'name' => 'avatar',\n 'label' => 'Avatar',\n 'type' => 'upload',\n 'upload' => true,\n 'disk' => 'public'\n ]);\n $this->crud->addField([ // Select2 = 1-n relationship\n 'label' => 'Blood Type',\n 'type' => 'select',\n 'name' => 'blood_type_id', // the db column for the foreign key\n 'entity' => 'bloodType', // the method that defines the relationship in your Model\n 'attribute' => 'title',\n 'model' => \"App\\Models\\BloodType\",\n ]);\n $this->crud->addField([\n 'name' => 'is_admin',\n 'label' => \"Administrator\",\n 'type' => 'select_from_array',\n 'options' => ['0' => 'No', '1' => 'Yes',],\n 'allows_null' => false,\n ]);\n\n // add asterisk for fields that are required in UserRequest\n $this->crud->setRequiredFields(StoreRequest::class, 'create');\n $this->crud->setRequiredFields(UpdateRequest::class, 'edit');\n }",
"public function run()\n {\n Tipo::create([ \n 'nombre' => 'Incumplimiento' \n ]);\n Tipo::create([ \n 'nombre' => 'Situación de riesgo' \n ]);\n Tipo::create([ \n 'nombre' => 'Accidente / Avería' \n ]);\n\n Status::create([ \n 'codigo'=> 'inicio', \n 'nombre'=>'Inicio' ]\n );\n Status::create([ \n 'codigo'=> 'pendiente-propuesta', \n 'nombre'=>'Pendiente propuesta'\n ]);\n Status::create([ \n 'codigo'=> 'pendiente-revision', \n 'nombre'=>'Pendiente revisión' \n ]);\n Status::create([ \n 'codigo'=> 'en-progreso', \n 'nombre'=>'En progreso' \n ]);\n Status::create([ \n 'codigo'=> 'corregido', \n 'nombre'=>'Corregido' \n ]);\n Status::create([ \n 'codigo'=> 'verificado', \n 'nombre'=>'Verificado' \n ]);\n Status::create([ \n 'codigo'=> 'cerrado', \n 'nombre'=>'Cerrado' \n ]);\n\n Role::create([\n 'name'=>'admin',\n ]);\n\n Role::create([\n 'name' => 'director',\n ]);\n\n Role::create([\n 'name' => 'responsable'\n ]);\n\n Role::create([\n 'name' => 'creador'\n ]);\n\n $user = User::create([\n 'name' =>'Admin',\n 'email'=>'admin@localhost',\n 'password'=>'admin',\n 'serie_documentos'=>'ADM',\n ]);\n $user->addRole('admin');\n $user->addRole('creador');\n $user->addRole('director');\n $user->addRole('responsable');\n }",
"public function setup()\n {\n $this->crud->setModel('App\\Models\\Order');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/order');\n $this->crud->setEntityNameStrings('order', 'orders');\n\n /*\n |--------------------------------------------------------------------------\n | BASIC CRUD INFORMATION\n |--------------------------------------------------------------------------\n */\n\n // $this->crud->setFromDb();\n\n // ------ CRUD COLUMNS\n /* $this->crud->addColumn([ // SELECT\n 'label' => 'Hotel Category',\n 'type' => 'select2',\n 'name' => 'hotel_categories_id',\n 'entity' => 'hotel_categories',\n 'attribute' => 'name',\n 'model' => \"App\\Models\\HotelCategory\",\n ]);*/\n $this->crud->addColumn([\n 'name' => 'mihpayid',\n 'label' => 'Order ID',\n ]);\n $this->crud->addColumn([\n 'name' => 'firstname',\n 'label' => 'Name',\n ]);\n\n $this->crud->addColumn([\n 'name' => 'email',\n 'label' => 'Email',\n ]);\n\n $this->crud->addColumn([\n 'name' => 'amount',\n 'label' => 'Amount',\n ]);\n $this->crud->addColumn([\n 'name' => 'status',\n 'label' => 'Status',\n ]);\n $this->crud->addColumn([\n 'name' => 'City',\n 'label' => 'City',\n ]);\n $this->crud->addColumn([\n 'name' => 'created_at',\n 'label' => 'Date',\n ]);\n $this->crud->enableAjaxTable();\n\n \n }",
"protected function setupListOperation()\n {\n CRUD::setFromDb(); // columns\n\n $this->crud->setColumns([\n [ \n 'name' => 'id',\n 'label' => 'ID',\n 'type' => 'number',\n\n ],\n [\n 'name' => 'name',\n 'type' => 'text',\n 'label' => 'Name',\n 'orderable' => false,\n ],\n [\n // non-relationship count\n 'name' => 'Customer', // name of relationship method in the model\n 'type' => 'relationship_count', \n 'label' => 'Customers', // Table column heading\n // OPTIONAL\n 'suffix' => '', // to show \"123 tags\" instead of \"123 items\"\n ],\n [\n 'name' => 'type_id',\n 'label' => 'Permission',\n 'type' => 'boolean',\n 'options' => [0 => 'Collector', 1 => 'Administrator']\n ],\n\n ]);\n\n $this->crud->addButtonFromModelFunction('line', 'open_google', 'openReceive', 'beginning');\n }",
"public function run()\n {\n $defaultActions = collect([\n \t'index' => 'See All', \n \t'create' => 'Create', \n \t'store' => 'Store', \n \t'show' => 'View', \n \t'edit' => 'Edit',\n \t'update' => 'Update', \n \t'destroy' => 'Delete']);\n\n $entitiesTables = collect([\n 'brigades',\n\t\t\t'capture_types',\n\t\t\t'citizens',\n\t\t\t'colonies',\n\t\t\t'colony_scopes',\n\t\t\t'permissions',\n\t\t\t'problem_types',\n\t\t\t'request_priorities',\n\t\t\t'request_rejections',\n\t\t\t'request_states',\n\t\t\t'requests',\n\t\t\t'roles',\n\t\t\t'sectors',\n\t\t\t'settlement_types',\n\t\t\t'supervisions',\n\t\t\t'typologies',\n\t\t\t'users',\n 'request_types',\n ]);\n\n foreach ($entitiesTables as $entity) {\n foreach ($defaultActions as $action => $actionDescription) {\n Permission::create([\n 'label' => $actionDescription.' '.studly_case($entity),\n 'name' => $action.'.'.$entity,\n ]);\n }\n }\n\n Permission::create([\n 'label' => 'Configurar Colonies',\n 'name' => 'config.colonies'\n ]);\n Permission::create([\n 'label' => 'Configurar Requests',\n 'name' => 'config.requests',\n ]);\n Permission::create([\n 'label' => 'Configurations options',\n 'name' => 'configurations.options',\n ]);\n }",
"public function run()\n {\n \tSchema::disableForeignKeyConstraints();\n Role::truncate();\n\n Role::insert([\n \t[\n \t\t'name' => 'admin',\n \t\t'description' => 'managment full system'\n \t],\n \t[\n \t\t'name' => 'garage',\n \t\t'description' => 'garage use system'\n \t],\n [\n 'name' => 'user',\n 'description' => 'people use system'\n ],\n ]);\n }",
"public function crud() {\n\t\t\n\t\t$this->load->model('Produttori_model','produttori');\n\t\t$data=array(\"produttore\" => \"franco\");\n\t\t$this->produttori->create($data);\n\t\t$this->produttori->update(array(),1);\n\t\t$this->produttori->delete(3);\n\t\tvar_dump ($this->produttori->read());\n\t\t$this->load->view('welcome_message');\n\t}",
"protected function setupListOperation()\n {\n /*$this->crud->setFromDb();*/\n $this->crud->addColumn(['name' => 'name', 'type' => 'text', 'label' => 'Name']);\n $this->crud->addColumn(['name' => 'sku', 'type' => 'text', 'label' => 'SKU / Product Unique ID']);\n $this->crud->addColumn(['name' => 'price', 'type' => 'text', 'label' => 'Price / €']);\n $this->crud->addColumn(['name' => 'status', 'type' => 'text', 'label' => 'Status']);\n $this->crud->addColumn(['name' => 'user.name', 'type' => 'text', 'label' => 'User Name']);\n $this->crud->addColumn(['name' => 'category.name', 'type' => 'text', 'label' => 'Category']);\n $this->crud->addColumn(['name' => 'publish_date', 'type' => 'text', 'label' => 'Publish Date']);\n $this->crud->addColumn(['name' => 'blocking_date', 'type' => 'text', 'label' => 'Blocking Date']);\n $this->crud->addColumn(['name' => 'created_at', 'type' => 'text', 'label' => 'Created Om']);\n $this->crud->addColumn(['name' => 'updated_at', 'type' => 'text', 'label' => 'Updated On']);\n }",
"public function setup()\n {\n $this->crud->setModel(\"App\\Article\");\n $this->crud->setRoute(config('backpack.base.route_prefix', 'admin').'/article');\n $this->crud->setEntityNameStrings('article', 'articles');\n\n $this->crud->addButtonFromView('line', 'admin_preview', 'admin_preview', 'beginning');\n if (!backpack_user()->can('view_all_articles'))\n $this->crud->addClause('where','user_id','=', backpack_user()->id);\n\n /*\n |--------------------------------------------------------------------------\n | LIST OPERATION\n |--------------------------------------------------------------------------\n */\n $this->crud->operation('list', function () {\n $this->crud->removeButtonFromStack('clone', 'line');\n $this->crud->removeButtonFromStack('show', 'line');\n\n $this->crud->addColumn([\n\n 'label' => 'Author',\n 'type' => 'select',\n 'name' => 'user_id',\n 'entity' => 'user',\n 'attribute' => 'name',\n// 'model' => 'App\\Models\\BackpackUser'\n ]);\n $this->crud->addColumn('title');\n $this->crud->addColumn('description');\n $this->crud->addColumn([\n 'name' => 'post_type',\n 'label' => \"Post Type\",\n 'type' => 'select_from_array',\n 'options' => [\n 0 => \"Normal\",\n 1 => \"Main Post\",\n 2 => \"Post up\",\n 3 => \"Post down\",]\n ]);\n $this->crud->addColumn('status');\n $this->crud->addColumn([\n 'name' => 'featured',\n 'label' => 'Featured',\n 'type' => 'check',\n ]);\n $this->crud->addColumn([\n 'label' => 'Category',\n 'type' => 'select',\n 'name' => 'category_id',\n 'entity' => 'category',\n 'attribute' => 'name',\n ]);\n });\n\n /*\n |--------------------------------------------------------------------------\n | CREATE & UPDATE OPERATIONS\n |--------------------------------------------------------------------------\n */\n $this->crud->operation(['create', 'update'], function () {\n $this->crud->setValidation(\\App\\Http\\Requests\\ArticleRequest::class);\n\n $this->crud->addField([\n 'name' => 'title',\n 'label' => 'Title',\n 'type' => 'text',\n 'placeholder' => 'Your title here',\n ]);\n\n $this->crud->addField([\n 'name' => 'description',\n 'label' => 'Description',\n 'hint' => 'A small description of what the article is about',\n 'type' => 'text',\n 'placeholder' => 'Your description here',\n ]);\n\n $this->crud->addField([\n 'name' => 'slug',\n 'label' => 'Slug (URL)',\n 'type' => 'text',\n 'hint' => 'Will be automatically generated from your title, if left empty.',\n // 'disabled' => 'disabled'\n ]);\n $this->crud->addField([\n 'name' => 'date',\n 'label' => 'Date',\n 'type' => 'date',\n 'default' => date('Y-m-d'),\n ]);\n $this->crud->addField([\n 'name' => 'content',\n 'label' => 'Content',\n 'type' => 'ckeditor',\n 'extra_plugins' => ['image2','widget', 'colorbutton', 'justify', 'find', 'codesnippet', 'embed', 'iframe' ],\n 'options' => [\n 'autoGrow_minHeight' => 200,\n 'autoGrow_bottomSpace' => 50,\n ],\n// 'removePlugins' => 'image,maximize',\n ]);\n $this->crud->addField([\n 'name' => 'image',\n 'label' => 'Image',\n 'type' => 'browse',\n ]);\n $this->crud->addField([\n 'label' => 'Category',\n 'type' => 'select2_multiple',\n 'name' => 'category',\n 'entity' => 'category',\n 'attribute' => 'name',\n 'pivot' => true,\n ]);\n $this->crud->addField([\n 'label' => 'Tags',\n 'type' => 'select2_multiple',\n 'name' => 'tags', // the method that defines the relationship in your Model\n 'entity' => 'tags', // the method that defines the relationship in your Model\n 'attribute' => 'name', // foreign key attribute that is shown to user\n 'pivot' => true, // on create&update, do you need to add/delete pivot table entries?\n ]);\n $this->crud->addField([\n 'name' => 'status',\n 'label' => 'Status',\n 'type' => 'enum',\n ]);\n\n if (backpack_user()->can('make important')){\n $this->crud->addField([\n 'name' => 'post_type',\n 'label' => 'Post Type',\n 'type' => 'radio',\n 'options' => [\n // the key will be stored in the db, the value will be shown as label;\n 0 => \"Normal\",\n 1 => \"Main Post\",\n 2 => \"Post up\",\n 3 => \"Post down\"\n ],\n 'inline' => true,\n ]);\n }\n\n $this->crud->addField([\n 'name' => 'featured',\n 'label' => 'Featured item',\n 'type' => 'checkbox',\n ]);\n\n $this->crud->addField([\n 'name' => 'user_id',\n 'type'=> 'hidden',\n 'value'=> backpack_user()->id,\n ]);\n });\n }",
"public function createTable()\n\t{\n\t\t$app = Factory::getApplication();\n\n\t\tif ($app->isSite())\n\t\t{\n\t\t\techo 'Error creating DB table - Need to run this in admin area';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$user = Factory::getUser();\n\n\t\tif (!$user->authorise('core.admin'))\n\t\t{\n\t\t\techo 'Error creating DB table - You need to be superadmin user to exeacute this task';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$jinput = $app->input;\n\t\t$context = $jinput->get->get('context', '', 'cmd');\n\n\t\tif (empty($context))\n\t\t{\n\t\t\techo 'Error creating DB table - No context is passed';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$model = $this->getModel('indexer');\n\t\t$model->createTable($context);\n\t}",
"protected function setupCreateOperation()\n {\n $this->crud->addField(['name' => 'name', 'type' => 'text', 'label' => 'Name']);\n $this->crud->addField([\n 'name' => 'school_id',\n 'type' => 'select',\n 'label' => 'School Name',\n 'entity' => 'School', // the method that defines the relationship in your Model\n 'attribute' => 'name', // foreign key attribute that is shown to user\n 'model' => \"App\\Models\\School\", // foreign key model\n ]);\n\n /**\n * Fields can be defined using the fluent syntax or array syntax:\n * - CRUD::field('price')->type('number');\n * - CRUD::addField(['name' => 'price', 'type' => 'number']));\n */\n }",
"public function setup()\n {\n $this->crud->setModel('App\\Models\\ExpiredCompany');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/expired-company');\n $this->crud->setEntityNameStrings('Expired Company', 'Expired Companies');\n\n /*\n |--------------------------------------------------------------------------\n | CrudPanel Configuration\n |--------------------------------------------------------------------------\n */\n\n // TODO: remove setFromDb() and manually define Fields and Columns\n // $this->crud->setFromDb();\n $this->setupColumns();\n $this->setupFilters();\n\n // add asterisk for fields that are required in ExpiredCompanyRequest\n $this->crud->setRequiredFields(StoreRequest::class, 'create');\n $this->crud->setRequiredFields(UpdateRequest::class, 'edit');\n\n $this->crud->removeAllButtonsFromStack('top');\n $this->crud->addButtonFromView('line', 'renew', 'renew_company');\n $this->crud->removeButton('update');\n $this->crud->setListView('crud::customize.list');\n $this->crud->removeButtonFromStack('create', 'top');\n $this->crud->enableExportButtons();\n\n if (backpack_user()->hasAnyRole([CAG_VIEWER_ROLE, COMPANY_VIEWER_ROLE])) {\n $this->crud->denyAccess('delete');\n $this->crud->denyAccess('update');\n }\n $this->crud->setEditView('crud::companies.renew');\n }",
"public function run()\n {\n crud::create([\n \t'nama' => 'andi',\n \t'kelas' => '4B',\n \t'alamat' =>'Lamongan'\n ]);\n }",
"public function createAction()\n {\n $this->request()->commandProperties([\n 'name',\n ]);\n\n if (!$name = $this->request()->command('name'))\n return $this->_('ERROR: Empty migration name parameter');\n\n if (!$name = preg_replace('~[^0-9A-z_]+~iu', '', $name))\n return $this->_('ERROR: Wrong migration name parameter');\n\n if (!is_dir(MIGRATE_PATH))\n return $this->_('ERROR: Directory is not exist \"' . MIGRATE_PATH . '\"');\n\n $name = 'Migrate_' . time() . \"_$name\";\n\n $content = @file_get_contents(BASE_PATH . 'base/migrate/create.tpl');\n $content = str_replace('{name}', $name, $content);\n\n @file_put_contents(MIGRATE_PATH . $name . '.php', $content);\n\n return $this->_('Migration \"' . $name . '\" created');\n }",
"private static function do_html_form_create($fields, $table){\n global $dbname;\n global $app_dir;\n $filename = Inflect::singularize($table);\n $form_str = '@extends(\\'layouts.bulma\\')'.\"\\n\";\n $form_str .= '@section(\\'title\\', \\'creating new '.Inflect::singularize($table).'\\')'.\"\\n\";\n $form_str .= '@section(\\'sidebar\\')'.\"\\n\";\n $form_str .= '@parent'.\"\\n\";\n $form_str .= '@endsection'.\"\\n\";\n $form_str .= '@section(\\'content\\')'.\"\\n\";\n $form_str .= '<form action=\"{{ route(\\''.$table.'.create\\') }}\" class=\"form container\" method=\"POST\" enctype=\"multipart/form-data\">';\n $form_str .= \"\\n\".' <h1 class=\"title is-3\">ADD '.strtoupper(str_replace(\"_\",\" \",Inflect::singularize($table))).'</h1>'.\"\\n\";\n foreach($fields as $field){\n $req = false;\n if(strpos($field[\"Type\"], \"int\")>-1 && $field[\"Key\"]!==\"MUL\"){\n if($field[\"Null\"]===\"NO\") $req = true;\n $form_str .= \" \".self::getInputField($field[\"Field\"], \"number\", $table, $req);\n }else if($field[\"Key\"] === \"MUL\"){\n $form_str .= \" \".self::getSelectField($field[\"Field\"], $table);\n }else if(strpos($field[\"Type\"], \"varchar\")>-1){\n if($field[\"Null\"]===\"NO\") $req = true;\n $form_str .= \" \".self::getInputField($field[\"Field\"], \"text\", $table, $req);\n }else if(strpos($field[\"Type\"], \"text\")>-1){\n $form_str .= \" \".self::getTextarea($field[\"Field\"], $table);\n }\n }\n $form_str .= self::getButtonGrp();\n $form_str .= \"</form>\\n@endsection\";\n $file_dir = $app_dir.\"/resources/views/$table\";\n $views_file = $app_dir.\"/resources/views/$table/create.blade.php\";\n if(is_readable($views_file)){\n file_put_contents($views_file, $form_str);\n }else{\n exec(\"mkdir $file_dir\");\n exec(\"chmod -R 755 $app_dir./resources/views/\");\n $fp = fopen($views_file,\"w+\");\n fwrite($fp, \"file created\", 128);\n fclose($fp);\n file_put_contents($views_file, $form_str);\n }\n }",
"private function _get_crud_for_index() {\t\t\n\t\t$data = array(\n\t\t\t'insert' => array(\n\t\t\t\tarray ('name' => 'name', 'label' => t('Role name'), 'type' => 'input',\n\t\t\t\t\t'rules' => array('unique', 'required', array('max_length' => 30, 'min_length' => 3), 'trim'),),\n\t\t\t),\n\t\t\t'select' => array(\n\t\t\t\tarray('name' => 'id', 'label' => 'ID', 'rules' => array('key', 'hidden', 'trim'),),\n\t\t\t\tarray('name' => 'name',\t'label' => t('Role name'), 'link' => 'example1/acl/screens/{id}', \n\t\t\t\t\t'rules' => array('trim', 'htmlspecialchars'),),\n\t\t\t),\n\t\t\t'update' => array(\n\t\t\t\tarray('name' => 'name',\t'label' => t('Role name'), 'type' => 'input', \n\t\t\t\t\t'rules' => array('unique', 'required', array('max_length' => 30, 'min_length' => 3), 'trim'),),\n\t\t\t),\n\t\t\t'delete' => array(\n\t\t\t\tarray('name' => 'name', 'label' => t('Role name'),),\n\t\t\t),\n 'search' => array('name' => t('Role name')),\n\t\t\t'datasource' => array(\n\t\t\t\t'table' => 'oci_roles',\n\t\t\t),\n\t\t\t'properties' => array(\n\t\t\t\t'name' => 'roles',\n\t\t\t\t'uri' => 'example1/roles/index',\n\t\t\t\t'index_column' => TRUE,\n\t\t\t\t'index_column_start' => 1,\n 'pagination' => TRUE,\n\t\t\t\t'pagination_per_page' => 5,\n\t\t\t\t'insert' => TRUE,\n\t\t\t\t'update' => TRUE,\n\t\t\t\t'delete' => TRUE,\n\t\t\t\t'crud_title' => NULL,\n\t\t\t\t'crud_form_title' => '<h2>'.t('List of Roles').'</h2>',\n\t\t\t\t'insert_form_title' => '<h2>'.t('Insert Data').'</h2>',\n\t\t\t\t'update_form_title' => '<h2>'.t('Update Data').'</h2>',\n\t\t\t\t'delete_form_title' => '<h2>'.t('Delete Data').'</h2>',\n\t\t\t),\n\t\t);\n\t\t$this->crud->set_data($data);\n\t\treturn $this->crud->render();\n\t}",
"public function run()\n\t{\n\t\t// Insert ACL types\n\t\tDB::table('acl_types')->insert(array(\n\t\t\tarray('id' => 1, 'name' => 'Self'),\n\t\t\tarray('id' => 2, 'name' => 'All'),\n\t\t\tarray('id' => 3, 'name' => 'User'),\n\t\t\tarray('id' => 4, 'name' => 'Group'),\n\t\t));\n\n\t\t// Insert ACL flags\n\t\tDB::table('acl_flags')->insert(array(\n\t\t\tarray('id' => 1, 'name' => 'acl_manage'),\n\t\t\tarray('id' => 2, 'name' => 'field_edit'),\n\t\t\tarray('id' => 3, 'name' => 'field_manage'),\n\t\t\tarray('id' => 4, 'name' => 'field_view'),\n\t\t\tarray('id' => 5, 'name' => 'group_edit'),\n\t\t\tarray('id' => 6, 'name' => 'group_manage'),\n\t\t\tarray('id' => 7, 'name' => 'user_edit'),\n\t\t\tarray('id' => 8, 'name' => 'user_manage'),\n\t\t));\n\n\t\t// Insert the user status values\n\t\tDB::table('user_status')->insert(array(\n\t\t\tarray('id' => 1, 'name' => 'Inactive'),\n\t\t\tarray('id' => 2, 'name' => 'Active'),\n\t\t\tarray('id' => 3, 'name' => 'Blocked'),\n\t\t));\n\n\t\t// Insert token types\n\t\tDB::table('token_types')->insert(array(\n\t\t\tarray('id' => 1, 'name' => 'Email'),\n\t\t\tarray('id' => 2, 'name' => 'Password'),\n\t\t));\n\n\t\t// Insert device types\n\t\tDB::table('device_types')->insert(array(\n\t\t\tarray('id' => 1, 'name' => 'Computer'),\n\t\t\tarray('id' => 2, 'name' => 'Mobile'),\n\t\t\tarray('id' => 3, 'name' => 'Tablet'),\n\t\t));\n\n\t\t// Insert group types\n\t\tDB::table('group_types')->insert(array(\n\t\t\tarray('id' => 1, 'name' => 'Open'),\n\t\t\tarray('id' => 2, 'name' => 'Request'),\n\t\t\tarray('id' => 3, 'name' => 'Closed'),\n\t\t));\n\n\t\t// Insert field categories\n\t\tDB::table('field_categories')->insert(array(\n\t\t\tarray('id' => 1, 'name' => 'Basic'),\n\t\t\tarray('id' => 2, 'name' => 'Contact'),\n\t\t\tarray('id' => 3, 'name' => 'Other'),\n\t\t));\n\n\t\t// Insert field types\n\t\tDB::table('field_types')->insert(array(\n\t\t\tarray('id' => 1, 'name' => 'TextBox', 'option' => Flags::NO),\n\t\t\tarray('id' => 2, 'name' => 'TextArea', 'option' => Flags::NO),\n\t\t\tarray('id' => 3, 'name' => 'Radio', 'option' => Flags::YES),\n\t\t\tarray('id' => 4, 'name' => 'CheckBox', 'option' => Flags::YES),\n\t\t\tarray('id' => 5, 'name' => 'Dropdown', 'option' => Flags::YES),\n\t\t\tarray('id' => 6, 'name' => 'DatePicker', 'option' => Flags::NO),\n\t\t));\n\n\t\t// Insert admin user account\n\t\tDB::table('users')->insert(array(\n\t\t\t'name' => 'John Doe',\n\t\t\t'gender' => 'M',\n\t\t\t'date_of_birth' => '1980-07-01',\n\t\t\t'timezone' => 'America/Chicago',\n\t\t\t'password' => Hash::make('password'),\n\t\t\t'title' => 'Site administrator',\n\t\t\t'hash' => str_random(8),\n\t\t\t'status' => UserStatus::ACTIVE,\n\t\t));\n\n\t\t// Insert admin email addresses\n\t\tDB::table('user_emails')->insert(array(\n\t\t\t'user_id' => 1,\n\t\t\t'address' => '[email protected]',\n\t\t\t'primary' => Flags::YES,\n\t\t\t'verified' => Flags::YES,\n\t\t));\n\n\t\t// Insert the group entries\n\t\tDB::table('groups')->insert(array(\n\t\t\t'name' => 'Registered users',\n\t\t\t'description' => 'All registered users on the website.',\n\t\t\t'type' => GroupTypes::CLOSED,\n\t\t\t'hash' => str_random(8),\n\t\t\t'auto_join' => Flags::YES,\n\t\t));\n\n\t\tDB::table('groups')->insert(array(\n\t\t\t'name' => 'Sysadmins',\n\t\t\t'description' => 'System administrators with full control over the website.',\n\t\t\t'type' => GroupTypes::CLOSED,\n\t\t\t'hash' => str_random(8),\n\t\t));\n\n\t\t// Link the user to registered users group\n\t\tDB::table('user_groups')->insert(array(\n\t\t\t'user_id' => 1,\n\t\t\t'group_id' => 1,\n\t\t));\n\n\t\t// Link user to the sysadmin group\n\t\tDB::table('user_groups')->insert(array(\n\t\t\t'user_id' => 1,\n\t\t\t'group_id' => 2,\n\t\t));\n\n\t\t// Allow sysadmins to edit all users\n\t\tDB::table('acl')->insert(array(\n\t\t\t'flag' => ACLFlags::USER_EDIT,\n\t\t\t'subject_id' => 2,\n\t\t\t'subject_type' => ACLTypes::GROUP,\n\t\t\t'object_id' => 0,\n\t\t\t'object_type' => ACLTypes::ALL,\n\t\t));\n\n\t\t// Allow registered users to edit their own profiles\n\t\tDB::table('acl')->insert(array(\n\t\t\t'flag' => ACLFlags::USER_EDIT,\n\t\t\t'subject_id' => 1,\n\t\t\t'subject_type' => ACLTypes::GROUP,\n\t\t\t'object_id' => 0,\n\t\t\t'object_type' => ACLTypes::SELF,\n\t\t));\n\n\t\t// Allow sysadmins to manage all users\n\t\tDB::table('acl')->insert(array(\n\t\t\t'flag' => ACLFlags::USER_MANAGE,\n\t\t\t'subject_id' => 2,\n\t\t\t'subject_type' => ACLTypes::GROUP,\n\t\t\t'object_id' => 0,\n\t\t\t'object_type' => ACLTypes::ALL,\n\t\t));\n\n\t\t// Allow sysadmins to edit all groups\n\t\tDB::table('acl')->insert(array(\n\t\t\t'flag' => ACLFlags::GROUP_EDIT,\n\t\t\t'subject_id' => 2,\n\t\t\t'subject_type' => ACLTypes::GROUP,\n\t\t\t'object_id' => 0,\n\t\t\t'object_type' => ACLTypes::ALL,\n\t\t));\n\n\t\t// Allow sysadmins to manage all groups\n\t\tDB::table('acl')->insert(array(\n\t\t\t'flag' => ACLFlags::GROUP_MANAGE,\n\t\t\t'subject_id' => 2,\n\t\t\t'subject_type' => ACLTypes::GROUP,\n\t\t\t'object_id' => 0,\n\t\t\t'object_type' => ACLTypes::ALL,\n\t\t));\n\n\t\t// Allow sysadmins to manage fields\n\t\tDB::table('acl')->insert(array(\n\t\t\t'flag' => ACLFlags::FIELD_MANAGE,\n\t\t\t'subject_id' => 2,\n\t\t\t'subject_type' => ACLTypes::GROUP,\n\t\t\t'object_id' => 0,\n\t\t\t'object_type' => ACLTypes::ALL,\n\t\t));\n\n\t\t// Allow sysadmins to manage ACLs\n\t\tDB::table('acl')->insert(array(\n\t\t\t'flag' => ACLFlags::ACL_MANAGE,\n\t\t\t'subject_id' => 2,\n\t\t\t'subject_type' => ACLTypes::GROUP,\n\t\t\t'object_id' => 0,\n\t\t\t'object_type' => ACLTypes::ALL,\n\t\t));\n\t}",
"protected function setupListOperation()\n {\n // CRUD::setFromDb(); // columns\n\n \n CRUD::column('name');\n CRUD::column('project_id');\n CRUD::column('priority');\n \n /**\n * Columns can be defined using the fluent syntax or array syntax:\n * - CRUD::column('price')->type('number');\n * - CRUD::addColumn(['name' => 'price', 'type' => 'number']); \n */\n \n $this->crud->addButtonFromView('top', 'tasks-reorder', 'tasks-reorder');\n $this->crud->denyAccess('reorder');\n \n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }",
"protected function setupListOperation()\n {\n // $this->crud->addButtonFromView('top', 'all_com', 'all_com', 'begining');\n // $this->crud->addButtonFromView('top', 'complaint', 'complaint', 'begining');\n // $this->crud->addButtonFromView('top', 'evaluation', 'evaluation', 'begining');\n // $this->crud->addButtonFromView('top', 'price', 'price', 'begining');\n // $this->crud->addButtonFromView('top', 'outofstock', 'outofstock', 'begining');\n // $this->crud->addButtonFromView('top', 'outoflist', 'outoflist', 'begining');\n // $this->crud->addButtonFromView('top', 'sells', 'sells', 'begining');\n\n\n // $this->crud->addColumn([\n // 'label' => 'Communication',\n // 'type' => 'select',\n // 'name' => 'communication_types_id',\n // 'type' => 'select_from_array',\n // 'options' => [\n // 'Out Of Stock' => 'Out Of Stock',\n // 'Out Of List' => 'Out Of List',\n // 'Complaint' => 'Complaint',\n // 'Price' => 'Price',\n // 'Evaluation' => 'Evaluation',\n // ],\n\n // ]);\n // $this->crud->addColumn([\n // 'label' => 'Case Number',\n // 'type' => 'text',\n // 'name' => 'id',\n // ]);\n\n $this->crud->addColumn([\n 'label' => 'Lead Name',\n 'type' => 'select',\n 'name' => \"person_id\",\n 'entity' => 'person',\n 'model' => 'App\\Models\\person',\n 'wrapper' => [\n 'class' => 'form-group col-md-12',\n 'font-weight' => 'bold'\n ]\n ]);\n $this->crud->addColumn([\n 'label' => 'Company',\n 'type' => 'select',\n 'name' => 'personcompany_id',\n 'attribute' =>'company_name',\n 'entity' => 'person',\n 'model' => 'App\\Models\\person',\n ]);\n\n\n // $this->crud->addColumn([\n // 'type' => 'text',\n // 'label' => \"Landline\",\n // 'name' => 'personphone_id',\n // 'attribute' =>'Landline',\n // 'entity' => 'person',\n // 'model' => 'App\\Models\\person',\n // ]);\n $this->crud->addColumn([\n 'name' => 'personemail_id',\n 'type' => 'select',\n 'label' => \"Mobile\",\n 'entity' => 'person',\n 'attribute' =>'mobile_number',\n 'model' => 'App\\Models\\person',\n 'wrapper' => [\n 'class' => 'form-group col-md-12'\n ]\n ]);\n $this->crud->addColumn([\n 'name' => 'personsource_id',\n 'type' => 'select',\n 'label' => \"lead Source\",\n 'entity' => 'person',\n 'attribute' =>'source',\n 'model' => 'App\\Models\\person',\n 'wrapper' => [\n 'class' => 'form-group col-md-12'\n ]\n ]);\n $this->crud->addColumn([\n 'label' => 'Lead Owner',\n 'type' => 'select',\n 'name' => 'user_id',\n 'attribute' =>'name',\n 'entity' => 'user',\n 'model' => 'App\\Models\\user',\n ]);\n $this->crud->addColumn([\n 'name' => 'person_id',\n 'type' => 'select',\n 'label' => \"Email\",\n 'entity' => 'person',\n 'attribute' =>'created_at',\n 'model' => 'App\\Models\\person',\n 'wrapper' => [\n 'class' => 'form-group col-md-12'\n ]\n ]);\n\n\n\n // $this->crud->addColumn([\n // 'label' => 'Communicated_By',\n // 'type' => 'select',\n // 'name' => 'user_id',\n // 'attribute' =>'name',\n // 'entity' => 'user',\n // 'model' => 'App\\Models\\user',\n\n // ]);\n // $this->crud->addColumn([\n // 'label' => 'Company',\n // 'type' => 'select',\n // 'name' => 'person_id',\n // 'attribute' =>'company_name',\n // 'entity' => 'person',\n // 'model' => 'App\\Models\\person',\n\n // ]);\n // $this->crud->addColumn([\n // 'label' => 'Type',\n // 'type' => 'select',\n // 'name' => 'type',\n // 'attribute' =>'type',\n // 'entity' => 'person',\n // 'model' => 'App\\Models\\person',\n // ]);\n // $this->crud->addColumn([\n // 'label' => 'Communication',\n // 'type' => 'select_from_array',\n // 'name' => 'communication_ways_id',\n // 'allows_null' => true,\n // 'options' => [\n // 'Phone' => 'Phone',\n // 'Telegram' => 'Telegram',\n // 'Physical' => 'Physical',\n // 'E-Mail' => 'E-Mail',\n // 'Facebook' => 'Facebook',\n // ],\n\n // ]);\n // $this->crud->addColumn([\n // 'label' => 'Product',\n // 'type' => 'text',\n // 'name' => 'product',\n\n // ]);\n // $this->crud->addColumn([\n // 'label' => 'Quantity',\n // 'type' => 'number',\n // 'name' => 'quantity',\n\n // ]);\n // $this->crud->addColumn([\n // 'label' => 'Second',\n // 'type' => 'time',\n // 'name' => 'second',\n\n // ]);\n\n }",
"public function create($args){\n\n if($args[0] == 'model'){\n\n if(!isset($args[1])){\n echo 'You must specify a table to build the model from' . PHP_EOL;\n exit;\n }//if\n\n $table = $args[1];\n\n $templatePath = isset($args[2]) ? $args[2] : 'app/config/model.format';\n $outputPath = isset($args[3]) ? $args[3] : 'app/model';\n\n if($table=='all'){\n $result = $this->getDBSchema();\n while($row = $result->fetch()){\n $model = \\Disco\\manage\\Manager::buildModel($row['table_name']);\n \\Disco\\manage\\Manager::writeModel($row['table_name'],$model,$templatePath,$outputPath);\n }//while\n }//if\n else {\n $model = \\Disco\\manage\\Manager::buildModel($table);\n \\Disco\\manage\\Manager::writeModel($table,$model,$templatePath,$outputPath);\n }//el\n\n }//if\n else if($args[0] == 'record'){\n\n if(!isset($args[1])){\n echo 'You must specify a table to build the record from' . PHP_EOL;\n exit;\n }//if\n\n $table = $args[1];\n\n $templatePath = isset($args[2]) ? $args[2] : 'app/config/record.format';\n $outputPath = isset($args[3]) ? $args[3] : 'app/record';\n\n if($table=='all'){\n $result = $this->getDBSchema();\n while($row = $result->fetch()){\n $record = \\Disco\\manage\\Manager::buildRecord($row['table_name']);\n \\Disco\\manage\\Manager::writeRecord($row['table_name'],$record,$templatePath,$outputPath);\n }//while\n }//if\n else {\n $record = \\Disco\\manage\\Manager::buildRecord($table);\n \\Disco\\manage\\Manager::writeRecord($table,$record,$templatePath,$outputPath);\n }//el\n\n }//elif\n\n }",
"public function createTables()\r\n {\r\n // create the admin table\r\n $admin_table = new Ddl\\CreateTable('admins');\r\n $admin_table->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $admin_table->addColumn(new Column\\Char('username', 15));\r\n $admin_table->addColumn(new Column\\Char('password', 255));\r\n $admin_table->addColumn(new Column\\Integer('setup_ran', false, null, array('unsigned' => true)));\r\n\r\n // add the constraints\r\n $admin_table->addConstraint(new Constraint\\UniqueKey('username'));\r\n $admin_table->addConstraint(new Constraint\\PrimaryKey('id'));\r\n\r\n\r\n // create the members table\r\n $members_table = new Ddl\\CreateTable('members');\r\n $members_table->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $members_table->addColumn(new Column\\Char('username', 15));\r\n $members_table->addColumn(new Column\\Char('password', 150));\r\n $members_table->addColumn(new Column\\Blob('avatar', true));\r\n $members_table->addColumn(new Column\\Boolean('new', false, null, array('unsigned' => false)));\r\n\r\n // add the constraints\r\n $members_table->addConstraint(new Constraint\\UniqueKey('username'));\r\n $members_table->addConstraint(new Constraint\\PrimaryKey('id'));\r\n\r\n\r\n // create the profile table\r\n $profile_table = new Ddl\\CreateTable('profiles');\r\n $profile_table->addColumn(new Column\\Integer('profile_id', false, null, array('unsigned' => true)));\r\n $profile_table->addColumn(new Column\\Char('display_name', 75));\r\n $profile_table->addColumn(new Column\\Char('email_address', 75));\r\n $profile_table->addColumn(new Column\\Integer('age', false, null, array('unsigned' => true)));\r\n $profile_table->addColumn(new Column\\Char('location', 150));\r\n $profile_table->addColumn(new Column\\Text('bio'));\r\n $profile_table->addColumn(new Column\\Integer('views', false, null, array('unsigned' => false)));\r\n\r\n // add the constraints\r\n $profile_table->addConstraint(new Constraint\\UniqueKey('display_name'));\r\n $profile_table->addConstraint(new Constraint\\UniqueKey('email_address'));\r\n $profile_table->addConstraint(new Constraint\\PrimaryKey('profile_id'));\r\n\r\n\r\n // create the profile settings table\r\n $profile_settings_table = new Ddl\\CreateTable('profile_settings');\r\n $profile_settings_table->addColumn(new Column\\Integer('profile_id', false, null, array('unsigned' => true)));\r\n $profile_settings_table->addColumn(new Column\\Char('setting', 75));\r\n $profile_settings_table->addColumn(new Column\\Integer('value', false, null, array('unsigned' => false)));\r\n\r\n // add the constraints\r\n $profile_settings_table->addConstraint(new Constraint\\ForeignKey('profile_id_fk', 'profile_id', 'profiles', 'profile_id', 'cascade', 'cascade'));\r\n $profile_settings_table->addConstraint(new Constraint\\UniqueKey('setting'));\r\n $profile_settings_table->addConstraint(new Constraint\\PrimaryKey('profile_id'));\r\n\r\n\r\n // create the groups table\r\n $groups_table = new Ddl\\CreateTable('groups');\r\n $groups_table->addColumn(new Column\\Integer('id', false, null, array('unsigned' => true, 'auto_increment' => true)));\r\n $groups_table->addColumn(new Column\\Char('group_name', 100));\r\n $groups_table->addColumn(new Column\\Char('group_creator', 15));\r\n $groups_table->addColumn(new Column\\Datetime('group_created_date'));\r\n $groups_table->addColumn(new Column\\Text('group_description'));\r\n\r\n // add the constraints\r\n $groups_table->addConstraint(new Constraint\\UniqueKey('group_name'));\r\n $groups_table->addConstraint(new Constraint\\PrimaryKey('id'));\r\n\r\n\r\n // create the group settings table\r\n $group_settings_table = new Ddl\\CreateTable('group_settings');\r\n $group_settings_table->addColumn(new Column\\Integer('group_id', false, null, array('unsigned' => true)));\r\n $group_settings_table->addColumn(new Column\\Char('setting', 75));\r\n\r\n // add the constraints\r\n $group_settings_table->addConstraint(new Constraint\\ForeignKey('group_settings_id', 'group_id', 'groups', 'id', 'cascade', 'cascade'));\r\n $group_settings_table->addConstraint(new Constraint\\PrimaryKey('group_id'));\r\n\r\n\r\n // create the group_members table\r\n $group_mems_table = new Ddl\\CreateTable('group_members');\r\n $group_mems_table->addColumn(new Column\\Integer('group_id', false, null, array('unsigned' => true)));\r\n $group_mems_table->addColumn(new Column\\Integer('member_id', false, null, array('unsigned' => true)));\r\n $group_mems_table->addColumn(new Column\\Boolean('banned', false, 0));\r\n $group_mems_table->addColumn(new Column\\Boolean('suspended', false, 0));\r\n\r\n // add the constraints\r\n $group_mems_table->addConstraint(new Constraint\\ForeignKey('group_id_fk', 'group_id', 'groups', 'id', 'cascade', 'cascade'));\r\n $group_mems_table->addConstraint(new Constraint\\ForeignKey('member_id_fk', 'member_id', 'members', 'id', 'cascade', 'cascade'));\r\n $group_mems_table->addConstraint(new Constraint\\PrimaryKey(array('group_id', 'member_id')));\r\n\r\n\r\n // create the group_admin table\r\n $group_admins_table = new Ddl\\CreateTable('group_admins');\r\n $group_admins_table->addColumn(new Column\\Integer('group_id', false, null, array('unsigned' => true)));\r\n $group_admins_table->addColumn(new Column\\Integer('user_id', false, null, array('unsigned' => true)));\r\n\r\n // add the constraints\r\n $group_admins_table->addConstraint(new Constraint\\ForeignKey('fk_group_id', 'group_id', 'groups', 'id', 'cascade', 'cascade'));\r\n $group_admins_table->addConstraint(new Constraint\\ForeignKey('fk_user_id', 'user_id', 'members', 'id', 'cascade', 'cascade'));\r\n $group_admins_table->addConstraint(new Constraint\\PrimaryKey(array('group_id', 'user_id')));\r\n\r\n\r\n // create the group_ranks table\r\n $group_ranks_table = new Ddl\\CreateTable('group_ranks');\r\n $group_ranks_table->addColumn(new Column\\Integer('group_id', false, null, array('unsigned' => true)));\r\n $group_ranks_table->addColumn(new Column\\Integer('user_id', false, null, array('unsigned' => true)));\r\n $group_ranks_table->addColumn(new Column\\Integer('rank', false, null, array('unsigned' => true)));\r\n\r\n // add the constraints\r\n $group_ranks_table->addConstraint(new Constraint\\ForeignKey('fk_group_id_rank', 'group_id', 'groups', 'id', 'cascade', 'cascade'));\r\n $group_ranks_table->addConstraint(new Constraint\\ForeignKey('fk_user_id_rank', 'user_id', 'members', 'id', 'cascade', 'cascade'));\r\n $group_ranks_table->addConstraint(new Constraint\\PrimaryKey(array('group_id', 'user_id')));\r\n\r\n\r\n // create the group members online table\r\n $group_members_online_table = new Ddl\\CreateTable('group_members_online');\r\n $group_members_online_table->addColumn(new Column\\Integer('member_id', false, null, array('unsigned' => true)));\r\n $group_members_online_table->addColumn(new Column\\Integer('group_id', false, null, array('unsigned' => true)));\r\n $group_members_online_table->addColumn(new Column\\Boolean('status', true, null, array('unsigned' => false)));\r\n\r\n // add the constraints\r\n $group_members_online_table->addConstraint(new Constraint\\ForeignKey('fk_group_user_id', 'member_id', 'group_members', 'member_id', 'cascade', 'cascade'));\r\n $group_members_online_table->addConstraint(new Constraint\\ForeignKey('fk_groups_online', 'group_id', 'groups', 'id', 'cascade', 'cascade'));\r\n $group_members_online_table->addConstraint(new Constraint\\PrimaryKey(array('member_id', 'group_id')));\r\n\r\n \r\n // create the group join requests table\r\n $group_join_requests = new Ddl\\CreateTable('group_join_requests');\r\n $group_join_requests->addColumn(new Column\\Integer('group_id', false, null, array('unsigned' => true)));\r\n $group_join_requests->addColumn(new Column\\Integer('member_id', false, null, array('unsigned' => true)));\r\n $group_join_requests->addColumn(new Column\\Text('user_data'));\r\n \r\n // add the constraints\r\n $group_join_requests->addConstraint(new Constraint\\PrimaryKey(array('group_id', 'member_id')));\r\n \r\n\r\n // create the boards table\r\n $boards_table = new Ddl\\CreateTable('boards');\r\n $boards_table->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $boards_table->addColumn(new Column\\Char('board_name', 150));\r\n $boards_table->addColumn(new Column\\Text('board_moderators'));\r\n\r\n // add the constraints\r\n $boards_table->addConstraint(new Constraint\\UniqueKey('board_name'));\r\n $boards_table->addConstraint(new Constraint\\PrimaryKey('id'));\r\n\r\n\r\n // create the board messages table\r\n $boards_msg_table = new Ddl\\CreateTable('board_messages');\r\n $boards_msg_table->addColumn(new Column\\Integer('message_id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $boards_msg_table->addColumn(new Column\\Integer('board_id', false, null, array('unsigned' => true)));\r\n $boards_msg_table->addColumn(new Column\\Integer('num_of_posts', false, 0, array('unsigned' => false)));\r\n $boards_msg_table->addColumn(new Column\\Char('author', 15));\r\n $boards_msg_table->addColumn(new Column\\Char('subject', 150));\r\n $boards_msg_table->addColumn(new Column\\Text('messages'));\r\n $boards_msg_table->addColumn(new Column\\Text('replies'));\r\n $boards_msg_table->addColumn(new Column\\Blob('attachments'));\r\n\r\n // add the constraints\r\n $boards_msg_table->addConstraint(new Constraint\\ForeignKey('fk_board_id', 'board_id', 'boards', 'id', 'cascade', 'cascade'));\r\n $boards_msg_table->addConstraint(new Constraint\\PrimaryKey('message_id'));\r\n\r\n\r\n // create the trending topics table\r\n $trending_topics = new Ddl\\CreateTable('trending_topics');\r\n $trending_topics->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $trending_topics->addColumn(new Column\\Char('topic', 150));\r\n $trending_topics->addColumn(new Column\\Char('author', 15));\r\n $trending_topics->addColumn(new Column\\Integer('number_of_views', false, null, array('unsigned' => true)));\r\n $trending_topics->addColumn(new Column\\Text('topic_message'));\r\n\r\n // add the constraints\r\n $trending_topics->addConstraint(new Constraint\\UniqueKey('topic'));\r\n $trending_topics->addConstraint(new Constraint\\PrimaryKey('id'));\r\n\r\n\r\n // create the private messages table\r\n $private_messages = new Ddl\\CreateTable('private_messages');\r\n $private_messages->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $private_messages->addColumn(new Column\\Integer('user_id', false, null, array('unsigned' => true)));\r\n $private_messages->addColumn(new Column\\Text('to'));\r\n $private_messages->addColumn(new Column\\Char('from', 15));\r\n $private_messages->addColumn(new Column\\Char('subject', 150));\r\n $private_messages->addColumn(new Column\\Text('message'));\r\n $private_messages->addColumn(new Column\\Datetime('date_received'));\r\n $private_messages->addColumn(new Column\\Integer('active', true, null));\r\n $private_messages->addColumn(new Column\\Integer('archived', true, null));\r\n\r\n // add the constraints\r\n $private_messages->addConstraint(new Constraint\\PrimaryKey('id'));\r\n\r\n\r\n // create the themes table\r\n $themes_table = new Ddl\\CreateTable('themes');\r\n $themes_table->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $themes_table->addColumn(new Column\\Char('theme_name', 150));\r\n $themes_table->addColumn(new Column\\Char('theme_author'. 15));\r\n $themes_table->addColumn(new Column\\Char('theme_css_file', 200));\r\n $themes_table->addColumn(new Column\\Char('theme_images', 200));\r\n\r\n // add the constraints\r\n $themes_table->addConstraint(new Constraint\\UniqueKey('theme_name'));\r\n $themes_table->addConstraint(new Constraint\\PrimaryKey('id'));\r\n\r\n\r\n // create the events table\r\n $events_table = new Ddl\\CreateTable('events');\r\n $events_table->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $events_table->addColumn(new Column\\Integer('member_id', false, null, array('unsigned' => true)));\r\n $events_table->addColumn(new Column\\Char('event_name', 150));\r\n $events_table->addColumn(new Column\\Text('event_description'));\r\n $events_table->addColumn(new Column\\Datetime('start_date'));\r\n $events_table->addColumn(new Column\\Datetime('end_date'));\r\n\r\n // add the constraints\r\n $events_table->addConstraint(new Constraint\\PrimaryKey(array('id', 'member_id')));\r\n\r\n $pending_users_table = new Ddl\\CreateTable('pending_users');\r\n $pending_users_table->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $pending_users_table->addColumn(new Column\\Char('username', 15));\r\n $pending_users_table->addColumn(new Column\\Char('password', 255));\r\n $pending_users_table->addColumn(new Column\\Char('email', 75));\r\n $pending_users_table->addColumn(new Column\\Char('pending_code', 255));\r\n\r\n // add the constraints\r\n $pending_users_table->addConstraint(new Constraint\\UniqueKey('username'));\r\n $pending_users_table->addConstraint(new Constraint\\PrimaryKey('id'));\r\n\r\n\r\n // create the sessions table\r\n $sessions_table = new Ddl\\CreateTable('sessions');\r\n $sessions_table->addColumn(new Column\\Char('username', 30));\r\n $sessions_table->addColumn(new Column\\Char('password', 255));\r\n $sessions_table->addColumn(new Column\\Integer('active', false, null, array('unsigned' => true)));\r\n $sessions_table->addColumn(new Column\\Char('session_id', 150));\r\n\r\n // add the constraints\r\n $sessions_table->addConstraint(new Constraint\\UniqueKey('username'));\r\n\r\n \r\n // create the status table\r\n $status_table = new Ddl\\CreateTable('status');\r\n $status_table->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => false, 'unsigned' => true)));\r\n $status_table->addColumn(new Column\\Char('status', 150));\r\n $status_table->addColumn(new Column\\Integer('time_status', false, null, array('auto_increment' => false)));\r\n \r\n // add the constraints\r\n $status_table->addConstraint(new Constraint\\PrimaryKey('id'));\r\n\r\n \r\n // create the friends table\r\n $friends_table = new Ddl\\CreateTable('friends');\r\n $friends_table->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $friends_table->addColumn(new Column\\Integer('friend_id', false, null, array('auto_increment' => false, 'unsigned' => true)));\r\n $friends_table->addColumn(new Column\\Integer('user_id', false, null, array('auto_increment' => false, 'unsigned' => true)));\r\n \r\n // add the constraints\r\n $friends_table->addConstraint(new Constraint\\PrimaryKey('id'));\r\n \r\n \r\n // create the friend requests table\r\n $friend_requests_table = new Ddl\\CreateTable('friend_requests');\r\n $friend_requests_table->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $friend_requests_table->addColumn(new Column\\Integer('request_id', false, null, array('auto_increment' => false, 'unsigned' => true)));\r\n $friend_requests_table->addColumn(new Column\\Integer('friend_id', false, null, array('auto_increment' => false, 'unsigned' => true)));\r\n\r\n // add the constraints\r\n $friend_requests_table->addConstraint(new Constraint\\PrimaryKey('id'));\r\n \r\n \r\n // create the friends online table\r\n $friends_online_table = new Ddl\\CreateTable('friends_online');\r\n $friends_online_table->addColumn(new Column\\Integer('user_id', false, null, array('unsigned' => true)));\r\n \r\n // add the constraints\r\n $friends_online_table->addConstraint(new Constraint\\PrimaryKey('user_id'));\r\n \r\n \r\n // create the chat table\r\n $chat_table = new Ddl\\CreateTable('chat');\r\n $chat_table->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $chat_table->addColumn(new Column\\Char('who', 15));\r\n $chat_table->addColumn(new Column\\Char('from', 15));\r\n $chat_table->addColumn(new Column\\Datetime('chat_date', false, null));\r\n $chat_table->addColumn(new Column\\Datetime('chat_end_date', false, null));\r\n $chat_table->addColumn(new Column\\Integer('active', true, null, array('unsigned' => false)));\r\n \r\n // add the constraints\r\n $chat_table->addConstraint(new Constraint\\PrimaryKey('id'));\r\n \r\n \r\n // make the tables\r\n $this->query(array(\r\n $admin_table,\r\n $members_table,\r\n $profile_table,\r\n $profile_settings_table,\r\n $groups_table,\r\n $group_settings_table,\r\n $group_mems_table,\r\n $group_admins_table,\r\n $group_ranks_table,\r\n $group_members_online_table,\r\n $group_join_requests,\r\n $boards_table,\r\n $boards_msg_table,\r\n $trending_topics,\r\n $private_messages,\r\n $themes_table,\r\n $events_table,\r\n $pending_users_table,\r\n $sessions_table,\r\n $status_table,\r\n $friends_table,\r\n $friend_requests_table,\r\n $friends_online_table,\r\n $chat_table\r\n ));\r\n\r\n return true;\r\n }",
"public function run()\n {\n // Manage::create([\n // 'menu' => 'logo',\n // 'action' => [\n // 'read' => true,\n // 'add' => false,\n // 'update' => true,\n // 'delete' => false\n // ],\n // ]);\n\n // Manage::create([\n // 'menu' => 'image',\n // 'action' => [\n // 'read' => true,\n // 'add' => true,\n // 'update' => false,\n // 'delete' => true\n // ],\n // ]);\n\n // Manage::create([\n // 'menu' => 'pages',\n // 'action' => [\n // 'read' => true,\n // 'add' => true,\n // 'update' => true,\n // 'delete' => true\n // ],\n // ]);\n }",
"protected function setupCreateOperation()\n {\n CRUD::setValidation(PenyakitRequest::class);\n\n //CRUD::setFromDb(); // fields\n\n /**\n * Fields can be defined using the fluent syntax or array syntax:\n * - CRUD::field('price')->type('number');\n * - CRUD::addField(['name' => 'price', 'type' => 'number']));\n */\n $this->crud->addField(\n [\n 'name' => 'nama_penyakit',\n 'type' => 'text',\n 'label' => 'Nama Penyakit'\n\n ]\n );\n\n $this->crud->addField(\n [\n 'name' => 'deskripsi',\n 'label' => 'Deskripsi',\n 'type' => 'summernote',\n 'options' => [\n 'toolbar' => [\n ['style', ['style']],\n ['font', ['bold', 'underline', 'clear']],\n ['color', ['color']],\n ['para', ['ul', 'ol', 'paragraph']],\n ['table', ['table']],\n ['insert', ['link', 'picture', 'video']],\n ['view', ['fullscreen', 'codeview', 'help']]\n ]\n ],\n ],\n );\n\n $this->crud->addField(\n [\n 'name' => 'saran',\n 'label' => 'Saran',\n 'type' => 'summernote',\n 'options' => [\n 'toolbar' => [\n ['style', ['style']],\n ['font', ['bold', 'underline', 'clear']],\n ['color', ['color']],\n ['para', ['ul', 'ol', 'paragraph']],\n ['table', ['table']],\n ['insert', ['link', 'picture', 'video']],\n ['view', ['fullscreen', 'codeview', 'help']]\n ]\n ],\n ],\n );\n }",
"public function run()\n {\n $permission = [\n [\n 'name' => 'role-list',\n 'label' => 'Liste des roles',\n\n ],\n [\n 'name' => 'role-create',\n 'label' => 'Créer un role',\n\n ],\n [\n 'name' => 'role-edit',\n 'label' => 'Modifier un role',\n\n ],\n [\n 'name' => 'role-delete',\n 'label' => 'Supprimer un role',\n\n ],\n [\n 'name' => 'projet-list',\n 'label' => 'liste des projets',\n\n ],\n [\n 'name' => 'projet-create',\n 'label' => 'Créer un projet',\n\n ],\n [\n 'name' => 'projet-edit',\n 'label' => 'Modifier un projet',\n\n ],\n [\n 'name' => 'projet-delete',\n 'label' => 'Supprimer un projet',\n\n ]\n ];\n foreach ($permission as $key => $value) {\n \\App\\Permission::create($value);\n }\n\n \\App\\Role::create(array(\n 'name' => 'admin',\n 'label' => 'Administrateur'\n ));\n\n \\App\\User::create(array(\n 'name' => 'admin',\n 'password'=>bcrypt('password'),\n 'email'=>'[email protected]'));\n\n \\App\\RoleUser::create(array(\n 'role_id'=>1,\n 'user_id'=>1\n ));\n\n /*$this->call(PermissionTableSeeder::class);\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);*/\n\n\n }",
"public function createApply()\n {\n Az::debug($this->newName, 'application');\n\n Az::debug($this->newName, 'creating DB & tables');\n $this->createDb();\n $this->fillDb();\n $this->callPageRunCmd();\n\n }",
"private function create()\n {\n if ($this->isRequired()) {\n $db = Database::getDatabaseConnection();\n $db->exec($this->getDropQuery());\n $db->exec($this->getCreateQuery());\n $this->populate($db);\n }\n }",
"public function create()\n {\n parent::create();\n\n $sheet = $this->add_sheet();\n\n $this->add_table($sheet, $this->database, $this->generate_table());\n }",
"public function setup()\n {\n $this->crud->setModel('App\\Models\\Skills\\Skill');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/courseskill');\n $this->crud->setEntityNameStrings('courseskill', 'courseskills');\n\n\n $this->crud->denyAccess('show');\n $this->crud->denyAccess('update');\n $this->crud->denyAccess('delete');\n $this->crud->denyAccess('create');\n $this->crud->removeAllButtons();\n\n $permissions = backpack_user()->getAllPermissions();\n if($permissions->contains('name', 'courses.delete'))\n {\n $this->crud->addButtonFromView('top', 'attachSkills', 'attachSkills', 'end');\n }\n\n $course = $this->course;\n $this->crud->course = $course;\n $this->crud->query = $this->crud->query->whereHas('course', function ($query) use ($course) {\n $query->where('course_id', $course);\n });\n \n\n /*\n |--------------------------------------------------------------------------\n | CrudPanel Configuration\n |--------------------------------------------------------------------------\n */\n //$this->crud->setFromDb();\n $this->crud->setColumns([\n\n [ // skill type\n 'label' => 'Type', // Table column heading\n 'type' => 'select',\n 'name' => 'skill_type', // the method that defines the relationship in your Model\n 'entity' => 'skill_type', // the method that defines the relationship in your Model\n 'attribute' => 'name', // foreign key attribute that is shown to user\n 'model' => 'skill_type', // foreign key model\n ],\n\n [\n 'label' => \"Name\", // skill description\n 'type' => \"text\",\n 'name' => 'name'\n ],\n\n [ // skill level\n 'label' => 'Level', // Table column heading\n 'type' => 'select',\n 'name' => 'level', // the method that defines the relationship in your Model\n 'entity' => 'level', // the method that defines the relationship in your Model\n 'attribute' => 'name', // foreign key attribute that is shown to user\n 'model' => 'level', // foreign key model\n ],\n\n [\n 'label' => \"Weight\", // skill description\n 'type' => \"text\",\n 'name' => 'weight'\n ],\n\n ]);\n }",
"protected function setupCreateOperation()\n {\n abort(404);\n /**\n * Fields can be defined using the fluent syntax or array syntax:\n * - CRUD::field('price')->type('number');\n * - CRUD::addField(['name' => 'price', 'type' => 'number']));\n */\n }",
"public function run()\n {\n $data = array(\n array(\n 'projectid' => 1,\n 'project' => 'Project Nova',\n 'desc' => 'sample project',\n 'visibility' => 'public',\n 'created' => time()\n ),\n array(\n 'projectid' => 2,\n 'project' => 'Project X',\n 'desc' => 'sample project',\n 'visibility' => 'public',\n 'created' => time()\n )\n );\n $table = $this->table('projects');\n $table->insert($data)\n ->save();\n }",
"public function run()\n {\n SystemModule::truncate();\n SystemModule::create([\n 'name' => 'Field Reporting System',\n 'alias' => 'FRS',\n 'controller_namespace' => 'App\\Http\\Controllers\\Admin\\Frs\\/',\n 'model_namespace' => 'App\\Models\\Frs\\/',\n 'view_namespace' => 'views\\admin\\frs/',\n 'route_name' => 'admin.frs',\n 'description' => 'Partisipa Field Reporting System',\n ]);\n SystemModule::create([\n 'name' => 'Online Leave Aplication',\n 'alias' => 'FRS',\n 'controller_namespace' => 'App\\Http\\Controllers\\Admin\\Ola\\/',\n 'model_namespace' => 'App\\Models\\Ols\\/',\n 'view_namespace' => 'views\\admin\\ola/',\n 'route_name' => 'admin.ola',\n 'description' => 'Partisipa Online Leave Application',\n ]);\n SystemModule::create([\n 'name' => 'Online Timesheet Aplication',\n 'alias' => 'OTA',\n 'controller_namespace' => 'App\\Http\\Controllers\\Admin\\Ota\\/',\n 'model_namespace' => 'App\\Models\\Ota\\/',\n 'view_namespace' => 'views\\admin\\ota/',\n 'route_name' => 'admin.ota',\n 'description' => 'Partisipa Online Timesheet',\n ]\n );\n }",
"protected function setupListOperation()\n {\n if (About::count() > 0) {\n $this->crud->denyAccess((array)'create');\n }\n// CRUD::addColumn(['name' => 'text_one', 'label' => 'Текст первый']); // columns\n CRUD::addColumn(['name' => 'image_one', 'type' => 'image', 'label' => 'Изображение первое']); // columns\n// CRUD::addColumn(['name' => 'text_two', 'label' => 'Текст второй']); // columns\n CRUD::addColumn(['name' => 'image_two', 'type' => 'image', 'label' => 'Изображение второе']); // columns\n CRUD::addColumn(['name' => 'image_third', 'type' => 'image', 'label' => 'Изображение второе']); // columns\n CRUD::addColumn(['name' => 'image_four', 'type' => 'image', 'label' => 'Изображение второе']); // columns\n\n /**\n * Columns can be defined using the fluent syntax or array syntax:\n * - CRUD::column('price')->type('number');\n * - CRUD::addColumn(['name' => 'price', 'type' => 'number']);\n */\n }",
"protected function setupListOperation()\n {\n $this->crud->addColumn([\n 'name' => 'title',\n 'label'=> _('Title'),\n 'type' =>'text'\n ]);\n $this->crud->addColumn([\n 'name' => 'status',\n 'label' => _('Status'),\n 'type' => 'boolean',\n // optionally override the Yes/No texts\n 'options' => [\n 1 => '<i class=\"lar la-check-circle\" style=\"color: green\"></i>',\n 0 => '<i class=\"las la-times-circle\" style=\"color: red\"></i>'\n ]\n ]);\n $this->crud->addColumn([\n 'name' => 'thumbnail',\n 'label' => _('Preview'),\n 'type' => 'image',\n 'prefix' => config('app.upload_patch'),\n 'width' => '100px',\n 'height' => 'auto'\n\n ]);\n\n\n /**\n * Columns can be defined using the fluent syntax or array syntax:\n * - CRUD::column('price')->type('number');\n * - CRUD::addColumn(['name' => 'price', 'type' => 'number']);\n */\n }",
"abstract function get_crud_service();",
"public function create() {\r\n require $this->views_folder . 'create.php';\r\n }",
"public function run()\n {\n \\App\\Models\\Category::factory(10)->create();\n \\App\\Models\\Country::factory(10)->create();\n \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Opportunity::factory(10)->create();\n \\App\\Models\\OpportunityDetail::factory(10)->create();\n \n \\App\\Models\\Question::factory(10)->create();\n \\App\\Models\\Comment::factory(10)->create();\n \n }",
"public function setup()\n {\n $this->crud->setModel('App\\Models\\Book');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/books');\n $this->crud->setEntityNameStrings('book', 'books');\n\n\n $this->crud->addColumns([\n [\n 'name' => 'image', // The db column name\n 'label' => \"Book Poster\", // Table column heading\n 'type' => 'image',\n // 'prefix' => 'folder/subfolder/',\n // optional width/height if 25px is not ok with you\n 'height' => '80px',\n 'width' => '80px',\n ],\n [\n 'name' => 'title', // The db column name\n 'label' => \"Title\", // Table column heading\n ]\n\n ]);\n\n $this->crud->addFields([\n [ // Upload\n 'name' => 'image',\n 'label' => 'Book Poster',\n 'type' => 'upload',\n 'upload' => true,// if you store files in the /public folder, please ommit this; if you store them in /storage or S3, please specify it;\n ],\n\n ['label' => 'Book Title', 'name' => 'title'],\n\n ['label' => 'Description', 'name' => 'description', 'type' => 'textarea'],\n\n ['label' => 'Author/Publication', 'name' => 'author'],\n\n [ // Select2\n 'label' => \"Subject\",\n 'type' => 'select2',\n 'name' => 'subject_id', // the db column for the foreign key\n 'entity' => 'subject', // the method that defines the relationship in your Model\n 'attribute' => 'name', // foreign key attribute that is shown to user\n 'model' => \"App\\Models\\Subject\", // foreign key model\n 'allows_null' => false\n ],\n\n [ // Select2\n 'label' => \"Topic\",\n 'type' => 'select2',\n 'name' => 'topic_id', // the db column for the foreign key\n 'entity' => 'topic', // the method that defines the relationship in your Model\n 'attribute' => 'nameWithSubject', // foreign key attribute that is shown to user\n 'model' => \"App\\Models\\Topic\", // foreign key model\n 'allows_null' => true\n ],\n\n\n [ // select_from_array\n 'name' => 'is_premium',\n 'label' => \"Is Premium Content\",\n 'type' => 'select_from_array',\n 'options' => [0 => 'No', 1 => 'Yes'],\n 'allows_null' => false,\n // 'allows_multiple' => true, // OPTIONAL; needs you to cast this to array in your model;\n ],\n ]);\n\n $this->crud->addButtonFromModelFunction('line', 'manageChapters', 'manageChapters', 'end');\n\n\n }",
"public function run()\n {\n Tipo_documento::create([\n 'nombre' => 'Cedula',\n ]);\n\n Tipo_documento::create([\n 'nombre' => 'Tarjeta de identidan',\n ]);\n }",
"public function run()\n {\n $table = new Web_Service();\n $table->nombre = 'trayectoria';\n $table->descripcion = 'Consulta datos relacionados con la trayectoria de cada alumno';\n $table->key = 'He seguido la trayectoria en la que he creido y he confiado en mi mismo / Antonio Saura';\n $table->save();\n\n $table= new Web_Service();\n $table->nombre = 'identidad';\n $table->descripcion = 'Consulta datos relacionados con la información personal de cada alumno';\n $table->key = 'Nadie puede definir tu identidad, tu personalidad. Al fin y al cabo cada uno es responsable de quién y como es / Chinogizbo';\n $table->save();\n }",
"public function run()\n {\n DB::table('fields')->insert(\n [\n [\n \"title\" => \"String\",\n \"alias\" => \"input\",\n ],\n [\n \"title\" => \"Text\",\n \"alias\" => \"textarea\",\n ],\n [\n \"title\" => \"Select\",\n \"alias\" => \"select\",\n ],\n [\n \"title\" => \"Password\",\n \"alias\" => \"password\",\n ],\n [\n \"title\" => \"Radio\",\n \"alias\" => \"radio\",\n ],\n [\n \"title\" => \"Editor\",\n \"alias\" => \"editor\",\n ],\n [\n \"title\" => \"File\",\n \"alias\" => \"file\",\n ],\n [\n \"title\" => \"Hidden\",\n \"alias\" => \"hidden\",\n ],\n [\n \"title\" => \"Multiple Input\",\n \"alias\" => \"multiple_input\",\n ],\n\n ]\n );\n }",
"function createFields() {\n\tDB::exec(\"DROP TABLE IF EXISTS fields\");\n\t// create fields table\n\tDB::exec(\"CREATE TABLE fields (\n\t\tid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\tname VARCHAR(50) NOT NULL UNIQUE,\n\t\tcontent TEXT\n\t)\");\n\n\toutput(RESULT_INFO, \"Fields setup successfully completed\");\n\treturn 1;\n}",
"protected function setupListOperation()\n {\n\n $this->crud->setColumns([\n [ \n 'name' => 'id',\n 'label' => 'ID',\n 'type' => 'number',\n\n ],\n [\n 'name' => 'name',\n 'type' => 'text',\n 'label' => 'Customer',\n 'orderable' => false,\n ],\n [\n 'name' => 'target',\n 'type' => 'number',\n 'label' => 'Target',\n 'orderable' => false,\n ],\n [\n // non-relationship count\n 'name' => 'Machines', // name of relationship method in the model\n 'type' => 'relationship_count', \n 'label' => 'Machines', // Table column heading\n // OPTIONAL\n 'suffix' => '', // to show \"123 tags\" instead of \"123 items\"\n ],\n [\n 'name' => 'balance',\n 'type' => 'text',\n 'label' => 'Balance',\n ],\n [ \n // any type of relationship\n 'name' => 'User', // name of relationship method in the model\n 'type' => 'relationship',\n 'label' => 'Collector', // Table column heading\n // OPTIONAL\n // 'entity' => 'tags', // the method that defines the relationship in your Model\n // 'attribute' => 'name', // foreign key attribute that is shown to user\n // 'model' => App\\Models\\Category::class, // foreign key model\n ],\n ]);\n\n }",
"protected function setupCreateOperation()\n {\n CRUD::setValidation(DeliveryNoteDetailRequest::class);\n\n CRUD::setFromDb(); // fields\n\n /**\n * Fields can be defined using the fluent syntax or array syntax:\n * - CRUD::field('price')->type('number');\n * - CRUD::addField(['name' => 'price', 'type' => 'number']));\n */\n }",
"public function run()\n {\n //\n TypeNew::create([\n 'description' => 'General',\n \n ]);\n TypeNew::create([\n 'description' => 'Cursos',\n \n ]);\n TypeNew::create([\n 'description' => 'Ofertas Laborales',\n \n ]);\n \n }",
"protected function setupCreateOperation()\n {\n CRUD::setValidation(StoreRequest::class);\n\n /**\n * Fields can be defined using the fluent syntax or array syntax:\n * - CRUD::field('price')->type('number');\n * - CRUD::addField(['name' => 'price', 'type' => 'number']));\n */\n }",
"public function setup()\n {\n $this->crud->setModel('App\\Models\\Employee');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/employees');\n $this->crud->setEntityNameStrings(trans('fields.employee'), trans('fields.employees'));\n $this->crud->addButtonFromModelFunction('line', 'calendar', 'get_calendar_button', 'end'); // add a button whose HTML is returned by a method in the CRUD model\n $this->crud->addButtonFromModelFunction('line', 'password', 'change_password_button');\n// $this->crud->setEditView('change_password');\n /*\n |--------------------------------------------------------------------------\n | CrudPanel Configuration\n |--------------------------------------------------------------------------\n */\n\n $this->crud->enableExportButtons();\n\n $this->crud->allowAccess('show');\n\n $this->crud->setColumns([\n [\n 'label'=> trans('fields.name'),\n 'type' => \"select\",\n 'name' => 'user_id', // the column that contains the ID of that connected entity;\n 'entity' => 'user', // the method that defines the relationship in your Model\n 'attribute' => \"name\", // foreign key attribute that is shown to user\n// 'model' => \"App\\Users\", // foreign key model\n 'searchLogic' => function ($query, $column, $searchTerm) {\n $query->orWhereHas('user', function ($q) use ($column, $searchTerm) {\n $q->where('name', 'like', '%'.$searchTerm.'%');\n });\n },\n 'orderable' => true,\n 'orderLogic' => function ($query, $column, $columnDirection) {\n $query->leftJoin('users', 'users.id', '=', 'employees.user_id')\n ->orderBy('users.name', $columnDirection)->select('employees.*');\n }\n ],\n [\n 'name' => 'employee_uid',\n 'label' => trans('fields.employee_id'),\n 'type' => 'text',\n 'orderable' => false,\n ],\n [\n 'name' => 'email',\n 'label' => trans('fields.email'),\n 'type' => 'email',\n 'searchLogic' => function ($query, $column, $searchTerm) {\n $query->orWhereHas('user', function ($q) use ($column, $searchTerm) {\n $q->where('email', 'like', '%'.$searchTerm.'%');\n });\n }\n ],\n [\n 'name' => 'photo',\n 'label' => trans('fields.photo'),\n 'type' => 'image',\n 'orderable' => false,\n ],\n [\n 'name' => 'nif',\n 'label' => trans('fields.nif'),\n 'type' => 'text',\n 'orderable' => false,\n ],\n [\n 'name' => 'affiliation',\n 'label' => trans('fields.affiliation'),\n 'type' => 'text',\n 'orderable' => false,\n ],\n [\n 'name' => 'holidays',\n 'label' => trans('fields.holiday_days'),\n 'type' => 'text',\n 'orderable' => true,\n ],\n [\n 'label' => trans('fields.work_centers'),\n 'type' => \"select\",\n 'name' => 'workcenter_id', // the method that defines the relationship in your Model\n 'entity' => 'workcenter', // the method that defines the relationship in your Model\n 'attribute' => \"name\", // foreign key attribute that is shown to user\n 'model' => \"App\\Models\\Workcenter\", // foreign key model\n 'orderable' => false,\n ],\n [\n 'label' => trans('fields.departments'),\n 'type' => \"select\",\n 'name' => 'department_id', // the method that defines the relationship in your Model\n 'entity' => 'department', // the method that defines the relationship in your Model\n 'attribute' => \"name\", // foreign key attribute that is shown to user\n 'model' => \"App\\Models\\Department\", // foreign key model\n 'orderable' => false,\n ],\n ]);\n\n\n\n // Fields (both - create, update)\n $this->crud->addFields([\n [\n 'name' => 'name',\n 'label' => trans('fields.name'),\n 'type' => 'text',\n ]\n ]);\n // Fields (only create)\n $this->crud->addField(\n [\n 'name' => 'employee_uid',\n 'label' => trans('fields.employee_id'),\n 'type' => 'text',\n 'value' => $this->employee_uid(),\n 'hint' => trans('fields.employee_id_hint'),\n ], 'create')->afterField('name');\n\n // Fields (only update)\n $this->crud->addField(\n [\n 'name' => 'employee_uid',\n 'label' => trans('fields.employee_id'),\n 'type' => 'text',\n 'hint' => trans('fields.employee_id_hint'),\n ], 'update')->afterField('name');\n\n // Fields (both - create, update)\n $this->crud->addFields([\n [\n 'name' => 'email',\n 'label' => trans('fields.email'),\n 'type' => 'email',\n ]\n ]);\n // Fields (only create)\n $this->crud->addField(\n [\n 'name' => 'password',\n 'label' => trans('fields.password'),\n 'type' => 'password',\n ],'create')->afterField('email');\n $this->crud->addField(\n [\n 'name' => 'password_confirmation',\n 'label' => trans('fields.password_confirmation'),\n 'type' => 'password',\n ], 'create')->afterField('password');\n\n // Fields (both - create, update)\n $this->crud->addFields([\n [\n 'label' => trans('fields.photo'),\n 'name' => \"photo\",\n 'type' => 'image',\n 'upload' => true,\n 'crop' => false,\n 'aspect_ratio' => 1,\n ],\n [\n 'name' => 'nif',\n 'label' => trans('fields.nif'),\n 'type' => 'text',\n ],\n [\n 'name' => 'affiliation',\n 'label' => trans('fields.affiliation'),\n 'type' => 'text',\n ],\n [\n 'label' => trans('fields.work_centers'),\n 'type' => 'select2',\n 'name' => 'workcenter_id', // the method that defines the relationship in your Model\n 'entity' => 'workcenter', // the method that defines the relationship in your Model\n 'attribute' => 'name', // foreign key attribute that is shown to user\n 'model' => \"App\\Models\\Workcenter\", // foreign key model\n ],\n [\n 'label' => trans('fields.departments'),\n 'type' => 'select2',\n 'name' => 'department_id', // the db column for the foreign key\n 'entity' => 'department', // the method that defines the relationship in your Model\n 'attribute' => 'name', // foreign key attribute that is shown to user\n 'model' => \"App\\Models\\Department\", // foreign key model\n ],\n [\n 'name' => 'user_id',\n 'type' => 'hidden'\n ],\n ]);\n\n $this->crud->addField(\n [\n 'label' => trans('fields.working_days'),\n 'type' => 'working_day',\n 'name' => 'workingDays',\n 'entity' => 'workingDays',\n 'attribute' => 'id',\n 'model' => \"App\\Models\\WorkingDays\",\n 'pivot' => true,\n ], 'update')->afterField('affiliation');\n\n $this->crud->addField(\n [\n 'name' => 'holidays',\n 'label' => trans('fields.number_holidays'),\n 'type' => 'number'\n ], 'update')->afterField('affiliation');\n\n\n // add asterisk for fields that are required in EmployeeRequest\n $this->crud->setRequiredFields(StoreRequest::class, 'create');\n $this->crud->setRequiredFields(UpdateRequest::class, 'edit');\n }",
"public function setup()\n {\n $this->crud->setModel('App\\Models\\Experience');\n $this->crud->setRoute(config('backpack.base.route_prefix').'/experience');\n $this->crud->setEntityNameStrings('experience', 'experiences');\n\n /*\n |--------------------------------------------------------------------------\n | CrudPanel Configuration\n |--------------------------------------------------------------------------\n */\n $this->crud->addColumns([\n ['name' => 'position', 'type' => 'text', 'label' => 'Position'],\n ['name' => 'employer', 'type' => 'text', 'label' => 'Employer'],\n ['name' => 'from', 'type' => 'date', 'label' => 'From', 'format' => 'M-Y'],\n ['name' => 'to', 'type' => 'date', 'label' => 'To', 'format' => 'M-Y'],\n ['name' => 'ongoing', 'type' => 'boolean', 'label' => 'Ongoing'],\n ]);\n $this->crud->addFields([\n ['name' => 'position', 'type' => 'text', 'label' => 'Position'],\n ['name' => 'employer', 'type' => 'text', 'label' => 'Employer'],\n ['name' => 'website', 'type' => 'url', 'label' => 'Website'],\n ['name' => 'from', 'type' => 'date_picker', 'label' => 'From', 'date_picker_options' => ['format' => 'mm-yyyy', 'viewMode' => 'months', 'minViewMode' => 'months']],\n ['name' => 'to', 'type' => 'date_picker', 'label' => 'To', 'date_picker_options' => ['format' => 'mm-yyyy', 'viewMode' => 'months', 'minViewMode' => 'months']],\n ['name' => 'ongoing', 'type' => 'checkbox', 'label' => 'Ongoing'],\n ['name' => 'logo', 'type' => 'image', 'upload' => true, 'crop' => false, 'aspect_ratio' => 1, 'disk' => 'public'],\n ]);\n\n // add asterisk for fields that are required in ExperienceRequest\n $this->crud->setRequiredFields(StoreRequest::class, 'create');\n $this->crud->setRequiredFields(UpdateRequest::class, 'edit');\n }",
"private function make()\n {\n \n $file = database_path().'/migrations/'.$this->fileName.'.php';\n \n $content = $this->blueprint();\n \n $this->file_write( $file, $content );\n \n }",
"public function run()\n {\n \t// Clear table\n Schema::disableForeignKeyConstraints();\n OrderProduct::truncate();\n CategoryProduct::truncate();\n Order::truncate();\n Cart::truncate();\n Product::truncate();\n Category::truncate();\n User::truncate();\n PaymentKey::truncate();\n Schema::enableForeignKeyConstraints();\n\n // User\n \t$guest = User::create([\n \t\t'name' => 'guest',\n \t\t'email' => '[email protected]',\n \t\t'password' => bcrypt('password')\n \t]);\n \t$admin = User::create([\n \t\t'name' => 'admin',\n \t\t'role' => 'ORDER_PROCESSOR',\n \t\t'email' => '[email protected]',\n \t\t'password' => bcrypt('password')\n \t]);\n \t$inventory = User::create([\n \t\t'name' => 'admin',\n \t\t'role' => 'INVENTORY_MANAGER',\n \t\t'email' => '[email protected]',\n \t\t'password' => bcrypt('password')\n \t]);\n \t$operation = User::create([\n \t\t'name' => 'admin',\n \t\t'role' => 'OPERATION_MANAGER',\n \t\t'email' => '[email protected]',\n \t\t'password' => bcrypt('password')\n \t]);\n\n \t//Category\n\t\t$arabica = Category::create(['name' => 'arabica']);\n\t\t$robusta = Category::create(['name' => 'robusta']);\n\t\t$bean = Category::create(['name' => 'bean']);\n\t\t$powder = Category::create(['name' => 'powder']);\n\t\t$toraja = Category::create(['name' => 'toraja']);\n\t\t$java = Category::create(['name' => 'java', 'parent_id' => $arabica->id]);\n\t\t$aceh = Category::create(['name' => 'aceh', 'parent_id' => $arabica->id]);\n\t\t$vietnam = Category::create(['name' => 'vietnam', 'parent_id' => $robusta->id]);\n\t\t$luwak = Category::create(['name' => 'luwak', 'parent_id' => $robusta->id]);\n\n \t// Products\n\t\t$torajabean1 = Product::create([\n 'name' => 'Toraja Bean Small',\n 'description' => 'Toraja Bean Desc',\n 'stock' => 100,\n 'price' => 30000,\n 'weight' => 0.5,\n 'filepath' => 'toraja_bean_small.jpg'\n ]);\n\t\t$torajabean2 = Product::create([\n 'name' => 'Toraja Bean Big',\n 'description' => 'Toraja Bean Desc',\n 'stock' => 100,\n 'price' => 60000,\n 'weight' => 1,\n 'filepath' => 'toraja_bean_big.jpg'\n ]);\n\t\t$torajapowder1 = Product::create([\n 'name' => 'Toraja Powder Small',\n 'description' => 'Toraja Powder Desc',\n 'stock' => 100,\n 'price' => 25000,\n 'weight' => 0.5,\n 'filepath' => 'toraja_powder_small.jpg'\n ]);\n\t\t$luwakpowder1 = Product::create([\n 'name' => 'Luwak Powder Small',\n 'description' => 'Luwak Powder Desc',\n 'stock' => 100,\n 'price' => 40000,\n 'weight' => 0.25,\n 'filepath' => 'luwak_powder_small.jpg'\n ]);\n\n //CategoryProduct\n $cp11 = CategoryProduct::create(['category_id' => $toraja->id, 'product_id' => $torajabean1->id]);\n $cp12 = CategoryProduct::create(['category_id' => $bean->id, 'product_id' => $torajabean1->id]);\n $cp21 = CategoryProduct::create(['category_id' => $toraja->id, 'product_id' => $torajabean2->id]);\n $cp22 = CategoryProduct::create(['category_id' => $bean->id, 'product_id' => $torajabean2->id]);\n $cp31 = CategoryProduct::create(['category_id' => $toraja->id, 'product_id' => $torajapowder1->id]);\n $cp32 = CategoryProduct::create(['category_id' => $powder->id, 'product_id' => $torajapowder1->id]);\n $cp41 = CategoryProduct::create(['category_id' => $luwak->id, 'product_id' => $luwakpowder1->id]);\n $cp42 = CategoryProduct::create(['category_id' => $powder->id, 'product_id' => $luwakpowder1->id]);\n\n // Cart\n $cart1 = Cart::create(['user_id' => $guest->id, 'product_id' => $luwakpowder1->id, 'quantity' => 2]);\n $cart2 = Cart::create(['user_id' => $guest->id, 'product_id' => $torajabean2->id, 'quantity' => 3]);\n\n // Order\n\t $order1 = Order::create(['status' => 'PENDING', 'user_id' => $guest->id, 'address' => 'Jl. Dago no 22', 'payment_key'=>111]);\n \n //PaymentKey \n for ($i = 0; $i < 1000; $i++) {\n PaymentKey::create(['key'=>$i,'used'=>0]);\n } \n\n //OrderProduct\n $op11 = OrderProduct::create(['order_id' => $order1->id, 'product_id' => $torajapowder1->id, 'quantity' => 4, 'total_price' => $torajapowder1->price * 4, 'total_weight' => $torajapowder1->weight * 4]);\n $op12 = OrderProduct::create(['order_id' => $order1->id, 'product_id' => $luwakpowder1->id, 'quantity' => 3, 'total_price' => $luwakpowder1->price * 3, 'total_weight' => $luwakpowder1->weight * 3]);\n\n $ops = $order1->order_products();\n $total_price = 0;\n $total_weight = 0;\n\t\tforeach ($ops as $op){\n $total_price += $op->total_price;\n $total_weight += $op->total_weight;\n }\n $shipping_fee = $total_weight*5000;\n $order1->update([\n 'total_price' => $total_price,\n 'total_weight' => $total_weight,\n 'shipping_fee' => $shipping_fee,\n 'total_payment' => $total_price + $shipping_fee - $order1->payment_key,\n ]);\n\n }",
"public function setup()\n {\n $this->crud->setModel('App\\Models\\Product');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/product');\n $this->crud->setEntityNameStrings('Sản phẩm', 'Sản phẩm');\n $this->crud->orderBy('created_at', 'desc');\n /*\n |--------------------------------------------------------------------------\n | CrudPanel Configuration\n |--------------------------------------------------------------------------\n */\n\n $this->crud->addColumn(['name' => 'name', 'type' => 'text', 'label' => 'Name']);\n $this->crud->addColumn([\n 'name' => 'categories_id',\n 'type' => 'select',\n 'label' => 'Danh mục',\n 'entity' => 'category',\n 'attribute' => 'name',\n 'model' => 'App\\Models\\Category'\n ]);\n $this->crud->addColumn(['name' => 'price', 'type' => 'number', 'label' => 'Giá cả']);\n $this->crud->addColumn(['name' => 'description', 'type' => 'text', 'label' => 'Mô tả']);\n $this->crud->addColumn(['name' => 'short_description', 'type' => 'text', 'label' => 'Mô tả ngắn']);\n $this->crud->addColumn(['name' => 'status', 'type' => 'text', 'label' => 'Tình trạng']);\n $this->crud->addColumn([\n 'name' => 'top',\n 'type' => 'select_from_array',\n 'label' => 'Top',\n 'options' => ['false' => 'Không', 'true' => 'Có']\n ]);\n\n $this->crud->addField(['name' => 'name', 'type' => 'text', 'label' => 'Name']);\n $this->crud->addField([\n 'name' => 'categories_id',\n 'label' => 'Danh mục',\n 'type' => 'select',\n 'entity' => 'category',\n 'attribute' => 'name',\n 'model' => 'App\\Models\\Category'\n ]);\n $this->crud->addField(['name' => 'price', 'type' => 'number', 'number' => 'Giá cả']);\n $this->crud->addField([\n 'name' => 'description',\n 'type' => 'ckeditor',\n 'label' => 'Mô tả'\n ]);\n $this->crud->addField(['name' => 'short_description', 'type' => 'text', 'number' => 'Mô tả ngắn']);\n $this->crud->addField([\n 'name' => 'images',\n 'label' => 'Hình ảnh',\n 'type' => 'upload_multiple',\n 'upload' => true,\n 'disk' => 'public',\n 'hint' => 'Không nên chọn quá 4 ảnh để tối ưu trải nghiệm người dùng, ảnh đầu tiên sẽ là hình ảnh đại diện cho sản phẩm!'\n ]);\n $this->crud->addField([\n 'name' => 'status',\n 'type' => 'select_from_array',\n 'label' => 'Tình trạng',\n 'options' => ['Còn hàng' => 'Còn hàng', 'Hết hàng' => 'Hết hàng'],\n 'allows_null' => false,\n 'default' => 'Còn hàng'\n ]);\n $this->crud->addField([\n 'name' => 'top',\n 'type' => 'select_from_array',\n 'label' => 'Top',\n 'options' => ['false' => 'Không', 'true' => 'Có'],\n 'allows_null' => false,\n 'default' => 'false',\n 'hint' => 'Nếu bạn muốn đẩy sản phẩm ra phần các sản phẩm tốt nhất, hãy chọn Có!'\n ]);\n\n // add asterisk for fields that are required in ProductRequest\n $this->crud->setRequiredFields(StoreRequest::class, 'create');\n $this->crud->setRequiredFields(UpdateRequest::class, 'edit');\n }",
"public function setup()\n {\n $this->crud->setModel('App\\Models\\Permission');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/permission');\n $this->crud->setEntityNameStrings('permission', 'permissions');\n\n /*\n |--------------------------------------------------------------------------\n | CrudPanel Configuration\n |--------------------------------------------------------------------------\n */\n// $this->crud->enableBulkActions();\n// $this->crud->addBulkDeleteButton();\n\n $this->crud->addButtonFromModelFunction('top', 'generatePermissions', 'generatePermissionsButton', 'beginning');\n\n $this->crud->addFields([\n [\n 'label'=>'Name',\n 'name'=>'name'\n ],\n [\n 'label'=>'Guard',\n 'name'=>'guard_name',\n 'default'=>'web',\n 'type'=>'hidden'\n ],\n// [\n// 'label' => \"Roles\",\n// 'type' => 'checklist',\n// 'name' => 'roles', // the method that defines the relationship in your Model\n// 'entity' => 'roles', // the method that defines the relationship in your Model\n// 'attribute' => 'name', // foreign key attribute that is shown to user\n//\n// ],\n ], 'update/create/both');\n\n $this->crud->addColumns([\n [\n 'label'=>'Name',\n 'name'=>'name'\n ],\n [\n 'label'=>'Guard',\n 'name'=>'guard_name',\n ],\n [ // Select2Multiple = n-n relationship (with pivot table)\n 'label' => \"Roles\",\n 'type' => 'select_multiple',\n 'name' => 'roles', // the method that defines the relationship in your Model\n 'entity' => 'roles', // the method that defines the relationship in your Model\n 'attribute' => 'name', // foreign key attribute that is shown to user\n 'model' => \"App\\Models\\Role\", // foreign key model\n 'pivot' => true, // on create&update, do you need to add/delete pivot table entries?\n ],\n ]);\n\n\n// $this->crud->addButtonFromModelFunction('top', 'generatePermissionsButton', 'generatePermissionsButton', 'end');\n\n // add asterisk for fields that are required in PermissionRequest\n $this->crud->setRequiredFields(StoreRequest::class, 'create');\n $this->crud->setRequiredFields(UpdateRequest::class, 'edit');\n\n\n\n $this->crud->denyAccess(['list', 'create', 'update', 'reorder', 'delete', 'generatePermissions']);\n if(request()->user()->can('list permission'))\n $this->crud->allowAccess('list');\n if(request()->user()->can('create permission'))\n $this->crud->allowAccess('create');\n if(request()->user()->can('update permission'))\n $this->crud->allowAccess('update');\n if(request()->user()->can('delete permission'))\n $this->crud->allowAccess('delete');\n if(request()->user()->can('generate permission'))\n $this->crud->allowAccess(['generatePermissions']);\n }",
"protected function setupCreateOperation()\n {\n CRUD::setValidation(SettingRequest::class);\n\n CRUD::field('key')->type('text')->label('ID key');\n CRUD::field('name')->type('text')->label('Nom');\n CRUD::field('type')\n ->type('select_from_array')\n ->label('Type de widget')\n ->options([\n 'ckeditor' => 'ckeditor',\n 'textarea' => 'textarea',\n 'text' => 'text',\n ]);\n }",
"public function create()\n\t{\n\t\t//$admin_config = get_class_vars($this->Model)['admin_config'] ? : [];\n\t\t$class = $this->Model;\n\t\t$admin_config = $class::getConfig() ? : [];\n\t\t$template = isset($admin_config['template_edit']) ? $admin_config['template_edit'] : 'crud.edit';\n\n\t\treturn View::make($template, [\n\t\t\t'page' => [\n\t\t\t\t'action_path' => $admin_config['router'],\n\t\t\t\t'action_method' => 'post',\n\t\t\t\t'scripts' => [\n\t\t\t\t\t'markdown/markdown.min.js',\n\t\t\t\t\t'markdown/bootstrap-markdown.min.js',\n\t\t\t\t\t'jquery.hotkeys.min.js',\n\t\t\t\t\t'uncompressed/bootstrap-wysiwyg.js',\n\t\t\t\t],\n\t\t\t],\n\t\t\t'data' => Request::all(),\n\t\t\t'config' => $admin_config,\n\t\t]);\n\t}",
"public function run()\n {\n \n\n \\DB::table('tipo_documento')->delete();\n \n \\DB::table('tipo_documento')->insert(array (\n 0 => \n array (\n 'nombre' => 'DNI',\n 'habilitado' => true,\n ),\n 1 => \n array (\n 'nombre' => 'LC',\n 'habilitado' => true,\n ),\n 2 => \n array (\n 'nombre' => 'LE',\n 'habilitado' => true,\n ),\n 3 => \n array (\n 'nombre' => 'CEDULA',\n 'habilitado' => true,\n ),\n 4 => \n array (\n 'nombre' => 'OTRO',\n 'habilitado' => true,\n ),\n 5 => \n array (\n 'nombre' => 'NS/NC',\n 'habilitado' => true,\n ),\n ));\n \n \n }",
"public function create()\n {\n return view(\"management.table.create\");\n }",
"public function run()\n {\n\t\t\tDB::table('fields')->insert([\n 'name' => 'bg-image',\n 'type' => 6, \n 'label' => 'Imagen de fondo'\n ]);\n\n\t\t\tDB::table('fields')->insert([\n 'name' => 'homepage-title',\n 'type' => 2, \n 'label' => 'Titulo'\n ]);\n\n DB::table('fields')->insert([\n 'name' => 'subtitulo',\n 'type' => 2, \n 'label' => 'Subtitulo'\n ]);\n\n DB::table('fields')->insert([\n 'name' => 'stories-titulo',\n 'type' => 2, \n 'label' => 'Stories - Titulo'\n ]);\n\n DB::table('fields')->insert([\n 'name' => 'stories-texto',\n 'type' => 3, \n 'label' => 'Stories Texto'\n ]);\n\n DB::table('fields')->insert([\n 'name' => 'stories-imagen',\n 'type' => 6, \n 'label' => 'Stories Imagen'\n ]);\n\n DB::table('fields')->insert([\n 'name' => 'stories-link-texto',\n 'type' => 2, \n 'label' => 'Stories - Link texto'\n ]);\n\n DB::table('fields')->insert([\n 'name' => 'stories-link-href',\n 'type' => 2, \n 'label' => 'Stories - Link href'\n ]);\n\n DB::table('fields')->insert([\n 'name' => 'image',\n 'type' => 6, \n 'label' => 'Imagen'\n ]);\n\n DB::table('fields')->insert([\n 'name' => 'cuerpo',\n 'type' => 3, \n 'label' => 'Cuerpo'\n ]);\n }",
"public function run()\n {\n DB::table('user_fields')->insert([\n 'name' => 'name',\n 'title'=> 'Name',\n 'type' => 'string'\n ]);\n\n DB::table('user_fields')->insert([\n 'name' => 'email',\n 'title'=> 'Email',\n 'type' => 'string'\n ]);\n\n DB::table('user_fields')->insert([\n 'name' => 'last_name',\n 'title'=> 'Last Name',\n 'type' => 'string'\n ]);\n\n DB::table('user_fields')->insert([\n 'name' => 'company',\n 'title'=> 'Company',\n 'type' => 'string'\n ]);\n\n DB::table('user_fields')->insert([\n 'name' => 'country',\n 'title'=> 'Country',\n 'type' => 'string'\n ]);\n\n DB::table('user_fields')->insert([\n 'name' => 'phone',\n 'title'=> 'Phone',\n 'type' => 'string'\n ]);\n }",
"protected function setupCreateOperation()\n {\n CRUD::setValidation(CodeRequest::class);\n\n $this->addFieldDescriptionText();\n $this->addFieldIsVisibleCheckbox();\n }",
"protected function setupCreateOperation()\n {\n if (About::count() === 0) {\n $this->createUpdate();\n }\n\n /**\n * Fields can be defined using the fluent syntax or array syntax:\n * - CRUD::field('price')->type('number');\n * - CRUD::addField(['name' => 'price', 'type' => 'number']));\n */\n }",
"public function run()\n {\n $data = [\n [\n 'id' => '1',\n 'name' => 'Brooks',\n 'photo' => 'logo.png',\n 'address' => '159 Overland Road',\n 'contact' => '98832423423',\n 'photo_dir' => 'webroot\\\\files\\\\Companies\\\\photo\\\\',\n 'photo_size' => '16367',\n 'photo_type' => 'image/png',\n 'email' => NULL,\n 'activated' => '',\n ],\n [\n 'id' => '2',\n 'name' => 'Omnierps',\n 'photo' => 'omnierps_logo.png',\n 'address' => '220 Merrill Ln, APT 4',\n 'contact' => '9784579809',\n 'photo_dir' => 'webroot\\\\files\\\\Companies\\\\photo\\\\',\n 'photo_size' => '8130',\n 'photo_type' => 'image/png',\n 'email' => NULL,\n 'activated' => 'yes',\n ],\n ];\n\n $table = $this->table('companies');\n $table->insert($data)->save();\n }",
"public function run()\n {\n CatalogoCuestionario::create([\n 'tipo_cuestionario' => 'Extraordinario'\n ]);\n\n CatalogoCuestionario::create([\n 'tipo_cuestionario' => 'Recuperacion'\n ]);\n\n CatalogoCuestionario::create([\n 'tipo_cuestionario' => 'Ordinario'\n ]);\n\n CatalogoCuestionario::create([\n 'tipo_cuestionario' => 'Actividad'\n ]);\n }",
"public function run()\n {\n factory(\\App\\Domains\\Form\\Form::class)\n ->create([\n 'slug' => 'contacts',\n 'title' => 'Contatos',\n 'description' => 'Formulário de contatos',\n 'email' => '[email protected]',\n 'type' => 'contact'\n ]);\n\n factory(\\App\\Domains\\Form\\Form::class)\n ->create([\n 'slug' => 'newsletters',\n 'title' => 'Newsletters',\n 'description' => 'Formulário para receber assinaturas de newsletters.',\n 'email' => '[email protected]',\n 'type' => 'newsletter'\n ]);\n\n factory(\\App\\Domains\\Form\\Form::class)->create([\n 'slug' => 'resumes',\n 'title' => 'Trabalhe Conosco',\n 'description' => 'Formulário para receber currículos.',\n 'email' => '[email protected]',\n 'type' => 'resume'\n ]);\n }",
"protected function setupListOperation()\n {\n $this->crud->removeAllButtons();\n $this->crud->disableResponsiveTable();\n CRUD::column('name');\n CRUD::column('cron_expression');\n CRUD::column('grace_time_in_minutes');\n CRUD::column('last_failed_at');\n CRUD::column('last_finished_at');\n// CRUD::column('last_pinged_at');\n CRUD::column('last_skipped_at');\n CRUD::column('last_started_at');\n// CRUD::column('ping_url');\n// CRUD::column('registered_on_oh_dear_at');\n CRUD::column('timezone');\n CRUD::column('type');\n CRUD::column('updated_at');\n\n /**\n * Columns can be defined using the fluent syntax or array syntax:\n * - CRUD::column('price')->type('number');\n * - CRUD::addColumn(['name' => 'price', 'type' => 'number']);\n */\n }",
"public function run()\n {\n $file = file_get_contents(database_path('seeds/jsons/tablesTerminales.json'));\n $fields = json_decode($file);\n\n foreach ($fields as $field) {\n\n // Ingresar el nombre del modelo\n \\App\\Models\\Terminales\\Terminal::create([\n 'name' => $field->name,\n 'brand' => $field->brand,\n 'copy' => $field->copy,\n 'state' => $field->state,\n 'cash_price' => $field->cash_price,\n 'from_price' => $field->from_price,\n 'screen_size' => $field->screen_size,\n 'front_cam' => $field->front_cam,\n 'back_cam' => $field->back_cam,\n 'os' => $field->os,\n 'memory' => $field->memory,\n 'extensible_memory' => $field->extensible_memory,\n 'height' => $field->height,\n 'width' => $field->width,\n 'depth' => $field->depth,\n 'battery' => $field->battery,\n 'colors' => $field->colors,\n 'img' => $field->img\n ]);\n }\n }",
"public function createAction()\r\n\t{\r\n\t\treturn $this->_crud();\r\n\t}",
"function createDBTables() {\n $installer = new TrelloInstaller();\n return $installer->install();\n }",
"public function run()\n {\n\n $root = new Role;\n $root->name = 'root';\n $root->display_name = 'Súper Administrador';\n $root->description = 'Visualiza todos los módulos de la plataforma.';\n $root->save();\n\n $security_module = new \\Logistic\\Module;\n $security_module->name = 'security';\n $security_module->save();\n $cutomers_module = new \\Logistic\\Module;\n $cutomers_module->name = 'customers';\n $cutomers_module->save();\n $purchase_module = new \\Logistic\\Module;\n $purchase_module->name = 'purchases';\n $purchase_module->save();\n\n $submodule_module = new \\Logistic\\Submodule;\n $submodule_module->name = 'modules';\n $submodule_module->module_id = $security_module->id;\n $submodule_module->save();\n\n $submodule_submodules = new \\Logistic\\Submodule;\n $submodule_submodules->name = 'submodules';\n $submodule_submodules->module_id = $security_module->id;\n $submodule_submodules->save();\n\n $submodule_users = new \\Logistic\\Submodule;\n $submodule_users->name = 'users';\n $submodule_users->module_id = $security_module->id;\n $submodule_users->save();\n\n $submodule_roles = new \\Logistic\\Submodule;\n $submodule_roles->name = 'roles';\n $submodule_roles->module_id = $security_module->id;\n $submodule_roles->save();\n\n $submodule_permissions = new \\Logistic\\Submodule;\n $submodule_permissions->name = 'permissions';\n $submodule_permissions->module_id = $security_module->id;\n $submodule_permissions->save();\n\n $submodule_companies = new \\Logistic\\Submodule;\n $submodule_companies->name = 'companies';\n $submodule_companies->module_id = $cutomers_module->id;\n $submodule_companies->save();\n\n $submodule_business_unities = new \\Logistic\\Submodule;\n $submodule_business_unities->name = 'business_unities';\n $submodule_business_unities->module_id = $cutomers_module->id;\n $submodule_business_unities->save();\n\n $submodule_products = new \\Logistic\\Submodule;\n $submodule_products->name = 'products';\n $submodule_products->module_id = $cutomers_module->id;\n $submodule_products->save();\n\n $submodule_purchase_order = new \\Logistic\\Submodule;\n $submodule_purchase_order->name = 'purchase_order';\n $submodule_purchase_order->module_id = $purchase_module->id;\n $submodule_purchase_order->save();\n\n\n $permissions = [\n\n 'modules' => [\n [\n 'name' => 'view-module',\n 'display_name' => 'Visualizar Módulo',\n 'description' => 'Permite visualizar los módulos de la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_module->id,\n ],\n [\n 'name' => 'create-module',\n 'display_name' => 'Crear Módulo',\n 'description' => 'Permite crear módulos en la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_module->id,\n ],\n [\n 'name' => 'edit-module',\n 'display_name' => 'Editar Módulo',\n 'description' => 'Permite editar módulos en la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_module->id,\n ],\n [\n 'name' => 'delete-module',\n 'display_name' => 'Eliminar Módulo',\n 'description' => 'Permite eliminar módulos en la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_module->id,\n ],\n [\n 'name' => 'restore-module',\n 'display_name' => 'Restaurar Módulo',\n 'description' => 'Permite restaurar módulos eliminados en la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_module->id,\n ],\n ],\n 'submodules' => [\n [\n 'name' => 'view-submodule',\n 'display_name' => 'Visualizar Submódulo',\n 'description' => 'Permite visualizar los submódulos de la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_submodules->id\n ],\n [\n 'name' => 'create-submodule',\n 'display_name' => 'Crear Submódulo',\n 'description' => 'Permite crear submódulos en la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_submodules->id\n ],\n [\n 'name' => 'edit-submodule',\n 'display_name' => 'Editar Submódulo',\n 'description' => 'Permite editar submódulos en la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_submodules->id\n ],\n [\n 'name' => 'delete-submodule',\n 'display_name' => 'Eliminar Submódulo',\n 'description' => 'Permite eliminar submódulos en la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_submodules->id\n ],\n [\n 'name' => 'restore-submodule',\n 'display_name' => 'Restaurar Submódulo',\n 'description' => 'Permite restaurar submódulos eliminados en la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_submodules->id\n ],\n [\n 'name' => 'attach-roles',\n 'display_name' => 'Asignar Roles',\n 'description' => 'Permite asignar roles a los usuarios de la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_submodules->id\n ],\n ],\n 'users' => [\n [\n 'name' => 'view-users',\n 'display_name' => 'Visualizar Usuarios',\n 'description' => 'Permite visualizar los usuarios de la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_users->id\n ],\n [\n 'name' => 'create-users',\n 'display_name' => 'Crear Usuarios',\n 'description' => 'Permite crear usuarios en la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_users->id\n ],\n [\n 'name' => 'edit-users',\n 'display_name' => 'Editar Usuarios',\n 'description' => 'Permite editar usuarios en la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_users->id\n ],\n [\n 'name' => 'delete-users',\n 'display_name' => 'Eliminar Usuarios',\n 'description' => 'Permite eliminar usuarios en la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_users->id\n ],\n [\n 'name' => 'restore-users',\n 'display_name' => 'Restaurar Usuarios',\n 'description' => 'Permite restaurar usuarios eliminados en la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_users->id\n ],\n ],\n 'roles' => [\n [\n 'name' => 'view-roles',\n 'display_name' => 'Visualizar Roles',\n 'description' => 'Permite visualizar los roles de la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_roles->id\n ],\n [\n 'name' => 'create-roles',\n 'display_name' => 'Crear Roles',\n 'description' => 'Permite crear roles en la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_roles->id\n ],\n [\n 'name' => 'edit-roles',\n 'display_name' => 'Editar Roles',\n 'description' => 'Permite editar roles en la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_roles->id\n ],\n [\n 'name' => 'delete-roles',\n 'display_name' => 'Eliminar Roles',\n 'description' => 'Permite eliminar roles en la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_roles->id\n ],\n [\n 'name' => 'restore-roles',\n 'display_name' => 'Restaurar Roles',\n 'description' => 'Permite restaurar roles eliminados en la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_roles->id\n ],\n [\n 'name' => 'attach-permissions',\n 'display_name' => 'Asignar Permisos',\n 'description' => 'Permite asignar permisos a los roles de la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_roles->id\n ],\n ],\n 'permissions' => [\n [\n 'name' => 'view-permissions',\n 'display_name' => 'Visualizar Permisos',\n 'description' => 'Permite visualizar los permisos de la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_permissions->id\n ],\n [\n 'name' => 'create-permissions',\n 'display_name' => 'Crear Permisos',\n 'description' => 'Permite crear permisos en la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_permissions->id\n ],\n [\n 'name' => 'edit-permissions',\n 'display_name' => 'Editar Permisos',\n 'description' => 'Permite editar permisos en la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_permissions->id\n ],\n [\n 'name' => 'delete-permissions',\n 'display_name' => 'Eliminar Permisos',\n 'description' => 'Permite eliminar permisos en la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_permissions->id\n ],\n [\n 'name' => 'restore-permissions',\n 'display_name' => 'Restaurar Permisos',\n 'description' => 'Permite restaurar permisos eliminados en la aplicación.',\n 'module_id' => $security_module->id,\n 'submodule_id' => $submodule_permissions->id\n ],\n ],\n\n 'companies' => [\n [\n 'name' => 'view-companies',\n 'display_name' => 'Visualizar Compañías',\n 'description' => 'Permite visualizar las compañías de la aplicación.',\n 'module_id' => $cutomers_module->id,\n 'submodule_id' => $submodule_companies->id\n ],\n [\n 'name' => 'create-companies',\n 'display_name' => 'Crear Compañías',\n 'description' => 'Permite crear compañías en la aplicación.',\n 'module_id' => $cutomers_module->id,\n 'submodule_id' => $submodule_companies->id\n ],\n [\n 'name' => 'edit-companies',\n 'display_name' => 'Editar Compañías',\n 'description' => 'Permite editar compañías en la aplicación.',\n 'module_id' => $cutomers_module->id,\n 'submodule_id' => $submodule_companies->id\n ],\n [\n 'name' => 'delete-companies',\n 'display_name' => 'Eliminar Compañías',\n 'description' => 'Permite eliminar compañías en la aplicación.',\n 'module_id' => $cutomers_module->id,\n 'submodule_id' => $submodule_companies->id\n ],\n [\n 'name' => 'restore-companies',\n 'display_name' => 'Restaurar Compañías',\n 'description' => 'Permite restaurar compañías eliminados en la aplicación.',\n 'module_id' => $cutomers_module->id,\n 'submodule_id' => $submodule_companies->id\n ],\n ],\n 'business-unities' => [\n [\n 'name' => 'view-business-unities',\n 'display_name' => 'Visualizar Unidades de Negocio',\n 'description' => 'Permite visualizar las unidades de negocio de la aplicación.',\n 'module_id' => $cutomers_module->id,\n 'submodule_id' => $submodule_business_unities->id,\n ],\n [\n 'name' => 'create-business-unities',\n 'display_name' => 'Crear Unidades de Negocio',\n 'description' => 'Permite crear unidades de negocio en la aplicación.',\n 'module_id' => $cutomers_module->id,\n 'submodule_id' => $submodule_business_unities->id,\n ],\n [\n 'name' => 'edit-business-unities',\n 'display_name' => 'Editar Unidades de Negocio',\n 'description' => 'Permite editar unidades de negocio en la aplicación.',\n 'module_id' => $cutomers_module->id,\n 'submodule_id' => $submodule_business_unities->id,\n ],\n [\n 'name' => 'delete-business-unities',\n 'display_name' => 'Eliminar Unidades de Negocio',\n 'description' => 'Permite eliminar unidades de negocio en la aplicación.',\n 'module_id' => $cutomers_module->id,\n 'submodule_id' => $submodule_business_unities->id,\n ],\n [\n 'name' => 'restore-business-unities',\n 'display_name' => 'Restaurar Unidades de Negocio',\n 'description' => 'Permite restaurar unidades de negocio eliminados en la aplicación.',\n 'module_id' => $cutomers_module->id,\n 'submodule_id' => $submodule_business_unities->id,\n ],\n ],\n 'products' => [\n [\n 'name' => 'view-products',\n 'display_name' => 'Visualizar Productos',\n 'description' => 'Permite visualizar los productos de la aplicación.',\n 'module_id' => $cutomers_module->id,\n 'submodule_id' => $submodule_products->id\n ],\n [\n 'name' => 'create-products',\n 'display_name' => 'Crear Productos',\n 'description' => 'Permite crear productos en la aplicación.',\n 'module_id' => $cutomers_module->id,\n 'submodule_id' => $submodule_products->id\n ],\n [\n 'name' => 'edit-products',\n 'display_name' => 'Editar Productos',\n 'description' => 'Permite editar productos en la aplicación.',\n 'module_id' => $cutomers_module->id,\n 'submodule_id' => $submodule_products->id\n ],\n [\n 'name' => 'delete-products',\n 'display_name' => 'Eliminar Productos',\n 'description' => 'Permite eliminar productos en la aplicación.',\n 'module_id' => $cutomers_module->id,\n 'submodule_id' => $submodule_products->id\n ],\n [\n 'name' => 'restore-products',\n 'display_name' => 'Restaurar Productos',\n 'description' => 'Permite restaurar productos eliminados en la aplicación.',\n 'module_id' => $cutomers_module->id,\n 'submodule_id' => $submodule_products->id\n ],\n ],\n\n 'purchase-order' => [\n [\n 'name' => 'view-purchase-order',\n 'display_name' => 'Visualizar Ordenes de Compra',\n 'description' => 'Permite visualizar las ordenes de compra de la aplicación.',\n 'module_id' => $purchase_module->id,\n 'submodule_id' => $submodule_purchase_order->id\n ],\n [\n 'name' => 'create-purchase-order',\n 'display_name' => 'Crear Ordenes de Compra',\n 'description' => 'Permite crear ordenes de compra en la aplicación.',\n 'module_id' => $purchase_module->id,\n 'submodule_id' => $submodule_purchase_order->id\n ],\n [\n 'name' => 'edit-purchase-order',\n 'display_name' => 'Editar Ordenes de Compra',\n 'description' => 'Permite editar ordenes de compra en la aplicación.',\n 'module_id' => $purchase_module->id,\n 'submodule_id' => $submodule_purchase_order->id\n ],\n [\n 'name' => 'delete-purchase-order',\n 'display_name' => 'Eliminar Ordenes de Compra',\n 'description' => 'Permite eliminar ordenes de compra en la aplicación.',\n 'module_id' => $purchase_module->id,\n 'submodule_id' => $submodule_purchase_order->id\n ],\n [\n 'name' => 'restore-purchase-order',\n 'display_name' => 'Restaurar Ordenes de Compra',\n 'description' => 'Permite restaurar ordenes de compra eliminados en la aplicación.',\n 'module_id' => $purchase_module->id,\n 'submodule_id' => $submodule_purchase_order->id\n ],\n ],\n ];\n $modules = [\n [\n 'name' => 'view-security-module',\n 'display_name' => 'Módulo de seguridad',\n 'description' => 'Visualizar el módulo de seguridad',\n 'module_id' => $security_module->id\n ],\n [\n 'name' => 'view-customers-module',\n 'display_name' => 'Módulo de clientes',\n 'description' => 'Visualizar el módulo de clientes',\n 'module_id' => $cutomers_module->id\n ],\n [\n 'name' => 'view-purchase-module',\n 'display_name' => 'Módulo de compras',\n 'description' => 'Visualizar el módulo de compras',\n 'module_id' => $purchase_module->id\n ],\n ];\n\n $security = new Permission;\n $security->fill( $modules[0] );\n $security->save();\n\n $customers = new Permission;\n $customers->fill( $modules[1] );\n $customers->save();\n\n $purchase = new Permission;\n $purchase->fill( $modules[2] );\n $purchase->save();\n\n $modules_view = new Permission;\n $modules_view->fill($permissions['modules'][0]);\n $modules_view->save();\n $modules_create = new Permission;\n $modules_create->fill($permissions['modules'][1]);\n $modules_create->save();\n $modules_edit = new Permission;\n $modules_edit->fill($permissions['modules'][2]);\n $modules_edit->save();\n $modules_delete = new Permission;\n $modules_delete->fill($permissions['modules'][3]);\n $modules_delete->save();\n $modules_restore = new Permission;\n $modules_restore->fill($permissions['modules'][4]);\n $modules_restore->save();\n\n $submodules_view = new Permission;\n $submodules_view->fill($permissions['submodules'][0]);\n $submodules_view->save();\n $submodules_create = new Permission;\n $submodules_create->fill($permissions['submodules'][1]);\n $submodules_create->save();\n $submodules_edit = new Permission;\n $submodules_edit->fill($permissions['submodules'][2]);\n $submodules_edit->save();\n $submodules_delete = new Permission;\n $submodules_delete->fill($permissions['submodules'][3]);\n $submodules_delete->save();\n $submodules_restore = new Permission;\n $submodules_restore->fill($permissions['submodules'][4]);\n $submodules_restore->save();\n\n $users_view = new Permission;\n $users_view->fill($permissions['users'][0]);\n $users_view->save();\n $users_create = new Permission;\n $users_create->fill($permissions['users'][1]);\n $users_create->save();\n $users_edit = new Permission;\n $users_edit->fill($permissions['users'][2]);\n $users_edit->save();\n $users_delete = new Permission;\n $users_delete->fill($permissions['users'][3]);\n $users_delete->save();\n $users_restore = new Permission;\n $users_restore->fill($permissions['users'][4]);\n $users_restore->save();\n\n $roles_view = new Permission;\n $roles_view->fill($permissions['roles'][0]);\n $roles_view->save();\n $roles_create = new Permission;\n $roles_create->fill($permissions['roles'][1]);\n $roles_create->save();\n $roles_edit = new Permission;\n $roles_edit->fill($permissions['roles'][2]);\n $roles_edit->save();\n $roles_delete = new Permission;\n $roles_delete->fill($permissions['roles'][3]);\n $roles_delete->save();\n $roles_restore = new Permission;\n $roles_restore->fill($permissions['roles'][4]);\n $roles_restore->save();\n\n $permissions_module_view = new Permission;\n $permissions_module_view->fill($permissions['permissions'][0]);\n $permissions_module_view->save();\n $permissions_module_create = new Permission;\n $permissions_module_create->fill($permissions['permissions'][1]);\n $permissions_module_create->save();\n $permissions_module_edit = new Permission;\n $permissions_module_edit->fill($permissions['permissions'][2]);\n $permissions_module_edit->save();\n $permissions_module_delete = new Permission;\n $permissions_module_delete->fill($permissions['permissions'][3]);\n $permissions_module_delete->save();\n $permissions_module_restore = new Permission;\n $permissions_module_restore->fill($permissions['permissions'][4]);\n $permissions_module_restore->save();\n\n $companies_view = new Permission;\n $companies_view->fill($permissions['companies'][0]);\n $companies_view->save();\n $companies_create = new Permission;\n $companies_create->fill($permissions['companies'][1]);\n $companies_create->save();\n $companies_edit = new Permission;\n $companies_edit->fill($permissions['companies'][2]);\n $companies_edit->save();\n $companies_delete = new Permission;\n $companies_delete->fill($permissions['companies'][3]);\n $companies_delete->save();\n $companies_restore = new Permission;\n $companies_restore->fill($permissions['companies'][4]);\n $companies_restore->save();\n\n $business_unities_view = new Permission;\n $business_unities_view->fill($permissions['business-unities'][0]);\n $business_unities_view->save();\n $business_unities_create = new Permission;\n $business_unities_create->fill($permissions['business-unities'][1]);\n $business_unities_create->save();\n $business_unities_edit = new Permission;\n $business_unities_edit->fill($permissions['business-unities'][2]);\n $business_unities_edit->save();\n $business_unities_delete = new Permission;\n $business_unities_delete->fill($permissions['business-unities'][3]);\n $business_unities_delete->save();\n $business_unities_restore = new Permission;\n $business_unities_restore->fill($permissions['business-unities'][4]);\n $business_unities_restore->save();\n\n $products_view = new Permission;\n $products_view->fill($permissions['products'][0]);\n $products_view->save();\n $products_create = new Permission;\n $products_create->fill($permissions['products'][1]);\n $products_create->save();\n $products_edit = new Permission;\n $products_edit->fill($permissions['products'][2]);\n $products_edit->save();\n $products_delete = new Permission;\n $products_delete->fill($permissions['products'][3]);\n $products_delete->save();\n $products_restore = new Permission;\n $products_restore->fill($permissions['products'][4]);\n $products_restore->save();\n\n $purchase_order_view = new Permission;\n $purchase_order_view->fill($permissions['purchase-order'][0]);\n $purchase_order_view->save();\n $purchase_order_create = new Permission;\n $purchase_order_create->fill($permissions['purchase-order'][1]);\n $purchase_order_create->save();\n $purchase_order_edit = new Permission;\n $purchase_order_edit->fill($permissions['purchase-order'][2]);\n $purchase_order_edit->save();\n $purchase_order_delete = new Permission;\n $purchase_order_delete->fill($permissions['purchase-order'][3]);\n $purchase_order_delete->save();\n $purchase_order_restore = new Permission;\n $purchase_order_restore->fill($permissions['purchase-order'][4]);\n $purchase_order_restore->save();\n\n $root_permissions = [\n //Modules\n $security,\n $customers,\n $purchase,\n //Submodules\n $modules_view,\n $modules_create,\n $modules_edit,\n $modules_delete,\n $modules_restore,\n $submodules_view,\n $submodules_create,\n $submodules_edit,\n $submodules_delete,\n $submodules_restore,\n $users_view,\n $users_create,\n $users_edit,\n $users_delete,\n $users_restore,\n $roles_view,\n $roles_create,\n $roles_edit,\n $roles_delete,\n $roles_restore,\n $permissions_module_view,\n $permissions_module_create,\n $permissions_module_edit,\n $permissions_module_delete,\n $permissions_module_restore,\n $companies_view,\n $companies_create,\n $companies_edit,\n $companies_delete,\n $companies_restore,\n $business_unities_view,\n $business_unities_create,\n $business_unities_edit,\n $business_unities_delete,\n $business_unities_restore,\n $products_view,\n $products_create,\n $products_edit,\n $products_delete,\n $products_restore,\n $purchase_order_view,\n $purchase_order_create,\n $purchase_order_edit,\n $purchase_order_delete,\n $purchase_order_restore,\n ];\n\n $root->attachPermissions( $root_permissions );\n\n factory( \\Logistic\\User::class )->create([\n 'email' => '[email protected]',\n 'company_id' => \\Logistic\\Company::query()->first(['id'])->id\n ])->attachRole($root);\n }"
] | [
"0.693118",
"0.6528552",
"0.64528906",
"0.6360113",
"0.63291967",
"0.63034594",
"0.62817436",
"0.62744105",
"0.61242926",
"0.60947925",
"0.60270715",
"0.60240877",
"0.6006936",
"0.6003734",
"0.59901595",
"0.59843534",
"0.5981116",
"0.59676474",
"0.59668183",
"0.5964585",
"0.5964551",
"0.5963036",
"0.596153",
"0.594748",
"0.5942445",
"0.59061277",
"0.58913016",
"0.58633447",
"0.5862683",
"0.5845642",
"0.58352214",
"0.58350706",
"0.5832639",
"0.5800994",
"0.58005536",
"0.57905704",
"0.57886016",
"0.57852167",
"0.57803756",
"0.57758725",
"0.57722676",
"0.57678705",
"0.57639766",
"0.5755526",
"0.5755469",
"0.5749191",
"0.5729881",
"0.57135",
"0.5697816",
"0.5690672",
"0.5690264",
"0.56844765",
"0.56840944",
"0.56766206",
"0.56727064",
"0.566157",
"0.56552935",
"0.5648692",
"0.5643391",
"0.5640417",
"0.5634359",
"0.56339514",
"0.56335384",
"0.5632257",
"0.56301326",
"0.5621155",
"0.5618528",
"0.5618051",
"0.5610987",
"0.5609626",
"0.5601657",
"0.56010365",
"0.56007695",
"0.5598741",
"0.5597601",
"0.5597444",
"0.55954546",
"0.5594325",
"0.55907404",
"0.5590238",
"0.55838233",
"0.55833274",
"0.55829996",
"0.5578523",
"0.5573626",
"0.5573122",
"0.5565919",
"0.5561875",
"0.5561127",
"0.5560139",
"0.55512387",
"0.5549721",
"0.5547512",
"0.5546057",
"0.5542299",
"0.55332124",
"0.55323094",
"0.5531812",
"0.5526576",
"0.55108446"
] | 0.6060111 | 10 |
/8 Table get columns and format lines | private function table_get_columns(int $manage_button = 0, string $manage_uri = '', array $exclude = [])
{
// Initialize
$table_columns = [];
$format_lines = [];
// Get table columns
foreach ($this->columns as $alias => $type) {
if (in_array($alias, $exclude)) { continue; }
$table_columns[] = " '$alias' => '" . ucwords(str_replace('_', ' ', $alias)) . "'";
// Add format line, if needed
if (preg_match("/^decimal/i", $type)) {
$format_lines[] = " \$row['$alias'] = fmoney(\$row['$alias']);";
} elseif (preg_match("/^(datetime|timestamp)/i", $type)) {
$format_lines[] = " \$row['$alias'] = fdate(\$row['$alias'], true);";
} elseif (preg_match("/^date/i", $type)) {
$format_lines[] = " \$row['$alias'] = fdate(\$row['$alias']);";
} elseif (preg_match("/^tinyint/i", $type)) {
$format_lines[] = " \$row['$alias'] = \$row['$alias'] == 1 ? 'Yes' : 'No';";
}
}
// Add manage button, if needed
if ($manage_button == 1) {
$table_columns[] = " 'manage' => 'Manage'";
$format_lines[] = " \$row['manage'] = \"<center><a:button href=\\\"/" . $manage_uri . "_manage?record_id=\$row[id]\\\" label=\\\"Manage\\\"></center>\";";
}
// Return
return array($table_columns, $format_lines);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static function pp_tbl(array &$arr) {\n\n if (empty($arr) || !self::$pretty_print)\n return;\n\n // Count rows\n $cols = substr_count(explode(\"\\n\", $arr[0])[0], \"|\");\n // And fill an array \n $cmax = array_fill(0, $cols, 0);\n\n // Loop through each entry in array\n foreach($arr as $key => $line) {\n $h = 0; // Last column separator position\n $col = 0;\n\n // And each character in entry\n for($i = 0; $i < strlen($line); $i++) {\n\n // To work with entries with several rows in an entry\n if ($line[$i] == \"\\n\") {\n $h = $i;\n continue;\n }\n\n // Hit column separator\n if ($line[$i] == \"|\") {\n\n // Find longes column\n if (($i-$h) > $cmax[$col % $cols])\n $cmax[$col % $cols] = ($i - $h - 1);\n\n $h = $i;\n $col++;\n }\n }\n }\n\n // Do the same as above\n foreach($arr as $key => $line) {\n $h = 0; // Last column separator position\n $col = 0;\n\n // Clear array entry\n $arr[$key] = \"\";\n\n for($i = 0; $i < strlen($line); $i++) {\n\n if ($line[$i] == \"\\n\") {\n $arr[$key] .= \"|\";\n $h = $i;\n continue;\n }\n\n if ($line[$i] == \"|\") {\n // Get the conten from $h to $i (content of column)\n $lead = substr($line, $h, $i - $h);\n\n // Check if it must be padded with spaces\n if (($i - $h) < $cmax[$col % $cols])\n $lead .= str_repeat(\" \", $cmax[$col % $cols] - ($i - $h) + 1);\n\n // Restore array entry\n $arr[$key] .= $lead . (($i + 1) == strlen($line) ? \"|\" : \"\");\n\n $h = $i;\n $col++;\n }\n }\n }\n }",
"public function getTable()\r\n {\r\n $this->calculateColumnWidth();\r\n\r\n $output = $this->border ? $this->getBorderLine() : '';\r\n foreach ($this->data as $y => $row) {\r\n if ($row === self::HR) {\r\n if (!$this->allBorders) {\r\n $output .= $this->getBorderLine();\r\n unset($this->data[$y]);\r\n }\r\n\r\n continue;\r\n }\r\n\r\n foreach ($row as $x => $cell) {\r\n $output .= $this->getCellOutput($x, $row);\r\n }\r\n $output .= PHP_EOL;\r\n\r\n if ($y === self::HEADER_INDEX) {\r\n $output .= $this->getBorderLine();\r\n } else {\r\n if ($this->allBorders) {\r\n $output .= $this->getBorderLine();\r\n }\r\n }\r\n }\r\n\r\n if (!$this->allBorders) {\r\n $output .= $this->border ? $this->getBorderLine() : '';\r\n }\r\n\r\n if (PHP_SAPI !== 'cli') {\r\n $output = '<pre>' . $output . '</pre>';\r\n }\r\n\r\n return $output;\r\n }",
"function print_table($data)\n{\n\t$col_width = array();\n\n\t// pre-calculate column width\n\tforeach ($data as $row) {\n\t\tforeach ($row as $col => $value) {\n\t\t\t$col_width[$col] = max(@$col_width[$col], mb_strlen(var_export($value, true)));\n\t\t}\n\t}\n\n\t// include key width\n\tforeach ($col_width as $label => & $width) {\n\t\t$width = max(mb_strlen($label), $width);\n\t}\n\t\n\t// show table header\n\techo \"\\n \";\n\tforeach ($col_width as $label => $width) {\n\t\techo \"+\", str_repeat('-', $width + 2);\n\t}\n\techo \"+\\n \";\n\tforeach ($col_width as $label => $width) {\n\t\t$pad = ($width - mb_strlen($label)) / 2.;\n\t\techo \"| \", str_repeat(' ', floor($pad)), $label, str_repeat(' ', ceil($pad)), \" \";\n\t}\n\techo \"|\\n \";\n\tforeach ($col_width as $label => $width) {\n\t\techo \"+\", str_repeat('-', $width + 2);\n\t}\n\techo \"+\\n \";\n\n\t// show table\n\tforeach ($data as $row) {\n\t\tforeach ($row as $col => $value) {\n\t\t\t$value_str = var_export($value, true);\n\t\t\t$pad = $col_width[$col] - mb_strlen($value_str);\n\t\t\tif (is_numeric($value)) {\n\t\t\t\techo \"| \", str_repeat(' ', $pad), $value_str, \" \";\n\t\t\t} else {\n\t\t\t\techo \"| \", $value_str, str_repeat(' ', $pad), \" \";\n\t\t\t}\n\t\t}\n\t\techo \"|\\n \";\n\t}\n\n\tforeach ($col_width as $label => $width) {\n\t\techo \"+\", str_repeat('-', $width + 2);\n\t}\n\techo \"+\\n\\n\";\n}",
"function print_row($key, $row)\n{\n printf('Reading data for row %s' . PHP_EOL, $key);\n foreach ((array) $row as $family => $cols) {\n printf('Column Family %s' . PHP_EOL, $family);\n foreach ($cols as $col => $data) {\n for ($i = 0; $i < count($data); $i++) {\n printf(\n \"\\t%s: %s @%s%s\" . PHP_EOL,\n $col,\n $data[$i]['value'],\n $data[$i]['timeStamp'],\n $data[$i]['labels'] ? sprintf(' [%s]', $data[$i]['labels']) : ''\n );\n }\n }\n }\n print(PHP_EOL);\n}",
"function _tableColumnWidth(&$table){\r\n//! @return void\r\n\t$cs = &$table['cells'];\r\n\t$mw = $this->getStringWidth('W');\r\n\t$nc = $table['nc'];\r\n\t$nr = $table['nr'];\r\n\t$listspan = array();\r\n\t//Xac dinh do rong cua cac cell va cac cot tuong ung\r\n\tfor ($j=0;$j<$nc;$j++){\r\n\t\t$wc = &$table['wc'][$j];\r\n\t\tfor ($i=0;$i<$nr;$i++){\r\n\t\t\tif (isset($cs[$i][$j]) && $cs[$i][$j]){\r\n\t\t\t\t$c = &$cs[$i][$j];\r\n\t\t\t\t$miw = $mw;\r\n\t\t\t\t$c['maw']\t= $c['s'];\r\n\t\t\t\tif (isset($c['nowrap']))\t\t\t$miw = $c['maw'];\r\n\t\t\t\tif (isset($c['w'])){\r\n\t\t\t\t\tif ($miw<$c['w'])\t$c['miw'] = $c['w'];\r\n\t\t\t\t\tif ($miw>$c['w'])\t$c['miw'] = $c['w']\t = $miw;\r\n\t\t\t\t\tif (!isset($wc['w'])) $wc['w'] = 1;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$c['miw'] = $miw;\r\n\t\t\t\t}\r\n\t\t\t\tif ($c['maw'] < $c['miw'])\t\t\t$c['maw'] = $c['miw'];\r\n\t\t\t\tif (!isset($c['colspan'])){\r\n\t\t\t\t\tif ($wc['miw'] < $c['miw'])\t\t$wc['miw']\t= $c['miw'];\r\n\t\t\t\t\tif ($wc['maw'] < $c['maw'])\t\t$wc['maw']\t= $c['maw'];\r\n\t\t\t\t}else $listspan[] = array($i,$j);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t//Xac dinh su anh huong cua cac cell colspan len cac cot va nguoc lai\r\n\t$wc = &$table['wc'];\r\n\tforeach ($listspan as $span){\r\n\t\tlist($i,$j) = $span;\r\n\t\t$c = &$cs[$i][$j];\r\n\t\t$lc = $j + $c['colspan'];\r\n\t\tif ($lc > $nc) $lc = $nc;\r\n\t\t\r\n\t\t$wis = $wisa = 0;\r\n\t\t$was = $wasa = 0;\r\n\t\t$list = array();\r\n\t\tfor($k=$j;$k<$lc;$k++){\r\n\t\t\t$wis += $wc[$k]['miw'];\r\n\t\t\t$was += $wc[$k]['maw'];\r\n\t\t\tif (!isset($c['w'])){\r\n\t\t\t\t$list[] = $k;\r\n\t\t\t\t$wisa += $wc[$k]['miw'];\r\n\t\t\t\t$wasa += $wc[$k]['maw'];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($c['miw'] > $wis){\r\n\t\t\tif (!$wis){//Cac cot chua co kich thuoc => chia deu\r\n\t\t\t\tfor($k=$j;$k<$lc;$k++) $wc[$k]['miw'] = $c['miw']/$c['colspan'];\r\n\t\t\t}elseif (!count($list)){//Khong co cot nao co kich thuoc auto => chia deu phan du cho tat ca\r\n\t\t\t\t$wi = $c['miw'] - $wis;\r\n\t\t\t\tfor($k=$j;$k<$lc;$k++) \r\n\t\t\t\t\t$wc[$k]['miw'] += ($wc[$k]['miw']/$wis)*$wi;\r\n\t\t\t}else{//Co mot so cot co kich thuoc auto => chia deu phan du cho cac cot auto\r\n\t\t\t\t$wi = $c['miw'] - $wis;\r\n\t\t\t\tforeach ($list as $k)\r\n\t\t\t\t\t$wc[$k]['miw'] += ($wc[$k]['miw']/$wisa)*$wi;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($c['maw'] > $was){\r\n\t\t\tif (!$wis){//Cac cot chua co kich thuoc => chia deu\r\n\t\t\t\tfor($k=$j;$k<$lc;$k++) $wc[$k]['maw'] = $c['maw']/$c['colspan'];\r\n\t\t\t}elseif (!count($list)){//Khong co cot nao co kich thuoc auto => chia deu phan du cho tat ca\r\n\t\t\t\t$wi = $c['maw'] - $was;\r\n\t\t\t\tfor($k=$j;$k<$lc;$k++) \r\n\t\t\t\t\t$wc[$k]['maw'] += ($wc[$k]['maw']/$was)*$wi;\r\n\t\t\t}else{//Co mot so cot co kich thuoc auto => chia deu phan du cho cac cot auto\r\n\t\t\t\t$wi = $c['maw'] - $was;\r\n\t\t\t\tforeach ($list as $k)\r\n\t\t\t\t\t$wc[$k]['maw'] += ($wc[$k]['maw']/$wasa)*$wi;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}",
"abstract public function tableColumns();",
"function Latex_Table_Multi($titles,$table,$spec=\"c\")\n {\n $clines=array();\n $rtable=array();\n \n $rids=array_keys($table);\n\n $width=0;\n foreach ($rids as $rid)\n {\n $row=$table[ $rid ];\n if (!is_array($row)) { $row=array($row); }\n if (!empty($row[ \"Row\" ])) { $row=$row[ \"Row\" ]; }\n if ($width<count($row)) { $width=count($row); }\n }\n \n foreach ($rids as $rid)\n {\n $row=$table[ $rid ];\n if (!is_array($row))\n {\n $row=array\n (\n $this->MultiCell($row,$width)\n );\n \n $table[ $rid ]=$row;\n }\n \n \n if (!is_array($row)) { $row=array($row); }\n if (!empty($row[ \"Row\" ])) { $row=$this->B($row[ \"Row\" ]); }\n \n $rtable[ $rid ]=array();\n $clines[ $rid ]=array();\n\n $cids=array_keys($row);\n for ($m=0;$m<count($cids);$m++)\n {\n $cid=$cids[ $m ];\n \n $cell=$row[ $cid ];\n \n $text=$cell;\n if (!empty($cell[ \"Text\" ]))\n {\n $text=$cell[ \"Text\" ];\n }\n \n $rtable[ $rid ][ $cid ]=$text;\n\n $start=$cid+1;\n $end=$start;\n if (!empty($cell[ \"Options\" ][ \"COLSPAN\" ]))\n {\n $end=$start+$cell[ \"Options\" ][ \"COLSPAN\" ]-1;\n }\n \n $clines[ $rid ][ $cid ]=\n \"\\\\cline{\".$start.\"-\".$end.\"}\";\n }\n }\n\n \n for ($n=0;$n<count($rids);$n++)\n {\n $rid=$rids[ $n ];\n \n $row=$table[ $rid ];\n \n if (!is_array($row))\n {\n $row=array\n (\n $this->MultiCell($row,$width)\n );\n }\n \n if (!empty($row[ \"Row\" ])) { $row=$row[ \"Row\" ]; }\n \n $cids=array_keys($row);\n foreach ($row as $cid => $cell)\n {\n if (!empty($cell[ \"Options\" ]))\n {\n if (!empty($cell[ \"Options\" ][ \"ROWSPAN\" ]))\n {\n for ($m=0;$m<$cell[ \"Options\" ][ \"ROWSPAN\" ]-1;$m++)\n {\n if ($rids[ $n+$m ])\n {\n $rrid=$rids[ $n+$m ];\n unset($clines[ $rrid ][ $cid ]);\n }\n }\n\n $rtable[ $rid ][ $cid ]=\n $this->Latex_Table_Multi_Row\n (\n $cell[ \"Options\" ][ \"ROWSPAN\" ],\n $rtable[ $rid ][ $cid ]\n ).\n \"\";\n }\n\n if (!empty($cell[ \"Options\" ][ \"COLSPAN\" ]))\n {\n $rtable[ $rid ][ $cid ]=\n $this->Latex_Table_Multi_Col\n (\n $cell[ \"Options\" ][ \"COLSPAN\" ],\n $rtable[ $rid ][ $cid ],\n $cid\n );\n }\n \n \n }\n }\n\n }\n \n $specs=array();\n for ($n=0;$n<$width;$n++)\n {\n array_push($specs,$spec);\n }\n \n $latex=\"\\\\begin{tabular}{|\".join(\"|\",$specs).\"|}\\n\\\\hline\\n\";\n for ($n=0;$n<count($rids);$n++)\n {\n $rid=$rids[ $n ];\n $latex.=\n join(\" &\\n\",$rtable[ $rid ]).\"\\\\\\\\\\n\".\n join(\" \",$clines[ $rid ]).\"\\n\".\n \"\";\n }\n\n $latex.=\"\\\\end{tabular}\\n\";\n\n //$this->ShowLatexCode($latex);exit();\n\n return $latex;\n }",
"function WriteTable($tcolums)\n {\n for ($i = 0; $i < sizeof($tcolums); $i++)\n {\n $current_col = $tcolums[$i];\n $height = 0;\n \n // get max height of current col\n $nb=0;\n for($b = 0; $b < sizeof($current_col); $b++)\n {\n // set style\n $this->SetFont($current_col[$b]['font_name'], $current_col[$b]['font_style'], $current_col[$b]['font_size']);\n $color = explode(\",\", $current_col[$b]['fillcolor']);\n $this->SetFillColor($color[0], $color[1], $color[2]);\n $color = explode(\",\", $current_col[$b]['textcolor']);\n $this->SetTextColor($color[0], $color[1], $color[2]); \n $color = explode(\",\", $current_col[$b]['drawcolor']); \n $this->SetDrawColor($color[0], $color[1], $color[2]);\n $this->SetLineWidth($current_col[$b]['linewidth']);\n \n $nb = max($nb, $this->NbLines($current_col[$b]['width'], $current_col[$b]['text'])); \n $height = $current_col[$b]['height'];\n } \n $h=$height*$nb;\n \n \n // Issue a page break first if needed\n $this->CheckPageBreak($h);\n \n // Draw the cells of the row\n for($b = 0; $b < sizeof($current_col); $b++)\n {\n $w = $current_col[$b]['width'];\n $a = $current_col[$b]['align'];\n \n // Save the current position\n $x=$this->GetX();\n $y=$this->GetY();\n \n // set style\n $this->SetFont($current_col[$b]['font_name'], $current_col[$b]['font_style'], $current_col[$b]['font_size']);\n $color = explode(\",\", $current_col[$b]['fillcolor']);\n $this->SetFillColor($color[0], $color[1], $color[2]);\n $color = explode(\",\", $current_col[$b]['textcolor']);\n $this->SetTextColor($color[0], $color[1], $color[2]); \n $color = explode(\",\", $current_col[$b]['drawcolor']); \n $this->SetDrawColor($color[0], $color[1], $color[2]);\n $this->SetLineWidth($current_col[$b]['linewidth']);\n \n $color = explode(\",\", $current_col[$b]['fillcolor']); \n $this->SetDrawColor($color[0], $color[1], $color[2]);\n \n \n // Draw Cell Background\n $this->Rect($x, $y, $w, $h, 'FD');\n \n $color = explode(\",\", $current_col[$b]['drawcolor']); \n $this->SetDrawColor($color[0], $color[1], $color[2]);\n \n // Draw Cell Border\n if (substr_count($current_col[$b]['linearea'], \"T\") > 0)\n {\n $this->Line($x, $y, $x+$w, $y);\n } \n \n if (substr_count($current_col[$b]['linearea'], \"B\") > 0)\n {\n $this->Line($x, $y+$h, $x+$w, $y+$h);\n } \n \n if (substr_count($current_col[$b]['linearea'], \"L\") > 0)\n {\n $this->Line($x, $y, $x, $y+$h);\n }\n \n if (substr_count($current_col[$b]['linearea'], \"R\") > 0)\n {\n $this->Line($x+$w, $y, $x+$w, $y+$h);\n }\n \n \n // Print the text\n $this->MultiCell($w, $current_col[$b]['height'], $current_col[$b]['text'], 0, $a, 0);\n \n // Put the position to the right of the cell\n $this->SetXY($x+$w, $y); \n }\n \n // Go to the next line\n $this->Ln($h); \n } \n }",
"function table_display($table)\n{\n $out = '';\n $out = '<style> td,th{border: solid 2px black;}</style>';\n if (count($table) == 0) {\n //table is empty\n return 'table is empty';\n }\n $out .= '<table>';\n\n //table header\n $col_names = array_keys($table[0]);\n $out .= '<tr>';\n foreach ($col_names as $col_name) {\n $out .= '<th>'.$col_name.'</th>';\n }\n $out .= '</tr>';\n //table data\n $out .= '</tr>';\n foreach ($table as $one_row) {\n $out .= '<tr>';\n foreach ($one_row as $key => $col_name) {\n if ($key == 'price' and gettype($key) != 'integer') {\n $out .= '<td> $'.$col_name.' </td>';\n } else {\n $out .= '<td>'.$col_name.' </td>';\n }\n }\n $out .= '</tr>';\n }\n $out .= '</table>';\n\n return $out;\n}",
"function ImprovedTable($header,$data)\n{\n\t//Anchuras de las columnas\n\t$w=array(60,30,20,35,35);\n\t//Cabeceras\n\t$l = mysql_connect(\"localhost\",\"pmm\",\"guhAf2eh\");\n\t//$l = mysql_connect(\"DBSERVER\",\"root\",\"root\");\n\tmysql_select_db(\"pmm_dbpruebas\", $l);\n\t//mysql_select_db(\"pmm_dbweb\", $l);\n\t$s = \"SELECT CONCAT_WS(' ',nombre,paterno,materno) AS cliente, d.calle, d.poblacion, d.estado, d.pais\n\tFROM catalogocliente cc\n\tINNER JOIN direccion d ON cc.id = d.codigo\n\tWHERE d.facturacion='SI'\n\tLIMIT 0,100\";\t\n\t$r = mysql_query($s,$l) or die($s);\n\t\n\tfor($i=0;$i<count($header);$i++)\n\t\t$this->Cell($w[$i],7,$header[$i],1,0,'C');\n\t$this->Ln();\n\t//Datos\t\n\t\twhile($row = mysql_fetch_array($r)){\n\t\t\t$this->Cell($w[0],6,$row[0],'LR');\n\t\t\t$this->Cell($w[1],6,$row[1],'LR');\n\t\t\t$this->Cell($w[2],6,number_format($row[2]),'LR',0,'R');\n\t\t\t$this->Cell($w[3],6,number_format($row[3]),'LR',0,'R');\n\t\t\t$this->Ln();\n\t\t}\n\t/*foreach($data as $row)\n\t{\n\t\t$this->Cell($w[0],6,$row[0],'LR');\n\t\t$this->Cell($w[1],6,$row[1],'LR');\n\t\t$this->Cell($w[2],6,number_format($row[2]),'LR',0,'R');\n\t\t$this->Cell($w[3],6,number_format($row[3]),'LR',0,'R');\n\t\t$this->Ln();\n\t}*/\n\t//Lnea de cierre\n\t$this->Cell(array_sum($w),0,'','T');\n}",
"protected function table($data, $is = true) {\n $columns = [];\n foreach ($data as $row_key => $row) {\n foreach ($row as $cell_key => $cell) {\n $length = strlen($cell);\n if (empty($columns[$cell_key]) || $columns[$cell_key] < $length) {\n $columns[$cell_key] = $length;\n }\n }\n }\n\n // Output table, padding columns\n $table = \"\";\n foreach ($data as $row_key => $row) {\n foreach ($row as $cell_key => $cell)\n $table .= str_pad($cell, $columns[$cell_key]) . (($is == false) ? \"\\t\" : \"\\t\");\n $table .= PHP_EOL;\n }\n return $table;\n\n }",
"public function tableColumns($table,$column);",
"public function getTableColumns()\n\t{\n\t}",
"function TableShow($align,$LineFeedHeight)\r\n{\r\n\t// Le calcul ne l'est pas, lui ;-)\r\n\t$oldFontSizePt=$this->FontSizePt;\r\n\t$oldFontFamily=$this->FontFamily;\r\n\r\n\t$tableFontFamily='helvetica';\r\n\t$cellmargin=3.0;\t\t// pifomètre : un peu de marge sur la largeur de cellule\r\n\t$wrwi=$this->w - $this->lMargin - $this->rMargin;\r\n\t//-----------\r\n\t$tableFontSize=10;\r\n\t$TableWidth = 1.01*$wrwi;\r\n\t$max_width=0;\r\n\t$min_font_size=6.0; // mis à 6, 5 était vraiment petit\r\n\t$maxiter = 10;\r\n\tdo {\r\n\t\t$tableFontSize = $tableFontSize *min(1.0,$wrwi/$TableWidth)*0.99; // 0.99 pour converger plus vite\r\n\r\n\t\t$fixed_width= ($tableFontSize<$min_font_size) || ($maxiter==1) || ($TableWidth<=$wrwi);\r\n\t\tif ($fixed_width)\r\n\t\t\t$coeff=min(1.0,$wrwi/$TableWidth);\r\n\r\n\t\t$tableFontSize = max($min_font_size,$tableFontSize);\r\n\t\t// on boucle sur la taille de police tant que la largeur du tableau ne rentre pas dans la page\r\n\r\n\t\t// remise à zéro des largeurs de colonnes\r\n\t\tforeach ($this->columnProp as $i=>$cprop)\r\n\t\t\tif ($fixed_width)\t$this->columnProp[$i]['w']=$this->columnProp[$i]['w']*$coeff;// redimenssioner la largeur de la colonne\r\n\t\t\telse\t$this->columnProp[$i]['w']=0.0;\r\n\t\tforeach($this->tableContent as $j=>$row)\r\n\t\t\t$this->lineProp[$j]['h']=0.0;\r\n\r\n\t\t// on passe toutes les cellules du tableau en revue\r\n\t\t// de façon à calculer la largeur max de chaque colonne pour la taille de police courante\r\n\t\tforeach($this->tableContent as $j=>$row) {\r\n\t\t\tforeach($row as $i=>$cell) {\r\n\t\t\t\t$htmlContent = $cell['content'].\"<br />\";\r\n\t\t\t\tif ($this->tableContent[$j][$i]['TH']) {\r\n\t\t\t\t\t$htmlContent=\"<B>$htmlContent</B>\";\r\n\t\t\t\t}\r\n\t\t\t\tlist($width,$height)=$this->CellSize($htmlContent,$tableFontFamily,$tableFontSize,$LineFeedHeight,$cellmargin,$fixed_width?$this->columnProp[$i]['w']:0);\r\n\r\n\t\t\t\tif (!$fixed_width)\r\n\t\t\t\t\t$this->columnProp[$i]['w'] = max($this->columnProp[$i]['w'],$width);\r\n\t\t\t\t$this->lineProp[$j]['h'] = max($this->lineProp[$j]['h'],$height)+0.3;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Repris de CalcWidth : calcul de la largeur de la table\r\n\t\t$TableWidth=0.0;\r\n\t\tforeach($this->columnProp as $col) {\r\n\t\t\t$TableWidth += $col['w'];\r\n\t\t}\r\n\t} while (!$fixed_width && $maxiter--);\r\n\r\n\t//-----------\r\n\t//\tEnvoi du tableau dans le flux PDF\r\n\t//-----------\r\n\r\n\t$this->SetFont($tableFontFamily, '', $tableFontSize);\r\n\t//Calcule l'abscisse du tableau\r\n\tif($align=='C')\r\n\t\t$this->TableX=max(($this->w-$TableWidth)/2, 0);\r\n\telseif($align=='R')\r\n\t\t$this->TableX=max($this->w-$this->rMargin-$TableWidth, 0);\r\n\telse\r\n\t\t$this->TableX=$this->lMargin;\r\n\r\n\t$ci=0;\t# flip-flop pour couleur de fond de ligne\r\n\tforeach($this->tableContent as $j=>$row) {\r\n\t\t$this->SetX($this->TableX);\r\n\t\t$fill = !empty($this->RowColors[$ci]);\r\n\t\tif ($fill) {\r\n\t\t\t$this->SetFillColor($this->RowColors[$ci][0],\r\n\t\t\t\t\t\t\t\t$this->RowColors[$ci][1],\r\n\t\t\t\t\t\t\t\t$this->RowColors[$ci][2]);\r\n\t\t}\r\n\r\n\t\tforeach($this->tableContent[$j] as $i=>$cell) {\r\n\t\t\tif ($this->tableContent[$j][$i]['TH'] == true) {\r\n\t\t\t\t$this->SetFont($tableFontFamily, 'B', $tableFontSize);\r\n\t\t\t\t$this->SetFillColor(255, 255, 0);\t// jaune\r\n\t\t\t\t$fill=1;\r\n\t\t\t}\r\n\t\t\t$this->OutputCell(\r\n\t\t\t\t$this->columnProp[$i]['w'],\r\n\t\t\t\t$this->lineProp[$j]['h'],\r\n\t\t\t\t$cell['content'],\r\n\t\t\t\t1,\r\n\t\t\t\t$LineFeedHeight,\r\n\t\t\t\t$this->columnProp[$i]['a'],\r\n\t\t\t\t$fill,0);\r\n\r\n\t\t\tif ($this->tableContent[$j][$i]['TH']) {\r\n\t\t\t\t$this->SetFont('', '', $tableFontSize);\r\n\t\t\t\t$this->SetFillColor(255);\t// blanc\r\n\t\t\t}\r\n\t\t}\r\n\t\t$ci=1-$ci;\r\n\t\t$this->maxLineWidth = max($this->maxLineWidth,$this->x);\r\n\t\t$this->Ln($this->lineProp[$j]['h']);\r\n\t}\r\n\r\n\t$this->SetFont($oldFontFamily, '', $oldFontSizePt);\r\n\t$this->Ln($LineFeedHeight);\r\n}",
"function _tableColumnWidth(&$table){\n//! @return void\n\t$cs = &$table['cells'];\n\t$mw = $this->getStringWidth('W');\n\t$nc = $table['nc'];\n\t$nr = $table['nr'];\n\t$listspan = array();\n\t//Xac dinh do rong cua cac cell va cac cot tuong ung\n\tfor($j = 0 ; $j < $nc ; $j++ ) //columns\n {\n\t\t$wc = &$table['wc'][$j];\n\t\tfor($i = 0 ; $i < $nr ; $i++ ) //rows\n {\n\t\t\tif (isset($cs[$i][$j]) && $cs[$i][$j])\n {\n\t\t\t\t$c = &$cs[$i][$j];\n\t\t\t\t$miw = $mw;\n\t\t\t\tif (isset($c['maxs']) and $c['maxs'] != '') $c['s'] = $c['maxs'];\n\t\t\t\t$c['maw']\t= $c['s'];\n\t\t\t\tif (isset($c['nowrap'])) $miw = $c['maw'];\n\t\t\t\tif (isset($c['w']))\n {\n\t\t\t\t\tif ($miw<$c['w'])\t$c['miw'] = $c['w'];\n\t\t\t\t\tif ($miw>$c['w'])\t$c['miw'] = $c['w']\t = $miw;\n\t\t\t\t\tif (!isset($wc['w'])) $wc['w'] = 1;\n\t\t\t\t}\n else $c['miw'] = $miw;\n\t\t\t\tif ($c['maw'] < $c['miw']) $c['maw'] = $c['miw'];\n\t\t\t\tif (!isset($c['colspan']))\n {\n\t\t\t\t\tif ($wc['miw'] < $c['miw'])\t\t$wc['miw']\t= $c['miw'];\n\t\t\t\t\tif ($wc['maw'] < $c['maw'])\t\t$wc['maw']\t= $c['maw'];\n\t\t\t\t}\n else $listspan[] = array($i,$j);\n //Check if minimum width of the whole column is big enough for a huge word to fit\n $auxtext = implode(\"\",$c['text']);\n $minwidth = $this->WordWrap($auxtext,$wc['miw']-2);// -2 == margin\n if ($minwidth < 0 and (-$minwidth) > $wc['miw']) $wc['miw'] = (-$minwidth) +2; //increase minimum width\n if ($wc['miw'] > $wc['maw']) $wc['maw'] = $wc['miw']; //update maximum width, if needed\n\t\t\t}\n\t\t}//rows\n\t}//columns\n\t//Xac dinh su anh huong cua cac cell colspan len cac cot va nguoc lai\n\t$wc = &$table['wc'];\n\tforeach ($listspan as $span)\n {\n\t\tlist($i,$j) = $span;\n\t\t$c = &$cs[$i][$j];\n\t\t$lc = $j + $c['colspan'];\n\t\tif ($lc > $nc) $lc = $nc;\n\t\t\n\t\t$wis = $wisa = 0;\n\t\t$was = $wasa = 0;\n\t\t$list = array();\n\t\tfor($k=$j;$k<$lc;$k++)\n {\n\t\t\t$wis += $wc[$k]['miw'];\n\t\t\t$was += $wc[$k]['maw'];\n\t\t\tif (!isset($c['w']))\n {\n\t\t\t\t$list[] = $k;\n\t\t\t\t$wisa += $wc[$k]['miw'];\n\t\t\t\t$wasa += $wc[$k]['maw'];\n\t\t\t}\n\t\t}\n\t\tif ($c['miw'] > $wis)\n {\n\t\t\tif (!$wis)\n {//Cac cot chua co kich thuoc => chia deu\n\t\t\t\tfor($k=$j;$k<$lc;$k++) $wc[$k]['miw'] = $c['miw']/$c['colspan'];\n\t\t\t}\n elseif(!count($list))\n {//Khong co cot nao co kich thuoc auto => chia deu phan du cho tat ca\n\t\t\t\t$wi = $c['miw'] - $wis;\n\t\t\t\tfor($k=$j;$k<$lc;$k++) $wc[$k]['miw'] += ($wc[$k]['miw']/$wis)*$wi;\n\t\t\t}\n else\n {//Co mot so cot co kich thuoc auto => chia deu phan du cho cac cot auto\n\t\t\t\t$wi = $c['miw'] - $wis;\n\t\t\t\tforeach ($list as $k)\t$wc[$k]['miw'] += ($wc[$k]['miw']/$wisa)*$wi;\n\t\t\t}\n\t\t}\n\t\tif ($c['maw'] > $was)\n {\n\t\t\tif (!$wis)\n {//Cac cot chua co kich thuoc => chia deu\n\t\t\t\tfor($k=$j;$k<$lc;$k++) $wc[$k]['maw'] = $c['maw']/$c['colspan'];\n\t\t\t}\n elseif (!count($list))\n {\n //Khong co cot nao co kich thuoc auto => chia deu phan du cho tat ca\n\t\t\t\t$wi = $c['maw'] - $was;\n\t\t\t\tfor($k=$j;$k<$lc;$k++) $wc[$k]['maw'] += ($wc[$k]['maw']/$was)*$wi;\n\t\t\t}\n else\n {//Co mot so cot co kich thuoc auto => chia deu phan du cho cac cot auto\n\t\t\t\t$wi = $c['maw'] - $was;\n\t\t\t\tforeach ($list as $k)\t$wc[$k]['maw'] += ($wc[$k]['maw']/$wasa)*$wi;\n\t\t\t}\n\t\t}\n\t}\n}",
"public function fullTableRow($in){\n $out = '';\n $cols = array_keys($in);\n foreach($in as $k => $v){\n if(!isset($v)) $v = 'n/a';\n $out .= '<td><a title=\"'.$k.'\">'.$v.'</a></td>';\n }\n return('<tr>'.$out.'</tr>');\n }",
"function FancyTable($data, $type, $sortby) {\r\n $this->SetFillColor(255, 0, 0);\r\n $this->SetTextColor(255);\r\n // $this->SetDrawColor(128, 0, 0);\r\n $this->SetLineWidth(.3);\r\n $this->SetFont('Arial', 'B', 14);\r\n\r\n // Color and font restoration\r\n $this->SetFillColor(220, 220, 220);\r\n $this->SetTextColor(0);\r\n $this->SetFont('');\r\n\r\n $w = $GLOBALS[\"width\"];\r\n $fill = false;\r\n\r\n $eId = $_GET[\"eId\"];\r\n if (isset($_GET[\"printall\"]))\r\n $printall = $_GET[\"printall\"];\r\n else\r\n $printall = 0;\r\n\r\n\r\n if ($eId == 999999 && $printall != 0) {\r\n for ($counter = 0; $counter < sizeof($data[1]); $counter++) {\r\n $row = $data[1][$counter];\r\n $this->SetFont('Arial', '', 14);\r\n $this->Cell($w[0], 9, number_format($row[\"school_id\"]), 'LR', 0, 'L', $fill);\r\n $this->Cell($w[1], 9, $row[\"school_name\"], 'LR', 0, 'L', $fill);\r\n $this->Cell($w[2], 9, number_format($row[\"marks_sum\"]), 'LR', 0, 'L', $fill);\r\n $this->Ln();\r\n $fill = !$fill;\r\n }\r\n } else {\r\n for ($counter = 0; $counter < sizeof($data[0]); $counter++) {\r\n $row = $data[0][$counter];\r\n $this->SetFont('Arial', '', 14);\r\n $this->Cell($w[0], 9, number_format($row[\"regn_number\"]), 'LR', 0, 'L', $fill);\r\n $this->Cell($w[1], 9, $row[\"name\"], 'LR', 0, 'L', $fill);\r\n $this->Cell($w[2], 9, $row[\"school_name\"], 'LR', 0, 'L', $fill);\r\n $this->Cell($w[3], 9, $row[\"event_name\"], 'LR', 0, 'L', $fill);\r\n $this->Cell($w[4], 9, number_format($row[\"position\"]), 'LR', 0, 'L', $fill);\r\n $this->Ln();\r\n $fill = !$fill;\r\n }\r\n }\r\n }",
"function mysql04($tabla){\n $qColumnNames = mysql_query(\"SHOW COLUMNS FROM \".$tabla) or die(\"mysql error\");\n $numColumns = mysql_num_rows($qColumnNames);\n $i = 0;\n while ( $i < $numColumns ){\n $colname = mysql_fetch_row($qColumnNames);\n $col[$i] = \"<th>\".$colname[0].\"</th>\";\n $i++;\n }\n $h = 0;\n $resultado[0] = \"<tr>\";\n while ( $h < $numColumns ){\n $resultado[0] = $resultado[0] . $col[$h];\n $h++;\n }\n $resultado[0] = $resultado[0].\"</tr>\";\n $query01=\"SELECT * FROM \".$tabla;\n $query02=mysql_query($query01);\n $numLines = mysql_num_rows($query02);\n\n $j=0;\n while( $rec = mysql_fetch_row($query02) ){\n for( $k = 0; $k != $numColumns ; $k++){\n if ( $resultado[1 + $j] == \"\" ){\n $resultado[1 + $j] = \"<tr>\";\n }\n if ( $rec[$k] == \"\" ){\n $rec[$k] = \"-\";\n }\n $resultado[1 + $j] = $resultado[1 + $j].\"<td>\".$rec[$k].\"</td>\";\n }\n $resultado[1 + $j] = $resultado[1 + $j].\"</tr>\";\n $j++;\n }\n return $resultado;\n/*\nCOMO USARLO\n$tabla = '';\n$resultado = mysql04($tabla);\necho \"<table>\";\n foreach( $resultado as $value ){\n\techo $value;\n}\necho \"</table>\";\n*/\n}",
"function listColumns($tablename);",
"public function previewColumns();",
"public abstract function get_columns($table);",
"protected function OrderLineTable() {\n\treturn $this->GetConnection()->MakeTableWrapper(KS_CLASS_ORDER_LINES);\n }",
"public abstract function getColumns($table);",
"abstract protected function columns();",
"abstract protected function doCols();",
"public function createTable()\n {\n // Create out table\n // First line of the file.\n $fh = $this->getInputFileHandle();\n rewind($fh);\n $fl = fgets($fh);\n // Trim and htmlentities the first line of the file to make column names\n $cols = array_map('trim', array_map('htmlentities', str_getcsv($fl, $this->vars['delimiter'], $this->vars['quotechar'], $this->vars['escapechar'])));\n // array to hold definitions\n $defs = array();\n // if our table *doesn't* have headers, give generic names\n if (!$this->vars['hh']) {\n $oc = $cols;\n $c = count($cols);\n $cols = array();\n for ($i = 0; $i < $c; $i++) {\n $col = \" `Column_\" . $i . \"` \";\n $col .= is_numeric($oc[$i]) ? \"DECIMAL(12,6) DEFAULT NULL\" :\n \"VARCHAR(512) CHARACTER SET \" . $this->vars['characterSet'] . \" COLLATE \" . $this->vars['collation'] . \" DEFAULT NULL\";\n $cols[] = $col;\n }\n } else {\n // if our table *does* have headers\n $file = new SplFileObject($this->vars['ifn']);\n $headers = $file->fgetcsv($this->vars['delimiter'], $this->vars['quotechar'], $this->vars['escapechar']);\n\n // number of columns to get for guessing types\n $n = min(10, $this->numLines());\n $firstNCols = array();\n for($i = 0; $i < $n; $i++){\n $firstNCols[$i] = $file->fgetcsv($this->vars['delimiter'], $this->vars['quotechar'], $this->vars['escapechar']);\n }\n $sl = $firstNCols[0];\n if(count($sl) !== count($cols)){\n $baseurl = explode('?', $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])[0];\n trigger_error(\"Number of columns inconsistent throughout file. For more information, see the error documentation.\");\n exit(1);\n }\n\n // guess the column types from the first n rows of info\n $colTypes = array_fill(0,count($cols),null);\n for($i = 0; $i < $n; $i++){\n foreach ($cols as $j => $col) {\n if(!isset($firstNCols[$i])){\n trigger_error('Why don\\'t we have row ' . $i . '??');\n }\n if(!isset($firstNCols[$i][$j])){\n if(count($firstNCols[$i]) !== count($cols)){\n trigger_error('Column count is inconsistent throughout the file. If you\\'re sure you have the right amount of columns, please check the delimiter options.');\n }\n trigger_error('Why don\\'t we have column ' . $j . '??');\n }\n $colTypes[$j] = $this->guessType(\n $firstNCols[$i][$j],\n $colTypes[$j]\n );\n }\n }\n\n foreach($colTypes as $i => &$type){\n $type = (is_null($type)) ? 'VARCHAR(512) CHARACTER SET ' . $this->vars['characterSet'] . ' COLLATE ' . $this->vars['collation'] . '' : $type;\n }\n\n /*echo \"<pre>\";\n print_r(array_combine($cols,$colTypes));\n echo \"</pre>\";\n exit();*/\n\n // We can pretty much only guess two data types from one row of information\n foreach ($cols as $i => &$col) {\n $cname = $col;\n $col = ' `' . $cname . '` ';\n $col .= $colTypes[$i];\n $col .= \" COMMENT '$cname'\";\n }\n }\n // Always have an id column!\n array_unshift($cols, ' `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT \\'id\\'');\n $SQL = \"CREATE TABLE IF NOT EXISTS `{$this->vars['db']['db']}`.`{$this->vars['db']['table']}` (\\n\";\n $SQL .= implode(\",\\n\", $cols);\n $SQL .= \"\\n) ENGINE=InnoDB DEFAULT CHARSET=\".$this->vars['characterSet'].\" CHARSET=\".$this->vars['characterSet'].\" COLLATE \".$this->vars['collation'].\";\";\n $this->executeSql($SQL);\n\n return $this;\n }",
"public function getTableOfContents();",
"function flip_tables() {\r\n\t\t$tables_flipped_counter = 0;\r\n\t\t$new_tables_array = array();\r\n\t\t$tables = OM::getAllOStrings($this->code, '<table', '</table>');\r\n\t\t//print('$tables: ');var_dump($tables);exit(0);\r\n\t\tforeach($tables as $table) {\r\n\t\t\t$new_table_array = array();\r\n\t\t\tpreg_match_all('/<(tr)([^<>]*?)>(.*?)<\\/\\1>/is', $table[0], $tr_matches, PREG_OFFSET_CAPTURE);\r\n\t\t\t//print('$tr_matches: ');var_dump($tr_matches);exit(0);\r\n\t\t\t$rowspan = 1;\r\n\t\t\t//$debug_counter = 0;\r\n\t\t\tforeach($tr_matches[0] as $index => $value) {\r\n\t\t\t\tpreg_match_all('/<(td|th)([^<>]*?)>(.*?)<\\/\\1>/is', $value[0], $cell_matches, PREG_OFFSET_CAPTURE);\r\n\t\t\t\tif($rowspan > 1) {\r\n\t\t\t\t\tforeach($cell_matches[0] as $index2 => $value2) {\r\n\t\t\t\t\t\tpreg_match_all('/rowspan=\"([^\"]*?)\"/is', $value2[0], $rowspan_matches, PREG_OFFSET_CAPTURE);\r\n\t\t\t\t\t\tif(sizeof($rowspan_matches[0]) > 0) {\r\n\t\t\t\t\t\t\t$rowspan = (int)$rowspan_matches[1][0][0];\r\n\t\t\t\t\t\t\t//print('$rowspan2: ');var_dump($rowspan);exit(0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$new_table_array[$index2 + 1][] = $value2[0];\r\n\t\t\t\t\t} \r\n\t\t\t\t} else {\r\n\t\t\t\t\tforeach($cell_matches[0] as $index2 => $value2) {\r\n\t\t\t\t\t\tpreg_match_all('/rowspan=\"([^\"]*?)\"/is', $value2[0], $rowspan_matches, PREG_OFFSET_CAPTURE);\r\n\t\t\t\t\t\tif(sizeof($rowspan_matches[0]) > 0) {\r\n\t\t\t\t\t\t\t//print('$rowspan_matches: ');var_dump($rowspan_matches);exit(0);\r\n\t\t\t\t\t\t\t$rowspan = (int)$rowspan_matches[1][0][0] + 1;\r\n\t\t\t\t\t\t\t//print('$rowspan2: ');var_dump($rowspan);exit(0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$new_table_array[$index2][] = $value2[0];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$rowspan--;\r\n\t\t\t\t/*if($debug_counter === 8) {\r\n\t\t\t\t\t//print('$new_table_array: ');var_dump($new_table_array);exit(0);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t$debug_counter++;*/\r\n\t\t\t}\r\n\t\t\t$new_tables_array[] = $new_table_array;\r\n\t\t}\r\n\t\t//print('$new_tables_array: ');var_dump($new_tables_array);exit(0);\r\n\t\t$reversed_tables = array_reverse($tables);\r\n\t\t$counter = sizeof($reversed_tables) - 1;\r\n\t\tforeach($reversed_tables as $table) {\r\n\t\t\t$new_table_code = '<table>\r\n';\r\n\t\t\tforeach($new_tables_array[$counter] as $row => $cells) {\r\n\t\t\t\t$new_table_code .= '<tr>\r\n';\r\n\t\t\t\tforeach($cells as $cell) {\r\n\t\t\t\t\t$cell = str_replace('colspan', 'XXXrow9o9spanXXX', $cell);\r\n\t\t\t\t\t$cell = str_replace('rowspan', 'colspan', $cell);\r\n\t\t\t\t\t$cell = str_replace('XXXrow9o9spanXXX', 'rowspan', $cell);\r\n\t\t\t\t\t$new_table_code .= $cell . '\r\n';\r\n\t\t\t\t}\r\n\t\t\t\t$new_table_code .= '</tr>\r\n';\r\n\t\t\t}\r\n\t\t\t$new_table_code .= '</table>';\r\n\t\t\t$this->code = substr($this->code, 0, $table[1]) . $new_table_code . '<table deleteme=\"y\"' . substr($this->code, $table[1] + 6);\r\n\t\t\t$counter--;\r\n\t\t\t$tables_flipped_counter++;\r\n\t\t}\r\n\t\t\r\n\t\t// fucking DOM...\r\n\t\t/*$query = '//' . ReTidy::get_html_namespace() . 'table';\r\n\t\t$tables = $this->xpath->query($query);\r\n\t\tforeach($tables as $table) {\r\n\t\t\t$query = './/' . ReTidy::get_html_namespace() . 'tr';\r\n\t\t\t$trs = $this->xpath->query($query, $table);\r\n\t\t\t$new_table_array = array();\r\n\t\t\t$record_max_cells_per_row = 0;\r\n\t\t\t$row = 0;\r\n\t\t\tforeach($trs as $tr) {\r\n\t\t\t\t$max_cells_per_row = 0;\r\n\t\t\t\t$query = './/' . ReTidy::get_html_namespace() . 'th | .//' . ReTidy::get_html_namespace() . 'td';\r\n\t\t\t\t$cells = $this->xpath->query($query, $tr);\r\n\t\t\t\t$new_tr_array = array();\r\n\t\t\t\tforeach($cells as $cell) {\r\n\t\t\t\t\t$new_tr_array[] = $cell;\r\n\t\t\t\t\t$max_cells_per_row++;\r\n\t\t\t\t}\r\n\t\t\t\t$new_table_array[$row] = $new_tr_array;\r\n\t\t\t\tif($max_cells_per_row > $record_max_cells_per_row) {\r\n\t\t\t\t\t$record_max_cells_per_row = $max_cells_per_row;\r\n\t\t\t\t}\r\n\t\t\t\t$row++;\r\n\t\t\t}\r\n\t\t\t//var_dump($new_table_array);\r\n\t\t\t//$new_table = new DOMElement('table');\r\n\t\t\t$new_table = $this->dom->createElementNS(self::$xhtmlns, 'table');\r\n\t\t\t$tr_counter = 0;\r\n\t\t\twhile($tr_counter < $record_max_cells_per_row) {\r\n\t\t\t\tprint('here4585687979789<br>');\r\n\t\t\t\t//$new_tr = new DOMElement('tr');\r\n\t\t\t\t$new_tr = $this->dom->createElementNS(self::$xhtmlns, 'tr');\r\n\t\t\t\tforeach($new_table_array as $row => $cells) {\r\n\t\t\t\t\tprint('here4585687979790<br>');\r\n\t\t\t\t\tforeach($cells as $index => $cell) {\r\n\t\t\t\t\t\tprint('here4585687979791<br>');\r\n\t\t\t\t\t\t//if($index === $tr_counter) {\r\n\t\t\t\t\t\t\tprint('here4585687979792<br>');\r\n\t\t\t\t\t\t\t//$clone = $cell->cloneNode(true);\r\n\t\t\t\t\t\t\t$new_tr->appendChild($cell);\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t$new_table->appendChild($new_tr);\r\n\t\t\t\t$tr_counter++;\r\n\t\t\t}\r\n\t\t\t$table->parentNode->appendChild($new_table);\r\n\t\t\t//$table->parentNode->appendChild(new DOMText(\"XXX9o9NewTagEndXXXccc9o9XXX\"));\r\n\t\t\t//$previousElement->appendChild(new DOMText(\"XXX9o9NewTagEndXXXstrong9o9XXX\"));\r\n\t\t\t//$tr_cell->appendChild(new DOMText(ReTidy::DOM_decoded_for_DOM_child_of($element_cell)));\r\n\t\t\t$table->setAttribute('deleteme', 'y');\r\n\t\t\t$tables_flipped_counter++;\r\n\t\t}*/\r\n\t\t$this->logMsgIf('tables flipped', $tables_flipped_counter);\r\n\t\treturn $tables_flipped_counter;\r\n\t}",
"static function dump_table ($rows)\n\t{\n\t\t$first_row = true;\n\t\t$keys = array();\n\t\t$lengths = array();\n\t\tforeach ($rows as $row) {\n\t\t\tforeach ($row as $key => $value) {\n\t\t\t\tif ($first_row) {\n\t\t\t\t\t$keys[] = $key;\n\t\t\t\t\t$lengths[$key] = strlen($key);\n\t\t\t\t}\n\t\t\t\t$val_len = strlen((string)$value);\n\t\t\t\tif ($val_len > $lengths[$key])\n\t\t\t\t\t$lengths[$key] = $val_len;\n\t\t\t}\n\t\t\t$first_row = false;\n\t\t}\n\t\tforeach ($keys as $i => $key) {\n\t\t\t$key_len = strlen($key);\n\t\t\tif ($key_len < $lengths[$key]) {\n\t\t\t\t$keys[$i] .= str_repeat(' ', $lengths[$key] - $key_len);\n\t\t\t}\n\t\t}\n\t\techo PHP_EOL;\n\t\techo implode(\"\\t\", $keys);\n\t\techo PHP_EOL;\n\t\tforeach ($rows as $i => $row) {\n\t\t\tforeach ($row as $key => $value) {\n\t\t\t\t$val_len = strlen((string)$value);\n\t\t\t\tif ($val_len < $lengths[$key]) {\n\t\t\t\t\t$row[$key] .= str_repeat(' ', $lengths[$key] - $val_len);\n\t\t\t\t}\n\t\t\t}\n\t\t\techo implode(\"\\t\", $row);\n\t\t\techo PHP_EOL;\n\t\t}\n\t}",
"public function getTableLayout()\n {\n return [\n 'headRows' => [0],\n 'table' => ['<table class=\"table table-striped table-hover table-condensed\">', '</table><br/>'],\n '0' => [ // Format für 1. Zeile\n 'tr' => ['<tr class=\"\">', '</tr>'],\n // Format für jede Spalte in der 1. Zeile\n 'defCol' => ['<td>', '</td>'],\n ],\n 'defRow' => [ // Formate für alle Zeilen\n 'tr' => ['<tr class=\"\">', '</tr>'],\n 'defCol' => ['<td>', '</td>'], // Format für jede Spalte in jeder Zeile\n ],\n 'defRowEven' => [ // Formate für alle geraden Zeilen\n 'tr' => ['<tr class=\"\">', '</tr>'],\n // Format für jede Spalte in jeder Zeile\n 'defCol' => ['<td>', '</td>'],\n ],\n ];\n }",
"public function print_table_description()\n {\n }",
"private function _getColorTable() {}",
"function morepagestable($datas,$lineheight=8) {\n $l = $this->lMargin;\n $startheight = $h = $this->GetY();\n $startpage = $currpage = $this->page;\n // calculate the whole width\n foreach($this->tablewidths AS $width) {\n $fullwidth += $width;\n }\n $this->SetFont('Arial','',6);\n // Now let's start to write the table\n foreach($datas AS $row => $data) {\n $this->page = $currpage;\n // write the horizontal borders\n $this->Line($l,$h,$fullwidth+$l,$h);\n // write the content and remember the height of the highest col\n $posicion = 0;\n $fil=0;\n foreach($data AS $col => $txt) {\n \tif($posicion == 0 AND strpos($txt,\".\")===false){\n \t\t$fil=1;\n \t}\n \t\n \t$posicion++;\n \t$this->SetFillColor(60,100,200);\n \t$this->SetTextColor(0,0,0);\n $this->page = $currpage;\n $this->SetXY($l,$h);\n $this->MultiCell($this->tablewidths[$col],$lineheight,$txt,0,1,$fil);\n $l += $this->tablewidths[$col];\n\t\t\t$this->SetFillColor(0,0,0);\n if($tmpheight[$row.'-'.$this->page] < $this->GetY()) {\n $tmpheight[$row.'-'.$this->page] = $this->GetY();\n }\n if($this->page > $maxpage)\n $maxpage = $this->page;\n }\n\n // get the height we were in the last used page\n $h = $tmpheight[$row.'-'.$maxpage];\n // set the \"pointer\" to the left margin\n $l = $this->lMargin;\n // set the $currpage to the last page\n $currpage = $maxpage;\n }\n // draw the borders\n // we start adding a horizontal line on the last page\n $this->page = $maxpage;\n $this->Line($l,$h,$fullwidth+$l,$h);\n // now we start at the top of the document and walk down\n for($i = $startpage; $i <= $maxpage; $i++) {\n $this->page = $i;\n $l = $this->lMargin;\n $t = ($i == $startpage) ? $startheight : $this->tMargin+140;\n $lh = ($i == $maxpage) ? $h : $this->h-$this->bMargin;\n $this->Line($l,$t,$l,$lh);\n foreach($this->tablewidths AS $width) {\n $l += $width;\n $this->Line($l,$t,$l,$lh);\n }\n }\n // set it to the last page, if not it'll cause some problems\n $this->page = $maxpage;\n}",
"public function flush() {\n if (empty($this->_row) or empty($this->_row['line']['normal'])) {\n // Nothing to print - each line has to have at least number\n $this->_row = array();\n foreach ($this->columns as $col) {\n $this->_row[$col] = array('normal'=>'', 'info'=>'', 'warning'=>'', 'error'=>'');\n }\n return;\n }\n $ci = 0;\n $ri = 1;\n echo '<tr class=\"r'.$ri.'\">';\n foreach ($this->_row as $key=>$field) {\n foreach ($field as $type=>$content) {\n if ($field[$type] !== '') {\n $field[$type] = '<span class=\"uu'.$type.'\">'.$field[$type].'</span>';\n } else {\n unset($field[$type]);\n }\n }\n echo '<td class=\"cell c'.$ci++.'\">';\n if (!empty($field)) {\n echo implode('<br />', $field);\n } else {\n echo ' ';\n }\n echo '</td>';\n }\n echo '</tr>';\n foreach ($this->columns as $col) {\n $this->_row[$col] = array('normal'=>'', 'info'=>'', 'warning'=>'', 'error'=>'');\n }\n }",
"function printWhole($tableName)\n{\n $result = executePlainSQL(\"SELECT * FROM {$tableName}\");\n OCICommit($db_conn);\n\n echo \"<br>Table [{$tableName}]:<br>\";\n\n // table head\n $ncols = oci_num_fields($result);\n echo \"<table><tr>\";\n for ($i = 1; $i <= $ncols; $i++) {\n $column_name = oci_field_name($result, $i);\n echo \"<th>{$column_name}</th>\";\n }\n echo \"</tr>\";\n\n // table data\n while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr>\";\n for ($i = 0; $i < $ncols; $i++) {\n echo \"<td>{$row[$i]}</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n}",
"function affichagetableau6_12($tab)\n{\n foreach ($tab as $elt) {\n echo \"[\" . $elt . \"]\" . \"\\t\";\n }\n echo \"\\nLes valeurs du tableau ont été incrémentées de 1.\";\n}",
"function FancyTable($header, $data)\n{\n $this->SetFillColor(255,0,0);\n $this->SetTextColor(255);\n $this->SetDrawColor(128,0,0);\n $this->SetLineWidth(.3);\n $this->SetFont('','B');\n // Header\n $w = array(40, 35, 40, 45);\n for($i=0;$i<count($header);$i++)\n $this->Cell($w[$i],7,$header[$i],1,0,'C',true);\n $this->Ln();\n // Color and font restoration\n $this->SetFillColor(224,235,255);\n $this->SetTextColor(0);\n $this->SetFont('');\n // Data\n $fill = false;\n foreach($data as $row)\n {\n $this->Cell($w[0],6,$row[0],'LR',0,'L',$fill);\n $this->Cell($w[1],6,$row[1],'LR',0,'L',$fill);\n $this->Cell($w[2],6,number_format($row[2]),'LR',0,'R',$fill);\n $this->Cell($w[3],6,number_format($row[3]),'LR',0,'R',$fill);\n $this->Ln();\n $fill = !$fill;\n }\n // Closing line\n $this->Cell(array_sum($w),0,'','T');\n}",
"public function getColumns();",
"public function getColumns();",
"public function getColumns();",
"public function getColumns();",
"public function getColumns();",
"public function getColumns();",
"public function getColumns();",
"function showDataTable(){\n\t\t$output = \"\";\n\t\t// print the table\n\t\t$output .= \"<table summary=\\\"\".$this->summary.\"\\\">\\n\";\n\t\t// print the caption\n\t\t$output .= \"<caption>\".$this->caption.\"</caption>\\n\";\n\t\t$output .= $this->showHeader();\n\t\t// initialise variables\n\t\t$altCounter = 0;\n\t\t$altClass = \"\";\n\t\t$h = 1;\n\t\t// loop each row\n\t\tfor ($x=0; $x<count($this->rows); $x++) {\n\t\t\t// if it is time to show the header\n\t\t\tif ($h==$this->headerRepeat){\n\t\t\t\t// show the header\n\t\t\t\t$output .= $this->showHeader();\n\t\t\t\t$h = 1;\n\t\t\t}\n\t\t\t$row = $this->rows[$x];\n\t\t\t// alternate the row classes\n\t\t\tif ($this->altClasses){\n\t\t\t\tif ($this->altClasses[$altCounter]!=\"\"){ $altClass = \" class=\\\"\".$this->altClasses[$altCounter].\"\\\"\"; } else { $altClass=\"\"; }\n\t\t\t\tif ($altCounter==count($this->altClasses)-1){ $altCounter=0; } else { $altCounter++; }\n\t\t\t}\n\t\t\t// set the parameters to nothing\n\t\t\t$params = \"\";\n\t\t\t// if there are parameters for this row set\n\t\t\tif (count($this->rowParams[$x])>0){\n\t\t\t\t// loop the parameters\n\t\t\t\twhile (list($attribute, $parameter) = each($this->rowParams[$x])) {\n\t\t\t\t\t// if the parameter is 'class'\n\t\t\t\t\tif (strtolower($attribute)==\"class\"){\n\t\t\t\t\t\t// replace the altClass variable\n\t\t\t\t\t\t$altClass = \" \".strtolower($attribute).\"=\\\"$parameter\\\"\";\n\t\t\t\t\t} else{\n\t\t\t\t\t\t// otherwise build the parameters\n\t\t\t\t\t\t$params .= \" \".strtolower($attribute).\"=\\\"$parameter\\\"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// print the row\n\t\t\t$output .= \"\t<tr$altClass$params>\\n\";\n\t\t\t\t// set the colSpan to 0\n\t\t\t\t$colSpan = 0;\n\t\t\t\t$colSpanAttribute = \"\";\n\t\t\t\t// if this row has less columns than the number of fields\n\t\t\t\tif (count($row)<count($this->fields)){\n\t\t\t\t\t$colSpan = (count($this->fields)-count($row))+1;\n\t\t\t\t}\n\t\t\t\t// loop each cell\n\t\t\t\tfor ($i=0; $i<count($row); $i++) {\n\t\t\t\t\t$value = $row[$i];\n\t\t\t\t\t$value = $this->formatField($i, $x);\n\t\t\t\t\t// make the colspan attribute\n\t\t\t\t\tif ($colSpan>0 && $i==(count($row)-1)){ $colSpanAttribute = \" colspan=\\\"$colSpan\\\"\"; }\n\t\t\t\t\t// print the cell\n\t\t\t\t\t$output .= \"\t\t<td$colSpanAttribute>\".$value.\"</td>\\n\";\n\t\t\t\t}\n\t\t\t// end the row\n\t\t\t$output .= \"\t</tr>\\n\";\n\t\t\t// increment the header repeat variable\n\t\t\t$h++;\n\t\t}\n\t\t// end the table\n\t\t$output .= \"</table>\\n\\n\";\n\t\tprint $output;\n\t}",
"public function cli() : string\n {\n $table = \"\";\n $largestNumber = $this->rows * $this->columns;\n $largestNumberLength = strlen(\"\" . $largestNumber);\n $spacingPrefab = \"\";\n\n for ($s = 0; $s < $largestNumberLength + 1; $s++) {\n $spacingPrefab .= \" \";\n }\n\n for ($row = 1; $row <= $this->rows + 1; $row++) {\n for ($column = 1; $column <= $this->columns + 1; $column++) {\n $currentChars = \"\";\n $currentCharsColorized = \"\";\n\n if ($row == 1 && $column == 1) {\n $currentChars = \"X\";\n $currentCharsColorized = \"\\033[1;37;44m\" . \"X\" . \"\\033[0m\";\n } elseif ($row == 1) {\n $currentChars = \"\" . ($column - 1) . \"\";\n $currentCharsColorized = \"\\033[1;37;44m\" . ($column - 1) . \"\\033[0m\";\n } elseif ($column == 1) {\n $currentChars = \"\" . ($row - 1) . \"\";\n $currentCharsColorized = \"\\033[1;37;44m\" . ($row - 1) . \"\\033[0m\";\n } else {\n $currentChars = \"\" . ($row - 1) * ($column - 1) . \"\";\n $currentCharsColorized = \"\" . ($row - 1) * ($column - 1) . \"\";\n }\n\n $spacing = substr($spacingPrefab, 0, strlen($spacingPrefab) - strlen($currentChars));\n\n $table .= $currentCharsColorized . $spacing;\n }\n\n $table .= \"\\r\\n\";\n }\n\n return $table;\n }",
"protected function _readTable() {}",
"protected function _readTable() {}",
"function drawTableLine($data_len=0) {\n\techo \" \" . str_repeat(\"-\", $data_len + 10) . \"\\r\\n\";\n}",
"public function summaryColumns();",
"public function visualizzazione(){\n $nameColumn = $this->getColumnName();\n $tuple = $this->read();\n foreach($nameColumn as $nome){\n $x = ' <td> '. $nome . ' </td> ';\n echo $x;\n }\n \n foreach($tuple as $ris){\n $str ='<tr> <td> '.$ris->getId(). ' </td> '.\n '<td> '.$ris->getNome(). '</td>'.\n '<td> '.$ris->getUsername(). '</td>'.\n '<td> '.$ris->getPassword(). '</td>'.\n '<td> '.$ris->getEmail(). '</td>'.\n '<td> '.$ris->getMuseo(). '</td>'.\n '</tr>';\n echo $str;\n };\n }",
"public function renderColumns () {\n $cols = '';\n\n foreach (self::getColumnsArray() as $key => $num) {\n if ($key == 0) $cols .= \" \";\n\n $cols .= \" $num \";\n }\n\n return $cols;\n }",
"function s_m_put_txt_data_order_columnnames($columnnames, $width, $tablename){\r\n if(count($columnnames) == 0){\r\n echo \"Error, no columnnames in $tablename\";\r\n die();\r\n }\r\n // make columnnames same as rows\r\n $columnnames_new = array();\r\n for($k = 0; $k < count($columnnames); $k++){\r\n $columnnames_new[$k] = $columnnames[$k] . str_repeat(\" \", $width[$k] - strlen($columnnames[$k]));\r\n }\r\n return $columnnames_new;\r\n}",
"function getTable($array, $firstLineHeader = true, $lastLineFooter = true, $withTableStructure = true)\n{\n\t$ret = '';\n\n\t$rows = count($array);\n\t$cols = isset($array[0]) ? count($array[0]) : 0;\n\t$i = 0;\n\n\tif($firstLineHeader)\n\t{\n\t\t$ret .= '<tr class=\"tableHeaderRow\">';\n\t\tfor($j = 0; $j < $cols; $j++)\n\t\t{\n\t\t\tif($j == ($cols - 1))\n\t\t\t\t$ret .= '<td class=\"tableHeaderCellR\">';\n\t\t\telse if($j == 0)\n\t\t\t\t$ret .= '<td class=\"tableHeaderCellL\">';\n\t\t\telse\n\t\t\t\t$ret .= '<td class=\"tableHeaderCell\">';\n\n\t\t\t$ret .= $array[$i][$j] . '</td>' . \"\\n\";\n\t\t}\n\t\t$ret .= '</tr>' . \"\\n\";\n\n\t\t$i++;\n\t}\n\n\tfor(; $i < $rows; $i++)\n\t{\n\t\t$ret .= '<tr class=\"tableRow\">';\n\t\tfor($j = 0; $j < $cols; $j++)\n\t\t{\n\t\t\tif($j == ($cols - 1))\n\t\t\t{\n\t\t\t\tif($i == ($rows - 1) && $lastLineFooter)\n\t\t\t\t\t$ret .= '<td class=\"tableCellBR\">';\n\t\t\t\telse if($i == 0)\n\t\t\t\t\t$ret .= '<td class=\"tableCellTR\">';\n\t\t\t\telse\n\t\t\t\t\t$ret .= '<td class=\"tableCellR\">';\n\t\t\t}\n\t\t\telse if($j == 0)\n\t\t\t{\n\t\t\t\tif($i == ($rows - 1) && $lastLineFooter)\n\t\t\t\t\t$ret .= '<td class=\"tableCellBL\">';\n\t\t\t\telse if($i == 0)\n\t\t\t\t\t$ret .= '<td class=\"tableCellTL\">';\n\t\t\t\telse\n\t\t\t\t\t$ret .= '<td class=\"tableCellL\">';\n\t\t\t}\n\t\t\telse if($i == ($rows - 1) && $lastLineFooter)\n\t\t\t\t$ret .= '<td class=\"tableCellB\">';\n\t\t\telse if($i == 0)\n\t\t\t\t$ret .= '<td class=\"tableCellT\">';\n\t\t\telse\n\t\t\t\t$ret .= '<td class=\"tableCell\">';\n\n\t\t\t$ret .= $array[$i][$j] . '</td>' . \"\\n\";\n\t\t}\n\t\t$ret .= '</tr>' . \"\\n\";\n\t}\n\n\tif($withTableStructure)\n\t\t$ret = '<p/><table class=\"tableMain\">' . $ret . '</table>';\n\n\treturn $ret;\n}",
"function viewTable($parks)\n{\n return formatTable($parks);\n}",
"function DOM_force_ths($table) {\r\n\t\t// ??\r\n\t\t$number_cells = $number_number_cells = $number_empty_cells = 0;\r\n\t\t$toppest_number = false;\r\n\t\t$leftest_number = false;\r\n\t\tforeach($this->table_grid as $index => $column) {\r\n\t\t\tforeach($column as $index2 => $value) {\r\n\t\t\t\t$number_cells++;\r\n\t\t\t\t$cell = $value[0];\r\n\t\t\t\tif(ReTidy::isNumberDatum(ReTidy::tagless($cell))) {\r\n\t\t\t\t\t$number_number_cells++;\r\n\t\t\t\t\t// mark the cell as a number\r\n\t\t\t\t\t$this->table_grid[$index][$index2][2] = \"number\";\r\n\t\t\t\t\tif(!$toppest_number && !$leftest_number) {\r\n\t\t\t\t\t\t// this should always find the first number in the table.\r\n\t\t\t\t\t\t$toppest_number = $index2;\r\n\t\t\t\t\t\t$leftest_number = $index;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(ReTidy::isEmptyTagIgnoringWhitespaceAndAttributes($cell)) {\r\n\t\t\t\t\t$number_empty_cells++;\r\n\t\t\t\t\t// mark the cell as empty\r\n\t\t\t\t\t$this->table_grid[$index][$index2][2] = \"empty\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$number_data_cells = $number_number_cells + $number_empty_cells;\r\n\t\tif(bcdiv($number_number_cells, $number_cells, 2) > 0.3) {\r\n\t\t\tif(bcdiv($number_empty_cells, $number_cells, 2) < 0.1 || bcdiv($number_data_cells, $number_cells, 2) > 0.5) {\r\n\t\t\t\t// the primary type of data is numbers\r\n\t\t\t\tforeach($this->table_grid as $index => $column) {\r\n\t\t\t\t\tforeach($column as $index2 => $value) {\r\n\t\t\t\t\t\tif($toppest_number <= $index2 && $leftest_number <= $index) {\r\n\t\t\t\t\t\t\t// we are into the data region of the table\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$cell = $value[0];\r\n\t\t\t\t\t\tif($this->table_grid[$index][$index2][2] != \"number\" && \r\n\t\t\t\t\t\t$this->table_grid[$index][$index2][2] != \"empty\" && \r\n\t\t\t\t\t\t$cell->nodeName != \"th\" /*&& \r\n\t\t\t\t\t\t!Retidy::isEmpty($cell)*/) {\r\n\t\t\t\t\t\t\t$cell->setAttribute('newtag', 'th');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$done_a_column = false;\r\n\t\t$done_a_row = false;\r\n\t\tforeach($this->table_grid as $index => $column) {\r\n\t\t\t$found_non_strong_in_column = false;\r\n\t\t\tforeach($column as $index2 => $value) {\r\n\t\t\t\t$cell = $value[0];\r\n\t\t\t\tif($index === 1) {\r\n\t\t\t\t\tif($index2 === 1) {\r\n\t\t\t\t\t\t// the top left cell will not be a data cell\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(ReTidy::getAttribute($cell, 'rowspan')) {\r\n\t\t\t\t\t\t// this is pretty aggressive\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(!$found_non_strong_in_column) {\r\n\t\t\t\t\t$query = './/' . ReTidy::get_html_namespace() . 'strong[1]';\r\n\t\t\t\t\t$first_strong_in_cell = $this->xpath->query($query, $cell);\r\n\t\t\t\t\t$strong = false;\r\n\t\t\t\t\tforeach($first_strong_in_cell as $strong) { }\r\n\t\t\t\t\tif(!$strong) {\r\n\t\t\t\t\t\tif(ReTidy::isEmptyTagIgnoringWhitespaceAndAttributes($cell) || ReTidy::getAttribute($cell, \"newtag\")->nodeValue === \"th\" || $cell->nodeName === \"th\") {\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$found_non_strong_in_column = true;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif(ReTidy::haveSameTextContent($cell, $strong)) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$found_non_strong_in_column = true;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!$found_non_strong_in_column) {\r\n\t\t\t\t$done_a_column = true;\r\n\t\t\t\tforeach($column as $index2 => $value) {\r\n\t\t\t\t\tif($toppest_number && $leftest_number && $toppest_number <= $index2 && $leftest_number <= $index) {\r\n\t\t\t\t\t\t// we are into the data region of the table\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$cell = $value[0];\r\n\t\t\t\t\tif(!ReTidy::isEmpty($cell)) {\r\n\t\t\t\t\t\t$cell->setAttribute('newtag', 'th');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} elseif(!$done_a_column) {\r\n\t\t\t\t// keep looking\r\n\t\t\t} else {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tforeach(ReTidy::array_mirror($this->table_grid) as $index => $row) {\r\n\t\t\t$found_non_strong_in_row = false;\r\n\t\t\tforeach($row as $index2 => $value) {\r\n\t\t\t\t$cell = $value[0];\r\n\t\t\t\tif($index === 1) {\r\n\t\t\t\t\tif($index2 === 1) {\r\n\t\t\t\t\t\t// the top left cell will not be a data cell\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(ReTidy::getAttribute($cell, 'colspan')) {\r\n\t\t\t\t\t\t// this is pretty aggressive\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(!$found_non_strong_in_row) {\r\n\t\t\t\t\t$query = './/' . ReTidy::get_html_namespace() . 'strong[1]';\r\n\t\t\t\t\t$first_strong_in_cell = $this->xpath->query($query, $cell);\r\n\t\t\t\t\t$strong = false;\r\n\t\t\t\t\tforeach($first_strong_in_cell as $strong) { }\r\n\t\t\t\t\tif(!$strong) {\r\n\t\t\t\t\t\tif(ReTidy::isEmptyTagIgnoringWhitespaceAndAttributes($cell) || ReTidy::getAttribute($cell, \"newtag\")->nodeValue === \"th\" || $cell->nodeName === \"th\") {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$found_non_strong_in_row = true;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif(ReTidy::haveSameTextContent($cell, $strong)) {\r\n\t\t\t\t\t\t\t//print(\"same<br>\\r\\n\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t//print(\"not<br>\\r\\n\");\r\n\t\t\t\t\t\t\t$found_non_strong_in_row = true;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!$found_non_strong_in_row) {\r\n\t\t\t\t$done_a_row = true;\r\n\t\t\t\tforeach($row as $index2 => $value) {\r\n\t\t\t\t\tif($toppest_number && $leftest_number && $toppest_number <= $index2 && $leftest_number <= $index) {\r\n\t\t\t\t\t\t// we are into the data region of the table\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$cell = $value[0];\r\n\t\t\t\t\tif(!ReTidy::isEmpty($cell)) {\r\n\t\t\t\t\t\t$cell->setAttribute('newtag', 'th');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} elseif(!$done_a_row) {\r\n\t\t\t\t// keep looking\r\n\t\t\t} else {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function display() {\r\n echo '<table cols=\"3\" style=\"font-size:large; font-weight:bold\">';\r\n echo '<tr>'; \r\n for ($pos = 0; $pos < 9; $pos++) { \r\n echo $this->show_cell($pos); \r\n if ($pos % 3 == 2) {\r\n echo '</tr><tr>';\r\n } \r\n }\r\n echo '</tr>';\r\n echo '</table>';\r\n }",
"function columns($table)\n{\n\treturn $this->drv->columns($table);\n}",
"function DisplayTableHeader()\n{\n\t$pdf = $GLOBALS['pdf'];\n\t$width_col_no = $GLOBALS['width_col_no'];\n\t$sync_name_index = $GLOBALS['sync_name_index'];\n\t$collectionWidth = $GLOBALS['collectionWidth'];\n\t$totalWidth = $GLOBALS['totalWidth'];\n\n\t//setkan font jadi bold untuk header\n\t$pdf->SetFont('helvetica','B',9);\n\n\t//koleksi tinggi column header\n\t$header_cols_height = array();\n\n\t//tinggi untuk column 'No'\n\t$header_cols_height[] = $pdf->getNumLines('No',$width_col_no);\n\n\t//dapatkan tinggi untuk setiap column\n\tforeach ($sync_name_index as $key => $value)\n\t{\n\t\t$width_converted = GetAndConvertColumnWidth($value, $sync_name_index, $collectionWidth, $totalWidth, $pdf);\n\t\t$header_cols_height[] = $pdf->getNumLines($value,$width_converted);\n\t}\n\n\t//cari siapa paling tinggi\n\t$max_height = max($header_cols_height);\n\n\t//display\n\t$pdf->SetFillColor(211,211,211);\n\n\t$pdf->MultiCell($w=$width_col_no, $h=5*$max_height+3, $txt='No', $border=1, $align='L', $fill=1, $ln=0, $x='', $y='', $reseth=true, $stretch=0, $ishtml=true, $autopadding=true, $maxh=$h, $v='M');\n\tforeach ($sync_name_index as $key => $value)\n\t{\n\t\t$width_converted = GetAndConvertColumnWidth($value, $sync_name_index, $collectionWidth, $totalWidth, $pdf);\n\t\t$pdf->MultiCell($w=$width_converted, $h=5*$max_height+3, $txt=$value, $border=1, $align='C', $fill=1, $ln=0, $x='', $y='', $reseth=true, $stretch=0, $ishtml=true, $autopadding=true, $maxh=$h, $v='M');\n\t}\n\n\t//reset font\n\t$pdf->SetFont('helvetica','',9);\n\t$pdf->Ln();\n}",
"function show_lines2($list_lines,$list_numlines,$list_indent,$only_code,$max_lines,$indent_mccount = Array()) {\n\necho \"<table>\\n\";\necho \"<thead><tr><th>Line</th><th>MC count</th><th>Code</th></tr></thead>\\n\";\necho \"<tbody>\\n\";\nfor ($i=0;$i<min(count($list_lines),$max_lines);$i++)\n{\n\techo \"<tr><td>\\n\";\n\n\t$line = htmlentities($list_lines[$i]);\n\t$numline = $list_numlines[$i];\n\t$indent = $list_indent[$i];\n\t\n\t$num_spaces = $indent*8;\n\t$indent_str = str_repeat(':'.str_repeat(' ',8),$indent); // indentazione\n\t\n\tif (count('indent_mccount') > 0)\n\t{\n\t\t$mc_count = $indent_mccount[$i];\n\t\tif ($mc_count > 0)\n\t\t{\n\t\t\t$ks_mccount = sprintf('(->%1d) </td><td> ', $mc_count);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ks_mccount = ' </td><td> ';\n\t\t}\n\t}\n\telse\n\t{\n\t\t$ks_mccount = '';\n\t}\n\t\n\t// function line spacing\n\tif (substr($line,0,8) === 'function')\n\t{\n\t\techo \" </td><td> </td><td> </td></tr>\\n<tr><td>\\n\";\n\t}\n\t\n\tif ($only_code)\n\t{\n\t\techo(sprintf('%s%s%s',$ks_mccount,$indent_str,$line));\n\t}\n\telse\n\t{\n\t\techo(sprintf('%3d </td><td> %s%s%s',$numline,$ks_mccount,$indent_str,$line));\n\t}\n\techo \"</td></tr>\\n\";\n} // end for $i\n\necho \"</tbody></table>\\n\";\n// stampa(' ');\n// stampa('------------------------------------------------------------------------------');\n\n}",
"function Latex_Table_Multi_Col($ncols,$text,$first=1,$spec=\"c\")\n {\n if ($ncols>1)\n {\n if ($first==0) { $spec=\"|\".$spec; }\n $spec.=\"|\";\n \n $text=\n \"\\\\multicolumn{\".\n $ncols.\n \"}{\".$spec.\"}{\".\n $text.\n \"}\";\n }\n \n return $text;\n }",
"function show_data(){\n\t\t$tmp = str_replace(\"\\n*\",\"\\n\",trim($this->col_data));\n\t\t$tmp = preg_replace(\"/^\\*/\",\"\",$tmp);\n\t\t$value = explode(\"\\n\",$tmp);\n\t\tif(count($value) > 1) $this->col_data = \"*\".implode(\"\\n*\",$value);\n\t\t#echo $this->col_data.\"\\n\";\n\t\treturn $this->col_data;\n\t}",
"function show_data(){\n\t\t$tmp = str_replace(\"\\n*\",\"\\n\",trim($this->col_data));\n\t\t$tmp = preg_replace(\"/^\\*/\",\"\",$tmp);\n\t\t$value = explode(\"\\n\",$tmp);\n\t\tif(count($value) > 1) $this->col_data = \"*\".implode(\"\\n*\",$value);\n\t\t#echo $this->col_data.\"\\n\";\n\t\treturn $this->col_data;\n\t}",
"function make_table($table) {\n return print_table($table, true);\n}",
"protected function getColumns()\n {\n $column = 'A';\n $columns = array();\n if ($this->settings['compare_type'] == self::COMPARE_TYPE_BY_BOX) {\n $columns[$column] = array('title' => 'Box number', 'field' => 'boxNumber_1');\n } elseif ($this->settings['compare_type'] == self::COMPARE_TYPE_BY_TIMECODE) {\n $columns[$column] = array('title' => 'Timecode', 'field' => 'startTime_1');\n $columns[++$column] = array('title' => 'Box number (' . $this->settings['column_1'] . ')', 'field' => 'boxNumber_1');\n $columns[++$column] = array('title' => 'Box number (' . $this->settings['column_2'] . ')', 'field' => 'boxNumber_2');\n }\n \n $columns[++$column] = array('title' => 'Differences area', 'field' => 'diffAreaLabel');\n $columns[++$column] = array('title' => $this->settings['column_1'], 'field' => 'column_1');\n $columns[++$column] = array('title' => $this->settings['column_2'], 'field' => 'column_2');\n \n return $columns;\n }",
"function formatRow(){\n $this->hook('formatRow');\n }",
"function dt($arr, $additional = TRUE, $return = FALSE, $colorColumns = array(), $conditions = array(), $bgColor = \"\", $id = \"\")\n {\n $output = \"\";\n $screenClass = \"\";\n\n if ($bgColor !== \"\") {\n if (strpos($bgColor, \"#\") !== 0) {\n $bgColor = \"#\" . $bgColor;\n }\n $bgColor = \"background-color:{$bgColor};\";\n $screenClass = \"class=\\\"screen\\\"\";\n } else {\n $bgColor = \"background-color:whitesmoke;\";\n }\n\n $output .= \"\\n<div style=\\\"border:1px solid #ccc;padding:6px;\" .\n \"margin:10px;font:14px Arial !important;\" .\n \"display:block;border-radius:4px;overflow:auto;{$bgColor}\\\">\\n\";\n\n if (!is_array($arr))\n return 0;\n\n if (count($arr) <= 0)\n return 0;\n\n\n if ($id == \"\") {\n $id = \"t\" . rand(100000, 999999);\n }\n $output .= \"<table id=\\\"$id\\\" style=\\\"margin: 16px 0px;border-collapse: collapse;border:solid 1px #CCC;font:12px Arial !important;\\\" {$screenClass}>\";\n $counter = 0;\n\n if ($additional) {\n\n $array = (array)current($arr);\n $names = array(\"#\");\n foreach ($array as $k => $v) {\n $names[] = $k;\n }\n\n foreach ($names as $a) {\n $output .= \"<td style=\\\"border-collapse: collapse;border:solid 1px #CCC;padding:2px;color:#999\\\"><b>{$a}</b></td>\";\n }\n }\n\n $row = 0;\n foreach ($arr as $a) {\n $row++;\n $array = (array)$a;\n $counter++;\n $output .= '<tr>';\n\n if ($additional)\n $output .= \"<td style=\\\"border-collapse: collapse;border:solid 1px #CCC;padding:2px;color:#999\\\">{$counter}</td>\";\n $col = 0;\n foreach ($array as $item) {\n $col++;\n if (is_object($item)) {\n $item = \"[OBJECT]\";\n }\n\n $add_style = \"\";\n if (count($colorColumns) > 0) {\n $ok = true;\n if (isset($conditions[$col])) {\n $condition = str_replace(\"{value}\", (string)$item, $conditions[$col]);\n $ok = eval($condition);\n }\n if (in_array($col, $colorColumns) && $ok) {\n $cols = str_to_color((string)$item);\n $add_style = \"color:{$cols[\"f\"]};background-color:{$cols[\"b\"]};\";\n }\n }\n if (is_array($item)) {\n $item = \"<pre>\" . json_encode($item, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . \"</pre>\";\n }\n $output .= \"<td style=\\\"border-collapse: collapse;border:solid 1px #CCC;padding:2px;{$add_style}\\\">{$item}</td>\";\n }\n $output .= '</tr>';\n }\n\n $output .= '</table>';\n $output .= \"</div>\";\n\n if (!$return)\n echo($output);\n\n return $output;\n }",
"function draw_table($rows) {\n \n echo \"<table border=1 cellspacing=1>\"; //Set up border and spacing\n echo \"<tr>\"; //Begin the table row insertion for header row\n \n foreach($rows[0] as $key => $item) {\n \n echo \"<th>$key</th>\";\n \n }\n \n echo \"</tr>\";\n \n // Insert data into each row\n foreach ($rows as $row) {\n \n echo \"<tr>\";\n \n foreach ($row as $key => $item) {\n \n echo \"<td>$item</td>\"; //Table data\n \n }\n \n echo \"</tr>\";\n \n }\n \n echo \"</table>\";\n \n }",
"function tabla($lista, $totalColumnas) {\n $totalFilas = count($lista) / $totalColumnas;\n echo \"<table border='1'>\";\n for ($fila = 0; $fila < $totalFilas; $fila++) {\n echo \"<tr>\";\n for ($i=0;$i<$totalColumnas;$i++) {\n $posicion = $totalColumnas * $fila + $i;\n if ($posicion < count($lista)) {\n $contenido = $lista[$posicion];\n } else {\n $contenido = \"\";\n }\n echo \"<td>\".$contenido.\"</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n}",
"function RowHeadFoot($data) {\n $nb = 0;\n for ($i = 0; $i < count($data); $i++)\n $nb = max($nb, $this->NbLines($this->widths[$i], $data[$i]));\n $h = 5 * $nb;\n //Issue a page break first if needed\n $this->CheckPageBreak($h);\n //Draw the cells of the row\n for ($i = 0; $i < count($data); $i++) {\n $w = $this->widths[$i];\n $a = isset($this->aligns[$i]) ? $this->aligns[$i] : 'L';\n //Save the current position\n $x = $this->GetX();\n $y = $this->GetY();\n //Draw the border\n $this->Rect($x, $y, $w, $h);\n //Print the text\n $this->SetFont('Arial', 'B', 7);\n $this->SetFillColor(203, 203, 203);\n $this->MultiCell($w, 5, $data[$i], 1, $a, true);\n //Put the position to the right of the cell\n $this->SetXY($x + $w, $y);\n }\n //Go to the next line\n $this->Ln($h);\n }",
"function toPlainTable($data)\n{\n\t$keys = $data[0];\n\t$keys = array_flip($keys);\n\t$result = '';\n\tforeach($keys as $key)\n\t{\n\t\t$result .= $key . ' ';\n\t}\n\t$result .= \"\\n\";\n\tforeach($data as $item)\n\t{\n\t\tforeach($item as $value)\n\t\t{\n\t\t\t$result .= $value . ' ';\n\t\t}\n\t\t$result .= \"\\n\";\n\t}\n\treturn $result;\n}",
"function prikazi_sqltabelu($sql_tabela) {\n\n\tglobal $db;\n\n\techo \"<table class='dt-table'>\";\n\techo \"<h2>\" . $sql_tabela . \"</h2>\";\n\n\t// generisanje headera tabele (prikaz podataka)\n\n\t$komanda_head = \"SELECT * FROM $sql_tabela LIMIT 1\";\n\t$result_head = mysql_query($komanda_head, $db);\t\n\n\twhile ( $red = mysql_fetch_assoc($result_head) ) :\n\n\t\t$m = 0;\n\n\t\techo \"<tr class='dt-table'>\";\n\n\t\tforeach ($red as $item) {\n\t\n\t\t\t$kolona = mysql_field_name($result_head, $m);\n \t\t\techo \"<td class='dt-table'>\" . $kolona . \"</td>\";\n \t\t\t//echo \"<td>\" . $item . \"</td>\";\n \t\t$m++;\n\n\t\t}\n\n\t\techo \"</tr>\";\n\n\tendwhile;\n\n\t// generisanje tela tabele (prikaz podataka)\n\n\t$komanda_body = \"SELECT * FROM $sql_tabela\";\n\t$result_body = mysql_query($komanda_body, $db);\n\n\n\twhile ( $red = mysql_fetch_assoc($result_body) ) :\n\n\t\t$n = 0;\n\n\t\techo \"<tr class='dt-table'>\";\n\n\t\tforeach ($red as $item) {\n\t\n\t\t\t$kolona = mysql_field_name($result_body, $n);\n \t\t\techo \"<td class='dt-table'>\" . $item . \"</td>\";\n \t\t$n++;\n\n\t\t}\n\n\t\techo \"</tr>\";\n\n\tendwhile;\n\n\techo \"</table>\";\n\n}",
"function it_should_make_the_example_table()\n {\n \t$table = '| Tables | Are | Cool |' . PHP_EOL . \n\t\t\t\t '|----------|:-------------:|------:|' . PHP_EOL .\n\t\t\t\t '| col 1 is | left-aligned | $1600 |' . PHP_EOL .\n\t\t\t\t '| col 2 is | centered | $12 |' . PHP_EOL .\n\t\t\t\t '| col 3 is | right-aligned | $1 |' . PHP_EOL;\n\n \t$this->headers(['Tables','Are','Cool']) //headers\n\t\t\t->align(['L','C','R']) // set column alignment\n\t\t\t->rows([ // add multiple rows at once\n\t\t\t\t['col 1 is', 'left-aligned', '$1600'],\n\t\t\t\t['col 2 is', 'centered', '$12'],\n\t\t\t])\n\t\t\t->row(['col 3 is', 'right-aligned', '$1'])\n\t\t\t->render()\n\t\t\t->shouldReturn($table);\n }",
"private function Write_Monthly_Table() {\n\t\t$top = 445 + self::VERT_MARGIN;\n\t\t$left = self::HORZ_MARGIN;\n\t\t$label_width = 160;\n\t\t$table_left = $left + $label_width;\n\t\t$cell_width = 55;\n\t\t$row_height = 8.5;\n\t\t\n\t\t/**\n\t\t * Build label backgrounds\n\t\t */\n\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t$this->Rect_TL($left, $top, $label_width + ($cell_width * 1), $row_height);\n\t\t$this->pdf->fill();\n\t\t\n\t\t/**\n\t\t * Add the strokes\n\t\t */\n\t\t$this->Rect_TL($table_left, $top, $cell_width, $row_height);\n\t//\t$this->Rect_TL($table_left + ($cell_width * 1), $top, $cell_width, $row_height);\n\t//\t$this->Rect_TL($table_left + ($cell_width * 2), $top, $cell_width, $row_height);\n\t\t$this->pdf->stroke();\n\t\t\n\t\t/**\n\t\t * Add the labels\n\t\t */\n\t\t$this->Text_TL(\"CURRENT PERIOD\",\n\t\t\t$left, $top, \n\t\t\t$label_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['LEFT']}\");\n\t\t\n\t\t$this->Text_TL(\"PERIOD\",\n\t\t\t$table_left, $top, \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['CENTER']}\");\n\t\t\n\t\t/*$this->Text_TL(\"WEEK\",\n\t\t\t$table_left + ($cell_width * 1), $top, \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['CENTER']}\");\n\t\t\n\t\t$this->Text_TL(\"MONTH\",\n\t\t\t$table_left + ($cell_width * 2), $top, \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['CENTER']}\");*/\n\t\t\t\n\t\t$current_row = 1;\n\t\t$totals = array(\n\t\t\t'weekly' => 0,\n\t\t\t'biweekly' => 0,\n\t\t\t'semimonthly' => 0,\n\t\t\t'monthly' => 0,\n\t\t);\n\t\tforeach ($this->data['period'] as $label => $values) {\n\t\t\t/**\n\t\t\t * Special processing\n\t\t\t */\n\t\t\tswitch ($label) {\n\t\t\t\tcase 'nsf$':\n\t\t\t\t\tcontinue 2;\n\t\t\t\tcase 'debit returns':\n//\t\t\t\t\t$this->pdf->setcolor('fill', 'rgb', 1, 1, 176/255, 0);\n//\t\t\t\t\t$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t\t\t$this->pdf->fill();\n\t\t\t\t\t\n//\t\t\t\t\t$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t\t\t$this->pdf->stroke();\n\t\t\t\t\t/*$percentage = $values['month']? number_format($values['month'] / $this->data['monthly']['total debited']['month'] * 100, 1):0;\n\t\t\t\t\t$this->Text_TL($percentage.'%',\n\t\t\t\t\t\t$table_left + ($cell_width * 3), $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['CENTER']}\");*/\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'net cash collected':\n\t\t\t\t\t$this->pdf->setcolor('fill', 'rgb', 1, 1, 176/255, 0);\n\t\t\t\t\t$this->Rect_TL($table_left, $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t\t\t//$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t\t\t//$this->Rect_TL($table_left + ($cell_width * 2), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t\t\t$this->pdf->fill();\n\t\t\t\t\t\n\t\t\t\t\t//$this->Text_TL(number_format($this->data['period']['total debited']['span'] - $this->data['period']['debit returns']['span'], 2),\n\t\t\t\t\t$this->Text_TL(number_format($this->data['period']['total debited']['span'] - $this->data['period']['nsf$']['span'], 2),\n\t\t\t\t\t\t$table_left, $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\t\t\n\t\t\t\t\t/*$this->Text_TL(number_format($this->data['monthly']['total debited']['week'] - $this->data['monthly']['debit returns']['week'], 2),\n\t\t\t\t\t\t$table_left + ($cell_width * 1), $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\t$this->Text_TL(number_format($this->data['monthly']['total debited']['month'] - $this->data['monthly']['debit returns']['month'], 2),\n\t\t\t\t\t\t$table_left + ($cell_width * 2), $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");*/\n\t\t\t\t\tbreak;\n\t\t\t\t//FORBIDDEN ROWS!\n\t\t\t\tcase 'moneygram deposit':\n\t\t\t\t//case 'credit card payments':\n\t\t\t\t\tcontinue 2;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t\t$format_decimals = 0;\n\t\t\tswitch ($label) {\n\t\t\t\tcase 'new customers':\n\t\t\t\tcase 'card reactivations':\n\t\t\t\tcase 'reactivated customers':\n\t\t\t\tcase 'refunded customers':\n\t\t\t\tcase 'resend customers':\n\t\t\t\tcase 'cancelled customers':\n\t\t\t\tcase 'paid out customers (ach)':\n\t\t\t\tcase 'paid out customers (non-ach)':\n\t\t\t\t\t$format_decimals = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$format_decimals = 2;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t\t$this->Rect_TL($left, $top + ($row_height * $current_row), $label_width, $row_height);\n\t\t\t$this->pdf->fill();\n\t\t\t\n\t\t\t$this->Rect_TL($table_left, $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t$this->Rect_TL($table_left + ($cell_width * 2), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t$this->pdf->stroke();\n\t\t\t\n\t\t\t$this->Text_TL(strtoupper($label),\n\t\t\t\t$left + $label_indent, $top + ($row_height * $current_row), \n\t\t\t\t$label_width - $label_indent, $row_height,\n\t\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['RIGHT']}\");\n\t\t\t\n\t\t\tif ($label != 'net cash collected') {\n\t\t\t\t$this->Text_TL(number_format($values['span'], $format_decimals),\n\t\t\t\t\t$table_left, $top + ($row_height * $current_row), \n\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\n\t\t\t\t/*$this->Text_TL(number_format($values['week'], $format_decimals),\n\t\t\t\t\t$table_left + ($cell_width * 1), $top + ($row_height * $current_row), \n\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\n\t\t\t\t$this->Text_TL(number_format($values['month'], $format_decimals),\n\t\t\t\t\t$table_left + ($cell_width * 2), $top + ($row_height * $current_row), \n\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");*/\n\t\t\t}\n\t\t\t\n\t\t\t$current_row++;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Advances in Collection\n\t\t */\n\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t$this->Rect_TL($left, $top + ($row_height * $current_row), $label_width, $row_height);\n\t\t$this->pdf->fill();\n\t\t\n\t\t$this->Rect_TL($table_left, $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t$this->pdf->stroke();\n\t\t\n\t\t$this->Text_TL(\"ADVANCES IN COLLECTION\",\n\t\t\t$left, $top + ($row_height * $current_row), \n\t\t\t$label_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t$this->Text_TL(number_format($this->data['advances_collections'], 2),\n\t\t\t$table_left, $top + ($row_height * $current_row), \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t/**\n\t\t * Advances in Active\n\t\t */\n\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t$this->Rect_TL($table_left + ($cell_width * 4), $top + ($row_height * $current_row), $cell_width * 2, $row_height);\n\t\t$this->pdf->fill();\n\t\t\n\t\t$this->Rect_TL($table_left + ($cell_width * 6), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t$this->pdf->stroke();\n\t\t\n\t\t$this->Text_TL(\"ACTIVE ADVANCES OUT\",\n\t\t\t$table_left + ($cell_width * 4), $top + ($row_height * $current_row), \n\t\t\t$cell_width * 2, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t$this->Text_TL(number_format($this->data['advances_active'], 2),\n\t\t\t$table_left + ($cell_width * 6), $top + ($row_height * $current_row), \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\n\t}",
"function getColumnas($conn, $exitosa) {\n\t\tif ($exitosa){\t\t\t\n\t\t\t$sql = 'SELECT c1_int, c2_int FROM #php_test_table';\n\t\t\t\n\t\t\techo '<table border=1 >';\t\t\n\t\t\tprint \"<tr>\";\n\t\t\tprint \"<td><b> c1_int </b></td>\";\n\t\t\tprint \"<td><b> c2_int </b></td>\";\n\t\t\tprint \"</tr>\";\n\t\t\tforeach ($conn->query($sql) as $row) {\n\t\t\t\tprint \"<tr>\";\n\t\t\t\tprint \"<td>\" . $row['c1_int'] . \"</td>\";\n\t\t\t\tprint \"<td>\" . $row['c2_int'] . \"</td>\";\n\t\t\t\tprint \"</tr>\";\n\t\t\t}\n\t\t\techo '</table>';\n\t\t}\n\t}",
"abstract protected function getColumnsHeader(): array;",
"function ImprovedTable($header, $data)\n\t{\n\t\t//$this ->Ln(20);\n\t\t\n\t\t$contador = 0;\n\t\t$w = array(40, 40, 30, 30);\n\t\t// Cabeceras\n\t\tfor($i=0;$i<count($header);$i++)\n\t\t\t$this->Cell($w[$i],7,$header[$i],1,0,'C');\n\t\t\n\t\t$this->Ln();\n\t\t// Datos\n\t\t$this->SetFont('Arial','',12);\n\t\tforeach($data as $row)\n\t\t{\n\t\t\t$this->Cell($w[0],6,$row[0],'LR');\n\t\t\t$this->Cell($w[1],6,$row[1],'LR');\n\t\t\t$this->Cell($w[2],6,$row[2],'LR',0,'L');\n\t\t\t$this->Cell($w[3],6,$row[3],'LR',0,'R');\n\t\t\t$this->Ln();\n\t\t\t$contador++;\n\t\t\tif($contador == 46){\n\t\t\t\t$this-> AddPage();\n\t\t\t\t$contador = 0;\n\t\t\t}\n\t\t}\n\t\t// Línea de cierre\n\t\t$this->Cell(array_sum($w),0,'','T');\n\t}",
"public function getTableDescription();",
"function rec_layout_tables($input) {\r\n\t$c = $ct = $cnt = 0;\r\n\t//preg_match_all('/<table[^>]*width=\"600\"[^>]*>.*?<\\/table>/is', $this->code, $tables);\r\n\tpreg_match_all('/<table[^>]*>.*?<\\/table>/is', $input, $tables);\r\n\tif(preg_match_all('/<table[^>]*>.*?<\\/table>/is', $tables, $tables_for_rec)) {\r\n\t\tforeach($tables_for_rec[0] as $index => $subtable) {\r\n\t\t\t$subtable = rec_layout_tables ($subtable);\r\n\t\t}\r\n\t}\t\t\r\n\tforeach($tables[0] as $index => $table) {\r\n\t\tif (preg_match('/<table[^>]*summary=\"[^\"]*\"[^>]*>/is', $table) || \r\n\t\tpreg_match('/<p[^>]*>(<strong>|).*?Table(au|) [0-9]{1,3}( |):.+?(<\\/strong>|)<\\/p>\\s*<table[^>]*>/is', $table) ||\r\n\t\tpreg_match('/<p[^>]*>(<strong>|).*?<a name=\"tab.+?(<\\/strong>|)<\\/p>\\s*<table[^>]*>/is', $table) ||\r\n\t\tpreg_match('/<p[^>]*>(<strong>|).*?<a id=\"tab.+?(<\\/strong>|)<\\/p>\\s*<table[^>]*>/is', $table)) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t$initial_table = $table;\r\n\t\t/*\r\n\t\t$biggest_width_for_table = \"0\";\r\n\t\t$width_type1 = \"\";\r\n\t\tpreg_match_all('/<tr[^>]>.*?<\\/tr>/is', $table, $trs);\r\n\t\tforeach($trs[0] as $index => $tr) {\r\n\t\t\tpreg_match_all('/<(td|th)[^>]*( width=\"([^\"]*)\")[^>]*>/is', $tr, $cell_widths1);\r\n\t\t\tpreg_match_all('/<(td|th)[^>]*( style=\"width:([^;]*);\")[^>]*>/is', $tr, $cell_widths2);\r\n\t\t\t$biggest_width1 = \"0\";\r\n\t\t\t$width_type1 = \"\";\r\n\t\t\t$biggest_width2 = \"0\";\r\n\t\t\t$width_type2 = \"\";\t\t\t\t\r\n\t\t\tforeach($cell_widths1[3] as $index => $cell_width) {\r\n\t\t\t\tpreg_match('/([0-9]*)([^0-9]*)/is', $cell_width, $width_match);\r\n\t\t\t\t$width_type1 = $width_match[2];\r\n\t\t\t\tif ($width_match[1] > $biggest_width1) {\r\n\t\t\t\t\t$biggest_width1 = $width_match[1];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tforeach($cell_widths2[3] as $index => $cell_width) {\r\n\t\t\t\tpreg_match('/([0-9]*)([^0-9]*)/is', $cell_width, $width_match);\r\n\t\t\t\t$width_type2 = $width_match[2];\r\n\t\t\t\tif ($width_match[1] > $biggest_width2) {\r\n\t\t\t\t\t$biggest_width2 = $width_match[1];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif ($biggest_width1 != 0) {\r\n\t\t\t\tif ($width_type1 == \"\") {\r\n\t\t\t\t\t$width_type1 = \"px\";\r\n\t\t\t\t}\r\n\t\t\t\t$biggest_width_for_tr = $biggest_width1;\r\n\t\t\t} else {\r\n\t\t\t\tif ($width_type2 == \"\") {\r\n\t\t\t\t\t$width_type2 = \"px\";\r\n\t\t\t\t}\r\n\t\t\t\t$biggest_width_for_tr = $biggest_width2;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$biggest_width_for_tr\t\t\t\r\n\t\t}\r\n\t\t*/\r\n\t\tforeach($this->config['layout_tables'] as $search => $replace) {\r\n\t\t\t$table = preg_replace(\"/\" . $search . \"/is\", $replace, $table, -1, $c);\r\n\t\t\t//$this->logMsgIf(\"layout_tables[\" . htmlentities($search) . \"]\", $c);\r\n\t\t\t//$ct += $c;\r\n\t\t}\r\n\t\t\r\n\t\tpreg_match('/<div style=\"width:100%;\">\\s*<div[^>]* style=\"clear:both;\">\\s*<div([^>]*) style=\"float:left;[^\"]*\">/is', $table, $first_cell_attributes);\r\n\r\n\t\tif (preg_match('/width:([^;]*);/is', $first_cell_attributes[1], $first_cell_width)){\r\n\t\t\t$table = preg_replace(\r\n\t\t\t'/<div([^>]*) style=\"clear:both;\">(\\s*)<div([^>]*) style=\"float:left;([^\"]*)\">/is', \r\n\t\t\t'<div$1 style=\"clear:both;\">$2<div$3 style=\"float:left;$4width:' . $first_cell_width[1] . ';\">', \r\n\t\t\t$table);\r\n\t\t}\r\n\t\t\r\n\t\tif(preg_match('/class=\"[^\"]*(width[0-9]{1,3})[^\"]*\"/is', $first_cell_attributes[1], $first_cell_width)) {\r\n\t\t\t$table = preg_replace(\r\n\t\t\t'/<div([^>]*) style=\"clear:both;\">(\\s*)<div([^>]*) style=\"float:left;([^\"]*)\">/is', \r\n\t\t\t'<div$1 style=\"clear:both;\">$2<div$3 style=\"float:left;$4\" class=\"' . $first_cell_width[1] . '\">', \r\n\t\t\t$table);\r\n\t\t}\r\n\t\t\r\n\t\tpreg_match('/<div style=\"width:100%;\">\\s*<div[^>]* style=\"clear:both;\">\\s*<div[^>]* style=\"float:left;[^\"]*\"[^>]*>.*?<\\/div>\\s*<div([^>]*) style=\"float:left;[^\"]*\">/is', $table, $second_cell_attributes);\t\t\t\t\t\t\r\n\t\t/*\r\n\t\tif (preg_match('/width:([^;]*);/is', $second_cell_attributes[1], $second_cell_width)){\r\n\t\t\t$table = preg_replace(\r\n\t\t\t'/<div([^>]*) style=\"clear:both;\">(\\s*)<div([^>]*) style=\"float:left;([^\"]*)\">(.*?)<\\/div>(\\s*)<div([^>]*) style=\"float:left;([^\"]*)\">/is', \r\n\t\t\t'<div$1 style=\"clear:both;\">$2<div$3 style=\"float:left;$4\">$5<\\/div>$6<div$7 style=\"float:left;$8' . $second_cell_width[1] . ';\">', \r\n\t\t\t$table);\r\n\t\t}\t\t\t\r\n\t\t\r\n\t\tif(preg_match('/class=\"[^\"]*(width[0-9]{1,3})[^\"]*\"/is', $second_cell_attributes[1], $second_cell_width)) {\r\n\t\t\t$table = preg_replace(\r\n\t\t\t'/<div([^>]*) style=\"clear:both;\">(\\s*)<div([^>]*) style=\"float:left;([^\"]*)\"([^>]*)>(.*?)<\\/div>(\\s*)<div([^>]*) style=\"float:left;([^\"]*)\">/is', \r\n\t\t\t'<div$1 style=\"clear:both;\">$2<div$3 style=\"float:left;$4\"$5>$6<\\/div>$7<div$8 style=\"float:left;$9\" class=\"' . $second_cell_width[1] . '\">', \r\n\t\t\t$table);\r\n\t\t}\t\t\t\r\n\t\t*/\r\n\t\t$this->code = str_replace($initial_table, $table, $this->code, $ct);\r\n\t\t$cnt += $ct;\r\n\t}\r\n\t$this->logMsgIf(\"layout_tables\", $cnt);\r\n\treturn $output;\r\n}",
"abstract public function getCols();",
"public static function columns()\n {\n return exec('/usr/bin/env tput cols');\n }",
"function parseData($data, $table, $measure, $isTwoCol, $type)\n\t{\n\t\t// Type 1 is regular data without metric/imperial\n\t\t// Type 2 is irregular key:value data\n\t\t// isTwoCol 0 is 1 column data\n\t\t// isTwoCol 1 is 2 column data, column headers set elsewhere.\n\n\t\tif ($type == 0)\n\t\t{\n\t\t\t$tbl = $data[\"spec\"]->$table->$measure;\n\t\t}\n\t\telse if ($type == 1)\n\t\t{\n\t\t\t$tbl = $data[\"spec\"]->$table->data;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tbl = $data[\"spec\"]->$table;\n\t\t}\n\n\t\tif ($type==2)\n\t\t{\n\t\t\tforeach($tbl as $key => $val)\n\t\t\t{\n\t\t\t\tif( $val != 'NA' )\n\t\t\t\t{\n\t\t\t\t\t$tableData .= '<tr><td class=\"head_cell\">'. $key . '</td><td class=\"data_cell\">'. $val .'</td></tr>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tforeach($tbl as $t){\n\t\t\t\tif( $t->value == 'NA' ) continue;\n\n\t\t\t\tif (!$isTwoCol)\n\t\t\t\t{\n\t\t\t\t\t$tableData .= '<tr><td class=\"head_cell\">'. $t->label . '</td><td class=\"data_cell\">'. $t->value .'</td></tr>';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$tableData .= '<tr><td class=\"head_cell_b\">'. $t->label . '</td><td class=\"data_cell_a\">'. $t->valuea .'</td><td class=\"data_cell_b\">'. $t->valueb .'</td></tr>';\n\t\t\t\t}\n\t\t\t}\n\n\t\treturn $tableData;\n\t}",
"abstract public function getColsFields();",
"public function makeColumns(){\n $hijosDetalle=$this->\n getReportedetalle()->\n where(['and', \"esdetalle='1'\", \"visiblecampo='1'\"])->\n orderBy('orden')->all();\n //echo count( $hijosDetalle);die();\n $columns=[];\n foreach($hijosDetalle as $fila){\n $columns[]=[\n 'attribute'=>$fila->nombre_campo,\n 'label'=>$fila->aliascampo,\n 'format'=>'raw',\n 'options'=>['width'=>\n $this->sizePercentCampo($fila->nombre_campo).'%'],\n ];\n \n \n }\n return $columns;\n \n }",
"function outputFormat(array $headers, array $cells, $result, $content_name) {\necho '<h3>'.ucfirst($content_name).' Content</h3>';\necho '<table>';\nforeach ($headers as $val) {\necho '<th>'.$val.'</th>';\n}\nwhile($row = mysqli_fetch_array($result))\n {\n echo '<tr>';\n foreach ($cells as $val) {\n echo '<td>'.$row[$val].'</td>';\n }\n echo '</tr>';\n }\n echo '</table>';\n}",
"protected function resultLines(Table $table): void\n {\n //\n }",
"protected function resultLines(Table $table): void\n {\n //\n }",
"function printTable ($rows, $cols) {\n echo \"<table border=1>\";\n\n for ($i=0; $i<$rows; $i++) {\n echo \"<tr>\";\n for ($j=0; $j<$cols; $j++) {\n echo \"<td> Content </td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n }",
"abstract public function listColumns();",
"function FrontPageTable(){\r\n //$this->SetFillColor(135,206,250);\r\n $this->SetFillColor(176,196,222);\r\n $this->SetTextColor(0);\r\n $this->SetDrawColor(0,0,0);\r\n $this->SetLineWidth(.3);\r\n $this->SetFont('','B');\r\n // Header\r\n\r\n $this->SetX(35);\r\n $this->Cell(70,7,'Prepared By:',1,0,'C',true);\r\n $this->Cell(40,7,'Organization',1,0,'C',true);\r\n $this->Cell(40,7,'Date',1,0,'C',true);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetTextColor(0,0,0);\r\n $this->SetFont('');\r\n $this->Cell(70,7,$this->PreparedBy,1,0,'C',false);\r\n $this->Cell(40,7,'NRAO',1,0,'C',false);\r\n $this->Cell(40,7,$this->MakeDate,1,0,'C',false);\r\n $this->Ln();\r\n\r\n\r\n $this->SetX(35);\r\n $this->SetTextColor(0);\r\n $this->SetFont('','B');\r\n $this->Cell(70,7,'FEIC WP Manager Approval:',1,0,'C',true);\r\n $this->Cell(40,7,'Organization',1,0,'C',true);\r\n $this->Cell(40,7,'Date',1,0,'C',true);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetFont('');\r\n $this->Cell(70,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetTextColor(0);\r\n $this->SetFont('','B');\r\n $this->Cell(70,7,'FE System Engineering Approval:',1,0,'C',true);\r\n $this->Cell(40,7,'Organization',1,0,'C',true);\r\n $this->Cell(40,7,'Date',1,0,'C',true);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetFont('');\r\n $this->Cell(70,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetTextColor(0);\r\n $this->SetFont('','B');\r\n $this->Cell(70,7,'FE IPT Lead Approval:',1,0,'C',true);\r\n $this->Cell(40,7,'Organization',1,0,'C',true);\r\n $this->Cell(40,7,'Date',1,0,'C',true);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetFont('');\r\n $this->Cell(70,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Ln();\r\n\r\n // Color and font restoration\r\n $this->SetFillColor(224,235,255);\r\n $this->SetTextColor(255);\r\n $this->SetFont('');\r\n // Data\r\n $fill = false;\r\n }",
"public function verticalTable($in){\n $out = '';\n foreach($in as $k => $v){\n $out .= '<tr><td style=\"text-align: left;\">'.$k.'</td><td style=\"text-align: left\">'.$v.'</td></tr>';\n }\n return($out);\n }",
"function ciniki_tenants_reportChunkTable($ciniki, $tnid, &$report, $chunk) {\n\n if( isset($chunk['textlist']) && $chunk['textlist'] != '' ) {\n $report['text'] .= $chunk['textlist'];\n }\n\n $html = '<table cellpadding=\"5\">';\n $html .= \"<thead><tr>\";\n $pdfhtml = '<table border=\"0\" cellpadding=\"5\" cellspacing=\"0\" style=\"border: 0.1px solid #aaa;\">';\n $pdfhtml .= \"<thead><tr>\";\n foreach($chunk['columns'] as $col) {\n $html .= \"<th>\" . $col['label'] . \"</th>\";\n $pdfhtml .= '<th bgcolor=\"#dddddd\" style=\"border: 0.1px solid #aaa;' \n . (isset($col['pdfwidth']) ? 'width:' . $col['pdfwidth'] : '') . '\">' . $col['label'] . \"</th>\";\n }\n $html .= \"</tr></thead>\";\n $html .= \"<tbody>\";\n $pdfhtml .= \"</tr></thead>\";\n $pdfhtml .= \"<tbody>\";\n\n foreach($chunk['data'] as $row) {\n $html .= \"<tr>\";\n $pdfhtml .= '<tr nobr=\"true\">';\n foreach($chunk['columns'] as $col) {\n $html .= '<td style=\"border: 1px solid #aaa; padding: 5px;\">';\n $pdfhtml .= '<td style=\"border: 0.1px solid #aaa;' . (isset($col['pdfwidth']) ? 'width:' . $col['pdfwidth'] : '') . '\">' ;\n if( isset($row[$col['field']]) ) {\n $html .= preg_replace(\"/\\n/\", \"<br/>\", $row[$col['field']]);\n $pdfhtml .= preg_replace(\"/\\n/\", \"<br/>\", $row[$col['field']]);\n }\n $html .= \"</td>\";\n $pdfhtml .= \"</td>\";\n }\n $html .= \"</tr>\";\n $pdfhtml .= \"</tr>\";\n }\n $html .= \"</tbody>\";\n $html .= \"</table>\";\n $pdfhtml .= \"</tbody>\";\n $pdfhtml .= \"</table>\";\n\n $report['html'] .= $html;\n\n\n $report['pdf']->addHtml(1, $pdfhtml);\n\n return array('stat'=>'ok');\n}",
"function print_column_headers($screen, $with_id = \\true)\n {\n }",
"public function get_columns()\n {\n }",
"public function get_columns()\n {\n }",
"public function get_columns()\n {\n }",
"public function get_columns()\n {\n }",
"function tabla03($array01){\n\t$i = '0';\n\t$array02[$i++] = \"<table border=\\\"0\\\">\";\n\tforeach( $array01 as $value ){\n\t\tforeach( $value as $key => $value){\n\t\t\t$array02[$i++] = \"<tr><td>\".$key.\"</td><td>\".$value.\"</td></tr>\\n\";\n\t\t}\n\t\t// linea en blanco\n\t\t$array02[$i++] = \"<tr><td></td><td></td></tr>\\n\";\n\t}\n\t$array02[$i++] = \"</table>\";\n\treturn $array02;\n\n// foreach( $array02 as $value ){\n//\techo $value;\n//}\n}",
"public function get_columns()\n {\n }",
"public function get_columns()\n {\n }",
"private function writeTable() {\n\t\trequire_once $GLOBALS[\"DIR_PRINT\"] . \"pdftable.php\";\n\t\t\n\t\t// create table with data and sum\n\t\t$table = new PDFTable($this->data);\n\t\t\n\t\t// set columns\n\t\t$table->setColumnWidth(1, 30);\n\t\t$table->setColumnWidth(2, 25);\n\t\t$table->setColumnWidth(3, 25);\n\t\t$table->setColumnWidth(5, 25);\n\t\t$table->setColumnWidth(6, 25);\n\t\t$table->setColumnWidth(7, 30);\n\t\t$table->setColumnWidth(13, 35);\n\t\t$table->setColumnWidth(14, 30);\n\t\t$table->setColumnWidth(15, 15);\n\t\t$table->setColumnWidth(16, 24);\n\t\t\n\t\t$table->changeColumnLabel(1, \"Nachname\");\n\t\t$table->changeColumnLabel(2, \"Vorname\");\n\t\t$table->changeColumnLabel(3, \"Privat\");\n\t\t$table->changeColumnLabel(5, \"Mobil\");\n\t\t$table->changeColumnLabel(6, \"Berufl.\");\n\t\t$table->changeColumnLabel(7, \"E-Mail\");\n\t\t$table->changeColumnLabel(13, \"Straße\");\n\t\t$table->changeColumnLabel(14, \"Ort\");\n\t\t$table->changeColumnLabel(15, \"PLZ\");\n\t\t$table->changeColumnLabel(16, \"Instrument\");\n\t\t\n\t\t$table->setColumnType(3, FieldType::CHAR);\n\t\t$table->setColumnType(5, FieldType::CHAR);\n\t\t$table->setColumnType(6, FieldType::CHAR);\n\t\t$table->setColumnType(15, FieldType::CHAR);\n\t\t\n\t\t$table->setCellBorder(\"T\");\n\t\t$table->setVerticalSpacing(1);\n\t\t\n\t\t// write the document\n\t\t$table->write($this->pdf);\n\t}"
] | [
"0.66024506",
"0.65558875",
"0.6365138",
"0.6280936",
"0.62644404",
"0.61646676",
"0.6162729",
"0.6130739",
"0.61240196",
"0.6088674",
"0.60841036",
"0.60797447",
"0.60592854",
"0.6018941",
"0.60140514",
"0.5992788",
"0.59366125",
"0.59136957",
"0.5899361",
"0.58986026",
"0.5897226",
"0.5886616",
"0.5844929",
"0.5834395",
"0.58178276",
"0.5814217",
"0.5813991",
"0.5798143",
"0.5791741",
"0.57785213",
"0.57704836",
"0.5770366",
"0.5766095",
"0.5759496",
"0.5754393",
"0.57471555",
"0.5746943",
"0.5730056",
"0.5730056",
"0.5730056",
"0.5730056",
"0.5730056",
"0.5730056",
"0.5730056",
"0.56943285",
"0.5689042",
"0.5688452",
"0.5687734",
"0.56816465",
"0.567632",
"0.5671775",
"0.5663079",
"0.5654724",
"0.5650864",
"0.56504744",
"0.5642904",
"0.5638417",
"0.5635722",
"0.56291294",
"0.5628448",
"0.56251734",
"0.5623783",
"0.5623783",
"0.56235963",
"0.56100523",
"0.5607769",
"0.5602985",
"0.5599604",
"0.55974936",
"0.5586939",
"0.55836284",
"0.5583304",
"0.5580988",
"0.5575088",
"0.5562053",
"0.5559324",
"0.5557924",
"0.5555255",
"0.55520093",
"0.55515313",
"0.5548",
"0.55418265",
"0.5536653",
"0.55345523",
"0.55325294",
"0.55265933",
"0.55265933",
"0.55230874",
"0.55193436",
"0.55176055",
"0.5516486",
"0.55125815",
"0.55114406",
"0.55105007",
"0.55105007",
"0.55105007",
"0.55105007",
"0.55104893",
"0.55091596",
"0.55091596",
"0.55088997"
] | 0.0 | -1 |
Create admin main view | public function create_view_admin(string $uri, array $exclude = [])
{
// Create main view components
pkg_component::create('view', $uri, $this->package);
pkg_component::create('view', $uri . '_manage', $this->package);
// Get .tpl / .php code
$code = [
'tpl/' . $uri . '.tpl' => base64_decode($this->code_templates['view_admin_main_tpl']),
'php/' . $uri . '.php' => base64_decode($this->code_templates['view_admin_main_php']),
'tpl/' . $uri . '_manage.tpl' => base64_decode($this->code_templates['view_admin_manage_tpl']),
'php/' . $uri . '_manage.php' => base64_decode($this->code_templates['view_admin_manage_php'])
];
// Set create php code
$php_code = [];
foreach ($this->columns as $alias => $type) {
if (in_array($alias, $exclude)) { continue; }
if (preg_match("/^(date|timestamp)/i", $type)) { continue; }
$php_code[] = " '$alias' => app::_post('$alias')";
}
// Set merge variables
$merge_vars = [
'package' => $this->package,
'alias' => $this->alias,
'alias_tc' => ucwords($this->alias),
'alias_plural' => $this->alias_plural,
'alias_plural_tc' => ucwords($this->alias_plural),
'dbtable' => $this->dbtable,
'uri' => $uri,
'php_code' => implode(", \n", $php_code)
];
// Replace merge fields
foreach ($code as $file => $contents) {
foreach ($merge_vars as $key => $value) {
$code[$file] = str_replace("~$key~", $value, $code[$file]);
}
// Save file
file_put_contents(SITE_PATH . '/views/' . $file, $code[$file]);
}
// Get created files
$this->created_files = array_merge($this->created_files, components::get_all_files('view', $uri, $this->package));
$this->created_files = array_merge($this->created_files, components::get_all_files('view', $uri . '_manage', $this->package));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function admin_page() {\n echo $this->generateView('main', []);\n }",
"public function adminmenu()\n {\n\n $vue = new ViewAdmin(\"Administration\");\n $vue->generer(array());\n }",
"public function admin_create()\n {\n return View::make('admin_create');\n }",
"public function createAdmin() { return view('panel.users.create.admin'); }",
"public function create()\n\t{\n\t\t\n return view('pages.createadmin');\n\t}",
"public function adminPanel() {\n $posts = $this->postManager->getPosts();\n $comments = $this->commentManager->getFlaggedComments();\n $view = new View(\"Administration\");\n $view->generate(array('posts' => $posts, 'comments' => $comments));\n }",
"public function admin(){\n $data = array('page_title' => \"Admin home\");\n $this->view->load_admin('home/admin/admin_view', $data);\n }",
"public function mainpage()\n {\n return view('admin.adminmainpage');\n }",
"public function create()\n {\n //\n return view ('theme.admin.create_admin');\n }",
"public function create()\n\t{\n\t\t$this->load->view('admin/header');\n\t\t$this->load->view('admin/create');\n\t\t\n\t}",
"public function index()\n\t{\n\t\t$this->load->view(\"admin_view\");\n\t}",
"public function create()\n {\n //\n return view(\"admin.$this->view.create\");\n }",
"public function index()\n\t{\n\t\tView::render('admin');\n\t}",
"public function admin()\n {\n return view('admin.main',[\n \"components\" => $this->getAdminThemeComponets(),\n \"modules\" => $this->getAdminThemeComponetsModules(),\n \"user\" => $this->getUserData()\n ]); \n }",
"public function actionAdmin()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->layout = 'admin';\n\n\t\t$this->render('admin');\n\t}",
"public function index() {\n $content = $this->lcopun->copun_add_form();\n $this->template->full_admin_html_view($content);\n }",
"public function create()\n\t{\n\t\treturn view(\"Olaylar::admin.\".$this->theme.\".create\")\n\t\t->with('headName', $this->headName);\n\t}",
"public function create()\n {\n Auth::check();\n return view(\"ControlPanel.admin.create\");\n }",
"public function index()\n\t{\n\t\t$this->template\n\t\t\t->title('')\n\t\t\t->build('admin/index');\n\t}",
"protected function create(){\n $subadmin = new Admin;\n return view('subadmin.create', compact('subadmin'));\n }",
"public function index()\n\t{\n\t\treturn view('admin/admin/admin')\n\t\t\t->with('title', 'Manage');\n\t}",
"public function create()\n {\n return view(\"Adminhome\");\n }",
"public function create()\n {\n //\n return $this->formView( new Admin() );\n }",
"public function index()\n\t{\n\t\t$type \t= 'amdin';\n\t\treturn View::make('admin',array(\n\t\t\t'type'\t=> $type\n\t\t\t));\n\t}",
"public function index()\n {\n return view('addAdmin');\n }",
"public function create()\n {\n return view('thuthuy.pages.admin.create');\n }",
"public function create()\n {\n return view('admin.webadmin.homepage.create');\n }",
"public function show_admin_page() {\n\t\t$this->view->render();\n\t}",
"public function create_admin()\n {\n //get dropdown data\n $functional_units = [];\n $data = [];\n $this->get_data($data, $functional_units);\n\n return view('accounts.create_admin')->with([\n 'functional_units' => $functional_units, \n 'data' => $data\n ]);\n }",
"public function create() {\n\t\treturn view('laravel-simple-blog::admin.create');\n\t}",
"public function adminindex() {\n $current_page = 'Admin';\n $content = \"<div class='alert alert-success'>The content of Admin Section</div>\";\n \n \n $menu = $this->buildmenu();//building a dynamic menu\n return view('pages.admin')->with('current_page', $current_page)\n ->with('page_content', $content)\n ->with('pages', $menu);\n }",
"public function create()\n\t{\n\t\t//$admin_config = get_class_vars($this->Model)['admin_config'] ? : [];\n\t\t$class = $this->Model;\n\t\t$admin_config = $class::getConfig() ? : [];\n\t\t$template = isset($admin_config['template_edit']) ? $admin_config['template_edit'] : 'crud.edit';\n\n\t\treturn View::make($template, [\n\t\t\t'page' => [\n\t\t\t\t'action_path' => $admin_config['router'],\n\t\t\t\t'action_method' => 'post',\n\t\t\t\t'scripts' => [\n\t\t\t\t\t'markdown/markdown.min.js',\n\t\t\t\t\t'markdown/bootstrap-markdown.min.js',\n\t\t\t\t\t'jquery.hotkeys.min.js',\n\t\t\t\t\t'uncompressed/bootstrap-wysiwyg.js',\n\t\t\t\t],\n\t\t\t],\n\t\t\t'data' => Request::all(),\n\t\t\t'config' => $admin_config,\n\t\t]);\n\t}",
"function index()\n {\n $this->_view_edit('view');\n }",
"public function admin() {\r\n $ruta = new Ruta($this->adapter);\r\n\r\n //Conseguimos todos los usuarios\r\n $allrut = $ruta->getAll();\r\n //Cargamos la vista index y le pasamos valores\r\n $this->view(\"Ruta/admin\", array(\"allrut\" => $allrut));\r\n \r\n }",
"public function admin()\n {\n return view('admin');\n }",
"function admin()\r\n\t{\r\n\t\t$this->permiso_model->need_admin_permition_level();\t\r\n\t\t\r\n\t\t$data = array();\r\n\t\t$data['main_content'] = 'admin_index';\r\n\r\n\t\t$this->load->model('tutor_model');\r\n\t\t$data['num_tutor'] = $this->tutor_model->count_all();\r\n\t\t\r\n\t\t$this->load->model('alumno_model');\r\n\t\t$data['num_alumno'] = $this->alumno_model->count_all();\r\n\t\t\r\n\t\t$this->load->model('tarea_model');\r\n\t\t$data['num_tarea'] = $this->tarea_model->count_all();\r\n\r\n\t\t$this->load->model('grupo_model');\r\n\t\t$data['num_grupo'] = $this->grupo_model->count_all();\r\n\r\n\t\t$this->load->view('includes/template',$data);\r\n\t}",
"public function actionAdmin() {\n\t\ttry {\n\t\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.structure.controllers');\n\t\t\t$this->setCurrentNode($this->currentContent->node);\n\t\t\t$content = new FormContent();\n\t\t\t$content->targetContentId = $this->currentContent->contentId;\n\t\t\t$content->selected = false;\n\n\t\t\t$contentCriteriaBuilder = new CriteriaBuilder('content');\n\t\t\t$contentCriteriaBuilder->filterBy('contentId', $this->currentContent->contentId);\n\n\t\t\t$this->render('admin', array(\n\t\t\t\t'breadcrumb' => $this->buildBreadcrumb($this->currentContent->contentId),\n\t\t\t\t'mainMenu' => $this->buildMainMenu(2, 4),\n\t\t\t\t'content'=>$content,\n\t\t\t\t'sourceContent'=>$this->currentContent,\n\t\t\t\t'node' => $this->currentNode,\n\t\t\t\t'contentsDataProvider' => $contentCriteriaBuilder->getActiveDataProvider(array('pagination' => false))\n\t\t\t));\n\t\t} catch(\\Exception $e) {\n\t\t\t\\Yii::log('Error in '.__METHOD__.'():'.$e->getMessage(), \\CLogger::LEVEL_ERROR, 'sweelix.yii1.admin.structure.controllers');\n\t\t\tthrow $e;\n\t\t}\n\t}",
"public function index()\n {\n return view('admin');\n }",
"public function index()\n {\n return view('admin');\n }",
"public function index()\n {\n return view('admin');\n }",
"public function index()\n {\n return view('admin');\n }",
"public function admin_create($type='page', $viewContext=null) {\n\t\t$this->_render['layout'] = 'admin';\n\t\t\n\t\tif(empty($type)) {\n\t\t\t$type = 'page';\n\t\t}\n\t\t$this->_render['template'] = $type . '/admin_create';\n\t\t\n\t\t// For front-end editing via modal with iframe...or any other special purpose that requires separate templates.\n\t\tif(!empty($viewContext) && is_string($viewContext)) {\n\t\t\t$cfg = Libraries::get();\n\t\t\t// layout\n\t\t\tarray_unshift($this->_render['paths']['layout'], $cfg['app']['path'] . '/views/_libraries/blackprint/layouts/' . $viewContext . '/{:layout}.{:type}.php', '{:library}/views/layouts/' . $viewContext . '/{:layout}.{:type}.php');\n\t\t\t\n\t\t\t// template\n\t\t\tarray_unshift($this->_render['paths']['template'], $cfg['app']['path'] . '/views/_libraries/blackprint/{:controller}/' . $viewContext . '/{:template}.{:type}.php', '{:library}/views/{:controller}/' . $viewContext . '/{:template}.{:type}.php');\n\t\t}\n\n\t\t$contentTypes = Content::contentTypes();\n\t\t$contentConfig = Content::contentConfig($type);\n\t\t$document = Content::create();\n\n\t\t// If data was passed, set some more data and save\n\t\tif ($this->request->data) {\n\t\t\t// CSRF\n\t\t\tif(!RequestToken::check($this->request)) {\n\t\t\t\tRequestToken::get(array('regenerate' => true));\n\t\t\t} else {\n\t\t\t\t$now = new MongoDate();\n\t\t\t\t$this->request->data['created'] = $now;\n\t\t\t\t$this->request->data['modified'] = $now;\n\n\t\t\t\t$this->request->data['_ownerId'] = (isset($this->request->user['_id'])) ? $this->request->user['_id']:null;\n\t\t\t\t$this->request->data['_ownerId'] = (isset($this->request->user['id'])) ? $this->request->user['id']:$this->request->data['_ownerId'];\n\n\t\t\t\t// Set the pretty URL that gets used by a lot of front-end actions.\n\t\t\t\t$this->request->data['url'] = $this->_generateUrl(array('model' => 'blackprint\\models\\Content'));\n\n\t\t\t\t// Set the content type (\"page\" by default)\n\t\t\t\t$this->request->data['_type'] = isset($type) ? $type:'page';\n\t\t\t\t\n\t\t\t\t// If there were file(s) passed.\n\t\t\t\tif(isset($this->request->data['files'])) {\n\t\t\t\t\t$failedFiles = array();\n\t\t\t\t\t$storedFiles = array();\n\n\t\t\t\t\tif(!$contentConfig['files']['allow']) {\n\t\t\t\t\t\tunset($this->request->data['files']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$allowedExtensions = explode(',', $contentConfig['files']['extensions']);\n\n\t\t\t\t\t\t// Ensure it's in a multi-dimensional array so we can loop and not need to do if/else.\n\t\t\t\t\t\t// Ideally, the template would use the form helper and specify 'files[]' as the field name,\n\t\t\t\t\t\t// but in case that didn't happen, ensure the loop will work for what was passed.\n\t\t\t\t\t\tif(isset($this->request->data['files']['error'])) {\n\t\t\t\t\t\t\t$this->request->data['files'] = array($this->request->data['files']);\n\t\t\t\t\t\t\t// ...Or use 'Filedata' in place of 'files' if set (Agile Uploader's default - this is just convenience).\n\t\t\t\t\t\t} elseif(isset($this->request->data['Filedata'])) {\n\t\t\t\t\t\t\tif(isset($this->request->data['Filedata']['error'])) {\n\t\t\t\t\t\t\t\t$this->request->data['files'] = array($this->request->data['Filedata']);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$this->request->data['files'] = $this->request->data['Filedata'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// The 'files' field is not saved on the content document. Instead, a '_files' field is used.\n\t\t\t\t\t\t// This avoids inadvertent conflicts and other issues. This '_files' field is also formatted in a different way.\n\t\t\t\t\t\t// It holds a reference to the file in GridFS along with the original file name, upload date, etc.\n\t\t\t\t\t\t$this->request->data['_files'] = !empty($document->_files) ? $document->_files->data():array();\n\n\t\t\t\t\t\t$i = 0;\n\t\t\t\t\t\tforeach($this->request->data['files'] as $k => $v) {\n\t\t\t\t\t\t\t// Only handle as many as set by 'limit' in the config (default is one - zero is unlimited).\n\t\t\t\t\t\t\tif($i < $contentConfig['files']['limit'] || $contentConfig['files']['limit'] == 0) {\n\t\t\t\t\t\t\t\t// Again, ensure what was passed will work...\n\t\t\t\t\t\t\t\tif(isset($v['error'])) {\n\t\t\t\t\t\t\t\t\tif($v['error'] != UPLOAD_ERR_OK) {\n\t\t\t\t\t\t\t\t\t\t$v['errorMessage'] = 'Failed to upload.';\n\t\t\t\t\t\t\t\t\t\t$failedFiles[] = array($k => $v);\n\t\t\t\t\t\t\t\t\t\tunset($this->request->data['files'][$k]);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t// If it came in ok...\n\t\t\t\t\t\t\t\t\t\t$ext = substr(strrchr($v['name'],'.'),1);\n\t\t\t\t\t\t\t\t\t\t$originalFilename = $v['name'];\n\n\t\t\t\t\t\t\t\t\t\t// Check if it's an allowed type (of if \"*\" was passed in the allowed extensions which would allow everything).\n\t\t\t\t\t\t\t\t\t\tif(!in_array($ext, $allowedExtensions) || in_array('*', $allowedExtensions)) {\n\t\t\t\t\t\t\t\t\t\t\t$v['errorMessage'] = 'File type not allowed.';\n\t\t\t\t\t\t\t\t\t\t\t$failedFiles[] = array($k => $v);\n\t\t\t\t\t\t\t\t\t\t\tunset($this->request->data['files'][$k]);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t// Check if it's within the max file size allowed.\n\t\t\t\t\t\t\t\t\t\t\tif($v['size'] > $contentConfig['files']['maxSize']) {\n\t\t\t\t\t\t\t\t\t\t\t\t$v['errorMessage'] = 'File size too large.';\n\t\t\t\t\t\t\t\t\t\t\t\t$failedFiles[] = array($k => $v);\n\t\t\t\t\t\t\t\t\t\t\t\tunset($this->request->data['files'][$k]);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t// Passed all checks? Store it.\n\t\t\t\t\t\t\t\t\t\t\t\t$gridFileId = Asset::store(\n\t\t\t\t\t\t\t\t\t\t\t\t\t$v['tmp_name'],\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'filename' => (string)uniqid(php_uname('n') . '.') . '.'.$ext,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'originalFilename' => $originalFilename,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'fileExt' => $ext,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'created' => $now\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t// If saved...\n\t\t\t\t\t\t\t\t\t\t\t\tif ($gridFileId) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Ensure the GridFS file document association is only saved once to the content document.\n\t\t\t\t\t\t\t\t\t\t\t\t\t// ...And on each association, add some data that may be useful before/without doing a second query to the GridFS collection.\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->request->data['_files'][(string)$gridFileId] = array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// This is the 'filename' seen publicly...There are routes that use the MongoId and extension to load the file.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'name' => (string)$gridFileId . '.' . $ext,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'originalFilename' => $originalFilename,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'fileExt' => $ext,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'created' => $now\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$storedFiles[] = array($k => $v);\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Failed to store to GridFS\n\t\t\t\t\t\t\t\t\t\t\t\t\t$v['errorMessage'] = 'File failed to save, please try again.';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$failedFiles[] = array($k => $v);\n\t\t\t\t\t\t\t\t\t\t\t\t\tunset($this->request->data['files'][$k]);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Don't save data to this field...Especially not binary file data.\n\t\t\t\t\tunset($this->request->data['files']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->request->data['_ownerId'] = (isset($this->request->user['_id'])) ? $this->request->user['_id']:null;\n\t\t\t\t$this->request->data['_ownerId'] = (isset($this->request->user['id'])) ? $this->request->user['id']:$this->request->data['_ownerId'];\n\n\t\t\t\t$publicIdConflict = false;\n\t\t\t\t$requestedPublicId = '';\n\t\t\t\tif(isset($this->request->data['_publicId']) && !empty($this->request->data['_publicId'])) {\n\t\t\t\t\t$requestedPublicId = $this->request->data['_publicId'];\n\t\t\t\t\t$publicIdConflict = Content::find('count', array('fields' => array('_publicId'), 'conditions' => array('_id' => array('$ne' => $document->_id), '_publicId' => $this->request->data['_publicId'])));\n\t\t\t\t\tif($publicIdConflict) {\n\t\t\t\t\t\t$this->request->data['_publicId'] = '!___conflict___!';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$redirect = false;\n\t\t\t\tif(isset($this->request->data['__redirect'])) {\n\t\t\t\t\t$redirect = $this->request->data['__redirect'];\n\t\t\t\t\tunset($this->request->data['__redirect']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Save\n\t\t\t\tif($document->save($this->request->data)) {\n\t\t\t\t\tFlashMessage::write('The content has been created successfully.');\n\t\t\t\t\t\n\t\t\t\t\t// Special redirect if the form has passed one, for example...edit and return to the form.\n\t\t\t\t\tif($redirect) {\n\t\t\t\t\t\t// If we want to jump specifically to the update action.\n\t\t\t\t\t\tif(substr($redirect, 0, 6) == 'update') {\n\t\t\t\t\t\t\t$redirectQueryParams = explode('?', $redirect);\n\t\t\t\t\t\t\t$redirectArgs = explode('/', $redirectQueryParams[0]);\n\t\t\t\t\t\t\t$redirectArgs[0] = $document->_id; // overwrite the 'update' it isn't a necessary argument\n\t\t\t\t\t\t\t$redirect = Router::match(array('admin' => true, 'library' => 'blackprint', 'controller' => 'content', 'action' => 'update', 'args' => $redirectArgs));\n\t\t\t\t\t\t\tif(isset($redirectQueryParams[1])) {\n\t\t\t\t\t\t\t\t$redirect .= '?' . $redirectQueryParams[1];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $this->redirect($redirect);\n\t\t\t\t\t}\n\t\t\t\t\t$this->redirect(array('library' => 'blackprint', 'controller' => 'content', 'action' => 'index', 'admin' => true));\n\t\t\t\t} else {\n\t\t\t\t\tFlashMessage::write('The content could not be created, please try again.');\n\t\t\t\t\t// change back the requseted _publicId if there was a conflict...this is a little bit hacky for validation\n\t\t\t\t\tif(isset($this->request->data['_publicId']) && $this->request->data['_publicId'] == '!___conflict___!') {\n\t\t\t\t\t\t$document->_publicId = $requestedPublicId;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->set(compact('document', 'contentTypes', 'contentConfig'));\n\t}",
"public function showCreate()\n {\n $user = Sentinel::check();\n $page_title = 'Create Admin';\n $roles = Sentinel::getRoleRepository()->pluck('name', 'id')->all();\n return view('admin.ManageAdmin.create', compact('user', 'page_title', 'roles'));\n }",
"public function index() {\n return view('admin');\n }",
"public function create(){\n require_once 'views/layouts users/header.php';\n require_once 'views/admin/create.php';\n require_once 'views/layouts users/footer.php';\n }",
"public function create() {\r\n return View::make('admin.create');\r\n }",
"public function indexAdmin()\n {\n $nodos = $this->mdlnodo->consultarnodos();\n require APP . 'view/_templates/headeradminodos.php';\n require APP . 'view/proyecto/admin/index.php';\n\t\t require APP . 'view/_footer/footeradminnodos.php';\n }",
"public function index()\n {\n return view('adminTemoignage');\n }",
"function admin()\n{\n global $app;\n\n $app->render('admin.html', [\n 'page' => mkPage(getMessageString('admin'), 0, 1),\n 'isadmin' => is_admin()]);\n}",
"protected function index(){\n $viewmodel = new AdminModel();\n $this->returnView(array('admins'=>$viewmodel->index()),true);\n }",
"function superadmin(){\n $this->auth(SUPER_ADM_LEVEL);\n $data['title'] = 'superadmin';\n $this->load->view('include/v_header', $data);\n $this->load->view('admin/superadmin/v_main');\n $this->load->view('include/v_footer');\n }",
"public function create()\n {\n return view('adminup');\n }",
"public function create()\n {\n return view('admin.index');\n }",
"public function index() {\n\t\t$this->load->view('admin/admin1.php');\n\t}",
"public function getMain(){\r\n\t\tinclude_once 'classes/person.php';\r\n\t\tif(person::getPermissionName()!='admin'){\r\n\t\t\t$login = Uri::getAction('Login');\r\n\t\t\theader(\"Location: $login\");\r\n\t\t}else{\r\n\t\t\trequire 'classes/view.php';\r\n\t\t\trequire './models/admin.php';\r\n\t\t\t$view = new view();\r\n\t\t\treturn $view->loadTemplate(new admin_model());\r\n\t\t}\r\n\t}",
"public function create()\n {\n //\n // return view('addAdmin');\n }",
"public function index()\n {\n return view('admin.admin');\n }",
"public function admin()\n\n {\n\n return view('admin');\n }",
"public function admin_page_create()\n {\n return view('admin.pages_admin.create');\n\n }",
"public function index(){\r\n\t\t$this->load->view('admin/index');\r\n\t}",
"public function admin() {\r\n $Conductor = new Conductor($this->adapter);\r\n\r\n //Conseguimos todos los usuarios\r\n $allCon = $Conductor->getAllUsers();\r\n //Cargamos la vista index y le pasamos valores\r\n $this->view(\"Conductor/admin\", array(\"allCon\" => $allCon));\r\n \r\n }",
"public function index()\n\t{\n\t\t$this->load->view('admin/index');\n\t}",
"public function admin(){\n return view('admin.index');\n }",
"public function addAdmin()\n {\n return view('backend.pages.admin.add-admin');\n }",
"public function create() {\r\n require $this->views_folder . 'create.php';\r\n }",
"public function index()\n {\n return view('admin.master');\n }",
"public function create(){\n\t\t$this->load->view('user/Admin_lte_theme/Admin_lte_header');\n \t$this->load->view('user/Admin_lte_theme/Admin_lte_leftsidebar');\n\t\t$this->load->view('user/store/Admin_lte_add_store_form');\n\t\t$this->load->view('user/Admin_lte_theme/Admin_lte_scripts_footer');\n\t}",
"public function index(){\n return View::make('admin.index');\n }",
"public function startAdmin()\n {\n return view('panel-user.index');\n }",
"public function admin()\n {\n $joogid = CoffeeMachine::orderBy('created_at', 'DESC')->get();\n return view('coffeeMachine.admin', compact('joogid'));\n }",
"public function index(){\n\t\t$this->Layout('Management');\n\t\t\n\t}",
"public function index()\n {\n return view('home_admin');\n }",
"public function create()\n {\n return view('adminlepy/create');\n }",
"public function create()\n {\n return view('admin.mainmenus.create');\n\n }",
"function controller()\n\t\t{\t\n\t\t\t$this->admin_page_header();\n\t\t\t$this->admin_menu();\n\t\t}",
"public function index() {\n $content = $this->llocation->location_add_form();\n $this->template->full_admin_html_view($content);\n }",
"public function index()\n\t{ \n\t \n\t $data['title'] = 'Category | Admin';\n\t\t$data['main'] = 'admin/category/category';\n\t\t$data['categories'] = $this->category_model->get_category_admin();\n\t\t$this->load->view('admin/template_admin', $data);\n\t}",
"public function create()\n\t{\n\t\treturn $this->renderView('admin.admins.create');\n\t}",
"public function create()\n {\n return view('superAdmin.addAdmin');\n }",
"public function adminIndex()\n {\n $config['list'] = VRPages::get()->toArray();\n $config['pageTitle'] = trans('app.pages');\n $config['route'] = route('app.pages.create');\n\n $config['edit'] = 'app.pages.edit';\n $config['delete'] = 'app.pages.delete';\n//dd($config);\n return view('admin.list', $config);\n }",
"public function admin()\n {\n $this->template_admin->displayad('admin');\n }",
"public function admin()\n {\n if ($this->loggedIn()) {\n $data['flights'] = $this->modalPage->getFlights();\n $data['name'] = $_SESSION['user_name'];\n $data['title'] = 'dashboard ' . $_SESSION['user_name'];\n $this->view(\"dashboard/\" . $_SESSION['user_role'], $data);\n\n } else {\n redirect('users/login');\n }\n\n }",
"public function createAdmin()\n {\n $users = User::all();\n return view('admin.create',['users'=>$users]);\n }",
"public function create()\n {\n return view('admin.admins.create'); \n }",
"public function admin()\n{\n return View('News/Admin');\n}",
"public function view()\n\t{\n\t\t$this->load->database();\n\t\t$this->load->view('/admin/header');\n\t\t$this->load->view('/admin/content');\n\t}",
"public function getCreate()\n\t{\n // Show the page\n return view('admin/language/create_edit');\n\t}",
"public function index()\n\t{\n\t\treturn View::make('backend.actas.administrativa');\n\t}",
"public function create()\n {\n //\n return view(\"Admin.Abs.add\");\n }",
"public function getCreate()\n\t{\n\t\treturn View::make('admin.admin.create');\n\t}",
"public function index() \r\n {\r\n return view('admin/index');\r\n }",
"public function addAdmin()\n {\n return view('super_admin/addAdmin');\n }",
"public function index(){\n return View('admin.index');\n }",
"public function showAddAdminPanel(){\n return $this->view('frontend/admin/addadmin.twig');\n }",
"public function index()\n {\n return view('advancedban::admin.index');\n }",
"public function index(){\n return view('pages.admin.index');\n }",
"public function createView(){\n\t\t$vue = new View(\"Create\");\n\t\t$vue->generer();\n\t}",
"public function createByAdmin()\n {\n return view('member.create');\n }",
"public function administration() {\n\t\t$success = ( isset( $_SESSION['success'] ) ? $_SESSION['success'] : null );\n\t\t$error = ( isset( $_SESSION['error'] ) ? $_SESSION['error'] : null );\n\t\t$login = ( isset( $_SESSION['login'] ) ? $_SESSION['login'] : null );\n\t\t$myView = new View( 'administration' );\n\t\t$myView->renderView( array( 'success' => $success, 'error' => $error, 'login' => $login ) );\n\t}",
"public function create()\n {\n return view('dashboard.admin.create');\n }",
"public function index()\n {\n return view('admin/index');\n }"
] | [
"0.79884493",
"0.7588061",
"0.75297457",
"0.74430585",
"0.7357532",
"0.73213184",
"0.7313495",
"0.7297489",
"0.7277124",
"0.7266115",
"0.72502863",
"0.7223638",
"0.7188841",
"0.7164646",
"0.7141506",
"0.71214664",
"0.7107813",
"0.70967036",
"0.7090291",
"0.70773095",
"0.7075394",
"0.7073414",
"0.7062395",
"0.7061869",
"0.70551914",
"0.70054275",
"0.6990974",
"0.697966",
"0.69778216",
"0.69773024",
"0.69683987",
"0.6967848",
"0.6966915",
"0.6956806",
"0.6956493",
"0.69428164",
"0.6934894",
"0.6917146",
"0.6917146",
"0.6917146",
"0.6917146",
"0.6915673",
"0.69124895",
"0.69009197",
"0.6899909",
"0.68919337",
"0.6888833",
"0.6876886",
"0.68752104",
"0.6874916",
"0.6874569",
"0.6873772",
"0.6869528",
"0.68661857",
"0.6865906",
"0.68508226",
"0.6829731",
"0.68297225",
"0.6821634",
"0.6819238",
"0.68092453",
"0.68048495",
"0.6803758",
"0.6793548",
"0.6791567",
"0.67874396",
"0.6781276",
"0.67808",
"0.677607",
"0.6766042",
"0.67658615",
"0.676162",
"0.67557937",
"0.675158",
"0.67422014",
"0.6738485",
"0.67363536",
"0.67363113",
"0.67337596",
"0.6731525",
"0.67305857",
"0.6725023",
"0.6723421",
"0.6722433",
"0.6717518",
"0.6717168",
"0.67126685",
"0.6703362",
"0.66981125",
"0.6698058",
"0.6697726",
"0.6693286",
"0.6681418",
"0.6677522",
"0.66698915",
"0.666919",
"0.6660724",
"0.6659842",
"0.66595286",
"0.66579527",
"0.6655292"
] | 0.0 | -1 |
Converter entidade para Array | public function toArray(): array; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function toEntityArray()\n {\n $return = [];\n foreach ($this as $row) {\n $return[] = $row;\n }\n return $return;\n }",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"abstract public function to_array();",
"public function convertItemArray() {}",
"public function toEntity($array);",
"public function toEntity($array);",
"function toArray() ;",
"function toArray() ;",
"public function toArray()\n {\n return $this->getEntity()->toArray();\n\t}",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"abstract protected function toArray();",
"public function toArray():array;",
"abstract public function toArray();",
"abstract public function toArray();",
"abstract public function toArray();",
"abstract public function toArray();",
"abstract public function toArray();",
"public function toArray()\n {\n return $this->cast('array');\n }",
"function _convert_to_table_data($entity)\n {\n $data = (array) $entity;\n foreach ($data as $key => $value) {\n if (is_array($value)) {\n $data[$key] = $this->object->serialize($value);\n }\n }\n return $data;\n }",
"public function toArray(){\n\t\treturn json_decode(json_encode($this->rows), true);\n\t}"
] | [
"0.7709663",
"0.75394917",
"0.75394917",
"0.753872",
"0.753872",
"0.753872",
"0.753872",
"0.7538566",
"0.7538566",
"0.7538566",
"0.7538566",
"0.7538566",
"0.7538566",
"0.7538566",
"0.7538566",
"0.7538566",
"0.7538566",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7491162",
"0.7483182",
"0.742539",
"0.74031144",
"0.74031144",
"0.73525184",
"0.73525184",
"0.73459363",
"0.7309844",
"0.7309844",
"0.7309844",
"0.7309844",
"0.7309844",
"0.7309844",
"0.7297263",
"0.72814304",
"0.7277119",
"0.7277119",
"0.7277119",
"0.7277119",
"0.7277119",
"0.7257223",
"0.7230192",
"0.71908087"
] | 0.0 | -1 |
Converter entidade para Json | public function toJson(): string; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function toJson();",
"public function toJson();",
"public function toJSON() {\n\n $oServidor = ServidorRepository::getInstanciaByCodigo(\n $this->getMatricula(),\n DBPessoal::getAnoFolha(),\n DBPessoal::getMesFolha()\n );\n\n $aRetorno = array();\n $aRetorno[\"codigo\"] = $this->getCodigo();\n $aRetorno[\"tipo\"] = $this->getTipoAssentamento();\n $aRetorno[\"natureza\"] = \"padrao\";\n $aRetorno[\"cgm_servidor\"] = $oServidor->getCgm()->getCodigo();\n $aRetorno[\"nome_servidor\"] = utf8_encode($oServidor->getCgm()->getNome());\n\n $aRetorno[\"matricula\"] = $this->getMatricula();\n $aRetorno[\"dataConcessao\"] = ($this->getDataConcessao() instanceof DBDate ? $this->getDataConcessao()->getDate(DBDate::DATA_PTBR) : $this->getDataConcessao());\n $aRetorno[\"historico\"] = $this->getHistorico();\n $aRetorno[\"codigoPortaria\"] = $this->getCodigoPortaria();\n $aRetorno[\"descricaoAto\"] = $this->getDescricaoAto();\n $aRetorno[\"dias\"] = $this->getDias();\n $aRetorno[\"percentual\"] = $this->getPercentual();\n $aRetorno[\"dataTermino\"] = ($this->getDataTermino() instanceof DBDate ? $this->getDataTermino()->getDate(DBDate::DATA_PTBR) : $this->getDataTermino());\n $aRetorno[\"segundoHistorico\"] = $this->getSegundoHistorico();\n $aRetorno[\"loginUsuario\"] = $this->getLoginUsuario();\n $aRetorno[\"dataLancamento\"] = ($this->getDataLancamento() instanceof DBDate ? $this->getDataLancamento()->getDate(DBDate::DATA_PTBR) : $this->getDataLancamento());\n $aRetorno[\"convertido\"] = (int)$this->isConvertido();\n $aRetorno[\"anoPortaria\"] = $this->getAnoPortaria();\n $aRetorno[\"hora\"] = $this->getHora();\n\n return json_encode((object)$aRetorno);\n }",
"public function toObject(){\r\n return json_decode($this->toJson());\r\n }",
"public function json(){ return json_encode( $this->objectify() ); }",
"public function jsonSerialize();",
"public function jsonSerialize();",
"public function jsonSerialize();",
"public function jsonSerialize();",
"public function jsonSerialize();",
"public function jsonSerialize();",
"public function jsonSerialize();",
"public function jsonSerialize();",
"public function toJSON(){\n $jsondata = array();\n $jsondata[\"idCliente\"]=$this->getIdCliente();\n $jsondata[\"idPedido\"]=$this->getIdPedido();\n \n return $jsondata;\n }",
"public function toJson($entity) {\n\t\treturn json_encode ( $this->toArray ( $entity ) );\n\t}",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function jsonSerialize()\n {\n return $this->tinydb_get_serializable_data();\n }",
"function toJson($object);",
"function to_json(tSerializable $object){\r\n return json_encode($object->jsonData());\r\n}",
"public function _jsonSerialize();",
"abstract function toEntity($value);",
"public function toJson() {\n\t\t\treturn json_encode(array(\n\t\t\t\t'id' => $this->id,\n\t\t\t\t'model' => $this->model,\n\t\t\t\t'type' => json_decode($this->type->toJson()),\n\t\t\t\t'description' => $this->description,\n\t\t\t\t'area' => json_decode($this->area->toJson()),\n\t\t\t\t'status' => $this->status\n\t\t\t));\n\t\t}",
"public function toJson(){\n\t\t$array = $this->toArray();\n\t\treturn json_encode($array);\n\t}",
"public function toJson()\n {\n return json_decode(json_encode($this->toArray()));\n }",
"public function jsonSerialize() {\n\n return ['id' => $this->id,\n 'name' => $this->name,\n 'author' => $this->author,\n 'description' => $this->description];\n \n \n }",
"public function jsonSerialize()\n {\n }",
"public function jsonSerialize()\n {\n }",
"function jsonSerialize() {\n return[\n \"id\"=>$this->id,\n \"nom\"=>$this->nom\n ];\n }",
"public function jsonSerialize()\n {\n $json = array();\n foreach ($this as $key => $value) {\n $json[$key] = $value;\n }\n \n $json['created_at'] = $this->getCreatedAt()->format(\"F j, Y\");\n \n return $json;\n }",
"public function toJSON(){\n return json_encode($this);\n }",
"public function jsonSerialize()\n {\n $output = [];\n foreach ($this::getReflection()->getProperties() as $propertyName => $property) {\n\n $value = $this->{$propertyName};\n if ($value instanceof Entity\\Collection || $value instanceof Entity) {\n $output[$propertyName] = $value->jsonSerialize();\n } elseif ($value instanceof \\DateTime\n && $property->getType() === Entity\\Reflection\\Property::TYPE_DATE\n ) {\n $output[$propertyName] = (array) $value;\n $output[$propertyName][\"date\"] = $value->format(self::$dateFormat);\n } else {\n $output[$propertyName] = $value;\n }\n }\n\n return $output;\n }",
"public function jsonize()\n {\n return json_encode($this->toArray());\n }",
"function jsonSerialize()\n\t{\n\t\treturn [\n\t\t\t'id' => $this->getId(),\n\t\t\t'metadata' => $this->getMetadata()\n\t\t];\n\t}",
"function _convert_to_table_data($entity)\n {\n $data = (array) $entity;\n foreach ($data as $key => $value) {\n if (is_array($value)) {\n $data[$key] = $this->object->serialize($value);\n }\n }\n return $data;\n }",
"public function toObject() \n {\n return $this->toJson();\n }",
"public function toJson()\n {\n return $this->serializer()->serialize($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function exportToJson()\n {\n $user = $this->load([\n 'bookings.resource',\n 'identifiers',\n ]);\n\n $user->bookings->transform(function ($item, $key) {\n return (object) [\n 'resource' => $item->resource->name,\n 'start' => $item->start_time->format('U'),\n 'end' => $item->end_time->format('U'),\n ];\n });\n\n $user->identifiers->transform(function ($item, $key) {\n return $item->value;\n });\n\n return json_encode($user->only(['email', 'name', 'bookings', 'identifiers']));\n }",
"final public function jsonSerialize() {}",
"public function jsonSerialize()\n {\n return $this->get();\n }",
"public function jsonSerialize()\n {\n return\n [\n 'cd_competencia_tecnica'=>$this->cd_competencia_tecnica,\n 'ds_competencia_tecnica'=>$this->ds_competencia_tecnica,\n 'nr_nivel'=>$this->nr_nivel\n ];\n }",
"public function __toString()\n {\n return json_encode(array(\n \"idusuario\"=>$this->getIdusuario(),\n \"deslogin\"=>$this->getDeslogin(),\n \"dessenha\"=>$this->getDessenha(),\n \"dataCadastro\"=>$this->getDataCadastro()->format(\"d-m-Y H:i:s\")\n ));\n }",
"function jsonSerialize()\n {\n return $this->jsonObjectSerialize()->jsonSerialize();\n }",
"public function __toString(){\n return json_encode($this->json);\n }",
"public function toJson() {\n\t\treturn json_encode($this->jsonSerialize());\n\t}",
"public function serialize($entity)\n {\n }",
"public function toJson() {\n return $this->jsonSerialize();\n }",
"public function toObject();",
"function jsonSerialize();",
"public function jsonSerialize()\n {\n $json = array();\n $json['uuid'] = $this->uuid;\n $json['updatedAt'] = DateTimeHelper::toRfc3339DateTime($this->updatedAt);\n $json['title'] = $this->title;\n $json['titleTranslated'] = $this->titleTranslated;\n $json['basePrice'] = $this->basePrice;\n $json['typeName'] = $this->typeName;\n $json['typeUuid'] = $this->typeUuid;\n $json['links'] = $this->links;\n $json['validFrom'] = $this->validFrom;\n $json['validThrough'] = isset($this->validThrough) ?\n DateTimeHelper::toSimpleDate($this->validThrough) : null;\n\n return $json;\n }",
"public function toWordPressEntity();",
"public function jsonSerialize()\n {\n return $this->toWei();\n }",
"public function jsonSerialize()\n {\n return [\n 'id'=> $this->id,\n 'nom'=> $this->nom,\n 'rue'=> $this->rue,\n 'latitude'=> $this->latitude,\n 'longitude'=> $this->longitude,\n 'ville'=> $this->ville,\n ];\n }",
"public function toJson()\n {\n return Json::encode($this->toArray(), false, array(\n 'enableJsonExprFinder' => TRUE,\n ));\n }",
"public function jsonSerialize()\r\n {\r\n $json = array();\r\n $json['id'] = $this->id;\r\n $json['source'] = $this->source;\r\n $json['location_id'] = $this->locationId;\r\n $json['name'] = $this->name;\r\n $json['total_ratings'] = $this->totalRatings;\r\n $json['average_rating'] = $this->averageRating;\r\n $json['stars'] = $this->stars;\r\n $json['type_id'] = $this->typeId;\r\n $json['meta_no_index'] = $this->metaNoIndex;\r\n $json['owner_id'] = $this->ownerId;\r\n $json['trip_id'] = $this->tripId;\r\n $json['address1'] = $this->address1;\r\n $json['address2'] = $this->address2;\r\n $json['postcode'] = $this->postcode;\r\n $json['telephone'] = $this->telephone;\r\n $json['url'] = $this->url;\r\n $json['description'] = $this->description;\r\n $json['longitude'] = $this->longitude;\r\n $json['latitude'] = $this->latitude;\r\n $json['num_rooms'] = $this->numRooms;\r\n $json['redirect_accommodation_id'] = $this->redirectAccommodationId;\r\n $json['redirect_id'] = $this->redirectId;\r\n $json['page_url'] = $this->pageUrl;\r\n $json['binary_options'] = $this->binaryOptions;\r\n $json['desc_overview'] = $this->descOverview;\r\n $json['desc_room_information'] = $this->descRoomInformation;\r\n $json['desc_facilities'] = $this->descFacilities;\r\n $json['desc_food_drink'] = $this->descFoodDrink;\r\n $json['date_created'] = $this->dateCreated;\r\n $json['date_updated'] = $this->dateUpdated;\r\n $json['date_removed'] = $this->dateRemoved;\r\n\r\n return $json;\r\n }"
] | [
"0.72832257",
"0.72832257",
"0.69611996",
"0.6845698",
"0.66761434",
"0.6605781",
"0.6605781",
"0.6605781",
"0.6605781",
"0.6605781",
"0.6605781",
"0.6605781",
"0.6605781",
"0.6515539",
"0.6505841",
"0.64859813",
"0.64859813",
"0.64859813",
"0.64859813",
"0.64859813",
"0.64859813",
"0.64859813",
"0.64859813",
"0.64859813",
"0.6483562",
"0.64386386",
"0.6398279",
"0.6392937",
"0.63894784",
"0.6309526",
"0.63007826",
"0.6254122",
"0.6221843",
"0.6196184",
"0.6196184",
"0.61942285",
"0.61527526",
"0.61341715",
"0.61242867",
"0.6112735",
"0.6109641",
"0.61072475",
"0.60908747",
"0.60889256",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6085776",
"0.6080604",
"0.60804737",
"0.6060568",
"0.6042787",
"0.60397446",
"0.60391724",
"0.6039101",
"0.60313153",
"0.60225177",
"0.6014382",
"0.6001209",
"0.59911305",
"0.5964036",
"0.5960151",
"0.5956732",
"0.59519523",
"0.59515816",
"0.5951403"
] | 0.67939264 | 5 |
Returns the current output of the process (STDOUT). | public function __toString(): string {
try {
return $this->getOutput();
}
catch (Exception $e) {
return '';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function stdout() {\n return $this->stdout;\n }",
"function getOutput ()\n {\n $descriptors = [\n 0 => ['pipe', 'w'],\n 1 => ['pipe', 'w'],\n 2 => ['pipe', 'w'],\n ];\n\n // Start the script\n $proc = proc_open($cmd, $descriptors, $pipes);\n\n // Read the stdin\n $stdin = stream_get_contents($pipes[0]);\n fclose($pipes[0]);\n\n // Read the stdout\n $stdout = stream_get_contents($pipes[1]);\n fclose($pipes[1]);\n\n // Read the stderr\n $stderr = stream_get_contents($pipes[2]);\n fclose($pipes[2]);\n\n // Close the script and get the return code\n $return_code = proc_close($proc);\n }",
"public function getStandardOutput();",
"public function getStandardOutputMessage()\n {\n return $this->behatProcess->getOutput();\n }",
"public function getStdout()\n {\n $lastline = substr($this->stdout, strrpos($this->stdout, \"\\n\", -2) + 1);\n if (substr($lastline, 0, 3) === 'OK ') {\n return substr($this->stdout, 0, strrpos($this->stdout, \"\\n\", -2));\n } else {\n return $this->stdout;\n }\n }",
"public static function output(){\n //Method inherited from \\Illuminate\\Foundation\\Console\\Kernel \n return \\App\\Console\\Kernel::output();\n }",
"public function getOutput() {\n return $this->io()->getOutput();\n }",
"public function getStdout(): ProcessInputStream\n {\n if (!$this->handle || $this->handle->status === ProcessStatus::STARTING) {\n throw new StatusError(\"Process has not been started or has not completed starting.\");\n }\n\n return $this->handle->stdout;\n }",
"public function getOutput()\n {\n return $this->output ?? $this->createOutput();\n }",
"public function getOutput(): string {\n\t\treturn $this->output;\n\t}",
"public function getOutput()\n {\n return $this->_output;\n }",
"public function getOutput()\n {\n return $this->output;\n }",
"public function getOutput()\n {\n return $this->output;\n }",
"public function getOutput()\n {\n return $this->output;\n }",
"public function getOutput()\n {\n return $this->output;\n }",
"public function getOutput()\n {\n return $this->output;\n }",
"public function getOutput()\n {\n return $this->output;\n }",
"public function getOutput()\n {\n return $this->output;\n }",
"public function getOutput()\n\t{\n\t\treturn $this->output;\n\t}",
"public function getOutput()\r\n\t{\r\n\t\treturn $this->_output;\r\n\t}",
"public function getConsoleOutput()\n {\n return $this->readOneof(56);\n }",
"public function getOutput()\n {\n return $this->output;\n }",
"public function getOutput () {\n $str = $this->output;\n $this->output = '';\n return $str;\n }",
"public function getRawOutput()\n {\n return $this->rawOutput;\n }",
"public function getRawOutput()\n {\n return $this->rawOutput;\n }",
"public function getOutput()\n\t{\n\t\t$this->context = null;\n\t\t\n\t\treturn $this->output;\n\t}",
"public function output() {\n return (string)$this->output;\n }",
"public function getOutput()\n {\n return $this->file->dumpString();\n }",
"public static function getOutput()\n {\n $session = self::getSession();\n return $session->content;\n }",
"public function getStdOut() {\n\t\treturn parent::getMessage();\n\t}",
"public function getOutput()\n {\n $output = '';\n \\ob_start();\n $this->render();\n $output = \\ob_get_contents();\n \\ob_end_clean();\n\n return $output;\n }",
"public function getOutput()\n {\n return $this->getParameter('output');\n }",
"public function getOutString()\n {\n return $this->outString;\n }",
"public function output( ) {\n rewind( $this->buffer );\n $output = $this->readBuffer( );\n fclose( $this->buffer );\n\n return $output;\n }",
"public function getLastOutput()\n {\n return $this->lastOutput;\n }",
"public function getOutput()\n\t{\n\t\tif (!$this->output)\n\t\t{\n\t\t\t// In 4.0, this will convert to throwing an exception and you will expected to\n\t\t\t// initialize this in the constructor. Until then set a default.\n\t\t\t$default = new Joomla\\Application\\Cli\\Output\\Xml;\n\t\t\t$this->setOutput($default);\n\t\t}\n\n\t\treturn $this->output;\n\t}",
"public abstract function usesStdout();",
"public function getDirectOutput()\n {\n return $this->directOutput;\n }",
"public static function stdout($string)\n {\n return fwrite(\\STDOUT, $string);\n }",
"public function getStdErr() {\n\t\treturn $this->stderr;\n\t}",
"public function getLastOutput()\n {\n return implode(PHP_EOL, $this->lastOutput);\n }",
"public function get_output() {\n return $this->data;\n }",
"protected function getDisplayFromOutput()\n {\n rewind($this->streamOutput->getStream());\n $display = stream_get_contents($this->streamOutput->getStream());\n\n return str_replace(PHP_EOL, \"\\n\", $display);\n }",
"public function getOutput()\n {\n $this->output = $output;\n }",
"public function output(): string\n {\n return $this->outString;\n }",
"final public function get_pty()\n {\n return $this->pty;\n }",
"protected function getProcessOutput(Process $process)\n {\n $output = '';\n\n // Add standard process output\n if ($processOutput = $process->getIncrementalOutput()) {\n $processOutputLines = explode(\"\\n\", $processOutput);\n\n // color output lines containing \"[WARN]\"\n foreach ($processOutputLines as &$processOutputLine) {\n if (strpos($processOutputLine, '[WARN]') !== false) {\n $processOutputLine = '<fg=black;bg=yellow>' . $processOutputLine . '</fg=black;bg=yellow>';\n } elseif (strpos($processOutputLine, '[DEBUG]') !== false) {\n $processOutputLine = '<comment>' . $processOutputLine . '</comment>';\n }\n }\n $output .= implode(\"\\n\", $processOutputLines);\n }\n\n // Add error output\n if ($errorOutput = $process->getIncrementalErrorOutput()) {\n $output .= '<error>' . rtrim($errorOutput, PHP_EOL) . '</error>' . \"\\n\";\n }\n\n return $output;\n\n }",
"public static function stdout($handle = null) {\n\t\treturn new static($handle ?: fopen(STDOUT, 'wb'));\n\t}",
"public function get_output()\n {\n }",
"public function get_export_output()\r\n {\r\n return $this->m_export_output;\r\n }",
"public function output()\n {\n if (! \\is_null($this->response->getRpcErrorCode())) {\n return $this->response->getRpcErrorData();\n }\n\n return $this->response->getRpcResult();\n }",
"public function getOutput(): string;",
"public function getCurrentUser(): string\n {\n $this->executor->execute('whoami', [], __DIR__, []);\n\n return trim($this->output->getBuffer());\n }",
"public function output($output = null) {\n\t\treturn $this->sget('output', $output);\n\t}",
"public function getOutput() {}",
"public function getOutput(): string\n {\n $log_file = $this->config->getLogFile();\n if (!file_exists($log_file)) {\n $msg = \"Server output log file does not exists '$log_file'\";\n $this->logger->error(\"Get server output failed: $msg\");\n throw new Exception\\RuntimeException($msg);\n } elseif (!is_readable($log_file)) {\n $msg = \"Cannot read log file do to missing read permission '$log_file'\";\n $this->logger->error(\"Get server output failed: $msg\");\n throw new Exception\\RuntimeException($msg);\n }\n $output = file_get_contents($log_file);\n\n return $output;\n }",
"public function getDebugOutput()\n {\n return $this->Debugoutput;\n }",
"public static function output() {}",
"public function getOutput() {\n\t\tglobal $wgDebugFunctionEntry, $wgProfileCallTree;\n\n\t\t$wgDebugFunctionEntry = false; // hack\n\n\t\tif ( !count( $this->mStack ) && !count( $this->mCollated ) ) {\n\t\t\treturn \"No profiling output\\n\";\n\t\t}\n\n\t\tif ( $wgProfileCallTree ) {\n\t\t\treturn $this->getCallTree();\n\t\t} else {\n\t\t\treturn $this->getFunctionReport();\n\t\t}\n\t}",
"public function getOutputLines()\n {\n return $this->output;\n }",
"public function getOutput(){\n\n if (is_null($this->output)) {\n\n ob_start();\n\n extract($this->data);\n\n require $this->view;\n\n $this->output = ob_get_clean();\n\n return $this->output;\n }\n }",
"public function getProcess()\n {\n return $this->get(self::PROCESS);\n }",
"public function stdout($string)\n {\n $STDOUT = isset($this->daemon->STDOUT) && !empty($this->daemon->STDOUT) && is_resource($this->daemon->STDOUT)\n ? $this->daemon->STDOUT\n : \\STDOUT;\n\n if ($this->isColorEnabled($STDOUT)) {\n $args = func_get_args();\n array_shift($args);\n $string = Console::ansiFormat($string, $args);\n }\n\n return fwrite($STDOUT, $string);\n }",
"public function getConsole();",
"public function getConsole();",
"static public function GetOutputStream() {\n if (isset(self::$output))\n return self::$output;\n else\n return false;\n }",
"public function getStdin(): ProcessOutputStream\n {\n if (!$this->handle || $this->handle->status === ProcessStatus::STARTING) {\n throw new StatusError(\"Process has not been started or has not completed starting.\");\n }\n\n return $this->handle->stdin;\n }",
"public static function stdout($handle = null) {\n\t\treturn new static($handle ?: fopen(STDERR, 'w+b'));\n\t}",
"public function processOutput() {}",
"protected function readOutput($stream = null)\n {\n if ($stream === null) {\n $stream = ConsoleStub::$outputStream;\n }\n\n rewind($stream);\n\n $output = '';\n\n while (!feof($stream) && ($buffer = fread($stream, 1024)) !== false) {\n $output .= $buffer;\n }\n\n return $output;\n }",
"public function stderr() {\n return $this->stderr;\n }",
"public function getOutput();",
"public function getOutput();",
"public function display_current()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" display ? ?\");\n\t}",
"public function getProcess()\n {\n return $this->getProcessBuilder()->getProcess();\n }",
"private function getResultLineForOutput(JobStats $jobStats)\n {\n $line = '<info>Finished in <comment>%s</comment>'.\n ' - MemoryUsed: <comment>%s</comment>'.\n ' - MemoryUsage: <comment>%s</comment>'.\n ' - MemoryUsageReal: <comment>%s</comment></info>';\n\n return sprintf($line,\n TimeTakenHelper::convert($jobStats->getTimeTaken()),\n DataSizeHelper::convert($jobStats->getMemoryUsed()),\n DataSizeHelper::convert($jobStats->getMemoryUsage()),\n DataSizeHelper::convert($jobStats->getMemoryUsageReal()));\n }",
"public function getOutputVerbosity();",
"public function getResult(): string\n {\n return $this->result;\n }",
"abstract function printOutput()",
"private function get_current_command() {\n\t\t$runner = new RunnerInstance();\n\n\t\treturn implode( ' ', (array) $runner()->arguments );\n\t}",
"public function __toString()\n {\n ob_start();\n $this->fpassthru();\n\n return ob_get_clean();\n }",
"public function getPhpinfoHtml()\r\n {\r\n ob_start();\r\n phpinfo();\r\n $info = ob_get_contents();\r\n ob_end_clean();\r\n if($this->fromConsole)\r\n return \"<pre>\" . $info . \"</pre>\";\r\n else\r\n return $info;\r\n }",
"public function getProcess()\n {\n return $this->process;\n }",
"public function getDebugOutput()\n {\n }",
"public function output() {\n\t\treturn $this->content;\n\t}",
"public function getProcess() {\n return $this->process;\n }",
"public function getProcess() {\n return $this->process;\n }",
"public function getConsole()\n {\n return $this->console;\n }",
"public function getExecString()\n {\n $command_string = $this->_command;\n \n// get the output append string\n $output = $this->getBufferOutput();\n if(empty($output) === false)\n {\n $output = ' > '.escapeshellarg($output);\n }\n \n// get the buffer divert string.\n $buffer_divert = '';\n if(empty($output) === false || empty($tracking) === false)\n {\n $buffer_divert = ' 2>&1 &';\n }\n \n// get the failure tracking boundaries\n// and get the completion boundary\n $completion_boundary_open = '';\n $completion_boundary_close = '';\n if($this->_failure_tracking === true)\n {\n $completion_boundary_open = '((';\n $completion_boundary_close = ' && echo '.$this->_escapeBoundaryInEcho($this->_completion_boundary).') || echo '.$this->_escapeBoundaryInEcho($this->_failure_boundary).' '.$this->_escapeBoundaryInEcho($this->_completion_boundary).' '.$this->_escapeBoundaryInEcho($this->_error_code_boundary).(self::$_is_windows === false ? '$?' : '').') 2>&1';\n }\n else\n {\n $completion_boundary_open = '(';\n $completion_boundary_close = ' && echo '.$this->_escapeBoundaryInEcho($this->_completion_boundary).') 2>&1';\n }\n \n// compile the final command and track\n return $completion_boundary_open.$command_string.$completion_boundary_close.$output.$buffer_divert;\n }",
"public function getProcessDescription()\n {\n return $this->processDescription;\n }",
"public function __toString()\n {\n ob_start();\n $this->output();\n\n return ob_get_clean();\n }",
"public function getOutputBase()\n {\n return $this->outputBase;\n }",
"public function getVerbosity()\n {\n return $this->decoratedOutput->getVerbosity();\n }",
"protected static function command($command)\n {\n $process = Process::fromShellCommandline($command, Path::current());\n\n $process->run();\n\n return trim($process->getOutput());\n }",
"public function getStdErr()\n {\n return $this->information['stdErr'];\n }",
"public function output(): array\n {\n return $this->output;\n }",
"public function buffer() {\n\t\treturn ob_get_contents();\n\t}",
"public function getOutMessage()\n {\n return $this->getProperty(OperationInterface::BPMN_PROPERTY_OUT_MESSAGE);\n }",
"public function get_output_content();",
"function GetDbmsOutput($c)\n {\n $res = false;\n $s = oci_parse($c, \"BEGIN DBMS_OUTPUT.GET_LINE(:LN, :ST); END;\");\n if (oci_bind_by_name($s, \":LN\", $ln, 255) &&\n oci_bind_by_name($s, \":ST\", $st)) {\n $res = array();\n while (($succ = oci_execute($s)) && !$st)\n $res[] = $ln;\n if (!$succ)\n $res = false;\n }\n oci_free_statement($s);\n return $res;\n }",
"function output($output)\n{\n return (new ConsoleOutput())->writeln($output);\n}"
] | [
"0.79905134",
"0.74117845",
"0.7393337",
"0.69226605",
"0.68348795",
"0.6726747",
"0.66161287",
"0.6560961",
"0.65591586",
"0.6525336",
"0.64619946",
"0.6460539",
"0.6460539",
"0.6460539",
"0.6460539",
"0.6460539",
"0.6460539",
"0.6460539",
"0.6423926",
"0.6373497",
"0.63484454",
"0.63374186",
"0.63205004",
"0.6196973",
"0.6196973",
"0.6186532",
"0.61275035",
"0.60577494",
"0.6047108",
"0.6035382",
"0.60140663",
"0.5994333",
"0.5943513",
"0.59176385",
"0.5897108",
"0.58468586",
"0.57860094",
"0.5764323",
"0.5753015",
"0.5706766",
"0.56997144",
"0.5678382",
"0.56724733",
"0.5641501",
"0.5628136",
"0.56251776",
"0.56059456",
"0.55851495",
"0.5564815",
"0.5561251",
"0.5558118",
"0.55335766",
"0.5498778",
"0.54621214",
"0.54404825",
"0.5435867",
"0.54143685",
"0.5355662",
"0.5354611",
"0.53422344",
"0.53384596",
"0.53153086",
"0.5304578",
"0.5300301",
"0.5300301",
"0.52850467",
"0.52849984",
"0.5277063",
"0.5264709",
"0.5263837",
"0.5262275",
"0.5258302",
"0.5258302",
"0.52334887",
"0.5225957",
"0.5225636",
"0.52237636",
"0.5223372",
"0.52033275",
"0.51870054",
"0.51727843",
"0.51723015",
"0.5171253",
"0.5169395",
"0.5168108",
"0.5152368",
"0.5152368",
"0.51448244",
"0.5123242",
"0.5122175",
"0.51106083",
"0.5105311",
"0.5095678",
"0.50802267",
"0.50781995",
"0.5071478",
"0.5045384",
"0.50443125",
"0.50323224",
"0.5031369",
"0.5027168"
] | 0.0 | -1 |
Run the database Seeds. | public function run()
{
$children = '[
{
"_from":"characters/NedStark",
"_to":"characters/RobbStark"
},
{
"_from":"characters/NedStark",
"_to":"characters/SansaStark"
},
{
"_from":"characters/NedStark",
"_to":"characters/AryaStark"
},
{
"_from":"characters/NedStark",
"_to":"characters/BranStark"
},
{
"_from":"characters/CatelynStark",
"_to":"characters/RobbStark"
},
{
"_from":"characters/CatelynStark",
"_to":"characters/SansaStark"
},
{
"_from":"characters/CatelynStark",
"_to":"characters/AryaStark"
},
{
"_from":"characters/CatelynStark",
"_to":"characters/BranStark"
},
{
"_from":"characters/NedStark",
"_to":"characters/JonSnow"
},
{
"_from":"characters/TywinLannister",
"_to":"characters/JaimeLannister"
},
{
"_from":"characters/TywinLannister",
"_to":"characters/CerseiLannister"
},
{
"_from":"characters/TywinLannister",
"_to":"characters/TyrionLannister"
},
{
"_from":"characters/CerseiLannister",
"_to":"characters/JoffreyBaratheon"
},
{
"_from":"characters/JaimeLannister",
"_to":"characters/JoffreyBaratheon"
}
]';
$childOf = json_decode($children, JSON_OBJECT_AS_ARRAY);
foreach ($childOf as $relation) {
Child::insertOrIgnore($relation);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function run()\n {\n $this->seedUsers();\n $this->seedAdmins();\n $this->seedMeals();\n\n $this->seedOrder();\n $this->seedOrderlist();\n\n $this->seedReload();\n }",
"public function run()\n {\n //base seeds\n $this->call(RoleSeed::class);\n $this->call(UserSeed::class);\n $this->call(PointSeed::class);\n $this->call(LevelSeed::class);\n\n // $this->call(CourseSeed::class);\n // $this->call(LessonSeed::class);\n\n\n // $this->call(AnswerSeed::class);\n // $this->call(QuizSeed::class);\n // $this->call(QuestionSeed::class);\n // $this->call(TemplateSeed::class);\n // $this->call(CertificationSeed::class);\n \n //relation seeds\n // $this->call(CourseLessonSeed::class);\n // $this->call(CourseQuizSeed::class);\n // $this->call(QuizQuestionSeed::class);\n // $this->call(QuestionAnswerSeed::class);\n //$this->call(DataCourseSeed::class);\n //$this->call(DataLessonSeed::class);\n }",
"public function run()\n {\n //$this->call(AboutTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n //$this->call(SettingsTableSeeder::class);\n \n\t #iseed_start\n\n\t //$this->call('UsersTableSeeder');\n\t $this->call('AboutTableSeeder');\n $this->call('GalleriesTableSeeder');\n $this->call('MessagesTableSeeder');\n $this->call('MessageStatusesTableSeeder');\n $this->call('ProjectsTableSeeder');\n $this->call('ProjectPropertiesTableSeeder');\n $this->call('PropertiesTableSeeder');\n $this->call('SettingsTableSeeder');\n #iseed_end\n }",
"public function run()\n {\n $this->call(RolesDatabaseSeeder::class);\n $this->call(UsersDatabaseSeeder::class);\n $this->call(LocalesDatabaseSeeder::class);\n $this->call(MainDatabaseSeeder::class);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->call(GenresTableSeeder::class);\n $this->call(UserTableSeeder::class);\n $this->call(ArtistTableSeeder::class);\n $this->call(AlbumTableSeeder::class);\n $this->call(TrackTableSeeder::class);\n $this->call(ListenedTableSeeder::class);\n $this->call(TrackGenreTableSeeder::class);\n $this->call(TrackStatusTableSeeder::class);\n $this->call(SubscriptionTableSeeder::class);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }",
"public function run()\n {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"\\n--- Seeding ---\\n\", TRUE));\n\n if (App::environment('production')) {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- ERROR: Seeding in Production is prohibited ---\\n\", TRUE));\n return;\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(ConfigsTableSeeder::class);\n $this->call(ConfigContentsTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n if (defined('STDERR')) fwrite(STDERR, print_r(\"Set FOREIGN_KEY_CHECKS=1 --- DONE\\n\", TRUE));\n\n // \\Artisan::call('command:regenerate-user-feeds');\n\n \\Cache::flush();\n\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- End Seeding ---\\n\\n\", TRUE));\n }",
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }",
"public function run()\n {\n $this->call(BranchesSeeder::class);\n $this->call(TerminalStateSeeder::class);\n $this->call(ColleaguesSeeder::class);\n $this->call(TerminalsSeeder::class);\n }",
"public function run()\n {\n $this->call([UserDatabaseSeeder::class,Lab406DatabaseSeeder::class]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }",
"public function run()\n {\n \t$this->call(SparkDeveloperSeeder::class);\n \t$this->call(TeamsTableSeeder::class);\n $this->call(NewsSeeder::class);\n $this->call(ForumSeeder::class);\n $this->call(ChatSeeder::class);\n }",
"public function run()\n {\n $this->call(AdvertPermissionsDatabaseSeeder::class);\n $this->call(AdvertMenuDatabaseSeeder::class);\n $this->call(AdvertSampleDatabaseSeeder::class);\n }",
"public function run()\n {\n // Disable guard for seeder\n Eloquent::unguard();\n\n $this->call(AvasTableSeeder::class);\n $this->call(WineriesTableSeeder::class);\n $this->call(AvaWineryTableSeeder::class);\n $this->call(TimesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(FavoritesTableSeeder::class);\n $this->call(WishlistsTableSeeder::class);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n $this->call(userTableSeeder::class);\n $this->call(hrl1TableSeeder::class);\n $this->call(hrl1CategoryTableSeeder::class);\n $this->call(hrl1PositionTableSeeder::class);\n $this->call(tel1TableSeeder::class);\n $this->call(pel2TableSeeder::class);\n $this->call(pel4TableSeeder::class);\n // $this->call(tel1CostfactorTableSeeder::class);\n\n }",
"public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n $this->call(UserSeed::class);\n $this->call(CategorySeed::class);\n $this->call(ExperienceSeeder::class);\n $this->call(LocationSeeder::class);\n $this->call(SalarySeeder::class);\n\n }",
"public function run()\n {\n $this->call('CategoryTableSeeder');\n $this->call('ProductTableSeeder');\n $this->call('ProductCategoriesTableSeeder');\n $this->call('GalleryImagesTableSeeder');\n $this->call('ProductGalleryTableSeeder');\n $this->call('ProductInventoryTableSeeder');\n $this->call('ProductInventoryPricesTableSeeder');\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->call(UserSeeder::class);\n $this->call(AuditeeSeeder::class);\n $this->call(AuditorSeeder::class);\n $this->call(CategorySeeder::class);\n $this->call(ContractorSeeder::class);\n $this->call(DepartmentSeeder::class);\n $this->call(SiteSeeder::class);\n $this->call(MonitoringSeeder::class);\n }",
"public function run()\n {\n $this->seedUsers();\n $this->seedBikes();\n $this->seedReservations();\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->call('DevicetypesTableSeeder');\n $this->call('HscontactsTableSeeder');\n $this->call('HighsiteVisitCategoriesTableSeeder');\n $this->call('BackhaultypesTableSeeder');\n $this->call('SystemsTableSeeder');\n }",
"public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t$this->call('CarouselTableSeeder');\n\t\t$this->call('NewsTableSeeder');\n\t\t$this->call('GlobalServiceCategoriesTableSeeder');\n\t\t$this->call('ServiceCategoriesTableSeeder');\n\t\t$this->call('ServicesTableSeeder');\n\t\t$this->call('CentresTableSeeder');\n\t\t$this->call('MembersTableSeeder');\n\t\t$this->call('LinksTableSeeder');\n $this->call('DocumentsCategoriesTableSeeder');\n\t\t$this->call('VideosTableSeeder');\n\t\t$this->call('PressTableSeeder');\n \n $this->call('UsersTableSeeder');\n\t}",
"public function run()\n {\n\t $this->call(CategoryTableSeed::class);\n\t $this->call(ProductTableSeed::class);\n\t $this->call(UserTableSeed::class);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->call(PublicationTableSeeder::class);\n $this->call(AuthorTableSeeder::class);\n $this->call(AuthorPublicationTableSeeder::class);\n $this->call(SlideTableSeeder::class);\n $this->call(PageTableSeeder::class);\n $this->call(DatasetTableSeeder::class);\n $this->call(DatasetRequestTableSeeder::class);\n $this->call(UserTableSeeder::class);\n }",
"public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(SeedFurnitureTable::class);\n $this->call(SeedCategoriesTable::class);\n $this->call(SeedUsersTable::class);\n $this->call(SeedMaterialsTable::class);\n $this->call(SeedOrdersTable::class);\n $this->call(SeedPromotionsTable::class);\n $this->call(SeedReviewsTable::class);\n $this->call(SeedTaxesTable::class);\n $this->call(SeedManufacturersTable::class);\n $this->call(SeedTransactionsTable::class);\n $this->call(SeedFurnitureOrderTable::class);\n }",
"public function run()\n {\n\n $this->call('UsersTableSeeder');\n $this->call('ItemsTableSeeder');\n\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call([\n HomeSeeder::class,\n ]);\n\n $this->call([\n NewsSeeder::class,\n ]);\n\n $this->call([\n ProductSeeder::class,\n ]);\n\n $this->call([\n ProgramSeeder::class,\n ]);\n \n $this->call([\n AboutSeeder::class,\n ]);\n\n $this->call([\n ContactSeeder::class,\n ]);\n }",
"public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(ContactSeeder::class);\n $this->call(ConditionSeeder::class);\n $this->call(DesignSeeder::class);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->call(LaratrustSeeder::class);\n $this->call(OverrideLaratrustDefaultUser::class);\n $this->call(DefaultUnitTableSeeder::class);\n $this->call(PhoneProviderTableSeeder::class);\n\n /* DUMMY DATA */\n if (App::environment('local', 'dev')) {\n\n $this->command->info('Local/Development Enviroment Detected. Starting Dummy Data Seeder...');\n\n $this->call(BankTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n $this->call(ProductTypeTableSeeder::class);\n $this->call(SupplierTableSeeder::class);\n $this->call(CustomerTableSeeder::class);\n $this->call(TrucksTableSeeder::class);\n $this->call(VendorTruckingTableSeeder::class);\n $this->call(WarehouseTableSeeder::class);\n $this->call(PriceLevelTableSeeder::class);\n $this->call(TruckMaintenancesTableSeeder::class);\n }\n\n }",
"public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(CreateUsersSeeder::class);\n $this->call(GameTableSeeder::class);\n\n $this->call(ScenariosTableSeeder::class);\n $this->call(PrefabsTableSeeder::class);\n $this->call(PrefabScanrioTableSeeder::class);\n\n\n // $this->call(KnowledgeComponentsTableSeeder::class);\n }",
"public function run()\n {\n $this->call(CountrySeeder::class);\n $this->call(CitySeeder::class);\n\n $this->call(UserSeeder::class);\n $this->call(StatusSeeder::class);\n Company::factory(20)->create();\n $this->call(StatusSeeder::class);\n $this->call(RoleSeeder::class);\n $this->call(CategorySeeder::class);\n Offer::factory(100)->create();\n Review::factory(100)->create();\n Project::factory(30)->create();\n Image::factory(90)->create();\n }",
"public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t// $this->call('TopicsTableSeeder');\n\t\t// $this->call('GiftsTableSeeder');\n\t\t// $this->call('GiftPostersTableSeeder');\n\t\t// // $this->call('GiftPhotoIntrosTableSeeder');\n\t\t// $this->call('PostersTableSeeder');\n\t\t// $this->call('UsersTableSeeder');\n\t\t// $this->call('GiftFocusTableSeeder');\n\t\t// $this->call('SearchTableSeeder');\n\t\t// $this->call('ArticlesTableSeeder');\n\t\t// $this->call('ArticlePartsTableSeeder');\n\t\t// $this->call('ArticleJoinsTableSeeder');\n\t\t// $this->call('ArticleJoinPartsTableSeeder');\n\t\t// $this->call('ArticleJoinComsTableSeeder');\n\t\t// $this->call('ArticleJoinReplysTableSeeder');\n\t\t// $this->call('CharactorsTableSeeder');\n\t\t// $this->call('ObjectsTableSeeder');\n\t\t// $this->call('PricesTableSeeder');\n\t\t// $this->call('ScenesTableSeeder');\n\t\t$this->call('OfficalNoticePartsTableSeeder');\n\t}",
"public function run()\n {\n Model::unguard();\n\n $this->command->info('seed start!');\n\n // 省市县\n $this->call('RegionTableSeeder');\n // 用户、角色\n $this->call('UserTableSeeder');\n // 权限\n $this->call('PurviewTableSeeder');\n // 博文分类\n $this->call('CategoryTableSeeder');\n // 博文、评论、标签\n $this->call('ArticleTableSeeder');\n // 心情\n $this->call('MoodTableSeeder');\n // 留言\n $this->call('MessageTableSeeder');\n // 文件\n $this->call('StorageTableSeeder');\n\n $this->command->info('seed end!');\n }",
"public function run()\n {\n //系统\n $this->call(AdminTablesSeeder::class);\n $this->call(ConfigsSeeder::class);\n\n \n //用户\n $this->call(UsersSeeder::class);\n\n\n //司机\n $this->call(DriversSeeder::class);\n $this->call(DriverEquipmentsSeeder::class);\n\n\n //订单\n $this->call(OrdersSeeder::class);\n\n\n //其他\n $this->call(ArticlesSeeder::class);\n }",
"public function run()\n {\n $this->call('EstacionesSeeder');\n $this->call('RutasSeeder');\n $this->call('RutaEstacionSeeder');\n $this->call('CapacidadSeeder');\n //$this->call('VehiculosSeeder');\n //$this->call('TripulantesSeeder');\n }",
"public function run()\n {\n $this->call(UserRolesSeeder::class);\n $this->call(UserPermissionsSeeder::class);\n $this->call(UserSeeder::class);\n $this->call(EspecieSeeder::class);\n $this->call(MascotaSeeder::class);\n /*Mascota::factory(44)->create();*/\n }",
"public function run()\n {\n Model::unguard();\n foreach (glob(__DIR__ . '/seeds/*.php') as $filename) {\n require_once($filename);\n }\n // $this->call(UserTableSeeder::class);\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n// $this->call('CustomerTableSeeder');\n $this->call('PhotoTableSeeder');\n// $this->call('ProductTableSeeder');\n// $this->call('StaffTableSeeder');\n// $this->call('PasswordResetsTableSeeder');\n// $this->call('UsersTableSeeder');\n $this->call('CustomersTableSeeder');\n $this->call('EmployeesTableSeeder');\n $this->call('InventoryTransactionTypesTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrderDetailsStatusTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('InvoicesTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrdersStatusTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n\n $this->call('OrdersTaxStatusTableSeeder');\n $this->call('PrivilegesTableSeeder');\n $this->call('EmployeePrivilegesTableSeeder');\n $this->call('ProductsTableSeeder');\n $this->call('InventoryTransactionsTableSeeder');\n $this->call('PurchaseOrderDetailsTableSeeder');\n\n $this->call('PurchaseOrderStatusTableSeeder');\n $this->call('PurchaseOrdersTableSeeder');\n $this->call('SalesReportsTableSeeder');\n $this->call('ShippersTableSeeder');\n $this->call('StringsTableSeeder');\n $this->call('SuppliersTableSeeder');\n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n Model::reguard();\n }",
"public function run()\n {\n $this->call(UsersSeeder::class);\n $this->call(StarSeeder::class);\n $this->call(LevelsSeeder::class);\n $this->call(EnemyTypesSeeder::class);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->call(MoviesSeeder::class);\n }",
"public function run()\n {\n $this->call('UserSeed');\n $this->call('UsersSeed');\n $this->call('CategoriasSeed');\n $this->call('PromocionesSeed');\n $this->call('ActividadesSeed');\n $this->call('ClientesSeed');\n $this->call('ProductosSeed');\n $this->call('NotificacionesClienteSeed');\n $this->call('ActividadesUsuarioSeed');\n $this->call('VentasProductoSeed');\n $this->call('PromocionesProductoSeed');\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(AuthorsTableSeeder::class);\n $this->call(ItemsTableSeeder::class);\n $this->call(SubItemTableSeeder::class);\n $this->call(BooksTableSeeder::class);\n $this->call(AboutTableSeeder::class);\n $this->call(BlogTableSeeder::class);\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n $this->call([\n UserSeeder::class,\n MentorSeeder::class,\n MenteeSeeder::class,\n AdminSeeder::class,\n CourseSeeder::class,\n ModuleSeeder::class,\n VideoSeeder::class,\n discussionmentorSeeder::class,\n discussionadminSeeder::class,\n CompanySeeder::class,\n companyjobSeeder::class,\n ]); \n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->call(AdvertisementsTableSeeder::class);\n $this->call(AdPositionsTableSeeder::class);\n $this->call(CategoriesTableSeeder::class);\n $this->call(CollectorsTableSeeder::class);\n $this->call(CollectsTableSeeder::class);\n $this->call(FixturesTableSeeder::class);\n $this->call(LeaguesTableSeeder::class);\n $this->call(LiveMatchesTableSeeder::class);\n $this->call(MigrationsTableSeeder::class);\n $this->call(PostsTableSeeder::class);\n $this->call(ScoresTableSeeder::class);\n $this->call(TeamsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(VideosTableSeeder::class);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }",
"public function run()\n {\n $this->seedDataTypes();\n $this->seedDataRows();\n $this->seedPermissions();\n $this->seedMenus();\n }",
"public function run()\n {\n // required data\n $this->call(SettingsTableSeeder::class);\n $this->call(RoleSeeder::class);\n $this->call(TabSeeder::class);\n $this->call(ShortcutSeeder::class);\n $this->call(HomeConfigCategorySeeder::class);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n \t$this->call('RolTableSeeder');\n \t$this->call('UserTableSeeder');\t\t\n \t$this->call('UserProfileTableSeeder');\n \t$this->call('AppTableSeeder');\n \t$this->call('AppXUserTableSeeder');\n \t$this->call('ModuleTableSeeder');\n \t$this->call('OptionTableSeeder');\n \t$this->call('PermitTableSeeder');\n $this->call('DepartmentTableSeeder');\n $this->call('CityTableSeeder');\n $this->call('CategoryTableSeeder');\t\n $this->call('StageTableSeeder');\n $this->call('ConectorsTableSeeder');\n }",
"public function run()\n {\n $this->call(ArtistsTableSeeder::class);\n $this->call(GenreTableSeeder::class);\n $this->call(ProducerTableSeeder::class);\n $this->call(LabelTableSeeder::class);\n $this->call(UserTableSeeder::class);\n $this->call(AlbumTableSeeder::class);\n $this->call(CountryTableSeeder::class);\n $this->call(RegionTableSeeder::class);\n $this->call(TagTableSeeder::class);\n $this->call(BroadcasterTableSeeder::class);\n $this->call(PlayTableSeeder::class);\n }",
"public function run()\n {\n $this->call(AmenitiesSeeder::class);\n $this->call(ListingCategorySeeder::class);\n $this->call(BlogCategorySeeder::class);\n $this->call(CitySeeder::class);\n }",
"public function run()\n {\n $this->call(UserTableSeeder::class);\n $this->call(AboutSeeder::class);\n $this->call(ContactTableSeeder::class);\n $this->call(SliderSeeder::class);\n $this->call(TeamMemberSeeder::class);\n $this->call(BangabandhuInfoSeeder::class);\n }",
"public function run()\n {\n $this->call([\n LanguageTableSeeder::class,\n BusinessTableSeeder::class,\n SuperuserTableSeeder::class,\n ConsumerTableSeeder::class,\n DelivererTableSeeder::class,\n DelivererLocationTableSeeder::class,\n MenuTableSeeder::class,\n CategoryTableSeeder::class,\n CategoryNameTableSeeder::class,\n ItemTypeTableSeeder::class,\n ItemTypeNameTableSeeder::class,\n ItemTableSeeder::class,\n MenuNameTableSeeder::class,\n ItemNameTableSeeder::class,\n OrderTableSeeder::class,\n PaymentTableSeeder::class,\n ]);\n }",
"public function run()\n {\n foreach($this->seeds as $seed)\n {\n call_user_func([$this, $seed]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // Para que no verifique el control de claves foráneas al hacer el truncate haremos:\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n\t\t// Primero hacemos un truncate de las tablas para que no se estén agregando datos\n\t\t// cada vez que ejecutamos el seeder.\n\t\t//Foto::truncate();\n\t\t//Album::truncate();\n\t\t//Usuario::truncate();\n DB::table('users')->delete();\n DB::table('ciudades')->delete();\n DB::table('tiendas')->delete();\n DB::table('ofertas')->delete();\n DB::table('ventas')->delete();\n\n\n\t\t// Es importante el orden de llamada.\n\t\t$this->call('UserSeeder');\n $this->call('CiudadSeeder');\n\t\t$this->call('TiendaSeeder');\n $this->call('OfertaSeeder');\n $this->call('VentaSeeder');\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(OnemTableSeeder::class);\n $this->call(DurumTableSeeder::class);\n $this->call(YetkiTableSeeder::class);\n $this->call(BildirimTursSeeder::class);\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->call(EstateTableSeeder::class);\n $this->call(EstateImageTableSeeder::class);\n $this->call(EstateArticleTableSeeder::class);\n $this->call(EstateArticleImagesTableSeeder::class);\n $this->call(ArticleTableSeeder::class);\n $this->call(LinkageTokenTableSeeder::class);\n\n // mall\n $this->call(ShopBusinessTableSeeder::class);\n $this->call(ShopFloorTableSeeder::class);\n $this->call(ShopTableSeeder::class);\n $this->call(CommodityTableSeeder::class);\n $this->call(CommodityImageTableSeeder::class);\n\n // 电商推荐\n $this->call(LinkageRoleSeeder::class);\n }",
"public function run()\n {\n $this->call(BodypartSeeder::class);\n $this->call(ExerciseSeeder::class);\n $this->call(UserTableSeeder::class);\n $this->call(JournalExerciseSeeder::class);\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n factory(App\\Lead::class,150)->create()->each(function($u){\n $u->domains()->save(factory(App\\Domain::class)->make());\n })->each(function($u){\n $u->communicationValues()->save(factory(\\App\\CommunicationValue::class)->make());\n });\n\n $this->call(DomainsTableSeeder::class);\n\n $this->call(CommunicationValuesTableSeeder::class);\n\n $this->call(CommentsTableSeeder::class);\n\n $this->call(CommunicationRecordsTableSeeder::class);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->call(StartUpTableSeeder::class);\n $this->call(StartUpCategoryTableSeeder::class);\n $this->call(TechPostsTableSeeder::class);\n $this->call(TechCategoryTableSeeder::class);\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(EmotionsTableSeeder::class);\n\n $this->call(RoomsTableSeeder::class);\n $this->call(RoomUsersTableSeeder::class);\n $this->call(FilesTableSeeder::class);\n\n $this->call(MessengesTableSeeder::class);\n\n $this->call(PrivatesTableSeeder::class);\n \n $this->call(FriendShipTableSeeder::class);\n \n $this->call(NotiroomTableSeeder::class);\n $this->call(NotiprivateTableSeeder::class);\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(CvTableSeeder::class);\n $this->call(SkillTableSeeder::class);\n $this->call(CvSkillTableSeeder::class); \n $this->call(UniversitiesTableSeeder::class);\n $this->call(EducationTableSeeder::class);\n $this->call(CompaniesTableSeeder::class);\n $this->call(WorkExperincesTableSeeder::class);\n $this->call(PortfolioTableSeeder::class);\n $this->call(ReferencesTableSeeder::class);\n }",
"public function run()\n {\n $this->call('DatabaseSeeder');\n $this->call('DemoTimeGroupsTableSeeder');\n $this->call('DemoLeavesTableSeeder');\n $this->call('DemoLogSchedulesTableSeeder');\n $this->call('DemoLogSchedulePatternsTableSeeder');\n $this->call('DemoTimeAttributesTableSeeder');\n $this->call('DemoTimesheetsTableSeeder');\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->call('GendersTableSeeder');\n $this->call('CountriesTableSeeder');\n $this->call('CitiesTableSeeder');\n $this->call('RolesTableSeeder');\n $this->call('UsersTableSeeder');\n $this->call('StatusesTableSeeder');\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->call(EventStatusSeeder::class);\n $this->call(EventCategorySeeder::class);\n $this->call(SaleStatusSeeder::class);\n $this->call(TicketStatusSeeder::class);\n $this->call(TicketProfileSeeder::class);\n\n }",
"public function run()\n {\n $this->call(CollegesTableSeeder::class);\n $this->call(CoursesTableSeeder::class);\n $this->call(ScholarshipsTableSeeder::class);\n $this->call(MembersTableSeeder::class);\n// $this->call(LinksTableSeeder::class);\n// $this->call(InternshipsTableSeeder::class);\n }",
"public function run()\n {\n\n $this->call(NotificationsSeeder::class);\n factory(\\App\\Models\\City::class, 20)->create();\n $this->call(TransactionStatusSeeder::class);\n $this->call(LeadStatusesSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(UsersSeeder::class);\n $this->call(UserCitySeeder::class);\n $this->call(LeadRejectionReasonsSeeder::class);\n factory(\\App\\Models\\User::class, 4)->create();\n factory(\\App\\Models\\Lead::class, 100)->create();\n $this->call(LeadTypesSeeder::class);\n\n }",
"public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }",
"public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }",
"public function run()\n {\n $this->call(UserSeeder::class);\n $this->call(PostSeeder::class);\n\t\t$this->call(CommentSeeder::class);\n $this->call(AboutSeeder::class);\n $this->call(ContactSeeder::class);\n }",
"public function run()\n {\n $this->command->info('Data seeding started.');\n\n Model::unguard();\n\n $this->call([\n // UsersTableSeeder::class,\n // ElementTypeTableSeeder::class,\n // ElementsTableSeeder::class,\n // PlaylistTableSeeder::class,\n // PlaylistAndElementsTableSeeder::class,\n // TickerObjectTypeTableSeeder::class,\n // TickerGroupTableSeeder::class,\n // TickerObjectTableSeeder::class,\n // RadioTableSeeder::class,\n // SettingsTableSeeder::class,\n // RefineDataSeeder::class,\n WebRadioTableSeeder::class,\n ]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->call(AdminsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(CategoriesTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(VideosTableSeeder::class);\n $this->call(CategoryVideoTableSeeder::class);\n $this->call(GroupUserTableSeeder::class);\n $this->call(GroupVideoTableSeeder::class);\n $this->call(UserVideoTableSeeder::class);\n $this->call(DateVideoTableSeeder::class);\n }",
"public function run()\n {\n $this->call([\n UserTableSeeder::class,\n ProjectTableSeeder::class,\n TimelineTableSeeder::class,\n ExpertTableSeeder::class,\n ExpertRestTableSeeder::class,\n ReservationTableSeeder::class,\n PermissionTableSeeder::class,\n ]);\n }",
"public function run()\n {\n $this->call([\n LevelsTableSeeder::class,\n LocationsTableSeeder::class,\n UsersTableSeeder::class,\n UnitsTableSeeder::class,\n CategoriesTableSeeder::class,\n SubcategoriesTableSeeder::class,\n CategorySubcategoryTableSeeder::class,\n // ProductsTableSeeder::class,\n RegionsTableSeeder::class,\n DistrictsTableSeeder::class,\n WardsTableSeeder::class,\n UserWardTableSeeder::class,\n LocationUserTableSeeder::class,\n StatusesTableSeeder::class,\n TransactiontypesTableSeeder::class,\n ]);\n }",
"public function run()\n {\n Model::unguard();\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(EntrustTableSeeder::class);\n\n $this->call(AccounttypeSeeder::class);\n $this->call(AppUserTableSeeder::class);\n $this->call(AppEmailUserTableSeeder::class);\n\n\n $this->call(CountryTableSeeder::class);\n $this->call(CityTableSeeder::class);\n\n\n $this->call(PostTypeTableSeeder::class);\n $this->call(PostSubTypeTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(AppPostSolvedTableSeeder::class);\n\n\n $this->call(AppCommentTypeTableSeeder::class);\n // $this->call(AppCommentTableSeeder::class);\n // $this->call(AppSubCommentTableSeeder::class);\n\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }\n\n Model::reguard();\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->call(AdminTablesSeeder::class);\n\n $this->call(TemplatesTableSeeder::class);\n\n $this->call(ActivitiesSeeder::class);\n\n $this->call(AwardsSeeder::class);\n\n// $this->call(CertificatesSeeder::class);\n $this->call(AdminMenuTableSeeder::class);\n $this->call(ActivitiesTableSeeder::class);\n// $this->call(AwardsTableSeeder::class);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n \n $this->call(BooksTableSeeder::class);\n \n $this->call(BookUnitsTableSeeder::class);\n \n $this->call(BooksInHandsTableSeeder::class);\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n $this->call('UserDataSeeder');\n $this->call('PostDataSeeder');\n $this->call('CommentDataSeeder');\n }",
"public function run()\n {\n $this->call('FacultySeeder');\n $this->call('SpecialitySeeder');\n $this->call('PoliciesSeeder');\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n /* Curso::factory(8)->create(); */\n /* $this->call(CidepartamentoSeeder::class);\n $this->call(CategoriaSeeder::class);\n $this->call(GeneroSeeder::class); */\n\n /* $this->call(UserSeeder::class); */\n\n\n /* Estudiante::factory(20)->create(); */\n\n /* Profesore::factory(12)->create(); */\n\n\n /* $this->call(EstudianteSeeder::class); */\n /* $this->call(CursoSeeder::class); */\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(GuestsTableSeeder::class);\n $this->call(CategoriesTableSeeder::class);\n $this->call(StatesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(PanelsTableSeeder::class);\n $this->call(ComplaintsTableSeeder::class);\n }",
"public function run() {\n\n // seeder para insertar trabajos\n $this->call(LanaSeeder::class);\n\n // seeder para insertar usuarios\n $this->call(UsuariosSeeder::class);\n\n // seeder para introducir trabajadores\n $this->call(LangileaSeeder::class);\n\n //seeder para insertar informacion de las fotos\n $this->call(ArgazkiSeeder::class);\n\n //seeder para insertar informacion de las citas\n $this->call(ZitaSeeder::class);\n\n }",
"public function run()\n {\n $this->call(StaffsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(FreeTimesTableSeeder::class);\n $this->call(HolidaysTableSeeder::class);\n $this->call(SickDaysTableSeeder::class);\n $this->call(LieuHoursTableSeeder::class);\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(AccessesTableSeeder::class);\n $this->call(CategoriesTableSeeder::class);\n $this->call(ContentsTableSeeder::class);\n $this->call(ContentsCategoriesTableSeeder::class);\n $this->call(MediaTypesTableSeeder::class);\n $this->call(ContentsMediaTypesTableSeeder::class);\n $this->call(ContentsUsersTableSeeder::class);\n $this->call(DownloadsTableSeeder::class);\n $this->call(RegistrationRequestsTableSeeder::class);\n $this->call(UsersContentsTableSeeder::class);\n }",
"public function run()\n {\n Model::unguard();\n\n // Temporarily increase memory limit to 2048M\n //ini_set('memory_limit', '2048M');\n\n $this->call('UserDataSeeder');\n\n $this->call('VenueDataSeeder');\n $this->call('ProfileDataSeeder');\n $this->call('EventDataSeeder');\n\n $this->call('RolesSeeder');\n }",
"public function run()\n {\n\n $this->call(UsersTableSeeder::class);\n $this->call(StudentsTableSeeder::class);\n\n $this->call(SectionsTableSeeder::class);\n $this->call(SectionsTableHeaderFooterSeeder::class);\n $this->call(QuestionsTableSeeder::class);\n $this->call(AnswersTableSeeder::class);\n\n $this->call(LocationsTableSeeder::class);\n $this->call(WardsTableSeeder::class);\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->call(UserSeeder::class);\n $this->call(MonitorSeeder::class);\n }",
"public function run()\n {\n Model::unguard();\n\n $this->call(FirstAdminSeed::class);\n $this->call(UserTableSeed::class);\n $this->call(UserProfileTableSeed::class);\n $this->call(ProductoTableSeed::class);\n $this->call(ContactenosTableSeed::class);\n\n Model::reguard();\n }",
"public function run()\n {\n // Base things\n $this->call(UserTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(SchoolTableSeeder::class);\n $this->call(ClientTableSeeder::class);\n $this->call(StudentTableSeeder::class);\n \n \n // Products\n $this->call(DrinksTableSeeder::class);\n $this->call(FoodsTableSeeder::class);\n $this->call(MenusTableSeeder::class);\n \n // Pivot Tables\n $this->call(DrinkMenuTableSeeder::class);\n $this->call(FoodMenuTableSeeder::class);\n $this->call(ClientStudentTableSeeder::class);\n \n // Tables with dependencies\n $this->call(OrdersTableSeeder::class);\n $this->call(OrderablesTableSeeder::class);\n $this->call(CategorizablesTableSeeder::class);\n //$this->call(CartTableSeeder::class); -> replaced with Cart package from Crinsane for now\n \n\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n $this->call(PaisSeeder::class);\n $this->call(DepartamentoSeeder::class);\n $this->call(MunicipioSeeder::class);\n $this->call(PersonaSeeder::class);\n }",
"public function run()\n\t{\n\t\tModel::unguard();\n\n\t\t// $this->call('UserTableSeeder');\n\t\t$this->call('ArticlesSeeder');\n $this->call('CategoriesSeeder');\n $this->call('LangsSeeder');\n $this->call('UsersSeeder');\n $this->call('TextsSeeder');\n\n\t}",
"public function run()\n {\n $this->call('UsersTableSeeder');\n $this->call('TrucksTableSeeder');\n $this->call('BoxesTableSeeder');\n $this->call('TypesTableSeeder');\n $this->call('PartsTableSeeder');\n $this->call('SubpartsTableSeeder');\n // $this->call('BrandsTableSeeder');\n // $this->call('ServicesTableSeeder');\n // $this->call('OwnersTableSeeder');\n // $this->call('InspectionPointsTableSeeder');\n // $this->call('DriversTableSeeder');\n // $this->call('CoordinatorsTableSeeder');\n // $this->call('MechanicsTableSeeder');\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n $this->call([\n UserSeeder::class,\n LanguageSeeder::class,\n MenuKeywordSeeder::class,\n ContentOneGroupKeywordSeeder::class,\n ContentTwoGroupKeywordSeeder::class,\n ContentThreeGroupKeywordSeeder::class,\n ContentFourGroupKeywordSeeder::class,\n ContentFiveGroupKeywordSeeder::class,\n ContentSixGroupKeywordSeeder::class,\n FrontendOneGroupKeywordSeeder::class,\n FrontendTwoGroupKeywordSeeder::class,\n SectionSeeder::class,\n ]);\n }",
"public function run()\n {\n Model::unguard();\n\n $this->call(ConfigTableSeeder::class);\n $this->call(LanguagesTableSeeder::class);\n $this->call(LocalesTableSeeder::class);\n // $this->call(PackageTableSeeder::class);\n // $this->call(PageDesignTableSeeder::class);\n // if(env('APP_ENV', false) == 'demo') {\n // $this->call(UsersTableSeeder::class);\n // }\n // $this->call(CustomerGroupTableSeeder::class);\n \n // $this->call(TicketStatusTableSeeder::class);\n // $this->call(MailProviderTabelSeeder::class);\n $this->call(DepartmentTableSeeder::class);\n // $this->call(FrontEndTableSeeder::class);\n \n\n Model::reguard();\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->call(GrupoAtendimentoSeed::class);\n $this->call(NivelDificuldadeSeed::class);\n $this->call(PerfilSeed::class);\n $this->call(RegiaoCidadesSeed::class);\n $this->call(DepartamentoSeed::class);\n $this->call(UnidadeSeed::class);\n $this->call(UsuarioSeed::class);\n }",
"public function run()\n {\n $this->disableForeignKeys();\n\n\n $this->call(CountriesTableSeeder::class);\n $this->call(UserTableSeeder::class);\n $this->call(PermissionRoleTableSeeder::class);\n $this->call(UserRoleTableSeeder::class);\n $this->call(LabsTableSeeder::class);\n $this->call(ClinicNurseSeeder::class);\n\n $this->call(ClinicTableSeeder::class);\n $this->call(AppointmentTableSeeder::class);\n $this->call(UserSpecialtiesTableSeeder::class);\n\n $this->enableForeignKeys();\n }",
"public function run()\n {\n \t$this->call(ActivitiesTableSeeder::class);\n $this->call(ApplicantsTableSeeder::class);\n $this->call(AttendanceTableSeeder::class);\n $this->call(BusTableSeeder::class);\n $this->call(HiredDriversTableSeeder::class);\n $this->call(LeavesTableSeeder::class);\n $this->call(QuestionTableSeeder::class);\n $this->call(UserTableSeeder::class);\n //$this->call(ApplicantsTableSeeder::class);\n \t\n }",
"public function run()\n {\n /*factory(App\\User::class,50)->create();\n factory(App\\Forum::class,5)->create();\n factory(App\\Post::class,500)->create();\n factory(App\\Comment::class,50000)->create();*/\n $this->call([\n UserSeeder::class,\n ForumSeeder::class,\n PostSeeder::class,\n CommentSeeder::class\n ]);\n }",
"public function run()\n {\n DB::disableQueryLog();\n $this->call(UsersTableSeeder::class);\n $this->call(RolesAndPermissionsTableSeeder::class);\n $this->call(TasksSeeder::class);\n $this->call(SettingsTableSeeder::class);\n $this->call(NotificationsSeeder::class);\n DB::enableQueryLog();\n }"
] | [
"0.82469493",
"0.8173527",
"0.81639016",
"0.81597686",
"0.815316",
"0.81495345",
"0.81479573",
"0.81428665",
"0.81083155",
"0.81038576",
"0.8100934",
"0.80979717",
"0.80969536",
"0.80800205",
"0.8072971",
"0.8071952",
"0.80700403",
"0.8065878",
"0.8060468",
"0.80597067",
"0.8058325",
"0.8053558",
"0.80524266",
"0.8050611",
"0.80505663",
"0.8047489",
"0.8045046",
"0.8042296",
"0.80409193",
"0.80382645",
"0.80375874",
"0.8037035",
"0.80333006",
"0.80329645",
"0.8032842",
"0.80326915",
"0.80309796",
"0.802912",
"0.8027301",
"0.8026173",
"0.80246097",
"0.8024074",
"0.80234224",
"0.8022358",
"0.8021923",
"0.80196726",
"0.8019161",
"0.80179703",
"0.80150783",
"0.8012406",
"0.8010987",
"0.80105895",
"0.801034",
"0.8008499",
"0.8007723",
"0.8007413",
"0.8006646",
"0.80059856",
"0.800572",
"0.80051523",
"0.8004626",
"0.8004395",
"0.8001614",
"0.8000609",
"0.80003375",
"0.7998936",
"0.79984766",
"0.7998429",
"0.7998036",
"0.79946584",
"0.79941654",
"0.79935235",
"0.79924476",
"0.79920834",
"0.79881525",
"0.79876995",
"0.7987218",
"0.79870176",
"0.7986755",
"0.7986565",
"0.7985926",
"0.79855734",
"0.798491",
"0.7981082",
"0.7980616",
"0.79799527",
"0.7978348",
"0.797826",
"0.7975495",
"0.7975297",
"0.7975154",
"0.7974874",
"0.79742146",
"0.797394",
"0.7973823",
"0.79724216",
"0.7971959",
"0.7970408",
"0.79702795",
"0.79677844",
"0.79672015"
] | 0.0 | -1 |
this up() migration is autogenerated, please modify it to your needs | public function up(Schema $schema) : void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE planet (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(50) NOT NULL, description LONGTEXT NOT NULL, type VARCHAR(50) NOT NULL, diameter INT NOT NULL, image VARCHAR(100) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE activities ADD type VARCHAR(30) DEFAULT NULL, ADD description LONGTEXT DEFAULT NULL');
$this->addSql('ALTER TABLE cabin ADD description LONGTEXT NOT NULL, ADD number_of_people INT DEFAULT NULL, ADD area INT DEFAULT NULL');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function up();",
"abstract public function up();",
"abstract public function up();",
"abstract public function up();",
"public function up()\n {\n $this->execute(\"\n ALTER TABLE `tcmn_communication` \n CHANGE `tcmn_pprs_id` `tcmn_pprs_id` SMALLINT(5) UNSIGNED NULL COMMENT 'person',\n CHANGE `tcmn_tmed_id` `tcmn_tmed_id` TINYINT(4) UNSIGNED NULL COMMENT 'medijs';\n \");\n }",
"public function up()\n {\n // This migration was removed, but fails when uninstalling plugin\n }",
"public function up()\n {\n $this->execute(\"\n\n ALTER TABLE `cucp_user_company_position` \n ADD COLUMN `cucp_role` CHAR(20) NULL AFTER `cucp_name`;\n\n \");\n }",
"public function up()\n\t{\n\t\t$this->dbforge->add_column($this->table, $this->field);\n\t}",
"public function migrateUp()\n {\n //$this->migrate('up');\n $this->artisan('migrate');\n }",
"public function up()\n {\n dbexec('ALTER TABLE #__subscriptions_coupons\n ADD `created_on` datetime DEFAULT NULL AFTER `usage`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n \n dbexec('ALTER TABLE #__subscriptions_vats\n ADD `created_on` datetime DEFAULT NULL AFTER `data`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n }",
"public function up()\n\t{\n\t\t$this->dbforge->modify_column($this->table, $this->field);\n\t}",
"public function safeUp()\n {\n $this->createTable(\n $this->tableName,\n [\n 'id' => $this->primaryKey(),\n 'user_id' => $this->integer(). ' UNSIGNED NOT NULL' ,\n 'source' => $this->string()->notNull(),\n 'source_id' => $this->string()->notNull(),\n ],\n 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'\n );\n\n $this->addForeignKey('fk_social_auth_user_id_to_user_id', $this->tableName, 'user_id', '{{%user}}', 'id', 'CASCADE', 'CASCADE');\n }",
"public function up()\n {\n }",
"public function up()\n {\n $user = $this->table('products', ['collation' => 'utf8mb4_persian_ci', 'engine' => 'InnoDB']);\n $user\n ->addColumn('name', STRING, [LIMIT => 20])\n ->addColumn('count', STRING, [LIMIT => 75])\n ->addColumn('code', STRING, [LIMIT => 100])\n ->addColumn('buy_price', STRING, [LIMIT => 30])\n ->addColumn('sell_price', STRING, [LIMIT => 30])\n ->addColumn('aed_price', STRING, [LIMIT => 50])\n ->addTimestamps()\n ->save();\n }",
"public function up()\n {\n // Drop table 'table_name' if it exists\n $this->dbforge->drop_table('lecturer', true);\n\n // Table structure for table 'table_name'\n $this->dbforge->add_field(array(\n 'nip' => array(\n \t'type' => 'VARCHAR(16)',\n\t\t\t\t'null' => true,\n\t\t\t\t'unique' => true\n\t\t\t),\n 'nik' => array(\n \t'type' => 'VARCHAR(16)',\n\t\t\t\t'null' => false,\n\t\t\t\t'unique' => true\n\t\t\t),\n 'name' => array(\n 'type' => 'VARCHAR(24)',\n 'null' => false,\n ),\n\t\t\t'id_study_program' => array(\n\t\t\t\t'type' => 'VARCHAR(24)',\n\t\t\t\t'null' => false,\n\t\t\t)\n\n ));\n $this->dbforge->add_key('nik', true);\n $this->dbforge->create_table('lecturer');\n }",
"public function up()\n\t{\n\t\t// are not setting the foreign key constraint, to allow the examination module to work without the intravitreal\n\t\t// injection module being installed\n\t\t$this->addColumn('et_ophciexamination_injectionmanagementcomplex', 'left_treatment_id', 'int(10) unsigned');\n\t\t$this->addColumn('et_ophciexamination_injectionmanagementcomplex', 'right_treatment_id', 'int(10) unsigned');\n\t}",
"public function safeUp()\n {\n $this->createTable('tbl_hand_made_item',\n [\n \"id\" => \"int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY\",\n \"price\" => \"integer\",\n \"discount\" => \"integer\",\n \"preview_id\" => \"integer\",\n \"name\" => \"string\",\n \"description\" => \"text\",\n \"short_description\" => \"text\",\n \"slug\" => \"string\",\n ]\n );\n }",
"public function preUp()\n {\n }",
"public function up()\n\t{\n\t\t// create the purchase_order_details table\n\t\tSchema::create('purchase_order_details', function($table) {\n\t\t\t$table->engine = 'InnoDB';\n\t\t $table->increments('id');\t\t \n\t\t $table->integer('purchase_order_id')->unsigned();//->foreign()->references('id')->on('orders');\n\t\t $table->integer('product_id')->unsigned();//->foreign()->references('id')->on('products');\n\t\t $table->integer('quantity');\t\t \t \n\t\t $table->integer('created_by')->unsigned();//->foreign()->references('id')->on('users');\t\t \n\t\t $table->integer('updated_by')->unsigned();\n\t\t $table->timestamps();\t\t \n\t\t});\t\n\t}",
"public function up()\n {\n if (!$this->isEdu()) {\n return;\n }\n \n $this->edu_up();\n }",
"public function up()\n\t{\t\t\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'2',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\t\t\n\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'3',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\n\t\t//\n\t}",
"public function up()\n {\n $table = $this->table('qobo_translations_translations');\n $table->renameColumn('object_foreign_key', 'foreign_key');\n $table->renameColumn('object_model', 'model');\n $table->renameColumn('object_field', 'field');\n $table->renameColumn('translation', 'content');\n\n if (!$table->hasColumn('locale')) {\n $table->addColumn('locale', 'char', [\n 'default' => null,\n 'limit' => 6,\n ]);\n }\n $table->update();\n\n $table = TableRegistry::getTableLocator()->get(\"Translations.Translations\");\n $entities = $table->find()->all();\n foreach($entities as $entity) {\n $entity->setDirty('locale', true);\n $table->save($entity);\n }\n }",
"public function up()\n {\n $this->addForeignKey('tours_fk', 'tours', 'id', 'tour_to_hotel', 'tour_id');\n\n $this->addForeignKey('t2h_fkh', 'tour_to_hotel', 'hotel_id', 'hotels', 'id');\n $this->addForeignKey('t2h_fkt', 'tour_to_hotel', 'tour_id', 'tours', 'id');\n }",
"public function safeUp()\r\n {\r\n $this->createTable('tbl_job_application', array(\r\n 'id' => 'pk',\r\n 'job_id' => 'integer NOT NULL',\r\n 'user_id' => 'integer NULL',\r\n 'name' => 'string NOT NULL',\r\n 'email' => 'text NOT NULL',\r\n 'phone' => 'text NOT NULL',\r\n 'resume_details' => 'text NOT NULL',\r\n 'create_date' => 'datetime NOT NULL',\r\n 'update_date' => 'datetime NULL',\r\n ));\r\n }",
"public function up()\n {\n $fields = array(\n 'first_login' => array('type' => 'char', 'constraint' => '1', 'default' => '1'),\n );\n $this->dbforge->add_column('user', $fields);\n }",
"public function safeUp() {\n\n $this->createTable('word', [\n 'word_id' => Schema::TYPE_PK,\n 'word_lang_id' => $this->integer(),\n 'word_name' => $this->string(500) . ' NOT NULL',\n 'word_detais' => $this->string(1000),\n ]);\n\n // Add foreign key\n $this->addForeignKey('fk_language_word_1', 'word',\n 'word_lang_id', 'language', 'lang_id', 'CASCADE', 'NO ACTION');\n \n // Create index of foreign key\n $this->createIndex('word_lang_id_idx', 'word', 'word_lang_id');\n }",
"public function safeUp()\n {\n $this->alterColumn('item_keuangan', 'created_at', \"TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00'\");\n\n /* Tambah Field */\n $this->addColumn('item_keuangan', 'status', \"TINYINT(1) NOT NULL DEFAULT '1' COMMENT '0=tidak aktif; 1=aktif;' AFTER `jenis`\");\n }",
"public function up()\n {\n $this->addForeignKey(\n 'fk_category_product_from_category',\n 'category_product',\n 'category_id',\n 'category',\n 'id',\n 'NO ACTION',\n 'NO ACTION'\n );\n\n $this->addForeignKey(\n 'fk_category_product_from_product',\n 'category_product',\n 'product_id',\n 'product',\n 'id',\n 'NO ACTION',\n 'NO ACTION'\n );\n }",
"public function up()\n\t{\n\t\t$this->dropColumn('korzet','utca'); \n\t\t$this->addColumn('korzet','utca','string NOT NULL');\n\t}",
"public function up()\n {\n Schema::table($this->table, function (Blueprint $table) {\n // $table->bigInteger('user_id')->default(0)->after('id'); // Example\n $table->dropColumn([\n // 'user_id', // Example\n ]);\n });\n }",
"public function up()\n {\n // $this->fields()->create([]);\n // $this->streams()->create([]);\n // $this->assignments()->create([]);\n }",
"public function up()\n {\n $table = $this->table('admins');\n $table->addColumn('name', 'string')\n ->addColumn('role', 'string')\n ->addColumn('username', 'string')\n ->addColumn('password', 'string')\n ->addColumn('created', 'datetime')\n ->addColumn('modified', 'datetime', ['null' => true])\n ->create();\n\n\n $data = [ \n [\n 'name' => 'Pedro Santos', \n 'username' => '[email protected]',\n 'password' => '101010',\n 'role' => 'Suporte',\n 'modified' => false\n ],\n ];\n\n $adminTable = TableRegistry::get('Admins');\n foreach ($data as $value) {\n $adminTable->save($adminTable->newEntity($value));\n }\n }",
"public function up(): void\n {\n try {\n // SM: We NEVER delete this table.\n if ($this->db->tableExists('prom2_pages')) {\n return;\n }\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"CREATE TABLE `prom2_pages` (\n `cntPageID` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `txtRelativeURL` varchar(255) NOT NULL COMMENT 'Relative URL',\n `txtTitle` varchar(70) NOT NULL COMMENT 'Title',\n `txtContent` text NOT NULL COMMENT 'Content',\n `blnRobots_DoNotAllow` bit(1) NOT NULL DEFAULT b'1',\n PRIMARY KEY (`cntPageID`),\n UNIQUE KEY `txtRelativeURL` (`txtRelativeURL`),\n KEY `txtTitle` (`txtTitle`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }",
"public function up()\n\t{\n\t\t// Add data to committee-members\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Brian O\\'Sullivan',\n\t\t\t'role' => 'Chairman',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Anthony Barker',\n\t\t\t'role' => 'PRO',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\t\t\n\t}",
"public function up()\n {\n $this->query(\"UPDATE `subscription_types` SET `user_label` = `name` WHERE `user_label` = '' OR `user_label` IS NULL;\");\n\n $this->table('subscription_types')\n ->changeColumn('user_label', 'string', ['null' => false])\n ->update();\n }",
"public function safeUp()\n\t{\n $sql = <<<SQL\n alter table r add R8 inte;\nSQL;\n\t\t//$this->execute($sql);\n $sql = <<<SQL\n ALTER TABLE r ADD constraint FK_r8_elgz1 FOREIGN KEY (r8) REFERENCES elgz (elgz1) ON DELETE SET DEFAULT ON UPDATE CASCADE;\nSQL;\n //$this->execute($sql);\n\t}",
"public function up()\n\t{\n\t\techo $this->migration('up');\n\n\t\tci('o_role_model')->migration_add('Cookie Admin', 'Cookie Designer and Eater', $this->hash());\n\t\t\n\t\treturn true;\n\t}",
"public function up()\n {\n\t\t$this->addColumn('{{%user}}', 'is_super', Schema::TYPE_SMALLINT . \"(1) NULL DEFAULT '0' AFTER `status`\");\n\t\t\n\t\t//Add new column for Option Group table\n\t\t$this->addColumn('{{%option_group}}', 'option_type', Schema::TYPE_STRING . \"(25) NULL DEFAULT 'text' AFTER `title`\");\n\t\t\n\t\t//Add new column for Order table\n\t\t$this->addColumn('{{%order}}', 'is_readed', Schema::TYPE_SMALLINT . \"(1) NULL DEFAULT '0' AFTER `shipment_method`\");\n }",
"public function up()\n {\n $this->addColumn(\\backend\\models\\VodProfile::tableName(), 'language', \"char(5) not null default 'en-US'\");\n }",
"public function up()\n {\n if (!Schema::hasTable($this->table))\n Schema::create($this->table, function (Blueprint $table)\n {\n $table->integer('parent_id')->unsigned()->index();\n $table->foreign('parent_id')->references('id')->on('organisations')->onDelete('restrict');\n\n $table->integer('child_id')->unsigned()->index();\n $table->foreign('child_id')->references('id')->on('organisations')->onDelete('restrict');\n\n $table->primary(['parent_id','child_id'],'organisation_relations_primary');\n\n $table->timestamps();\n $table->softDeletes();\n\n $table->engine = 'InnoDB';\n });\n }",
"public function up(){\n $table = $this->table('users', array('id'=>false, 'primary_key'=>'id'));\n $table->addColumn('id', 'integer', array('identity'=>true, 'signed'=>false));\n $table->addColumn('email', 'string', array('limit'=>100));\n $table->save();\n }",
"public function up() { return $this->run('up'); }",
"public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'l_id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\t\t\t\t'model_id' => 'INT UNSIGNED NOT NULL',\n\t\t\t\t'lang_id' => 'VARCHAR(5) NULL DEFAULT NULL',\n\n\t\t\t\t// examples:\n\t\t\t\t'l_label' => 'VARCHAR(200) NULL DEFAULT NULL',\n\t\t\t\t'l_announce' => 'TEXT NULL DEFAULT NULL',\n\t\t\t\t//'l_content' => 'TEXT NULL DEFAULT NULL',\n\n\t\t\t\t'INDEX key_model_id_lang_id (model_id, lang_id)',\n\t\t\t\t'INDEX key_model_id (model_id)',\n\t\t\t\t'INDEX key_lang_id (lang_id)',\n\n\t\t\t\t'CONSTRAINT fk_principles_lang_model_id_to_main_model_id FOREIGN KEY (model_id) REFERENCES ' . $this->relatedTableName . ' (id) ON DELETE CASCADE ON UPDATE CASCADE',\n\t\t\t\t'CONSTRAINT fk_principles_lang_lang_id_to_language_id FOREIGN KEY (lang_id) REFERENCES {{language}} (code) ON DELETE RESTRICT ON UPDATE CASCADE',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}",
"public function up()\n\t{\n\t\t// create the purchase_orders table\n\t\tSchema::create('purchase_orders', function($table) {\n\t\t\t$table->engine = 'InnoDB';\n\t\t $table->increments('id');\n\t\t $table->string('order_number', 128);\n\t\t $table->string('approved',50);\n\t\t $table->date('purchase_date');\t\t \t \t\t \t \n\t\t $table->integer('created_by')->unsigned();//->foreign()->references('id')->on('users');\t\t \t\t \n\t\t $table->integer('updated_by')->unsigned();\t\t \n\t\t $table->timestamps();\t\t \n\t\t});\t\n\t}",
"public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'label' => 'VARCHAR(20) NULL DEFAULT NULL COMMENT \"language label\"',\n\t\t\t\t'code' => 'VARCHAR(5) NOT NULL COMMENT \"language code\"',\n\t\t\t\t'locale' => 'VARCHAR (5) NULL DEFAULT NULL',\n\n\t\t\t\t'visible' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not visible; 1 - visible\"',\n\t\t\t\t'published' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not published; 1 - published\"',\n\t\t\t\t'position' => 'INT UNSIGNED NOT NULL DEFAULT 0 COMMENT \"order by position DESC\"',\n\t\t\t\t'created' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - creation time\"',\n\t\t\t\t'modified' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - last entity modified time\"',\n\n\t\t\t\t'UNIQUE key_unique_code (code)',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\n\t\t$this->insert('{{language}}', array(\n\t\t\t'label' => 'рус',\n\t\t\t'code' => 'ru',\n\t\t\t'locale' => 'ru',\n\t\t));\n\t}",
"public function up()\n {\n $this->execute('Update goods SET price_rub = price WHERE currency_id = 1');\n }",
"public function up()\n\t{\n $this->dropColumn('calculo','fecha');\n\n //add column fecha in producto\n $this->addColumn('producto','fecha','date');\n\t}",
"public function up(){\n Schema::table('entries', function (Blueprint $table) {\n $table->renameColumn('value', 'entry_value');\n });\n }",
"public function safeUp() {\n\t$this->createTable('post', array(\n 'id' =>\"int(11) NOT NULL AUTO_INCREMENT\",\n 'created_on' =>\"int(11) NOT NULL\",\n 'title' =>\"varchar(255) NOT NULL\",\n 'context' =>\"text NOT NULL\",\n \"PRIMARY KEY (`id`)\"\n\t),'ENGINE=InnoDB DEFAULT CHARSET=utf8');\n }",
"public function getUpSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `department_summary`\n\n CHANGE `twitter_account` `positive_twitter_account` TEXT NOT NULL,\n\n ADD `negative_twitter_account` TEXT NOT NULL AFTER `positive_twitter_account`;\n\nALTER TABLE `tweets`\n\n CHANGE `positive_twitter_account` `twitter_account` TEXT NOT NULL,\n\n DROP `negative_twitter_account`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }",
"public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }",
"public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }",
"public function safeUp()\n {\n $this->addColumn('{{%organization}}', 'legal_entity', $this->string()->null());\n $this->addColumn('{{%organization}}', 'contact_name', $this->string()->null());\n $this->addColumn('{{%organization}}', 'about', $this->text()->null());\n $this->addColumn('{{%organization}}', 'picture', $this->string()->null());\n }",
"public function up()\n {\n $this->table('agent_order_consignee_address')\n ->addColumn(Column::string('order_number')->setUnique()->setComment('订单编号'))\n \t\t->addColumn(Column::integer('agent_id')->setComment('代理商ID'))\n\t ->addColumn(Column::integer('create_time')->setDefault(1)->setComment('创建时间'))\n\t \n\t ->addColumn(Column::string('consignee_name')->setComment('收货人姓名'))\n\t ->addColumn(Column::string('consignee_phone')->setComment('收货人电话'))\n\t ->addColumn(Column::string('province')->setComment('省份'))\n\t ->addColumn(Column::string('city')->setComment('城市'))\n\t ->addColumn(Column::string('area')->setComment('地区'))\n\t ->addColumn(Column::string('address')->setComment('收货人详细地址'))\n ->create(); \n }",
"public function up()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'l_id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\t\t\t\t'model_id' => 'INT UNSIGNED NOT NULL',\n\t\t\t\t'lang_id' => 'VARCHAR(5) NULL DEFAULT NULL',\n\n\t\t\t\t'l_value' => 'TEXT NULL DEFAULT NULL',\n\n\t\t\t\t'INDEX key_model_id_lang_id (model_id, lang_id)',\n\t\t\t\t'INDEX key_model_id (model_id)',\n\t\t\t\t'INDEX key_lang_id (lang_id)',\n\n\t\t\t\t'CONSTRAINT fk_configuration_lang_model_id_to_main_model_id FOREIGN KEY (model_id) REFERENCES ' . $this->relatedTableName . ' (id) ON DELETE CASCADE ON UPDATE CASCADE',\n\t\t\t\t'CONSTRAINT fk_configuration_lang_lang_id_to_language_id FOREIGN KEY (lang_id) REFERENCES {{language}} (code) ON DELETE RESTRICT ON UPDATE CASCADE',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}",
"public function safeUp()\r\n {\r\n $this->up();\r\n }",
"public function up(){\n // $table->table('kelas')\n // ->addColumn('Id', 'int', \"11\", false, null, true, true)\n // ->addColumn('NamaKelas', 'varchar', \"100\")\n // ->create();\n }",
"public function safeUp()\n\t{\n\t\t$this->createTable('pesquisa', array(\n\t\t\t'id' => 'serial NOT NULL primary key',\n\t\t\t'nome' => 'varchar',\n\t\t));\n\t}",
"public function safeUp()\n\t{\n\t\t$this->up();\n\t}",
"public function safeUp()\n {\n $this->up();\n }",
"public function safeUp()\n {\n $this->up();\n }",
"public function up(){\n // $table->table('kelassiswa')\n // ->addColumn('Id', 'int', \"11\", false, null, true, true)\n // ->addColumn('Kelas_Id', 'int', \"11\")\n // ->addColumn('Peserta_Id', 'int', \"11\")\n // ->addForeignKey('Peserta_Id', 'peserta', \"Id\", \"CASCADE\")\n // ->addForeignKey('Kelas_Id', 'kelas', \"Id\")\n // ->create();\n\n }",
"public function up()\n\t{\n\t\tSchema::table('project_sections', function($t){\n\t\t\t$t->integer('created_by_project_id')->nullable()->unsigned();\n\t\t\t$t->boolean('public')->default(0);\n\n $t->foreign('created_by_project_id')->references('id')->on('projects')->on_delete('SET NULL');\n\t\t});\n\t}",
"public function up(){\n\t\tglobal $wpdb;\n\n\t\t$wpdb->query('ALTER TABLE `btm_tasks` ADD COLUMN `last_run` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `date_created`;');\n\t}",
"public function up()\n {\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_create');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_mods');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_modpacks');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->boolean('solder_keys')->default(0);\n $table->boolean('solder_clients')->default(0);\n $table->boolean('modpacks_create')->default(0);\n $table->boolean('modpacks_manage')->default(0);\n $table->boolean('modpacks_delete')->default(0);\n });\n }",
"public function up()\n {\n Schema::dropIfExists('db_question_new.t_answer_type');\n Schema::create('db_question_new.t_answer_type', function (Blueprint $table){\n $table->increments('id');\n t_field($table->integer('answer_type_no'),\"答案序号\");\n t_field($table->string('name'),\"步骤名字\");\n t_field($table->integer('subject'),\"科目id\");\n t_field($table->integer('open_flag')->default(1),\"开启与否\");\n }); \n }",
"public function up()\n\t{\n\t\t$sql = \"create table tbl_rights\n\t\t\t\t(\n\t\t\t\t\titemname varchar(64) not null,\n\t\t\t\t\ttype integer not null,\n\t\t\t\t\tweight integer not null,\n\t\t\t\t\tprimary key (itemname),\n\t\t\t\t\tforeign key (itemname) references tbl_auth_item (name) on delete cascade on update cascade\n\t\t\t\t)\";\n\t\t $this->execute($sql);\n\t\t \n\t}",
"public function safeUp()\n\t{\n\t\t$this->createTable( 'tbl_auth_item', array(\n\t\t \"name\" => \"varchar(64) not null\",\n\t\t \"type\" => \"integer not null\",\n\t\t \"description\" => \"text\",\n\t\t \"bizrule\" => \"text\",\n\t\t \"data\" => \"text\",\n\t\t \"primary key (name)\",\n\t\t));\n\n\t\t$this->createTable(\"tbl_auth_item_child\", array(\n \t\t\"parent\" => \" varchar(64) not null\",\n\t\t\"child\" => \" varchar(64) not null\",\n \t\t\"primary key (parent,child)\",\n\t\t));\n\n\t\t$this->createTable(\"tbl_auth_assignment\",array(\n \t\t\"itemname\" => \"varchar(64) not null\",\n \t\t\"userid\" => \"varchar(64) not null\",\n \t\t\"bizrule\" => \"text\",\n \t\t\"data\"\t => \"text\",\n \t\t\"primary key (itemname,userid)\",\n\t\t));\n\n\t\t$this->addForeignKey('fk_auth_item_child_parent','tbl_auth_item_child','parent','tbl_auth_item','name','CASCADE','CASCADE');\n\t\t$this->addForeignKey('fk_auth_assignment_itemname','tbl_auth_assignment','itemname','tbl_auth_item','name');\n\t\t$this->addForeignKey('fk_auth_assignment_userid','tbl_auth_assignment','userid','tbl_user','id');\n\t}",
"public function up()\n {\n // add foreign key for table `articles`\n $this->addForeignKey(\n 'fk-comments-article_id',\n 'comments',\n 'article_id',\n 'article',\n 'id'\n );\n }",
"public function safeUp()\r\n\t{\r\n\t\t$this->up();\r\n\t}",
"public function up()\n {\n\n $tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\n $this->createTable($this->createTableName, [\n 'id' => $this->primaryKey(),\n 'name' => $this->string()->notNull(),\n 'type' => $this->integer(1)->notNull(),\n 'location' => $this->text()->defaultValue(null),\n 'description' => $this->text()->defaultValue(null),\n 'created_by' => $this->integer()->notNull(),\n 'start_at' => $this->integer()->defaultValue(null),\n 'active' => $this->boolean()->defaultValue(true),\n\n ],$tableOptions);\n\n\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n\n $moduleInvite = Module::findOne(['name' => 'Actioncalendar', 'slug' => 'actioncalendar']);\n if(empty($moduleInvite)) {\n $this->batchInsert('{{%module}}', ['parent_id', 'name', 'slug', 'visible', 'sorting'], [\n [null, 'Actioncalendar', 'actioncalendar', 1, 22],\n ]);\n }\n\n }",
"public function up()\n\t{\n\t\tSchema::table('user_hasil', function($table)\n\t\t{\n\t\t\t$table->create();\n\t\t\t$table->integer('user_id');\n\t\t\t$table->string('grade', 2);\n\t\t\t$table->decimal('hasil', 5, 2);\n\t\t\t$table->year('tahun');\n\t\t\t$table->timestamps();\n\n\t\t\t$table->foreign('user_id')->references('id')->on('users')->on_update('cascade');\n\t\t});\n\t}",
"public function safeUp()\r\n {\r\n $tableOptions = null;\r\n if ($this->db->driverName === 'mysql') {\r\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';\r\n }\r\n\r\n $this->createTable('{{%contact_msg}}', [\r\n 'id' => Schema::TYPE_PK,\r\n 'from_email' => Schema::TYPE_STRING . \"(320) NOT NULL\",\r\n 'to_email' => Schema::TYPE_STRING . \"(320) NULL\",\r\n 'subject' => Schema::TYPE_STRING . \"(300) NOT NULL\",\r\n 'text' => Schema::TYPE_TEXT,\r\n 'viewed' => Schema::TYPE_BOOLEAN . \"(1) NOT NULL DEFAULT '0'\",\r\n 'created_at' => Schema::TYPE_TIMESTAMP . \" NULL\",\r\n 'updated_at' => Schema::TYPE_TIMESTAMP . \" NULL\",\r\n ], $tableOptions);\r\n }",
"public function up()\n {\n $this->alterColumn('{{%hystorical_data}}', 'project_id', $this->integer());\n\n $this->dropForeignKey('fk-hystorical_data-project_id',\n '{{%hystorical_data}}');\n\n $this->addForeignKey(\n 'fk-hystorical_data-project_id',\n '{{%hystorical_data}}',\n 'project_id',\n '{{%projects}}',\n 'id',\n 'SET NULL'\n );\n }",
"public function up()\n\t{\n\t\tSchema::create('flows_steps', function($table) {\n\n\t\t\t$table->engine = 'InnoDB';\n\n\t\t $table->increments('stepid');\n\t\t $table->integer('flowid');\n\t\t $table->string('step', 100);\n\t\t $table->integer('roleid');\n\t\t $table->integer('parentid');\n\t\t $table->integer('state');\n\t\t $table->integer('page');\n\t\t $table->integer('condition2');\n\t\t $table->timestamps();\n\n\t\t});\n\t}",
"public function safeUp()\n {\n $this->createTable('site_phrase', array(\n 'site_id' => self::MYSQL_TYPE_UINT,\n 'phrase' => 'string NOT NULL',\n 'hash' => 'varchar(32)',\n 'price' => 'decimal(10,2) NOT NULL',\n 'active' => self::MYSQL_TYPE_BOOLEAN,\n ));\n\n $this->addForeignKey('site_phrase_site_id', 'site_phrase', 'site_id', 'site', 'id', 'CASCADE', 'RESTRICT');\n }",
"public function up()\n\t{\n\t\tSchema::table('devices', function($table)\n\t\t{\n\t\t\t$table->string('uuid')->unique;\n\t\t\t$table->drop_column('uid');\n\t\t});\n\t}",
"public function up()\n\t{\n\t\t$this->execute(\"\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.*', 0, 'Edit invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.View', 0, 'View invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.*', 0, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.View', 0, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitem` VALUES('InvoiceEdit', 2, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('InvoiceView', 2, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FiitInvoiceItem.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FiitInvoiceItem.View');\n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FinvInvoice.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FinvInvoice.View');\n \");\n\t}",
"public function up()\n {\n $this->createTable('post',[\n 'id' => $this->primaryKey(),\n 'author_id' => $this->integer(),\n 'title' => $this->string(255)->notNull()->unique(),\n 'content' => $this->text(),\n 'published_at' => $this->dateTime()->defaultExpression('CURRENT_TIMESTAMP'),\n 'updated_at' => $this->dateTime()->defaultExpression('CURRENT_TIMESTAMP'),\n 'status' => \"ENUM('draft','published')\",\n 'image' => $this->string(255)\n ]); \n\n $this->addForeignKey(\n 'fk_post_author_id',\n 'post',\n 'author_id',\n 'user',\n 'id',\n 'CASCADE',\n 'NO ACTION'\n );\n }",
"public function up()\n\t{\n// $import->import();\n\t}",
"public function up()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{rights}}\")){\n\t\t\t$this->dropTable(\"authItem\");\n\t\t}\n\n\t\t$this->createTable(\"{{rights}}\", array(\n\t\t\t\"itemname\" => \"varchar(64) CHARACTER SET UTF8 NOT NULL\",\n\t\t\t\"type\"\t => \"int not null\",\n\t\t\t\"weight\" => \"int not null\",\n\t\t\t\"PRIMARY KEY (itemname)\"\n\t\t\t));\n\t}",
"public function up() {\r\n\t\t// UP\r\n\t\t$column = parent::Column();\r\n\t\t$column->setName('id')\r\n\t\t\t\t->setType('biginteger')\r\n\t\t\t\t->setIdentity(true);\r\n\t\tif (!$this->hasTable('propertystorage')) {\r\n\t\t\t$this->table('propertystorage', [\r\n\t\t\t\t\t\t'id' => false,\r\n\t\t\t\t\t\t'primary_key' => 'id'\r\n\t\t\t\t\t])->addColumn($column)\r\n\t\t\t\t\t->addColumn('path', 'text', ['limit' => 1024])\r\n\t\t\t\t\t->addColumn('name', 'text', ['limit' => 100])\r\n\t\t\t\t\t->addColumn('valuetype', 'integer',[])\r\n\t\t\t\t\t->addColumn('value', 'text', [])\r\n\t\t\t\t\t->create();\r\n\t\t}\r\n\t}",
"public function up()\n {\n $perfis = [\n [\n 'id' => 1,\n 'perfil' => 'Genérico',\n 'ativo' => 1\n ]\n ];\n\n $this->insert('singular_perfil', $perfis);\n\n $usuarios = [\n [\n 'id' => 1,\n 'nome' => 'Singular Framework',\n 'login' => 'singular',\n 'senha' => 'singular',\n 'perfil_id' => 1\n ]\n ];\n\n $this->insert('singular_usuario', $usuarios);\n }",
"public function safeUp()\n {\n $this->createTable('user', array(\n 'name' => 'string',\n 'username' => 'string NOT NULL',\n 'password' => 'VARCHAR(32) NOT NULL',\n 'salt' => 'VARCHAR(32) NOT NULL',\n 'role' => \"ENUM('partner', 'admin')\"\n ));\n }",
"public function up()\n\t{\n\t\t$demoUser = new User();\n\t\t$demoUser->username = \"demo\";\n\t\t$demoUser->email = '[email protected]';\n\t\t$demoUser->password = 'password';\n\t\t$demoUser->create_time = new CDbExpression('NOW()');\n\t\t$demoUser->update_time = new CDbExpression('NOW()');\n\n\t\t$demoUser->save();\n\n\t\t$adminUser = new User();\n\t\t$adminUser->username = \"admin\";\n\t\t$adminUser->email = '[email protected]';\n\t\t$adminUser->password = 'password';\n\t\t$adminUser->create_time = new CDbExpression('NOW()');\n\t\t$adminUser->update_time = new CDbExpression('NOW()');\n\n\t\t$adminUser->save();\n\n\t}",
"public function safeUp()\n {\n $tables = Yii::$app->db->schema->getTableNames();\n $dbType = $this->db->driverName;\n $tableOptions_mysql = \"CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB\";\n\n /* MYSQL */\n if (!in_array('question_tag', $tables)) {\n if ($dbType == \"mysql\") {\n $this->createTable('{{%question_tag}}', [\n 'question_id' => 'INT(11) NOT NULL',\n 'tag_id' => 'INT(11) NOT NULL',\n ], $tableOptions_mysql);\n }\n }\n }",
"public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t'like',\n\t\t\tarray(\n\t\t\t\t'id'=>'int(11) UNSIGNED NOT NULL AUTO_INCREMENT',\n\t\t\t\t'user_id' => 'int(11) UNSIGNED NOT NULL',\n\t\t\t\t'post_id' => 'int (11) NOT NULL',\n\t\t\t\t'status' => 'TINYINT(1)',\n\t\t\t\t'created_at' => 'int(11)',\n\t\t\t\t'updated_at' => 'int(11)',\n\t\t\t\t'PRIMARY KEY (id)',\n\t\t\t\t),\n\t\t\t'ENGINE=InnoDB'\n\n\t\t\t);\n\t}",
"public function up()\n\t{\n\t\tSchema::table('entries', function($table) {\n $table->create();\n $table->increments('id');\n $table->string('title', 128);\n $table->string('body');\n $table->integer('users_id')->unsigned();\n $table->index('users_id');\n $table->integer('last_edited_by');\n $table->foreign('users_id')->references('id')->on('users')->on_delete('no action');\n $table->timestamps();\n });\n\t}",
"public function up()\n {\n $this->alterColumn(\\app\\models\\EmailImportLead::tableName(), 'password', $this->string()->null());\n $this->alterColumn(\\app\\models\\EmailImportLead::tableName(), 'status', $this->integer()->null());\n }",
"public function up()\n {\n\t\t$tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\t\t\n\t\t$TABLE_NAME = 'HaberDeneme12';\n $this->createTable($TABLE_NAME, [\n 'HaberID' => $this->integer(10)->notNull(),\n 'Kategori' => $this->string(12)->notNull(),\n 'Baslik' => $this->string(128)->notNull(),\n 'Ozet' => $this->text()->notNull(),\n 'Detay' => $this->text()->notNull(),\n 'Resim' => $this->text()->notNull(),\n 'EklenmeTarihi' => $this->date(),\n 'GuncellenmeTarihi' => $this->date()\n ], $tableOptions);\n\t\t\n\t\t\n\t\t$TABLE_NAME = 'HaberKategoriDeneme12';\n\t\t $this->createTable($TABLE_NAME, [\n 'KategoriID' => $this->integer(10)->notNull(),\n 'Kategori' => $this->string(20)->notNull()\n ], $tableOptions);\n\t\t\n }",
"public function up()\n\t{\n\t\t$fields = array(\n \"`piezas` DECIMAL(3,2) DEFAULT NULL\",\n\n\t\t);\n\t\t$this->dbforge->add_column('rel_monto_servicios', $fields);\n\n\t}",
"public function up()\n {\n $this->insert('key_value', [\n 'key' => 'day_feed_count_dnr',\n 'value' => '15',\n ]);\n }",
"public function up()\n {\n // 创建操作记录表\n $tables = $this->table('history');\n // 用户动作\n $tables->addColumn('action', 'string', ['limit' => 20])\n ->addColumn('ip', 'string', ['limit' => 129])\n // 建立用户\n ->addColumn('user_id', 'integer')\n // 登录时间\n ->addColumn('operation_time', 'datetime')\n // 操作详情\n ->addColumn('desc', 'string',['limit'=>500,'null' => true])\n ->create();\n }",
"public function up()\n {\n $table = $this->table('vehicle_model_suggestions');\n\n if (!$table->exists()) {\n $table\n ->addPrimaryKey('id')\n ->addColumn('vehicle_id', 'integer', ['null' => false])\n ->addColumn('vehicle_model_id', 'integer', ['null' => false])\n ->addColumn('suggestion', 'text')\n ->addTimestamps()\n ->addColumn('deleted_at', 'datetime')\n ->create();\n }\n }",
"public function safeUp()\n {\n $this->insert('category',['name'=>'Uncategorized', 'slug'=>'uncategorized', 'description'=>'Default Category', 'created_at'=> new Expression('NOW()'),\n 'updated_at'=> new Expression('NOW()')]);\n $this->insert('user',['username'=>'Administrator', 'password_hash'=>'$2y$13$6yoLjvVORp/7EO1u8phYTuWYzhMSM4LVVsebZgcqEKj/EQLvo5nJK',\n 'email'=>'[email protected]',\n 'created_at'=> new Expression('NOW()'),\n 'updated_at'=> new Expression('NOW()'),\n 'status'=>1\n ]\n );\n }",
"public function safeUp()\n {\n $this->createTable($this->tableName, [\n 'post_id' => $this->bigInteger()->notNull(),\n 'category_id' => $this->bigInteger()->notNull(),\n ]);\n\n $this->addForeignKey('post_category_post_id_fk', $this->tableName, 'post_id', '{{%post}}', 'id', 'CASCADE', 'CASCADE');\n $this->addForeignKey('post_category_category_id_fk', $this->tableName, 'category_id', '{{%category}}', 'id', 'CASCADE', 'CASCADE');\n }",
"public function up()\n {\n Schema::table('categories', function(Blueprint $table)\n {\n $table->integer('parent_id', false, true)->nullable()->after('cat_order');\n });\n }",
"public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'application_id' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Ид приложения\"',\n\n\t\t\t\t'message' => 'TEXT NOT NULL DEFAULT \"\" COMMENT \"Оригинал\"',\n\t\t\t\t'category' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Категория\"',\n\t\t\t\t'language' => 'VARCHAR(5) NOT NULL DEFAULT \"\" COMMENT \"Язык\"',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}",
"public function up()\n\t{\n\t\t//\n\t\tSchema::create('options',function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->boolean('activate_pn');\n\t\t\t$table->string('basic_name');\n\t\t\t$table->string('basic_pass');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\t$o = new Option;\n\t\t$o->activate_pn = 0;\n\t\t$o->save();\n\t}",
"public function up() {\n\t\t$this->dbforge->add_field(array(\n\t\t\t'id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t\t'unsigned' => TRUE,\n\t\t\t\t'auto_increment' => TRUE\n\t\t\t),\n\t\t\t'name' => array(\n\t\t\t\t'type' => 'VARCHAR',\n\t\t\t\t'constraint' => '100',\n\t\t\t),\n\t\t\t'path' => array(\n\t\t\t\t'type' => 'VARCHAR',\n\t\t\t\t'constraint' => '100',\n\t\t\t)\n\t\t));\n\t\t$this->dbforge->add_key('id', TRUE);\n\t\t$this->dbforge->add_key('path');\n\t\t$this->dbforge->create_table('categories');\n\n\t\t// Table structure for table 'event_categories'\n\t\t$this->dbforge->add_field(array(\n\t\t\t'event_id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t),\n\t\t\t'category_id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t\t'unsigned' => TRUE,\n\t\t\t),\n\t\t));\n\t\t$this->dbforge->add_key('event_id', TRUE);\n\t\t$this->dbforge->add_key('category_id', TRUE);\n\t\t$this->dbforge->create_table('event_categories');\n\t}",
"public function up()\n\t{\n Laravel\\Database\\Schema::create(\"orbs\", function($table){\n $table->increments(\"id\");\n $table->string(\"name\");\n $table->string(\"description\");\n $table->integer(\"coins\");\n $table->integer(\"points\");\n $table->integer(\"min_level\");\n $table->integer(\"max_level\");\n $table->integer(\"owner_character\");\n $table->integer(\"acquisition_time\");\n $table->integer(\"last_attacker\");\n $table->integer(\"last_attack_time\");\n $table->string(\"image\");\n });\n\t}"
] | [
"0.80062366",
"0.79145443",
"0.79145443",
"0.79145443",
"0.7572342",
"0.756089",
"0.75283176",
"0.7498379",
"0.7493237",
"0.7453656",
"0.74463314",
"0.7433381",
"0.74307704",
"0.7427088",
"0.741794",
"0.73779047",
"0.7374933",
"0.7370453",
"0.73637444",
"0.73505706",
"0.7329024",
"0.7313519",
"0.7298817",
"0.72950184",
"0.72917736",
"0.7291469",
"0.72913444",
"0.72849613",
"0.72839737",
"0.7272078",
"0.7271878",
"0.72659117",
"0.7262893",
"0.7261672",
"0.7256839",
"0.72505474",
"0.7249633",
"0.72441125",
"0.724062",
"0.72376186",
"0.7218244",
"0.72177947",
"0.72046006",
"0.7203395",
"0.7196059",
"0.7191219",
"0.7189963",
"0.7177052",
"0.71761394",
"0.7167738",
"0.7164105",
"0.7164105",
"0.7159096",
"0.7147647",
"0.7136521",
"0.7129768",
"0.7124664",
"0.7123368",
"0.71168584",
"0.7104628",
"0.7104628",
"0.7104618",
"0.7097006",
"0.70931643",
"0.70886755",
"0.7087018",
"0.7086326",
"0.70830804",
"0.70829463",
"0.70780045",
"0.70702124",
"0.70690626",
"0.7066111",
"0.7062268",
"0.7058938",
"0.705882",
"0.70556235",
"0.70549136",
"0.7054758",
"0.70498437",
"0.70483595",
"0.7047308",
"0.7045881",
"0.70445794",
"0.7043173",
"0.703882",
"0.7038126",
"0.703674",
"0.7033728",
"0.7032356",
"0.7031423",
"0.70257956",
"0.70142514",
"0.70101255",
"0.7006208",
"0.6988486",
"0.6984963",
"0.69629973",
"0.69612974",
"0.69587934",
"0.6957519"
] | 0.0 | -1 |
this down() migration is autogenerated, please modify it to your needs | public function down(Schema $schema) : void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE planet');
$this->addSql('ALTER TABLE activities DROP type, DROP description');
$this->addSql('ALTER TABLE cabin DROP description, DROP number_of_people, DROP area');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function down()\n {\n //add your migration here \n }",
"public function down()\n {\n //add your migration here\n }",
"public function down()\n\t{\n $this->dropColumn('producto','fecha');\n\n //add column fecha in producto\n $this->addColumn('calculo','fecha','date');\n\t}",
"public function down()\n {\n \t\n \t$this->createTable('os', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n \t$this->insert('os', ['id' => 1, 'name' => 'Any']);\n \t$this->insert('os', ['id' => 2, 'name' => 'CentOS']);\n \t$this->insert('os', ['id' => 3, 'name' => 'RHEL']);\n \t$this->insert('os', ['id' => 4, 'name' => 'Fedora']);\n \t \n \t$this->createTable('os_bit', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n\n return false;\n }",
"public function down()\n {\n //Schema::dropIfExists('c');//回滚时执行\n\n }",
"public function down()\n {\n $this->dbforge->drop_column('user', 'created_at');\n }",
"public function down()\n {\n $this->dropForeignKey(\n 'fk-video-blog_id',\n 'video'\n );\n\n\n echo \"m160820_150846_video_create reverted.\\n\";\n\n }",
"public function down()\n\t{\nDB::query(\n\"drop table haal;\");\nDB::query(\n\"drop table kandidaat;\");\nDB::query(\n\"drop table haaletaja;\");\nDB::query(\n\"drop table partei;\");\nDB::query(\n\"drop table valimisringkond;\");\n\t}",
"public function down()\n\t{\n\t\t// Remove data from committee_members\n\t\tDB::table('committee_members')->where('id', '<', 3)->delete();\t\n\t}",
"public function down(){\n $this->dropTable('users');\n }",
"public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `department_summary`\n\n CHANGE `positive_twitter_account` `twitter_account` TEXT NOT NULL,\n\n DROP `negative_twitter_account`;\n\nALTER TABLE `tweets`\n\n CHANGE `twitter_account` `positive_twitter_account` TEXT NOT NULL,\n\n ADD `negative_twitter_account` INTEGER NOT NULL AFTER `quality_tweet`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }",
"public function down()\n {\n Schema::table('attachments', function(Blueprint $table) {\n\n $table->dropColumn('viewable_id');\n $table->dropColumn('viewable_type');\n\n\n });\n }",
"public function down()\n\t{\n\t\t//Schema::drop('purchase_order_details');\n\t}",
"public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nDROP TABLE IF EXISTS `movimiento`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }",
"public function down()\n\t{\n//\t\t$this->dbforge->drop_table('blog');\n\n//\t\t// Dropping a Column From a Table\n\t\t$this->dbforge->drop_column('categories', 'icon');\n\t}",
"public function down()\n\t{\n\t\t// nothing to do here.\n\t}",
"public function down(){\r\n $this->dbforge->drop_table('users'); //eliminacion de la tabla users\r\n }",
"public function down()\n\t{\n\t\tSchema::drop('student');\n\t\t//\n\t}",
"public function down()\n{\n\nSchema::drop('event_user');\nSchema::drop('events');\nSchema::drop('file');\nSchema::drop('file_ref');\nSchema::drop('groups');\nSchema::drop('project_user');\nSchema::drop('projects');\nSchema::drop('quicknote');\nSchema::drop('subtasks');\nSchema::drop('task_user');\nSchema::drop('tasks');\nSchema::drop('throttle');\nSchema::drop('timesheet');\nSchema::drop('todos');\nSchema::drop('user_profile');\nSchema::drop('users');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\n\n}",
"public function down() \n {\n \n }",
"public function down()\n\t{\n\t}",
"public function down()\n\t{\n\t}",
"public function down()\n\t{\n\t\t//\n\t}",
"public function down()\n\t{\n\t\t//\n\t}",
"public function down()\n\t{\n\t\t//\n\t}",
"public function down()\n {\n $this->table('contents')->drop()->save();\n }",
"public function down()\n\t{\n\t\tSchema::drop('education');\n\t}",
"public function down()\n\t{\n\t\tSchema::drop('l_wardrobe_table');\n\t}",
"public function down()\n\t{\n\t\techo $this->migration('down');\n\n\t\tci('o_role_model')->migration_remove($this->hash());\n\t\t\n\t\treturn true;\n\t}",
"public function safeDown()\n\t{\n $sql=\" ALTER TABLE `tbl_venta` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n //quitando la columna pto_venta de tbl_empleado\n $sql=\" ALTER TABLE `tbl_empleado` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n\t}",
"public function down()\n {\n\tSchema::drop('quizzes');\n }",
"public function down()\n {\n $this->output->writeln('Down migration is not available.');\n }",
"public function down()\n {\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=0');\n\n $this->executeSQL('DROP TABLE link');\n $this->executeSQL('DROP TABLE link_category');\n\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=1');\n }",
"public function down ()\n {\n }",
"abstract public function down();",
"abstract public function down();",
"abstract public function down();",
"public function down()\n {\n // This migration was removed, but fails when uninstalling plugin\n }",
"public function down()\r\n {\r\n $this->dbforge->drop_table('users');\r\n }",
"public function down() {\n\n\t}",
"public function down()\n {\n $this->dbforge->drop_table('lecturer', true);\n }",
"public function down()\n\t{\n\t\tSchema::drop('flows_steps');\n\t}",
"public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE galaxiee (id INT AUTO_INCREMENT NOT NULL, idu_id INT NOT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_8576D2AF376A6230 (idu_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE trou_noir (id INT AUTO_INCREMENT NOT NULL, id_g_id INT DEFAULT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_AB27242D95951086 (id_g_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE galaxiee ADD CONSTRAINT FK_8576D2AF376A6230 FOREIGN KEY (idu_id) REFERENCES univers (id)');\n $this->addSql('ALTER TABLE trou_noir ADD CONSTRAINT FK_AB27242D95951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('DROP TABLE trounoir');\n $this->addSql('ALTER TABLE galaxie DROP FOREIGN KEY FK_1C880711376A6230');\n $this->addSql('DROP INDEX IDX_1C880711376A6230 ON galaxie');\n $this->addSql('ALTER TABLE galaxie CHANGE idu_id id_u_id INT NOT NULL');\n $this->addSql('ALTER TABLE galaxie ADD CONSTRAINT FK_1C8807116F858F92 FOREIGN KEY (id_u_id) REFERENCES univers (id)');\n $this->addSql('CREATE INDEX IDX_1C8807116F858F92 ON galaxie (id_u_id)');\n $this->addSql('ALTER TABLE planete DROP FOREIGN KEY FK_490E3E5712013DEC');\n $this->addSql('DROP INDEX IDX_490E3E5712013DEC ON planete');\n $this->addSql('ALTER TABLE planete ADD id_s_id INT NOT NULL, ADD nb_sattelite INT NOT NULL, DROP ids_id, DROP nb_satelite');\n $this->addSql('ALTER TABLE planete ADD CONSTRAINT FK_490E3E574AEED04E FOREIGN KEY (id_s_id) REFERENCES systeme (id)');\n $this->addSql('CREATE INDEX IDX_490E3E574AEED04E ON planete (id_s_id)');\n $this->addSql('ALTER TABLE systeme DROP FOREIGN KEY FK_95796DE3CD7AFD24');\n $this->addSql('DROP INDEX IDX_95796DE3CD7AFD24 ON systeme');\n $this->addSql('ALTER TABLE systeme CHANGE idg_id id_g_id INT NOT NULL');\n $this->addSql('ALTER TABLE systeme ADD CONSTRAINT FK_95796DE395951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('CREATE INDEX IDX_95796DE395951086 ON systeme (id_g_id)');\n }",
"public function down() {\n $this->dbforge->drop_column('timesheets_items', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'reason_desc', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'reason_desc', TRUE);\n\n // change reason to note\n $fields = array(\n 'reason' => array(\n 'name' => 'note',\n 'type' => \"VARCHAR\",\n 'constraint' => 200,\n 'null' => TRUE\n )\n );\n $this->dbforge->modify_column('timesheets_items', $fields);\n $this->dbforge->modify_column('timesheets_expenses', $fields);\n }",
"public function down(): void\n {\n // Remove your data\n }",
"public function down()\n\t{\n\t\t//Schema::drop('purchase_orders');\n\t\t//Schema::drop('purchase_order_details');\n\t}",
"public function down()\n {\n\tSchema::drop('activities');\n }",
"public function down(){\n $this->dbforge->drop_table('subcategories_news'); //eliminacion de la tabla subcategories_news\n }",
"public function down()\n {\n //return false;\n\t\t\n\t\t$TABLE_NAME = 'Haber';\n $this->dropTable($TABLE_NAME);\n\t\t\n\t\t$TABLE_NAME = 'HaberKategori';\n $this->dropTable($TABLE_NAME);\n }",
"public function down()\n {\n }",
"public function down()\n {\n }",
"public function down()\n\t{\n\t\tDB::table('professor')->where('professor_id', '=', 1)->delete();\n\t\tDB::table('professor')->where('professor_id', '=', 2)->delete();\n\t\tDB::query('ALTER TABLE professor AUTO_INCREMENT = 1');\n\n\t\t//\n\t}",
"public function down(): bool {\n\t\t// Remove & add logic to revert the migration here.\n\t\techo \"M230123030315BaseTables cannot be rolled back.\\n\";\n\t\treturn false;\n\t}",
"public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_inicio` `fecha_inicio` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_fin` `fecha_fin` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `descuento` `descuento` DECIMAL;\r\n\r\nALTER TABLE `promocion`\r\n ADD `descripcion` VARCHAR(70) AFTER `id`,\r\n ADD `estado` VARCHAR(11) AFTER `fecha_fin`,\r\n ADD `promocion_global` TINYINT(1) NOT NULL AFTER `descuento`;\r\n\r\nALTER TABLE `promocion` DROP `activo`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }",
"public function down()\n\t{\n\t\t//return false;\n\t}",
"public function down(): void\n {\n try {\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"DROP TABLE IF EXISTS prom2_pages\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }",
"public function down()\n\t{\n\t\t//\n\t\tSchema::drop('options');\n\t}",
"public function change()\n {\n $this->schema->table('recurring_expenses',function($table){\n $table->date('end_repeat')->nullable();\n $table->boolean('ended')->default(false);\n $table->enum('repeat',['0','1','7','14','30','365'])->nullable();\n });\n\n $this->schema->table('expenses',function($table){\n $table->dropColumn('end_repeat');\n $table->dropColumn('repeat');\n $table->integer('parent_id')->nullable();\n $table->foreign('parent_id')->references('id')->on('expenses')->onDelete('cascade');\n });\n }",
"public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->dropForeign('users_id_turma_foreign');\n });\n\n Schema::table('contato', function (Blueprint $table) {\n $table->dropForeign('contato_id_usuario_foreign');\n });\n\n Schema::table('monitores', function (Blueprint $table) {\n $table->dropForeign('monitores_id_turma_foreign');\n $table->dropForeign('monitores_id_usuario_foreign');\n });\n\n Schema::table('galeria_portifolio', function (Blueprint $table) {\n $table->dropForeign('galeria_portifolio_id_portifolio_foreign');\n });\n\n Schema::table('portifolio_alunos', function (Blueprint $table) {\n $table->dropForeign('portifolio_alunos_id_portifolio_foreign');\n $table->dropForeign('portifolio_alunos_id_usuario_foreign');\n });\n\n Schema::table('cobranca', function (Blueprint $table) {\n $table->dropForeign('cobranca_id_aluno_foreign');\n });\n\n Schema::table('lista_de_presenca', function (Blueprint $table) {\n $table->dropForeign('lista_de_presenca_id_usuario_foreign');\n });\n\n Schema::table('forum_da_turma', function (Blueprint $table) {\n $table->dropForeign('forum_da_turma_id_usuario_foreign');\n });\n\n Schema::table('posts_do_site', function (Blueprint $table) {\n $table->dropForeign('posts_do_site_id_usuario_foreign');\n });\n\n Schema::table('posts_do_forum', function (Blueprint $table) {\n $table->dropForeign('posts_do_forum_id_topico_foreign');\n $table->dropForeign('posts_do_forum_id_usuario_foreign');\n });\n }",
"public function down()\n\t{\n\t\t$this->dropForeignKey('FK_task_creator','tbl_task');\n\n\t\t$this->dropTable('tbl_task');\n\t}",
"public function down()\n {\n $this->table('articles')->drop()->save();\n $this->table('categories')->drop()->save();\n $this->table('football_ragistrations')->drop()->save();\n $this->table('friends')->drop()->save();\n $this->table('menus')->drop()->save();\n $this->table('picnic_ragistrations')->drop()->save();\n $this->table('products')->drop()->save();\n $this->table('profiles')->drop()->save();\n $this->table('skills')->drop()->save();\n $this->table('spouses')->drop()->save();\n $this->table('students')->drop()->save();\n $this->table('submenus')->drop()->save();\n $this->table('users')->drop()->save();\n }",
"public function down(){\n\t\tSchema::dropIfExists('cargo');\n\t}",
"public function down()\n {\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )->save();\n\n $this->table('users')\n ->removeIndexByName('FK_users_roles')\n ->update();\n\n $this->table('users')\n ->addColumn('can_edit', 'boolean', [\n 'after' => 'enabled',\n 'default' => '0',\n 'length' => null,\n 'null' => false,\n ])\n ->removeColumn('role_id')\n ->update();\n\n $this->table('stundenplan')\n ->changeColumn('note', 'string', [\n 'default' => null,\n 'length' => 255,\n 'null' => true,\n ])\n ->removeColumn('loggedInNote')\n ->update();\n\n $this->table('roles')->drop()->save();\n }",
"public function down()\n\t{\n\t\t//\n\t\tDB::query('TRUNCATE TABLE app_user_apps_publishes CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_fbapps CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_applications CASCADE');\n\t}",
"public function down()\n\t{\n\t\t// Drop Table\n\t\tSchema::drop('activities_types');\n\t}",
"protected abstract function do_down();",
"public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE encherir_acheteur (encherir_id INT NOT NULL, acheteur_id INT NOT NULL, INDEX IDX_41ABAAFBB0BA17BB (encherir_id), INDEX IDX_41ABAAFB96A7BB5F (acheteur_id), PRIMARY KEY(encherir_id, acheteur_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE encherir_lot (encherir_id INT NOT NULL, lot_id INT NOT NULL, INDEX IDX_3C56919BB0BA17BB (encherir_id), INDEX IDX_3C56919BA8CBA5F7 (lot_id), PRIMARY KEY(encherir_id, lot_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFB96A7BB5F FOREIGN KEY (acheteur_id) REFERENCES acheteur (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFBB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BA8CBA5F7 FOREIGN KEY (lot_id) REFERENCES lot (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EB576A8');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EFC101A');\n $this->addSql('DROP INDEX IDX_503B7C878EB576A8 ON encherir');\n $this->addSql('DROP INDEX IDX_503B7C878EFC101A ON encherir');\n $this->addSql('ALTER TABLE encherir DROP id_acheteur_id, DROP id_lot_id');\n }",
"public function down()\n {\n $this->table('accounting_entries')\n ->dropForeignKey(\n 'accounting_entry_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('associations_events')\n ->dropForeignKey(\n 'event_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('events')\n ->dropForeignKey(\n 'event_type_id'\n )->save();\n\n $this->table('members')\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics')\n ->dropForeignKey(\n 'statistics_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics_event')\n ->dropForeignKey(\n 'statistics_id'\n )\n ->dropForeignKey(\n 'event_id'\n )->save();\n\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('accounting_entries')->drop()->save();\n $this->table('accounting_entry_type')->drop()->save();\n $this->table('associations')->drop()->save();\n $this->table('associations_events')->drop()->save();\n $this->table('event_type')->drop()->save();\n $this->table('events')->drop()->save();\n $this->table('members')->drop()->save();\n $this->table('roles')->drop()->save();\n $this->table('statistics')->drop()->save();\n $this->table('statistics_event')->drop()->save();\n $this->table('statistics_type')->drop()->save();\n $this->table('users')->drop()->save();\n }",
"public function down()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{user_block}}\")){\n\t\t\t$this->dropTable(\"{{user_block}}\");\n\t\t}\n\n\t}",
"public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user_login`;\n\nALTER TABLE `user` DROP `user_mname`;\n\nALTER TABLE `user` DROP `user_user`;\n\nALTER TABLE `user` DROP `user_password`;\n\nALTER TABLE `user` DROP `user_date_lastlogin`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }",
"public function down()\n\t{\n\t\tSchema::table('officers', function($t){\n\t\t\t$t->drop_column('role');\n\t\t});\n\t}",
"public function safeDown()\n {\n $this->down();\n }",
"public function safeDown()\n {\n $this->down();\n }",
"public function down()\n\t{\n\t\tSchema::drop('refs');\n\t}",
"public function down () {\n\t\treturn $this->rename_column ('headline', 'title', 'string', array ('limit' => 72));\n\t}",
"public function down()\n\t{\n\t\tSchema::drop('appeals');\n\t}",
"public function safeDown()\r\n {\r\n $this->down();\r\n }",
"public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user`;\n\nDROP TABLE IF EXISTS `question`;\n\nDROP TABLE IF EXISTS `answer`;\n\nDROP TABLE IF EXISTS `image`;\n\nDROP TABLE IF EXISTS `vote`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }",
"public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n<<<<<<< HEAD\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n $this->addSql('ALTER TABLE liste_affaire_affaire DROP FOREIGN KEY FK_CA81ADF3F082E755');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152EBF396750');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E65450D2529');\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E6584CF0CF');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2FF631228');\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCE2687AC3');\n $this->addSql('ALTER TABLE sejour DROP FOREIGN KEY FK_96F52028E2687AC3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152E46135043');\n $this->addSql('DROP TABLE affaire');\n<<<<<<< HEAD\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE responsable_legal');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('DROP TABLE enfant');\n $this->addSql('DROP TABLE enfant_sejour');\n $this->addSql('DROP TABLE sejour');\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE etablissement');\n $this->addSql('DROP TABLE liste_affaire');\n $this->addSql('DROP TABLE responsable_legal');\n $this->addSql('DROP TABLE user');\n }",
"public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}",
"public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}",
"public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}",
"public function down()\n {\n $this->table('mail_contents')->drop()->save();\n }",
"public function down() {\n\t}",
"public function down() {\n\t}",
"public function down() {\n\t}",
"public function down()\n {\n Schema::dropIfExists('reunion');\n }",
"public function down(): void\n {\n $this->table('services')\n ->dropForeignKey(\n ['currency_id','billing_period_id']\n )->save();\n $this->execute('DELETE FROM currencies');\n $this->execute('DELETE FROM billing_periods');\n $this->table('services')->drop()->save();\n $this->table('currencies')->drop()->save();\n $this->table('billing_periods')->drop()->save();\n }",
"public function down()\n\t{\n\t\tSchema::drop('article_category');\n\t}",
"public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->renameColumn('first_name', 'name');\n $table->dropIndex('users_first_name_index');\n $table->dropIndex('users_created_at_index');\n $table->dropIndex('users_updated_at_index');\n $table->dropColumn(\"last_name\");\n $table->dropColumn(\"username\");\n $table->dropColumn(\"provider\");\n $table->dropColumn(\"provider_id\");\n $table->dropColumn(\"api_token\");\n $table->dropColumn(\"code\");\n $table->dropColumn(\"remember_token\");\n $table->dropColumn(\"role_id\");\n $table->dropColumn(\"last_login\");\n $table->dropColumn(\"status\");\n $table->dropColumn(\"root\");\n $table->dropColumn('backend');\n $table->dropColumn(\"photo_id\");\n $table->dropColumn(\"lang\");\n $table->dropColumn(\"color\");\n $table->dropColumn(\"about\");\n $table->dropColumn(\"facebook\");\n $table->dropColumn(\"twitter\");\n $table->dropColumn(\"linked_in\");\n $table->dropColumn(\"google_plus\");\n });\n }",
"public function down()\n\t{\n\t\tSchema::drop('entries');\n\t}",
"public function down()\n\t{\n\t\tSchema::table('precios_aterrizajes_despegues', function(Blueprint $table)\n\t\t{\n\t\t\t//\n\t\t});\n\t}",
"public function down()\n{\nSchema::drop('statustype');\nSchema::drop('area');\nSchema::drop('region');\nSchema::drop('territory');\nSchema::drop('trackedevent');\nSchema::drop('zip_territory');\nSchema::drop('messagetype');\nSchema::drop('optintype');\nSchema::drop('representative');\nSchema::drop('pediatrician');\nSchema::drop('application_messagestatus');\nSchema::drop('application_optin');\nSchema::drop('application_trackedevent');\nSchema::drop('application');\n}",
"public function down()\n\t{\n\t\tSchema::drop(Config::get('sentry::sentry.table.users_metadata'));\n\t}",
"public function down()\n\t{\n\t\tSchema::drop('stor_mem');\n\t}",
"protected function tearDown(): void {\n $migration = include __DIR__.'/../database/migrations/create_all_visitors_tables.php.stub';\n $migration->down();\n\n $migrationTest = include __DIR__.'/Support/migrations/2023_01_12_000000_create_test_models_table.php';\n $migrationTest->down();\n }",
"public function down(Schema $schema) : void\n {\n $this->addSql('ALTER TABLE classe_personne DROP FOREIGN KEY FK_350001418F5EA509');\n $this->addSql('ALTER TABLE matiere_classe DROP FOREIGN KEY FK_AF649A8B8F5EA509');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA148F5EA509');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0E8F5EA509');\n $this->addSql('ALTER TABLE cours DROP FOREIGN KEY FK_FDCA8C9CF46CD258');\n $this->addSql('ALTER TABLE matiere_classe DROP FOREIGN KEY FK_AF649A8BF46CD258');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA14F46CD258');\n $this->addSql('ALTER TABLE personne_matiere DROP FOREIGN KEY FK_4E9BB3B7F46CD258');\n $this->addSql('ALTER TABLE absence DROP FOREIGN KEY FK_765AE0C9A21BD112');\n $this->addSql('ALTER TABLE classe_personne DROP FOREIGN KEY FK_35000141A21BD112');\n $this->addSql('ALTER TABLE contacte DROP FOREIGN KEY FK_C794A022A21BD112');\n $this->addSql('ALTER TABLE demande DROP FOREIGN KEY FK_2694D7A5A21BD112');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA14A6CC7B2');\n $this->addSql('ALTER TABLE personne_matiere DROP FOREIGN KEY FK_4E9BB3B7A21BD112');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EE455FCC0');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EBDDFA3C9');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EDC304035');\n $this->addSql('ALTER TABLE absence DROP FOREIGN KEY FK_765AE0C9E3797A94');\n $this->addSql('ALTER TABLE personne DROP FOREIGN KEY FK_FCEC9EFA76ED395');\n $this->addSql('ALTER TABLE reset_password_request DROP FOREIGN KEY FK_7CE748AA76ED395');\n $this->addSql('DROP TABLE absence');\n $this->addSql('DROP TABLE classe');\n $this->addSql('DROP TABLE classe_personne');\n $this->addSql('DROP TABLE contacte');\n $this->addSql('DROP TABLE cours');\n $this->addSql('DROP TABLE demande');\n $this->addSql('DROP TABLE matiere');\n $this->addSql('DROP TABLE matiere_classe');\n $this->addSql('DROP TABLE news');\n $this->addSql('DROP TABLE note');\n $this->addSql('DROP TABLE personne');\n $this->addSql('DROP TABLE personne_matiere');\n $this->addSql('DROP TABLE reset_password_request');\n $this->addSql('DROP TABLE salle');\n $this->addSql('DROP TABLE seance');\n $this->addSql('DROP TABLE user');\n }",
"public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDEA76ED395');\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDE19FCD424');\n $this->addSql('DROP TABLE booking');\n $this->addSql('DROP TABLE product_image');\n $this->addSql('DROP TABLE family_page_container');\n $this->addSql('DROP TABLE user');\n $this->addSql('DROP TABLE time_line');\n $this->addSql('ALTER TABLE family DROP FOREIGN KEY FK_A5E6215B727ACA70');\n $this->addSql('DROP INDEX IDX_A5E6215B727ACA70 ON family');\n $this->addSql('ALTER TABLE family ADD page_content_id INT NOT NULL, DROP parent_id, DROP has_uniques_prices, DROP has_seasonal_products');\n $this->addSql('ALTER TABLE family ADD CONSTRAINT FK_A5E6215B8F409273 FOREIGN KEY (page_content_id) REFERENCES page_content (id)');\n $this->addSql('CREATE INDEX IDX_A5E6215B8F409273 ON family (page_content_id)');\n $this->addSql('ALTER TABLE link ADD page_container_id INT DEFAULT NULL, DROP url');\n $this->addSql('ALTER TABLE link ADD CONSTRAINT FK_36AC99F123D5B0C FOREIGN KEY (page_container_id) REFERENCES page_container (id)');\n $this->addSql('CREATE INDEX IDX_36AC99F123D5B0C ON link (page_container_id)');\n $this->addSql('ALTER TABLE product DROP content, DROP order_by, DROP is_generic, DROP type, CHANGE title label VARCHAR(50) NOT NULL COLLATE utf8mb4_unicode_ci');\n $this->addSql('ALTER TABLE unit DROP duration');\n }",
"public function down(Schema $schema) : void\n {\n $this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398F5B7AF75');\n $this->addSql('ALTER TABLE suppliers DROP FOREIGN KEY FK_AC28B95C8486F9AC');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D6498486F9AC');\n $this->addSql('ALTER TABLE stock DROP FOREIGN KEY FK_4B365660D629F605');\n $this->addSql('ALTER TABLE stock DROP FOREIGN KEY FK_4B365660E308AC6F');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F46CFFE9AD6');\n $this->addSql('ALTER TABLE product DROP FOREIGN KEY FK_D34A04ADEE45BDBF');\n $this->addSql('ALTER TABLE suppliers DROP FOREIGN KEY FK_AC28B95CEE45BDBF');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649EE45BDBF');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F464584665A');\n $this->addSql('ALTER TABLE product_theme DROP FOREIGN KEY FK_36299C544584665A');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649D60322AC');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F46DCD6110');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F462ADD6D8C');\n $this->addSql('ALTER TABLE product_theme DROP FOREIGN KEY FK_36299C5459027487');\n $this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398A76ED395');\n $this->addSql('DROP TABLE address');\n $this->addSql('DROP TABLE format');\n $this->addSql('DROP TABLE material');\n $this->addSql('DROP TABLE `order`');\n $this->addSql('DROP TABLE order_detail');\n $this->addSql('DROP TABLE picture');\n $this->addSql('DROP TABLE product');\n $this->addSql('DROP TABLE product_theme');\n $this->addSql('DROP TABLE role');\n $this->addSql('DROP TABLE stock');\n $this->addSql('DROP TABLE suppliers');\n $this->addSql('DROP TABLE theme');\n $this->addSql('DROP TABLE user');\n }",
"public function down()\n {\n Schema::dropIfExists('data');\n }",
"public function down()\n\t{\n\t\tSchema::create('jobs',function($table){$table->increments('id');});\n\t\tSchema::create('job_location',function($table){$table->increments('id');});\n\t\tSchema::create('job_skill',function($table){$table->increments('id');});\n\t\tSchema::create('locations',function($table){$table->increments('id');});\n\t\tSchema::create('location_program',function($table){$table->increments('id');});\n\t\tSchema::create('location_scholarship',function($table){$table->increments('id');});\n\t\tSchema::create('positions',function($table){$table->increments('id');});\n\t\tSchema::create('programs',function($table){$table->increments('id');});\n\t\tSchema::create('program_subject',function($table){$table->increments('id');});\n\t\tSchema::create('scholarships',function($table){$table->increments('id');});\n\t\tSchema::create('scholarship_subject',function($table){$table->increments('id');});\n\t\tSchema::create('skills',function($table){$table->increments('id');});\n\t\tSchema::create('subjects',function($table){$table->increments('id');});\n\t}"
] | [
"0.79502094",
"0.7863702",
"0.7606416",
"0.7492738",
"0.73199725",
"0.7245919",
"0.7187675",
"0.7153845",
"0.71537775",
"0.71420383",
"0.71353674",
"0.71216005",
"0.7115856",
"0.7105365",
"0.70985687",
"0.7080349",
"0.70783705",
"0.7072629",
"0.7068311",
"0.7065529",
"0.7053633",
"0.7053633",
"0.70424956",
"0.70424956",
"0.70424956",
"0.7041426",
"0.703968",
"0.7029248",
"0.70252407",
"0.7021071",
"0.69888437",
"0.6985933",
"0.69781303",
"0.69711983",
"0.69435465",
"0.69435465",
"0.69435465",
"0.69422066",
"0.6941167",
"0.69392043",
"0.693508",
"0.6934209",
"0.69273883",
"0.69249666",
"0.6924165",
"0.69139355",
"0.6903021",
"0.6897935",
"0.6897865",
"0.6897159",
"0.6897159",
"0.6887517",
"0.68814087",
"0.68738264",
"0.6869671",
"0.68627596",
"0.6858359",
"0.685274",
"0.68442315",
"0.68434376",
"0.6836587",
"0.6836147",
"0.68347293",
"0.68302953",
"0.6829403",
"0.6828893",
"0.6825529",
"0.6823726",
"0.6818256",
"0.68105906",
"0.68082154",
"0.6805308",
"0.6805308",
"0.6789928",
"0.6775214",
"0.6774431",
"0.67646605",
"0.67588997",
"0.675822",
"0.67556226",
"0.67556226",
"0.67556226",
"0.6753787",
"0.6753203",
"0.6753203",
"0.6753203",
"0.67524594",
"0.6745875",
"0.67441654",
"0.6738876",
"0.67343754",
"0.6733525",
"0.67314184",
"0.67311025",
"0.67271084",
"0.67268074",
"0.6725997",
"0.67252296",
"0.6716472",
"0.6713497",
"0.6713106"
] | 0.0 | -1 |
Display a listing of the resource. | public function index()
{
$user_exams = Cache::remember('user_exams', 22 * 60, function () {
$enroll_courses = User::find(Auth::user()->id)->enrollCourses;
$exams = [];
foreach ($enroll_courses as $enroll_course) {
$exam = Course::find($enroll_course->course_id)->exams;
$exams[] = $exam;
}
return $exams;
});
return response()->json($user_exams);
// $exams = Exam::all();
// return response()->json($exams);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }",
"public function listing();",
"function index() {\n\t\t$this->show_list();\n\t}",
"public function actionList() {\n $this->_getList();\n }",
"public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }",
"public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }",
"public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }",
"function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}",
"public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }",
"public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }",
"public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}",
"function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}",
"public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }",
"public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}",
"public function actionRestList() {\n\t $this->doRestList();\n\t}",
"public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}",
"public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }",
"public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }",
"public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}",
"public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}",
"public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }",
"public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }",
"public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }",
"public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }",
"public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}",
"public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }",
"public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}",
"public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }",
"public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }",
"public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }",
"public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}",
"public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }",
"public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }",
"public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }",
"public function index()\n {\n return Resources::collection(Checking::paginate());\n }",
"public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }",
"public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }",
"public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }",
"public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }",
"public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }",
"public function view(){\n\t\t$this->buildListing();\n\t}",
"public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }",
"public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }",
"public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }",
"public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }",
"public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }",
"public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }",
"public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }",
"public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }",
"public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }",
"public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}",
"public function listAction() {}",
"public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }",
"public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }",
"public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }",
"public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }",
"public function executeList()\n {\n $this->setTemplate('list');\n }",
"public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }",
"function listing() {\r\n\r\n }",
"public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }",
"public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }",
"public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}",
"public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }",
"public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }",
"public function _index(){\n\t $this->_list();\n\t}",
"public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}",
"function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}",
"public function index()\n {\n $this->booklist();\n }",
"public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }",
"public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }",
"public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }",
"public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }",
"public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }",
"public function indexAction() {\n $this->_forward('list');\n }",
"public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }",
"public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }",
"public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}",
"public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }",
"public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }",
"public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }",
"public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }",
"public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }",
"public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}",
"public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }",
"public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }",
"public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }",
"public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}",
"public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }",
"public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }",
"public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }",
"public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }",
"public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }",
"public function index()\n {\n return view('admin.resources.index');\n }",
"public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}"
] | [
"0.7446777",
"0.736227",
"0.73005503",
"0.72478926",
"0.71631265",
"0.71489686",
"0.7131636",
"0.7105969",
"0.71029514",
"0.7101372",
"0.70508176",
"0.6995128",
"0.69890636",
"0.6934895",
"0.6900203",
"0.6899281",
"0.6891734",
"0.6887235",
"0.68670005",
"0.6849741",
"0.6830523",
"0.6802689",
"0.6797",
"0.67957735",
"0.67871135",
"0.6760129",
"0.67427456",
"0.6730486",
"0.67272323",
"0.67255723",
"0.67255723",
"0.67255723",
"0.67177945",
"0.6707866",
"0.6706713",
"0.6704375",
"0.6664782",
"0.6662871",
"0.6660302",
"0.6659404",
"0.6656656",
"0.6653517",
"0.6647965",
"0.6620322",
"0.66185474",
"0.6618499",
"0.6606105",
"0.6600617",
"0.65996987",
"0.6594775",
"0.6587389",
"0.6585109",
"0.6581641",
"0.6581017",
"0.6577157",
"0.65747666",
"0.6572513",
"0.65721947",
"0.6570553",
"0.65646994",
"0.6563556",
"0.6554194",
"0.65529937",
"0.65460825",
"0.65368485",
"0.653429",
"0.65328294",
"0.6526759",
"0.6526695",
"0.6526284",
"0.65191334",
"0.65183175",
"0.65174305",
"0.651703",
"0.65141153",
"0.6507088",
"0.65061647",
"0.6504046",
"0.64942145",
"0.6491893",
"0.64883405",
"0.6486392",
"0.6485077",
"0.64846045",
"0.6478858",
"0.64756656",
"0.64726377",
"0.6471126",
"0.64701074",
"0.6467418",
"0.6462195",
"0.64618355",
"0.6459199",
"0.6457831",
"0.6454631",
"0.64533997",
"0.6451915",
"0.6450861",
"0.6449301",
"0.64492667",
"0.64469045"
] | 0.0 | -1 |
Show the form for creating a new resource. | public function create()
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return view('admin.resources.create');\n }",
"public function create(){\n\n return view('resource.create');\n }",
"public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}",
"public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }",
"public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }",
"public function create()\n {\n return view ('forms.create');\n }",
"public function create ()\n {\n return view('forms.create');\n }",
"public function create()\n\t{\n\t\treturn view('faith.form');\n\t}",
"public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }",
"public function create()\n {\n return view(\"request_form.form\");\n }",
"public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }",
"public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle école'\n\t\t) ) );\n\t}",
"public function create()\n {\n return view($this->forms . '.create');\n }",
"public function create()\n {\n return view('restful.add');\n }",
"public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }",
"public function create()\n {\n return view('admin.createform');\n }",
"public function create()\n {\n return view('admin.forms.create');\n }",
"public function create()\n {\n return view('backend.student.form');\n }",
"public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }",
"public function create()\n {\n return view('client.form');\n }",
"public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }",
"public function create()\n {\n return view('Form');\n }",
"public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }",
"public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}",
"public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }",
"public function create()\n {\n return view('form');\n }",
"public function create()\n {\n return view('form');\n }",
"public function create()\n {\n return view('form');\n }",
"public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }",
"public function create()\n {\n return view('backend.schoolboard.addform');\n }",
"public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}",
"public function create()\n {\n //\n return view('form');\n }",
"public function create()\n {\n return view('rests.create');\n }",
"public function create()\n {\n return $this->showForm();\n }",
"public function create()\n {\n return $this->showForm();\n }",
"public function create()\n {\n return view(\"Add\");\n }",
"public function create(){\n return view('form.create');\n }",
"public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }",
"public function create()\n {\n\n return view('control panel.student.add');\n\n }",
"public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}",
"public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }",
"public function create()\n {\n return $this->cView(\"form\");\n }",
"public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }",
"public function create()\n {\n return view(\"dresses.form\");\n }",
"public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}",
"public function createAction()\n {\n// $this->view->form = $form;\n }",
"public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }",
"public function create()\n {\n return view('fish.form');\n }",
"public function create()\n {\n return view('users.forms.create');\n }",
"public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }",
"public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}",
"public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }",
"public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }",
"public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }",
"public function create()\n {\n return view('essentials::create');\n }",
"public function create()\n {\n return view('student.add');\n }",
"public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}",
"public function create()\n {\n return view('url.form');\n }",
"public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }",
"public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}",
"public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }",
"public function create()\n {\n return view('libro.create');\n }",
"public function create()\n {\n return view('libro.create');\n }",
"public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function create()\n {\n return view('crud/add'); }",
"public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}",
"public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function create()\n {\n return view(\"List.form\");\n }",
"public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}",
"public function create()\n {\n //load create form\n return view('products.create');\n }",
"public function create()\n {\n return view('article.addform');\n }",
"public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }",
"public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}",
"public function create()\n {\n return view('saldo.form');\n }",
"public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}",
"public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }",
"public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }",
"public function create()\n {\n return view('admin.inverty.add');\n }",
"public function create()\n {\n return view('Libro.create');\n }",
"public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }",
"public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }",
"public function create()\n {\n return view(\"familiasPrograma.create\");\n }",
"public function create()\n {\n return view('admin.car.create');\n }",
"public function create()\n {\n return view('admin.car.create');\n }",
"public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}",
"public function create()\n {\n return view(\"create\");\n }",
"public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}",
"public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }",
"public function create()\n {\n return view('forming');\n }",
"public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }",
"public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }",
"public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }",
"public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }",
"public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }",
"public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}",
"public function create()\n {\n return view('student::students.student.create');\n }",
"public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}"
] | [
"0.75948673",
"0.75948673",
"0.75863165",
"0.7577412",
"0.75727344",
"0.7500887",
"0.7434847",
"0.7433956",
"0.73892003",
"0.73531085",
"0.73364776",
"0.73125",
"0.7296102",
"0.7281891",
"0.72741455",
"0.72424185",
"0.7229325",
"0.7226713",
"0.7187349",
"0.7179176",
"0.7174283",
"0.7150356",
"0.71444064",
"0.71442676",
"0.713498",
"0.71283126",
"0.7123691",
"0.71158516",
"0.71158516",
"0.71158516",
"0.7112176",
"0.7094388",
"0.7085711",
"0.708025",
"0.70800644",
"0.70571953",
"0.70571953",
"0.70556754",
"0.70396435",
"0.7039549",
"0.7036275",
"0.703468",
"0.70305896",
"0.7027638",
"0.70265305",
"0.70199823",
"0.7018007",
"0.7004984",
"0.7003889",
"0.7000935",
"0.69973785",
"0.6994679",
"0.6993764",
"0.6989918",
"0.6986989",
"0.6966502",
"0.69656384",
"0.69564354",
"0.69518244",
"0.6951109",
"0.6947306",
"0.69444615",
"0.69423944",
"0.6941156",
"0.6937871",
"0.6937871",
"0.6936686",
"0.69345254",
"0.69318026",
"0.692827",
"0.69263744",
"0.69242257",
"0.6918349",
"0.6915889",
"0.6912884",
"0.691146",
"0.69103104",
"0.69085974",
"0.69040126",
"0.69014287",
"0.69012105",
"0.6900397",
"0.68951064",
"0.6893521",
"0.68932164",
"0.6891899",
"0.6891616",
"0.6891616",
"0.6889246",
"0.68880934",
"0.6887128",
"0.6884732",
"0.68822503",
"0.68809193",
"0.6875949",
"0.68739206",
"0.68739134",
"0.6870358",
"0.6869779",
"0.68696856",
"0.686877"
] | 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }",
"public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }",
"public function createStorage();",
"public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"function storeAndNew() {\n $this->store();\n }",
"public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }",
"public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }",
"public function store()\n\t{\n\t\t\n\t\t//\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}"
] | [
"0.72865677",
"0.7145327",
"0.71325725",
"0.6640912",
"0.66209733",
"0.65685713",
"0.652643",
"0.65095705",
"0.64490104",
"0.637569",
"0.63736665",
"0.63657933",
"0.63657933",
"0.63657933",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437"
] | 0.0 | -1 |
Display the specified resource. | public function show(Exam $exam)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Resource $resource)\n {\n // not available for now\n }",
"public function show(Resource $resource)\n {\n //\n }",
"function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }",
"private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }",
"function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}",
"public function show(ResourceSubject $resourceSubject)\n {\n //\n }",
"public function show(ResourceManagement $resourcesManagement)\n {\n //\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function retrieve(Resource $resource);",
"public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }",
"public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function show(Dispenser $dispenser)\n {\n //\n }",
"public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }",
"public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}",
"public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }",
"public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }",
"function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}",
"public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }",
"public function get(Resource $resource);",
"public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }",
"public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }",
"function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}",
"public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }",
"function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}",
"public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function show(rc $rc)\n {\n //\n }",
"public function show(Resolucion $resolucion)\n {\n //\n }",
"public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show(Resena $resena)\n {\n }",
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }",
"public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}",
"public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }",
"public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }",
"public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }",
"public function display()\n\t{\n\t\tparent::display();\n\t}",
"public function get_resource();",
"public function show()\n\t{\n\t\t\n\t}",
"function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}",
"public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }",
"public function display($title = null)\n {\n echo $this->fetch($title);\n }",
"public function display(){}",
"public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}",
"public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}",
"public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }",
"#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}",
"public function display() {\n echo $this->render();\n }",
"public function show($id)\n\t{\n\t//\n\t}",
"public function show($id)\n\t{\n\t//\n\t}",
"function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }",
"public function show($id)\n {\n //\n $this->_show($id);\n }",
"public function show()\n\t{\n\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {}",
"static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}",
"public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}",
"public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }",
"public abstract function display();",
"abstract public function resource($resource);",
"public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show(Response $response)\n {\n //\n }",
"public function show()\n {\n return auth()->user()->getResource();\n }",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}"
] | [
"0.8233718",
"0.8190437",
"0.6828712",
"0.64986944",
"0.6495974",
"0.6469629",
"0.6462615",
"0.6363665",
"0.6311607",
"0.62817234",
"0.6218966",
"0.6189695",
"0.61804265",
"0.6171014",
"0.61371076",
"0.61207956",
"0.61067593",
"0.6105954",
"0.6094066",
"0.6082806",
"0.6045245",
"0.60389996",
"0.6016584",
"0.598783",
"0.5961788",
"0.59606946",
"0.5954321",
"0.59295714",
"0.59182066",
"0.5904556",
"0.59036547",
"0.59036547",
"0.59036547",
"0.5891874",
"0.58688277",
"0.5868107",
"0.58676815",
"0.5851883",
"0.58144855",
"0.58124036",
"0.58112013",
"0.5803467",
"0.58012545",
"0.5791527",
"0.57901084",
"0.5781528",
"0.5779676",
"0.5757105",
"0.5756208",
"0.57561266",
"0.57453394",
"0.57435393",
"0.57422745",
"0.5736634",
"0.5736634",
"0.5730559",
"0.57259274",
"0.5724891",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5718969",
"0.5713412",
"0.57091093",
"0.5706405",
"0.57057405",
"0.5704541",
"0.5704152",
"0.57026845",
"0.57026845",
"0.56981397",
"0.5693083",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962"
] | 0.0 | -1 |
Show the form for editing the specified resource. | public function edit(Exam $exam)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }",
"public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function edit()\n {\n return view('hirmvc::edit');\n }",
"public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}",
"public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }",
"public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}",
"public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }",
"public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }",
"private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }",
"public function edit($id)\n {\n return $this->showForm('update', $id);\n }",
"public function edit($id)\n {\n return $this->showForm('update', $id);\n }",
"public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }",
"public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }",
"public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}",
"public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }",
"public function edit($model, $form);",
"function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}",
"public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}",
"public function edit()\n { \n return view('admin.control.edit');\n }",
"public function edit(Form $form)\n {\n //\n }",
"public function edit()\n {\n return view('common::edit');\n }",
"public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\r\n {\r\n return view('petro::edit');\r\n }",
"public function edit($id)\n {\n // show form edit user info\n }",
"public function edit()\n {\n return view('escrow::edit');\n }",
"public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }",
"public function edit()\n {\n return view('commonmodule::edit');\n }",
"public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit(form $form)\n {\n //\n }",
"public function actionEdit($id) { }",
"public function edit()\n {\n return view('admincp::edit');\n }",
"public function edit()\n {\n return view('scaffold::edit');\n }",
"public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }",
"public function edit()\n {\n return view('Person.edit');\n }",
"public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }",
"public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}",
"public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }",
"public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}",
"public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }",
"public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }",
"public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }",
"function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}",
"public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }",
"public function edit($id)\n {\n return $this->showForm($id);\n }",
"public function edit($id)\n {\n return $this->showForm($id);\n }",
"protected function _edit(){\n\t\treturn $this->_editForm();\n\t}",
"public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }",
"public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }",
"public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}",
"public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}",
"public function edit($id)\n {\n return view('models::edit');\n }",
"public function edit()\n {\n return view('home::edit');\n }",
"public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }",
"public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }",
"public function edit()\n {\n return view('user::edit');\n }",
"public function edit()\n {\n return view('user::edit');\n }",
"public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }",
"public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }",
"public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return view('consultas::edit');\n }",
"public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }",
"public function edit()\n {\n return view('dashboard::edit');\n }",
"public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }",
"public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }",
"public function edit() {\n return view('routes::edit');\n }",
"public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }",
"public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }",
"public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }",
"public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }",
"public function edit($id)\n {\n return view('cataloguemodule::edit');\n }",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }",
"public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }",
"public function edit()\n {\n return view('website::edit');\n }",
"public function edit()\n {\n return view('inventory::edit');\n }",
"public function edit()\n {\n return view('initializer::edit');\n }",
"public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }",
"public function edit($id)\n {\n return view('backend::edit');\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }",
"public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}",
"public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }",
"public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }",
"public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }",
"public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}",
"public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }",
"public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }",
"public function edit() \n\t{\n UserModel::authentication();\n\n //get the user's information \n $user = UserModel::user();\n\n\t\t$this->View->Render('user/edit', ['user' => $user]);\n }"
] | [
"0.78557473",
"0.76946205",
"0.72731614",
"0.7241571",
"0.71700776",
"0.70650244",
"0.7052897",
"0.698311",
"0.69465625",
"0.6944826",
"0.69399333",
"0.69286525",
"0.69031185",
"0.68969506",
"0.68969506",
"0.6878258",
"0.6862812",
"0.6859171",
"0.68560475",
"0.68436426",
"0.6834711",
"0.6810601",
"0.680613",
"0.6804975",
"0.68015367",
"0.6795471",
"0.6791821",
"0.6791821",
"0.6787303",
"0.6783644",
"0.67790574",
"0.67766285",
"0.6767741",
"0.67610145",
"0.67455536",
"0.67455536",
"0.6744367",
"0.6743159",
"0.6739656",
"0.67351145",
"0.67246765",
"0.67128825",
"0.6692859",
"0.66916454",
"0.6687554",
"0.66875297",
"0.6687494",
"0.6684443",
"0.668203",
"0.66689324",
"0.66680384",
"0.6664605",
"0.6664605",
"0.66621166",
"0.66604865",
"0.66589504",
"0.6655767",
"0.66542184",
"0.665213",
"0.66422516",
"0.6631665",
"0.663077",
"0.6627607",
"0.6627607",
"0.66193914",
"0.6618503",
"0.66160196",
"0.66146857",
"0.6609641",
"0.6608315",
"0.6605284",
"0.6595882",
"0.65947276",
"0.6594626",
"0.65895563",
"0.6589339",
"0.6587281",
"0.65805006",
"0.6579201",
"0.6579166",
"0.657641",
"0.6576111",
"0.65740323",
"0.65692765",
"0.6568046",
"0.6567221",
"0.6565346",
"0.6560687",
"0.6560687",
"0.6560384",
"0.65577257",
"0.65569293",
"0.65558636",
"0.6555392",
"0.65553015",
"0.65542984",
"0.655418",
"0.6554106",
"0.6547678",
"0.65473104",
"0.6543329"
] | 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request, Exam $exam)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }",
"public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }",
"public function update(Request $request, Resource $resource)\n {\n //\n }",
"public function updateStream($resource);",
"public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }",
"protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }",
"public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }",
"public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }",
"public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}",
"public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }",
"public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }",
"protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }",
"public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }",
"public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }",
"public function update($path);",
"public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }",
"public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }",
"public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}",
"public function updateStream($path, $resource, Config $config)\n {\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }",
"public function update($data) {}",
"public function update($data) {}",
"public function putStream($resource);",
"public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function update($entity);",
"public function update($entity);",
"public function setResource($resource);",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }",
"public function isUpdateResource();",
"public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }",
"public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }",
"public function store($data, Resource $resource);",
"public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }",
"public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }",
"public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }",
"public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }",
"public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }",
"public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }",
"public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }",
"public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }",
"public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }",
"public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }",
"public function update(Qstore $request, $id)\n {\n //\n }",
"public function update(IEntity $entity);",
"protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }",
"public function update($request, $id);",
"function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}",
"public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }",
"public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }",
"protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }",
"abstract public function put($data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function testUpdateSupplierUsingPUT()\n {\n }",
"public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }",
"public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }",
"public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }",
"public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }",
"public abstract function update($object);",
"public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }",
"public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }",
"public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }",
"public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }",
"public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }",
"public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }",
"public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }",
"public function update($entity)\n {\n \n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }",
"public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }",
"public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }",
"public function update($id, $input);",
"public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }",
"public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}",
"public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }",
"public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }",
"public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }",
"public function update($id);",
"public function update($id);",
"private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }",
"public function put($path, $data = null);",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }",
"public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }",
"public function update(Entity $entity);",
"public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }",
"public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}",
"public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }",
"public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }",
"public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }",
"public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }"
] | [
"0.7425105",
"0.70612276",
"0.70558053",
"0.6896673",
"0.6582159",
"0.64491373",
"0.6346954",
"0.62114537",
"0.6145042",
"0.6119944",
"0.61128503",
"0.6099993",
"0.6087866",
"0.6052593",
"0.6018941",
"0.60060275",
"0.59715486",
"0.5946516",
"0.59400934",
"0.59377414",
"0.5890722",
"0.5860816",
"0.5855127",
"0.5855127",
"0.58513457",
"0.5815068",
"0.5806887",
"0.57525045",
"0.57525045",
"0.57337505",
"0.5723295",
"0.5714311",
"0.5694472",
"0.5691319",
"0.56879413",
"0.5669989",
"0.56565005",
"0.56505877",
"0.5646085",
"0.5636683",
"0.5633498",
"0.5633378",
"0.5632906",
"0.5628826",
"0.56196684",
"0.5609126",
"0.5601397",
"0.55944353",
"0.5582592",
"0.5581908",
"0.55813426",
"0.5575312",
"0.55717176",
"0.55661047",
"0.55624634",
"0.55614686",
"0.55608666",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55573726",
"0.5556878",
"0.5554201",
"0.5553069",
"0.55530256",
"0.5543788",
"0.55435944",
"0.55412996",
"0.55393505",
"0.55368495",
"0.5535236",
"0.5534954",
"0.55237365",
"0.5520468",
"0.55163723",
"0.55125296",
"0.5511168",
"0.5508345",
"0.55072427",
"0.5502385",
"0.5502337",
"0.5501029",
"0.54995877",
"0.54979175",
"0.54949397",
"0.54949397",
"0.54946727",
"0.5494196",
"0.54941916",
"0.54925025",
"0.5491807",
"0.5483321",
"0.5479606",
"0.5479408",
"0.5478678",
"0.54667485",
"0.5463411",
"0.5460588",
"0.5458525"
] | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy(Exam $exam)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }",
"public function destroy(Resource $resource)\n {\n //\n }",
"public function removeResource($resourceID)\n\t\t{\n\t\t}",
"public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }",
"public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }",
"public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }",
"public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }",
"protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }",
"public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }",
"public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }",
"public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }",
"public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}",
"public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}",
"public function delete(): void\n {\n unlink($this->getPath());\n }",
"public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }",
"public function remove($path);",
"function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}",
"public function delete(): void\n {\n unlink($this->path);\n }",
"private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }",
"public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }",
"public function remove() {}",
"public function remove() {}",
"public function remove();",
"public function remove();",
"public function remove();",
"public function remove();",
"function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}",
"public function deleteImage(){\n\n\n Storage::delete($this->image);\n }",
"public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }",
"public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}",
"public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }",
"public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }",
"public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}",
"public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }",
"public function deleteImage(){\n \tStorage::delete($this->image);\n }",
"public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }",
"public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }",
"public function destroy($id)\n {\n Myfile::find($id)->delete();\n }",
"public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }",
"public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }",
"public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }",
"public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }",
"public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }",
"public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }",
"public function delete($path);",
"public function delete($path);",
"public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }",
"public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }",
"public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }",
"public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }",
"public function delete($path, $data = null);",
"public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }",
"public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }",
"public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }",
"public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }",
"public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }",
"public function del($path){\n\t\treturn $this->remove($path);\n\t}",
"public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }",
"public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}",
"public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }",
"public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }",
"public function revoke($resource, $permission = null);",
"public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }",
"function delete($path);",
"public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}",
"public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }",
"public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }",
"public function remove($filePath){\n return Storage::delete($filePath);\n }",
"public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }",
"public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }",
"public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }",
"public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }",
"function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }",
"public function remove($id);",
"public function remove($id);",
"public function deleted(Storage $storage)\n {\n //\n }",
"public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }",
"public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }",
"public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }",
"public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }",
"function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}",
"public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }",
"public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}",
"public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }",
"public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }"
] | [
"0.6672584",
"0.6659381",
"0.6635911",
"0.6632799",
"0.6626075",
"0.65424126",
"0.65416265",
"0.64648265",
"0.62882507",
"0.6175931",
"0.6129922",
"0.60893893",
"0.6054415",
"0.60428125",
"0.60064924",
"0.59337646",
"0.5930772",
"0.59199584",
"0.5919811",
"0.5904504",
"0.5897263",
"0.58962846",
"0.58951396",
"0.58951396",
"0.58951396",
"0.58951396",
"0.5880124",
"0.58690923",
"0.5863659",
"0.5809161",
"0.57735413",
"0.5760811",
"0.5753559",
"0.57492644",
"0.5741712",
"0.57334286",
"0.5726379",
"0.57144034",
"0.57096",
"0.5707689",
"0.5705895",
"0.5705634",
"0.5703902",
"0.5696585",
"0.5684331",
"0.5684331",
"0.56780374",
"0.5677111",
"0.5657287",
"0.5648262",
"0.5648085",
"0.5648012",
"0.5640759",
"0.5637738",
"0.5629985",
"0.5619264",
"0.56167465",
"0.5606877",
"0.56021434",
"0.5601949",
"0.55992156",
"0.5598557",
"0.55897516",
"0.5581397",
"0.5566926",
"0.5566796",
"0.55642897",
"0.55641",
"0.5556583",
"0.5556536",
"0.5550097",
"0.5543172",
"0.55422723",
"0.5540013",
"0.5540013",
"0.55371785",
"0.55365825",
"0.55300397",
"0.552969",
"0.55275744",
"0.55272335",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.5525997",
"0.5525624",
"0.5523911",
"0.5521122",
"0.5517412"
] | 0.0 | -1 |
Setup before running any test cases | public static function setUpBeforeClass()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function doSetup(): void\n {\n }",
"public function setup() {}",
"protected function setUp ()\n {}",
"function setUp() {\n\t\t\n\t}",
"function setUp() {\n\t\t\n\t}",
"private function setup()\r\n\t{ }",
"protected function setUp() { }",
"protected function setUp() { }",
"protected function setup(){\n }",
"function quickSetUp()\n {\n $this->setUp(null, null, null, null, null);\n }",
"public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}",
"public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}"
] | [
"0.8299111",
"0.8299111",
"0.8299111",
"0.8299111",
"0.8299111",
"0.8299111",
"0.8299111",
"0.8299111",
"0.8299111",
"0.8299111",
"0.8299111",
"0.8299111",
"0.8299111",
"0.8299111",
"0.8298778",
"0.8298778",
"0.8298778",
"0.8298778",
"0.8298778",
"0.8298778",
"0.8298778",
"0.8298778",
"0.8298778",
"0.8298778",
"0.8298778",
"0.8298778",
"0.8298778",
"0.8298778",
"0.8298778",
"0.82985723",
"0.82985723",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.829808",
"0.82344025",
"0.81765306",
"0.8172459",
"0.81542856",
"0.81542856",
"0.8106448",
"0.80816454",
"0.80816454",
"0.8051928",
"0.8037265",
"0.8031149",
"0.8031149"
] | 0.0 | -1 |
Setup before running each test case | public function setUp()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"function setUp() {\n\t\t\n\t}",
"function setUp() {\n\t\t\n\t}",
"protected function doSetup(): void\n {\n }",
"protected function setUp ()\n {}",
"public function setUp(): void\n {\n $this->setUpWithNoResult();\n }",
"protected function setUp() { }",
"protected function setUp() { }",
"public function setUp()\n {\n\n $this->db = Db::getActive();\n $this->response = Response::getActive();\n\n }",
"public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}",
"public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}",
"public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}",
"public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}"
] | [
"0.8136364",
"0.8136364",
"0.8136364",
"0.8136364",
"0.8136364",
"0.8136364",
"0.8136364",
"0.8136364",
"0.8136364",
"0.8136364",
"0.8136364",
"0.8136364",
"0.8136364",
"0.8136364",
"0.8136364",
"0.8136321",
"0.8136321",
"0.8136321",
"0.8136321",
"0.8136321",
"0.8136321",
"0.8136321",
"0.8136321",
"0.8136321",
"0.8136321",
"0.8136321",
"0.8136321",
"0.8136321",
"0.8136321",
"0.81356287",
"0.81356287",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.8134937",
"0.80421937",
"0.80421937",
"0.80289686",
"0.8018776",
"0.793929",
"0.7926855",
"0.7926855",
"0.7909959",
"0.7904265",
"0.7904265",
"0.7904265",
"0.7904265"
] | 0.0 | -1 |
Clean up after running each test case | public function tearDown()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp();",
"public function cleanUp();",
"public function cleanUp();",
"public function cleanup() {\n\t\t//TODO\n\t}",
"public function cleanTestActivities()\n {\n\n $this->collectCurrentTestUsers();\n $this->cleanExerciseUploadPictures();\n $this->cleanDeviceUploadPictures();\n $this->resetDatabase();\n }",
"protected function tearDown(): void {\n unset($this->integration);\n unset($this->ccm);\n unset($this->session);\n }",
"public function teardown()\n {\n //\n }",
"protected function tearDown(): void\n {\n $this->config = null;\n $this->container = null;\n $this->instance = null;\n }",
"public function tearDown()\n {\n unset($this->db);\n unset($this->statement);\n unset($this->mockData);\n }",
"protected function tearDown() {\n\n $this->client = null;\n $this->deleteTestLocations();\n $this->locIDs = null;\n reuse_generateXML();\n }",
"public function cleanup()\n {\n }",
"protected function tearDown(): void {\n\t\t$this->http_client = null;\n\t\t$this->process_transactions = array();\n\n\t\tif ( ! empty( $this->transactions ) ) {\n\t\t\t$this->transactions = array();\n\n\t\t\tCrudTable\\delete_rows( 'transactions', $this->key_pairs, 100 );\n\n\t\t\t$this->key_pairs['tag'] = $this->tag;\n\t\t\tCrudTable\\delete_rows( 'transactions', $this->key_pairs, 100 );\n\n\t\t\tTestHelpers::removeJsonFile( $this->process_tag );\n\t\t\tTestHelpers::removeJsonFile( $this->tag );\n\t\t}\n\t}",
"protected function cleanUp()\n\t{\n\t\t// clean\n\t\t$this->killExceededTasks();\n\t\t$this->cleanHistory();\n\t}",
"public function teardown()\n {\n }",
"function __destruct() {\n if ($this->testDir) {\n $this->eraseTempDir();\n }\n $this->unsetMockSession();\n }",
"public function tearDown()\n {\n unset($this->_standardLib);\n unset($this->_daughter);\n }",
"public function tearDown(): void\n {\n parent::tearDown();\n unset($this->purifier);\n unset($this->em);\n unset($this->objectiveManager);\n unset($this->learningMaterialManager);\n unset($this->courseLearningMaterialManager);\n unset($this->sessionLearningMaterialManager);\n unset($this->sessionDescriptionManager);\n unset($this->commandTester);\n }",
"public function cleanup()\n\t{\n\t}",
"public function tearDown() {\n $this->container = null;\n $this->model = null;\n $this->request = null;\n $this->response = null;\n $this->responseHeaders = null;\n $this->responseWriter = null;\n }",
"protected function tearDown()\n {\n unset($this->output);\n }",
"public function tearDown(): void\n {\n parent::tearDown();\n unset($this->filesystem);\n unset($this->diskSpace);\n unset($this->commandTester);\n }",
"protected function tearDown() {\n $this->osapiCollection = null;\n $this->list = null;\n parent::tearDown();\n }",
"public function tearDown()\n {\n // delete your instance\n OGR_DS_Destroy($this->hSrcDataSource);\n\n delete_directory($this->strPathToOutputData);\n\n unset($this->strPathToOutputData);\n unset($this->strTmpDumpFile);\n unset($this->strPathToData);\n unset($this->strPathToStandardData);\n unset($this->bUpdate);\n unset($this->hOGRSFDriver);\n unset($this->hLayer);\n unset($this->iSpatialFilter);\n unset($this->hSrcDataSource);\n }",
"public function cleanup()\n\t{\n\t\t\n\t}",
"protected function tearDown()\r\n {\r\n DirectoryManager::recursiveRemoveDir('data/tests');\r\n }",
"public function tearDown(): void\n {\n self::$environ->cleanupTestUploadFiles();\n self::$environ->clean();\n }",
"public function tearDown() {\n $this->resource = null;\n $this->response = null;\n $this->database = null;\n $this->storage = null;\n $this->event = null;\n $this->manager = null;\n }",
"public function tearDown()\n\t{\n\t\tunset($this->target);\n\t}",
"protected function tearDown(): void\n {\n $this->provider = null;\n $this->response = null;\n }",
"public function tearDown() : void {\n\t\tunset($this->ls); /* Kill circular references */\n\t\tunset($this->lsconn); /* Kill circular references */\n\t}",
"public function cleanup(): void\n {\n }",
"public function cleanup(): void\n {\n }",
"protected function tearDown(): void\n\t{\n\t\tglobal $modSettings;\n\n\t\t// remove temporary test data\n\t\tunset($modSettings);\n\t}",
"protected function tearDown() {\n gc_collect_cycles();\n }",
"public function tearDown(): void {\n // Remove any temporary directories that were created.\n $filesystem = new Filesystem();\n foreach ($this->tmpDirs as $dir) {\n $filesystem->remove($dir);\n }\n // Clear out variables from the previous pass.\n $this->tmpDirs = [];\n $this->io = NULL;\n // Clear the composer cache dir, if it was set\n putenv('COMPOSER_CACHE_DIR=');\n }",
"public function tearDown() {\n $this->transformation = null;\n }",
"public function tearDown() {\n $this->transformation = null;\n }",
"public function tearDown() {\n $this->transformation = null;\n }",
"protected function tearDown()\n {\n $this->regular1 = null;\n $this->regular2 = null;\n $this->rental1 = null;\n $this->rental2 = null;\n }",
"protected function tearDown()\n {\n $this->calculator = NULL;\n }",
"protected function tearDown(): void {\n $this->parser = null;\n }",
"public function teardown()\n {\n if ($this->csvFile) {\n unlink($this->csvFile);\n $this->csvFile = null;\n }\n\n if ($this->photoZip) {\n unlink($this->photoZip);\n $this->photoZip = null;\n }\n }",
"public function tearDown()\n {\n unset(\n $this->plugins,\n $this->events,\n $this->connection,\n $this->config\n );\n }",
"protected function tearDown()\n {\n session_destroy(); //req'd because Kml class sets a cookie\n $this->clearRequest();\n $this->clearTmpFiles();\n }",
"public function Cleanup()\r\n\t{\r\n\t}",
"protected function tearDown()\n {\n \tunset($this->object);\n }",
"protected function tearDown()\n {\n \tunset($this->object);\n }",
"protected function tearDown()\n {\n \tunset($this->object);\n }",
"protected function tearDown()\n {\n \tunset($this->object);\n }",
"public function tearDown() {\n\t\tFixtures::clear('db');\n\t\tGalleries::reset();\n\t\tImages::reset();\n\t}",
"public function tearDown() {\r\n\t\tunset($this->ImgTblHelper, $this->Controller, $this->View);\r\n\t\tparent::tearDown();\r\n\t}",
"protected function tearDown(): void\n {\n $this->autorizacao = null;\n $this->transacao = null;\n $this->object = null;\n }",
"protected function tearDown() {\r\n\t\t$this->dbh = null;\r\n\t\t$this->storage = null;\r\n\t\tparent::tearDown ();\r\n\t}",
"public function tearDown()\n {\n $this->objectManager->create(\\Magento\\Tax\\Test\\TestStep\\DeleteAllTaxRulesStep::class, [])->run();\n }",
"protected function tearDown() {\n $this->stack = null;\n }"
] | [
"0.7987785",
"0.7987785",
"0.7987785",
"0.7987785",
"0.7987785",
"0.7987785",
"0.7987785",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7986567",
"0.7985815",
"0.7985815",
"0.7985815",
"0.7985815",
"0.7985815",
"0.7985815",
"0.7850843",
"0.7850843",
"0.7850843",
"0.76951295",
"0.7688187",
"0.76663786",
"0.76383704",
"0.76116425",
"0.76023465",
"0.759858",
"0.7592881",
"0.7578189",
"0.75721014",
"0.7563723",
"0.7532292",
"0.7532245",
"0.7510675",
"0.7466052",
"0.745502",
"0.7447906",
"0.7437516",
"0.7432085",
"0.7422239",
"0.742056",
"0.74127865",
"0.7395499",
"0.7393894",
"0.73909515",
"0.7390909",
"0.7389362",
"0.7387827",
"0.7387827",
"0.7384437",
"0.7381771",
"0.73808354",
"0.73763293",
"0.73763293",
"0.73763293",
"0.73758084",
"0.7359128",
"0.7354937",
"0.7352378",
"0.73359734",
"0.7333032",
"0.7329993",
"0.7327933",
"0.7327933",
"0.7327933",
"0.7327933",
"0.73216355",
"0.7312936",
"0.7306989",
"0.7304376",
"0.7294614",
"0.72820467"
] | 0.0 | -1 |
Clean up after running all test cases | public static function tearDownAfterClass()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp();",
"public function cleanUp();",
"public function cleanUp();",
"public function cleanup() {\n\t\t//TODO\n\t}",
"public function cleanTestActivities()\n {\n\n $this->collectCurrentTestUsers();\n $this->cleanExerciseUploadPictures();\n $this->cleanDeviceUploadPictures();\n $this->resetDatabase();\n }",
"public function cleanup()\n {\n }",
"protected function cleanUp()\n\t{\n\t\t// clean\n\t\t$this->killExceededTasks();\n\t\t$this->cleanHistory();\n\t}",
"public function tearDown()\n {\n unset($this->db);\n unset($this->statement);\n unset($this->mockData);\n }",
"public function tearDown()\n {\n unset($this->_standardLib);\n unset($this->_daughter);\n }",
"public function teardown()\n {\n //\n }",
"protected function tearDown(): void {\n unset($this->integration);\n unset($this->ccm);\n unset($this->session);\n }",
"protected function tearDown() {\n\n $this->client = null;\n $this->deleteTestLocations();\n $this->locIDs = null;\n reuse_generateXML();\n }",
"public function cleanup()\n\t{\n\t}",
"protected function tearDown(): void\n {\n $this->config = null;\n $this->container = null;\n $this->instance = null;\n }",
"public function tearDown(): void\n {\n parent::tearDown();\n unset($this->purifier);\n unset($this->em);\n unset($this->objectiveManager);\n unset($this->learningMaterialManager);\n unset($this->courseLearningMaterialManager);\n unset($this->sessionLearningMaterialManager);\n unset($this->sessionDescriptionManager);\n unset($this->commandTester);\n }",
"public function teardown()\n {\n }",
"public function cleanup()\n\t{\n\t\t\n\t}",
"function __destruct() {\n if ($this->testDir) {\n $this->eraseTempDir();\n }\n $this->unsetMockSession();\n }",
"protected function tearDown(): void {\n\t\t$this->http_client = null;\n\t\t$this->process_transactions = array();\n\n\t\tif ( ! empty( $this->transactions ) ) {\n\t\t\t$this->transactions = array();\n\n\t\t\tCrudTable\\delete_rows( 'transactions', $this->key_pairs, 100 );\n\n\t\t\t$this->key_pairs['tag'] = $this->tag;\n\t\t\tCrudTable\\delete_rows( 'transactions', $this->key_pairs, 100 );\n\n\t\t\tTestHelpers::removeJsonFile( $this->process_tag );\n\t\t\tTestHelpers::removeJsonFile( $this->tag );\n\t\t}\n\t}",
"protected function tearDown()\r\n {\r\n DirectoryManager::recursiveRemoveDir('data/tests');\r\n }",
"public function tearDown()\n {\n // delete your instance\n OGR_DS_Destroy($this->hSrcDataSource);\n\n delete_directory($this->strPathToOutputData);\n\n unset($this->strPathToOutputData);\n unset($this->strTmpDumpFile);\n unset($this->strPathToData);\n unset($this->strPathToStandardData);\n unset($this->bUpdate);\n unset($this->hOGRSFDriver);\n unset($this->hLayer);\n unset($this->iSpatialFilter);\n unset($this->hSrcDataSource);\n }",
"protected function tearDown() {\n gc_collect_cycles();\n }",
"public function tearDown() {\n $this->container = null;\n $this->model = null;\n $this->request = null;\n $this->response = null;\n $this->responseHeaders = null;\n $this->responseWriter = null;\n }",
"public function tearDown(): void\n {\n parent::tearDown();\n unset($this->filesystem);\n unset($this->diskSpace);\n unset($this->commandTester);\n }",
"public function tearDown(): void {\n // Remove any temporary directories that were created.\n $filesystem = new Filesystem();\n foreach ($this->tmpDirs as $dir) {\n $filesystem->remove($dir);\n }\n // Clear out variables from the previous pass.\n $this->tmpDirs = [];\n $this->io = NULL;\n // Clear the composer cache dir, if it was set\n putenv('COMPOSER_CACHE_DIR=');\n }",
"public function cleanup(): void\n {\n }",
"public function cleanup(): void\n {\n }",
"public function Cleanup()\r\n\t{\r\n\t}",
"public function tearDown() : void {\n\t\tunset($this->ls); /* Kill circular references */\n\t\tunset($this->lsconn); /* Kill circular references */\n\t}",
"protected function tearDown()\n {\n unset($this->output);\n }",
"public function tearDown(): void\n {\n self::$environ->cleanupTestUploadFiles();\n self::$environ->clean();\n }",
"protected function tearDown() {\n $this->osapiCollection = null;\n $this->list = null;\n parent::tearDown();\n }",
"protected function tearDown()\n {\n $this->calculator = NULL;\n }",
"protected function tearDown(): void {\n $this->parser = null;\n }",
"protected function tearDown()\n {\n $this->compilerPass = null;\n $this->container = null;\n parent::tearDown();\n }",
"protected function tearDown()\n {\n $this->regular1 = null;\n $this->regular2 = null;\n $this->rental1 = null;\n $this->rental2 = null;\n }",
"public function tearDown() {\n\t\tFixtures::clear('db');\n\t\tGalleries::reset();\n\t\tImages::reset();\n\t}",
"protected function tearDown()\n {\n \\RPI\\Foundation\\Helpers\\FileUtils::delTree(__DIR__.\"/LESSPHPTest/ROOT\");\n }",
"public function tearDown() {\n $this->resource = null;\n $this->response = null;\n $this->database = null;\n $this->storage = null;\n $this->event = null;\n $this->manager = null;\n }",
"protected function tearDown(): void\n\t{\n\t\tglobal $modSettings;\n\n\t\t// remove temporary test data\n\t\tunset($modSettings);\n\t}",
"public function tearDown() {\n if ($this->wedisabledgc) {\n gc_enable();\n }\n $this->wedisabledgc = false;\n }",
"public function tearDown()\n {\n $fs = new SymfonyFileSystem();\n $fs->remove($this->fakeTestFileDir);\n\n unset($this->builder);\n unset($this->builder);\n unset($this->fs);\n m::close();\n }",
"protected function tearDown(): void\n {\n $this->provider = null;\n $this->response = null;\n }",
"function endTest() {\n unset($this->CalendarRecursion);\n unset($this->CalendarInstance);\n unset($this->Activity);\n ClassRegistry::flush();\n }",
"public function tearDown()\n {\n unset(\n $this->plugins,\n $this->events,\n $this->connection,\n $this->config\n );\n }",
"protected function tearDown()\n {\n session_destroy(); //req'd because Kml class sets a cookie\n $this->clearRequest();\n $this->clearTmpFiles();\n }",
"public function tearDown() {\r\n\t\tunset($this->ImgTblHelper, $this->Controller, $this->View);\r\n\t\tparent::tearDown();\r\n\t}",
"public function tearDown() {\n $this->transformation = null;\n }",
"public function tearDown() {\n $this->transformation = null;\n }",
"public function tearDown() {\n $this->transformation = null;\n }",
"protected function tearDown() {\r\n\t\t$this->dbh = null;\r\n\t\t$this->storage = null;\r\n\t\tparent::tearDown ();\r\n\t}",
"public function tearDown()\n\t{\n\t\tunset($this->target);\n\t}",
"function tearDown() {\n\t\t$this->wfRecursiveRemoveDir( $this->tmpName );\n\t}",
"protected function tearDown()\n {\n Phlash::clear();\n }",
"public function tearDown()\n {\n unset($this->filterRepositoryMock);\n unset($this->notificationContextManagerMock);\n unset($this->notificationTranslatorMock);\n unset($this->filterManager);\n }"
] | [
"0.79781395",
"0.79781395",
"0.79781395",
"0.79781395",
"0.79781395",
"0.79781395",
"0.79781395",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976836",
"0.7976344",
"0.7976344",
"0.7976344",
"0.7976344",
"0.7976344",
"0.7976344",
"0.78772247",
"0.78772247",
"0.78772247",
"0.77385294",
"0.7622718",
"0.7590846",
"0.7581981",
"0.75642306",
"0.75500023",
"0.7537886",
"0.75273365",
"0.7519937",
"0.7509883",
"0.7505579",
"0.74835205",
"0.74744475",
"0.7472191",
"0.7471073",
"0.7448932",
"0.74277306",
"0.74264514",
"0.7404205",
"0.739177",
"0.7386229",
"0.7383461",
"0.738092",
"0.738092",
"0.73677146",
"0.73663706",
"0.73597026",
"0.734277",
"0.7338558",
"0.73383325",
"0.7336859",
"0.73303896",
"0.7327291",
"0.73259425",
"0.7311458",
"0.7303411",
"0.7294846",
"0.7285744",
"0.7283386",
"0.7278399",
"0.7277675",
"0.7275594",
"0.72737646",
"0.7273622",
"0.7269152",
"0.7269152",
"0.7269152",
"0.72667706",
"0.72666764",
"0.7249254",
"0.7248658",
"0.72467804"
] | 0.0 | -1 |
Test case for getTrackingSources Get Webinar Tracking Sources. | public function testGetTrackingSources()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GetSources()\n\t{\n\t\t$result = $this->sendRequest(\"GetSources\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"function getSources();",
"function getSources ( $params=array() )\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['syndication_url']}/resources/sources.json\",$params);\n\n return $this->createResponse($result,'get All Sources');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }",
"abstract public function get_sources();",
"public function fetchSources () {\r\n\t}",
"protected function getSources()\n\t{\n\t\tif(!$this->sources)\n\t\t{\n\t\t\t$this->sources = Source::orderBy('title', 'asc')->get();\n\t\t}\n\t\t\n\t\treturn $this->sources;\n\t}",
"public function listsPatientsourcesget()\r\n {\r\n $response = Sources::all(); \r\n return response()->json($response, 200);\r\n }",
"public function listSources() {\n return null;\n }",
"function showGetEventSources() {\n\t\t$this->getEngine()->assign('oModel', utilityOutputWrapper::wrap($this->getModel()));\n\t\t$this->render($this->getTpl('sourceList', '/account'));\n\t}",
"public function listSources() {\n $this->resolve();\n return $this->sources;\n }",
"public function get_sources($args) {\n $payload = [];\n if (isset($args['category'])) $payload = $this->queries->get_category($args['category'], $payload);\n if (isset($args['country'])) $payload = $this->queries->get_country($args['country'], $payload);\n if (isset($args['language'])) $payload = $this->queries->get_language($args['language'], $payload);\n return $this->queries->connect($this->queries->constants->urls['sources'], $payload, $this->api_key);\n }",
"public function getSources()\n {\n return $this->sources;\n }",
"public function getSiteSources()\n {\n if (array_key_exists(\"siteSources\", $this->_propDict)) {\n return $this->_propDict[\"siteSources\"];\n } else {\n return null;\n }\n }",
"public function leads_sources_report()\n {\n echo json_encode($this->reports_model->leads_sources_report());\n }",
"function listSources() {\n\t\n\t}",
"public function getSources() {\n return $this->parameterMethod() == self::METHOD_GET ? self::SOURCE_URL : self::SOURCE_REQUEST;\n }",
"public function getSources()\n {\n return $this->hasMany(Source::className(), ['id_url' => 'id']);\n }",
"public static function getSources($data = array()) {\n\t\t$db = JO_Db::getDefaultAdapter();\n\n\t\t$query = $db->select()\n\t\t\t\t\t->from('pins_sources', array('*', 'pins' => new JO_Db_Expr('('.$db->select()->from('pins','COUNT(pin_id)')->where('source_id = pins_sources.source_id')->limit(1).')')))\n\t\t\t\t\t->order('pins_sources.source_id DESC');\n\n\t\tif(isset($data['filter_source']) && $data['filter_source']) {\n\t\t\t$query->where('source LIKE ?', '%'.str_replace(' ', '%', $data['filter_source']).'%');\n\t\t}\n\t\t\n\t\tif(isset($data['start']) && isset($data['limit'])) {\n\t\t\tif($data['start'] < 0) {\n\t\t\t\t$data['start'] = 0;\n\t\t\t}\n\t\t\t$query->limit($data['limit'], $data['start']);\n\t\t} \n\n\t\treturn $db->fetchAll($query);\n\n\t}",
"public function load_sources() {\n $this->sources = json_decode(file_get_contents(__DIR__ . '/../servers/sources.json'), true);\n if (!isset($this->sources[$this->site_id])) {\n die();\n }\n $this->data = $this->sources[$this->site_id];\n }",
"public function getSpecificPopulationSourcesList() {\n return $this->_get(3);\n }",
"public function sources()\n {\n if (is_null($this->sourceRequests)) {\n $this->sourceRequests = new SourceRequests($this->client);\n }\n\n return $this->sourceRequests;\n }",
"public function listSources($data = null) {\n\t\treturn null;\n\t}",
"public function getRoiSources()\n {\n //get DBO\n $db = JFactory::getDBO();\n $query = $db->getQuery(true);\n\n //construct query string\n $query->select(\"s.id,s.name,count(d.id) as number_of_deals,sum(d.amount) as revenue,s.type,s.cost\");\n $query->select(\"IF ( s.type <> 'per', ( ( ( ( sum(d.amount) - s.cost ) / s.cost ) * 100 ) ), ( ( sum(d.amount) - ( s.cost * count(d.id) ) ) / ( s.cost * count(d.id) ) * 100 ) ) AS roi\");\n $query->from(\"#__sources AS s\");\n\n //left join data\n $won_stage_ids = DealHelper::getWonStages();\n $query->leftJoin(\"#__deals AS d ON d.source_id = s.id AND d.stage_id IN (\".implode(',',$won_stage_ids).\") AND d.published=1 AND d.archived=0\");\n $query->leftJoin(\"#__users AS u ON u.id = d.owner_id\");\n\n //set our sorting direction if set via post\n $query->order($this->getState('Source.filter_order') . ' ' . $this->getState('Source.filter_order_Dir'));\n\n //group data\n $query->group(\"s.id\");\n\n if ($this->_id) {\n if ( is_array($this->_id) ) {\n $query->where(\"s.id IN (\".implode(',',$this->_id).\")\");\n } else {\n $query->where(\"s.id=$this->_id\");\n }\n }\n\n //filter based on member access roles\n $user_id = UsersHelper::getUserId();\n $member_role = UsersHelper::getRole();\n $team_id = UsersHelper::getTeamId();\n\n if ($member_role != 'exec') {\n\n if ($member_role == 'manager') {\n $query->where(\"u.team_id=$team_id\");\n } else {\n $query->where(\"(d.owner_id=$user_id)\");\n }\n\n }\n\n //set query and load results\n $db->setQuery($query);\n $results = $db->loadAssocList();\n\n return $results;\n }",
"public function getUserSources()\n {\n if (array_key_exists(\"userSources\", $this->_propDict)) {\n return $this->_propDict[\"userSources\"];\n } else {\n return null;\n }\n }",
"public function getPoolSourceslist()\n\t{\n\t\treturn($this->getProperty('sourceslist'));\n\t}",
"public function get_sources($args=array()){\n\n $_url = $this->api_url . 'sources?' . $this->api_key;\n foreach ($args as $key=>$item){\n if (!is_null($item) and !empty($item)){\n $_url .= '&' . $key . '=' .$item;\n }\n }\n\n $json = file_get_contents($_url);\n $obj = json_decode($json, true);\n return $obj;\n\n }",
"public function getSources(): array\n {\n return $this->config['source'] ?? [];\n }",
"public function testListServiceSources()\n {\n\n }",
"public function getGeneralPopulationSourcesList() {\n return $this->_get(2);\n }",
"protected function _getSources()\n {\n return array('oxBasket' => $this->getShop()->getBasket());\n }",
"function getUpcomingWebinars()\n {\n $path = $this->getPathRelativeToOrganizer('upcomingWebinars');\n\n return $this->sendRequest('GET', $path, $parameters = null, $payload = null);\n }",
"public function sources(): array\n {\n return $this->sources;\n }",
"function getJointSources($limit = 200) {\n\n $stateEncoded = STATE_PUBLISHED_ENCODED;\n $result = query(\"SELECT *\n FROM jointsources_summary\n WHERE state = {$stateEncoded}\n LIMIT {$limit};\");\n\n return createJointSourcesFromQueryResult($result);\n\n }",
"private function getAllSourcesFromDB() {\n return $this->database->table(\"source\")->fetchAll();\n }",
"public function listsPatientsourcesByIdget($patientsources_id)\r\n {\r\n $source = Sources::findOrFail($patientsources_id);\r\n return response()->json($source,200);\r\n }",
"public function GetNewsSources($start=0, $count=10, $asArray=false){\n\t\t\tif(is_string($start) === true && ctype_digit($start) === true){\n\t\t\t\t$start = (integer)$start;\n\t\t\t}\n\t\t\tif(is_string($count) === true && ctype_digit($count) === true){\n\t\t\t\t$count = (integer)$count;\n\t\t\t}\n\n\t\t\tif(is_integer($start) === false){\n\t\t\t\tthrow new InvalidArgumentException('Start point must be specified as integer.');\n\t\t\t}else if($start < 0){\n\t\t\t\tthrow new InvalidArgumentException('Start point must be greater than or equal to zero.');\n\t\t\t}else if(is_integer($count) === false){\n\t\t\t\tthrow new InvalidArgumentException('Count must be specified as integer.');\n\t\t\t}else if($count < 1){\n\t\t\t\tthrow new InvalidArgumentException('Count must be greater than or equal to one.');\n\t\t\t}else if(is_bool($asArray) === false){\n\t\t\t\tthrow new InvalidArgumentException('asArray flag must be specified as boolean.');\n\t\t\t}\n\n\t\t\t$response = array();\n\t\t\tif($asArray === true || WebUI\\GetNewsSources::hasInstance($this) === false){\n\t\t\t\t$result = $this->makeCallToAPI('GetNewsSources', true, array(\n\t\t\t\t\t'Start' => $start,\n\t\t\t\t\t'Count' => $count\n\t\t\t\t), array(\n\t\t\t\t\t'Total' => array('integer'=>array()),\n\t\t\t\t\t'Groups' => array('array'=>array(array('object'=>array())))\n\t\t\t\t));\n\t\t\t\tforeach($result->Groups as $group){\n\t\t\t\t\t$response[] = self::GroupResult2GroupRecord($group);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $asArray ? $response : WebUI\\GetNewsSources::r($this, $start, $result->Total, $response);\n\t\t}",
"public function getAvailableSources() {\n // Use plugin system to get list of available vacancy sources.\n $sources = $this->getDefinitions();\n\n $output = array();\n foreach ($sources as $id => $definition) {\n $output[$id] = $definition;\n }\n\n return $output;\n }",
"public function getOtherSourceList() {\n return $this->_get(6);\n }",
"public function sources() {\n return $this->hasMany(Location::class);\n }",
"protected function getSourcesContent(){\n if(empty($this->sources)){\n return;\n }\n $content = array();\n foreach($this->sources as $sourceFile){\n $content[] = file_get_contents($sourceFile);\n }\n return $content;\n }",
"function GetSourceList($sourceIds)\n\t{\n\t\t$result = $this->sendRequest(\"GetSourceList\", array(\"SourceIds\"=>$sourceIds));\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"protected static function getSources() : array\n {\n return static::$sources ?? (static::$sources = [\n self::STRENGTH_STRONG => [\n random\\sources\\OpenSSL::class => null\n ]\n ]);\n }",
"protected function inputSources()\n {\n if ($this->allowMultipleSources) {\n $sources = $this->sources;\n } else {\n $sources = [$this->source];\n }\n\n return $sources;\n }",
"function getSourceResults($json){\n\n\t\t// $url = array();\n\n\t\t$json_array = json_decode($json, true);\n\n\t\t$url = '';\n\n\t\tforeach($json_array['query']['pages'] as $page){\n\t\t\t\t// foreach($page['thumbnail'] as $thumbnail){\n\t\t\t\t// \t$url = $thumbnail['source'];\n\t\t\t\t// }\n\t\t\t\t$url = $page['thumbnail']['source'];\n\t\t}\n\n\t\treturn $url;\n\n\t}",
"public function lead_source_list()\n {\n \n $result = $this->db->query(\"call lead_source_list()\")->result();\n save_query_in_log();\n \n return $result;\n }",
"public function testBillingSources()\n {\n }",
"function wprss_get_all_feed_sources() {\n // Get all feed sources\n $feed_sources = new WP_Query( apply_filters(\n 'wprss_get_all_feed_sources',\n array(\n 'post_type' => 'wprss_feed',\n 'post_status' => 'publish',\n 'cache_results' => false, // Disable caching, used for one-off queries\n 'no_found_rows' => true, // We don't need pagination, so disable it\n 'posts_per_page' => -1\n )\n ) );\n return $feed_sources;\n }",
"public function testGetGeneSources() {\n\t\techo (\"\\n********************Test GetGeneSources()***************************************************\\n\");\n\t\t\n\t\t$tmp = get_class ( $this->gene->getGeneSources () );\n\t\t$this->assertEquals ( $tmp, \"Doctrine\\Common\\Collections\\ArrayCollection\" );\n\t}",
"static function loadArrayOfSourcesWithProperties(array $inSources) {\n\t\t $return = false;\n\t\t $properties = array();\n\t\t if ( count($inSources) > 0 ) {\n\t\t \t$query = '\n\t\t \t\tSELECT downloadSources.sourceID, downloadSources.downloadHash, downloadFiles.*\n\t\t \t\t FROM '.system::getConfig()->getDatabase('mofilm_content').'.downloadFiles\n\t\t \t\t INNER JOIN '.system::getConfig()->getDatabase('mofilm_content').'.downloadSources ON (downloadFiles.ID = downloadSources.downloadID)\n\t\t \t\t WHERE downloadSources.sourceID IN ('.implode(',', array_keys($inSources)).')\n\t\t \t\t AND downloadFiles.filetype = \"music\"';\n\n\t\t \t$oStmt = dbManager::getInstance()->prepare($query);\n\t\t \tif ( $oStmt->execute() ) {\n\t\t \t\tforeach ( $oStmt as $row ) {\n\t\t\t\t\t$oObject = new mofilmTrack();\n\t\t\t\t\t$oObject->loadFromArray($row);\n\n\t\t \t\t\t$properties[$row['sourceID']][] = $oObject;\n\t\t \t\t}\n\t\t \t}\n\t\t \t$oStmt->closeCursor();\n\n\t\t \tif ( false ) $oObject = new mofilmSource();\n\t\t \tforeach ( $inSources as $oObject ) {\n\t\t \t\tif ( $oObject instanceof mofilmSource ) {\n\t\t \t\t\tif ( array_key_exists($oObject->getID(), $properties) ) {\n\t\t \t\t\t\t$oObject = new mofilmSourceTrackSet();\n\t\t \t\t\t\t$oObject->setSourceID($oObject->getID());\n\t\t \t\t\t\t$oObject->setObjects($properties[$oObject->getID()]);\n\t\t \t\t\t\t$oObject->setModified(false);\n\n\t\t \t\t\t\t$oObject->setTrackSet($oObject);\n\t\t \t\t\t\t$return = true;\n\t\t \t\t\t}\n\t\t \t\t}\n\t\t \t}\n\t\t }\n\t\t return $return;\n\t}",
"public function get_source()\n {\n }",
"public function testSimpleExtractionFromAllSources()\n {\n $queryData = ['a' => 1, 'b' => 2];\n $requestData = ['a' => 2, 'b' => 4, 'c' => 8];\n $contentData = ['b' => 3, 'c' => 6, 'd' => 9];\n $request = $this->createRequest($queryData, $requestData, $contentData);\n\n $this->assertEquals(\n ['a' => 2, 'b' => 3, 'c' => 6, 'd' => 9],\n $this->extractParameters($request)\n );\n }",
"public function getDataSourcesList() {\n return $this->_get(8);\n }",
"public function getDataSourcesList() {\n return $this->_get(10);\n }",
"function wprss_get_feed_source() {\n // Get all feed sources\n $feed_sources = new WP_Query( apply_filters(\n 'wprss_get_all_feed_sources',\n array(\n 'post_type' => 'wprss_feed',\n 'post_status' => 'publish',\n 'cache_results' => false, // Disable caching, used for one-off queries\n 'no_found_rows' => true, // We don't need pagination, so disable it\n 'posts_per_page' => -1\n )\n ) );\n return $feed_sources;\n }",
"public function testSources()\n {\n $this->feed->setRenderer(new MockBlankRenderer(['customCfgData' => 'data']));\n $feedData = $this->feed->getFeed();\n\n $this->assertArrayHasKey('customCfgData', $feedData['channel']);\n\n $this->assertCount(3, $feedData['items']);\n }",
"public function getOtherSpecificPopulationSourceList() {\n return $this->_get(4);\n }",
"public function getMagentoWebsites();",
"public function testListPastWebinarPollResults()\n {\n }",
"public function getSources($context = null)\n {\n $sources = [];\n $sources['*'] = ['label' => Craft::t('All Subscribers')];\n\n $sources[] = ['heading' => Craft::t('Subscriptions')];\n foreach (craft()->charge_membershipSubscription->getAllMembershipSubscriptions() as $subscription) {\n $sources['membershipSubscriptionId:' . $subscription->id] = ['label' => $subscription->name, 'criteria' => ['membershipSubscriptionId' => $subscription->id]];\n }\n\n return $sources;\n }",
"public function test_getSourceUrl_sourceUrlFieldIsNotEmpty_returnCorrectly()\r\n\t{\r\n\t\t$expected = \"aDummySourcelUrl\";\r\n\t\t$this->service->sourceUrl = $expected;\r\n\t\t$actual = $this->service->getsourceurl();\r\n\t\t$this->assertEquals($expected, $actual);\r\n\t}",
"protected function availableSources(): array\n {\n return Craft::$app->getElementIndexes()->getSources(static::elementType(), 'modal');\n }",
"public function getSourcesAttribute()\n {\n $sources = [];\n\n $fullPath = $this->fullPath();\n\n if ( $this->file_extension != null || $this->file_extension != '' )\n {\n $sources['original'] = $fullPath . '/' . $this->file_name . '.' . $this->file_extension;\n } else {\n $sources['original'] = $fullPath . '/' . $this->file_name;\n }\n\n if ( $this->has_thumbnails )\n {\n\n foreach ( $this->thumbnails as $key => $size )\n {\n $sources[$key] = $fullPath . '/' . $size . '.' . $this->file_extension;\n }\n }\n\n return $sources;\n }",
"public function getMappingSources() {\n return parent::getMappingSources() + array(\n /* Field sources with data generated from other fields. */\n\n /* Custom field sources for enforcing uniqueness. */\n // stripped_guid is deprecated for use as GUID now, as per conversation with Dan Stryker\n // (sometimes feeds will have multiple opportunities at the same URL)\n 'stripped_guid' => array(\n 'name' => t('AFG: Opportunity URL'),\n 'description' => t('The GUID stripped of the fp:id which is appended after a hash character (#). This should be equivalent to fp:detailurl, but that doesn\\'t show up in the AFG feed output.'),\n ),\n 'volopp_hash' => array(\n 'name' => t('AFG: Hash of Title, Description, Provider'),\n 'description' => t('The md5 hash of the title, description, and fp:provider for a given feed item. Used as a GUID.'),\n ),\n\n /* Custom field for latitude from fp:latlong */\n 'afg_lat' => array(\n 'name' => t('AFG: Latitude'),\n 'description' => t('The latitude of a volunteer opportunity. (Taken from fp:latlong.)'),\n ),\n /* Custom field for longitude from fp:latlong */\n 'afg_long' => array(\n 'name' => t('AFG: Longitude'),\n 'description' => t('The longitude of a volunteer opportunity. (Taken from fp:latlong.)'),\n ),\n /* Custom field for opportunity start date from fp:startDate */\n 'afg_startDate' => array(\n 'name' => t('AFG: Opportunity Start Date'),\n 'description' => t('The opportunity start date in MM/DD/YYYY format.'),\n ),\n /* Custom field for opportunity end date from fp:endDate */\n 'afg_endDate' => array(\n 'name' => t('AFG: Opportunity End Date'),\n 'description' => t('The opportunity end date in MM/DD/YYYY format.'),\n ),\n\n /* Field sources taken directly from the AFG feed. */\n\n /* Fields that are always present on an AFG feed. */\n 'fp_id' => array(\n 'name' => t('AFG: Hash (fp:id)'),\n 'description' => t('Hashed ID of the opportunity in AFG feed output. Supposedly changes each day.'),\n ),\n 'fp_groupid' => array(\n 'name' => t('AFG: ID of Merged Opps (fp:groupid)'),\n 'description' => t('An ID for a deduped set of results.'),\n ),\n 'fp_provider' => array(\n 'name' => t('AFG: Raw Opportunity Source (fp:provider)'),\n 'description' => t('Provider of the opportunity. It is a \"machine name\", so is always lowercase and will not necessarily have spaces.'),\n ),\n 'fp_startDate' => array(\n 'name' => t('AFG: Raw Opportunity Start Date (fp:startDate)'),\n 'description' => t('The start date for a volunteer opportunity.'),\n ),\n 'fp_endDate' => array(\n 'name' => t('Opportunity End Date (fp:endDate)'),\n 'description' => t('The end date for a volunteer opportunity.'),\n ),\n 'fp_base_url' => array(\n 'name' => t('AFG: Hash (fp:base_url)'),\n 'description' => t('Same as fp:id.'),\n ),\n 'fp_xml_url' => array(\n 'name' => t('AFG: Opportunity URL with Hash (fp:xml_url)'),\n 'description' => t('Full URL to opportunity, including hash. (Same as GUID of opportunity.)'),\n ),\n 'fp_url_short' => array(\n 'name' => t('AFG: Opportunity URL Domain Name (fp:url_short)'),\n 'description' => t('The domain name of the site where the original opportunity listing is found.'),\n ),\n 'fp_latlong' => array(\n 'name' => t('AFG: Raw Latitude/Longitude (fp:latlong)'),\n 'description' => t('Latitude, Longitude to seven digits of precision. Needs custom parsing to be mapped.'),\n ),\n 'fp_location_name' => array(\n 'name' => t('AFG: Opportunity City, State Zip (fp:location_name)'),\n 'description' => t('Opportunity location, with city, state, and zip all in one field.'),\n ),\n 'fp_interest_count' => array(\n 'name' => t('AFG: Clickthrus? (fp:interest_count)'),\n 'description' => t('Unsure - possibly number of clickthrus.'),\n ),\n 'fp_impressions' => array(\n 'name' => t('AFG: Number of Pageviews? (fp:impressions)'),\n 'description' => t('Unsure - possibly number of pageviews, possibly related to an ad campaign.'),\n ),\n 'fp_quality_score' => array(\n 'name' => t('AFG: Opportunity Rating (fp:quality_score)'),\n 'description' => t('Internal rating from 0 to 10 of quality of opportunity.'),\n ),\n 'fp_virtual' => array(\n 'name' => t('AFG: Virtual Opportunity Status (fp:virtual)'),\n 'description' => t('Whether opportunity is virtual - True or False.'),\n ),\n 'fp_sponsoringOrganizationName' => array(\n 'name' => t('AFG: Sponsoring Organization Name (fp:sponsoringOrganizationName)'),\n 'description' => t('Name of organization offering this opportunity.'),\n ),\n 'fp_openEnded' => array(\n 'name' => t('AFG: Open-Ended Opportunity Status (fp:openEnded)'),\n 'description' => t('Whether opportunity is open-ended (no specific start or end date).'),\n ),\n 'fp_startTime' => array(\n 'name' => t('AFG: Opportunity Start Time (fp:startTime)'),\n 'description' => t('Opportunity start time.'),\n ),\n 'fp_endTime' => array(\n 'name' => t('AFG: Opportunity End Time (fp:endTime)'),\n 'description' => t('Opportunity end time.'),\n ),\n /* Fields that are sometimes present on an AFG feed. */\n 'fp_skills' => array(\n 'name' => t('AFG: Opportunity Skills (fp:skills)'),\n 'description' => t('Skills needed for this opportunity. (Many providers use this as a detailed description.)'),\n ),\n 'fp_contactEmail' => array(\n 'name' => t('AFG: Email Address for Primary Contact (fp:contactEmail)'),\n 'description' => t('The email address for the primary contact for the opportunity.'),\n ),\n 'fp_contactPhone' => array(\n 'name' => t('AFG: Phone Number for Primary Contact (fp:contactPhone)'),\n 'description' => t('The phone number for the primary contact for the opportunity.'),\n ),\n /* Feeds that are never (so far) present on an AFG feed. */\n 'fp_categories' => array(\n 'name' => t('AFG: Opportunity Categories (fp:categories)'),\n 'description' => t('The categories with which the opportunity is tagged. (Providers won\\'t usually offer this.)'),\n ),\n 'fp_s' => array(\n 'name' => t('fp:s'),\n 'description' => t('Unsure.'),\n ),\n 'fp_m' => array(\n 'name' => t('fp:m'),\n 'description' => t('Unsure.'),\n ),\n 'fp_addr1' => array(\n 'name' => t('AFG: First Line of Address? (fp:addr1)'),\n 'description' => t('First line of address?'),\n ),\n 'fp_addrname' => array(\n 'name' => t('AFG: Address Name? (fp:addrname)'),\n 'description' => t('Address Name?'),\n ),\n 'fp_contactNoneNeeded' => array(\n 'name' => t('fp:contactNoneNeeded'),\n 'description' => t('Unsure.'),\n ),\n 'fp_contactName' => array(\n 'name' => t('AFG: Name of Primary Contact? (fp:contactName)'),\n 'description' => t('Name of Primary Contact?'),\n ),\n 'fp_detailUrl' => array(\n 'name' => t('AFG: Link to Original Opportunity? (fp:detailUrl)'),\n 'description' => t('Link to Original Opportunity?'),\n ),\n 'fp_audienceAll' => array(\n 'name' => t('fp:audienceAll'),\n 'description' => t('Unsure.'),\n ),\n 'fp_audienceAge' => array(\n 'name' => t('AFG: Acceptable Ages? (fp:audienceAge)'),\n 'description' => t('What ages of volunteer the opportunity is suited for?'),\n ),\n 'fp_minAge' => array(\n 'name' => t('AFG: Minimum Age? (fp:minAge)'),\n 'description' => t('Minimum age for volunteers?'),\n ),\n 'fp_audienceSexRestricted' => array(\n 'name' => t('AFG: Volunteers Only of a Particular Gender? (fp:audienceSexRestricted)'),\n 'description' => t('Whether volunteers can only be of a particular gender?'),\n ),\n 'fp_street1' => array(\n 'name' => t('AFG: Street Address Line 1? (fp:street1)'),\n 'description' => t('Street Address Line 1?'),\n ),\n 'fp_street2' => array(\n 'name' => t('AFG: Street Address Line 2? (fp:street2)'),\n 'description' => t('Street Address Line 2?'),\n ),\n 'fp_city' => array(\n 'name' => t('AFG: City? (fp:city)'),\n 'description' => t('City?'),\n ),\n 'fp_region' => array(\n 'name' => t('AFG: Region/State? (fp:region)'),\n 'description' => t('Region/State?'),\n ),\n 'fp_postalCode' => array(\n 'name' => t('AFG: Postal Code/Zipcode? (fp:postalCode)'),\n 'description' => t('Postal Code/Zipcode?'),\n ),\n 'fp_country' => array(\n 'name' => t('AFG: Country? (fp:country)'),\n 'description' => t('Country?'),\n ),\n /* Service and Interest Area Auto-Tagged Value */\n 'volopp_tagged_value' => array(\n 'name' => t('Opportunity Currently Auto-Tagged'),\n 'description' => t('Whether or not the opportunity is currently auto-tagged by cron (always 0 on an import)'),\n ),\n );\n }",
"public function GetAssetSources(GetAssetSources $parameters)\n {\n return $this->__soapCall('GetAssetSources', array($parameters));\n }",
"public function get_sites()\n {\n }",
"public function getDataSourcesList() {\n return $this->_get(1);\n }",
"public function listSources($data = null) {\n return $this->client->getFunctions();\n }",
"public function GetAssetSourcesEx(GetAssetSourcesEx $parameters)\n {\n return $this->__soapCall('GetAssetSourcesEx', array($parameters));\n }",
"public function sources()\n {\n return $this->hasMany('Didbot\\DidbotApi\\Models\\Source');\n }",
"public function index()\n {\n $sources = $this->allResources($this->sourceRepository);\n\n return SourceResource::collection($sources);\n }",
"public function sourceRecords()\n {\n if (class_exists(\"Subsite\") && Subsite::get()->count() > 0) {\n $origMode = Versioned::get_reading_mode();\n Versioned::set_reading_mode(\"Stage.Stage\");\n $items = array(\n \"Pages\" => Subsite::get_from_all_subsites(\"SiteTree\"),\n \"Files\" => Subsite::get_from_all_subsites(\"File\"),\n );\n Versioned::set_reading_mode($origMode);\n\n return $items;\n } else {\n return array(\n \"Pages\" => Versioned::get_by_stage(\"SiteTree\", \"Stage\"),\n \"Files\" => File::get(),\n );\n }\n }",
"public function get_sites() {\n return $this->linkemperor_exec(null, null,\"/api/v2/customers/sites.json\");\n }",
"function getSourceById ( $id )\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['syndication_url']}/resources/sources/{$id}.json\");\n return $this->createResponse($result,'get Source','Id');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }",
"public function testListPastWebinarQA()\n {\n }",
"public function getSources()\n\t{\n\t\t$sources = array(\n\t\t\t'*' => array(\n\t\t\t\t'label' => Craft::t('All entries')\n\t\t\t)\n\t\t);\n\n\t\tif (Craft::hasPackage(CraftPackage::PublishPro))\n\t\t{\n\t\t\tforeach (craft()->sections->getEditableSections() as $section)\n\t\t\t{\n\t\t\t\t$key = 'section:'.$section->id;\n\n\t\t\t\t$sources[$key] = array(\n\t\t\t\t\t'label' => $section->name,\n\t\t\t\t\t'criteria' => array('sectionId' => $section->id)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $sources;\n\t}",
"protected function getApiSourceInfo() {\n if (empty($this->apiSourceInfo)) {\n $this->setApiSourceInfo();\n }\n return $this->apiSourceInfo;\n }",
"function listSources() {\n\t\t$cache = parent::listSources();\n\t\tif ($cache != null) {\n\t\t\treturn $cache;\n\t\t}\n\t\t$result = $this->_execute('SHOW TABLES FROM ' . $this->name($this->config['database']) . ';');\n\n\t\tif (!$result) {\n\t\t\treturn array();\n\t\t} else {\n\t\t\t$tables = array();\n\n\t\t\twhile ($line = mysql_fetch_row($result)) {\n\t\t\t\t$tables[] = $line[0];\n\t\t\t}\n\t\t\tparent::listSources($tables);\n\t\t\treturn $tables;\n\t\t}\n\t}",
"public function getSourceData();",
"public function sources($class = null)\n {\n }",
"function insertNewsSources_get(){//just call this function to insert news sources in databse.\n $response = $this->news_api->get_news_sources();\n $json_decode = json_decode($response);\n foreach($json_decode->sources as $value){\n $dataInsert['newsSourceId'] = $value->id;\n $dataInsert['name'] = $value->name;\n $dataInsert['description'] = $value->description;\n $dataInsert['url'] = $value->url;\n $dataInsert['category'] = $value->category;\n $dataInsert['language'] = $value->language;\n $dataInsert['country'] = $value->country;\n //pr($dataInsert);\n $this->common_model->insertData($dataInsert,NEWS_SOURCES);\n }\n\n }",
"public function testAddGeneSources() {\n\t\techo (\"\\n********************Test AddGeneSources()***************************************************\\n\");\n\t\n\t\t$result = - 1;\n\t\n\t\t$this->gene->addGeneSources( $this->publication );\n\t\t$result = $this->gene->getGeneSources()->count ();\n\t\n\t\t$this->assertEquals ( 1, $result );\n\t}",
"private static function addSources(? array $addSources = null)\n {\n self::verifyIsNull(\"Sources list\", $addSources);\n $validSources = [];\n\n foreach ($addSources as $key => $value) {\n if (is_numeric($key) || empty($value) || !filter_var($value, FILTER_VALIDATE_URL)) {\n continue;\n }\n\n $validSources[$key] = $value;\n }\n\n self::$endpoints = array_merge(self::$endpoints, $validSources);\n }",
"public function testWebinarPollGet()\n {\n }",
"public function load($sources): array;",
"public function getStartingPins()\n {\n $lng = config('app.locations.default_center.lng');\n $lat = config('app.locations.default_center.lat');\n return $this->getFoursquareLocations($lat, $lng);\n }",
"public function getFullFundingSources(){\n\t\t$connection=Database::getConnection();\n\t\t$query=\"SELECT * FROM fundingsource\";\n\t\t$items=\"\";\n\t\t$result_obj=$connection->query($query);\n\t\ttry{\n\t\t\twhile($result = $result_obj->fetch_array(MYSQLI_ASSOC)){\n\t\t\t\t$items[]=$result;\n\t\t\t}\n\t\t\treturn($items);\n\t\t}\n\t\tcatch(Exception $e){\n\t\t\treturn false;\n\t\t}\n\t}",
"public function index() {\n\n $ticket_sources = TicketSource::paginate(10);\n return view('tickets.settings.ticket_sources.index')->with('ticket_sources', $ticket_sources);\n }",
"protected function get_site_ids()\n {\n }",
"public function getGoogleAnalyticsSource()\n\t{\n\t\treturn $this->google_analytics_source;\n\t}",
"public function testGetPromotionCampaignsUsingGET()\n {\n }",
"protected function _getLists() {\n\t\t/** @var Thrive_Dash_Api_WebinarJamStudio $api */\n\t\t$api = $this->getApi();\n\t\ttry {\n\t\t\t$lists = array();\n\t\t\t$webinars = $api->getUpcomingWebinars();\n\t\t\tforeach ( $webinars as $key => $item ) {\n\t\t\t\t$lists [] = array(\n\t\t\t\t\t'id' => $item['webinar_id'],\n\t\t\t\t\t'name' => $item['name']\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $lists;\n\t\t} catch ( Thrive_Dash_Api_WebinarJamStudio_Exception $e ) {\n\t\t\t$this->_error = $e->getMessage();\n\n\t\t\treturn false;\n\t\t}\n\n\t}",
"public function SourcesToArray(){\n if ($this->config_data != NULL){\n $this->data_sources = array_keys($this->config_data);\n\n }\n }",
"function getCurrentSeasonDestinations(){ \n\t\n\t\t$current_season = @$this->session->userdata('current_season');\n\t\t$crn_s_id = @$current_season['id'];\n\t\t\n\t\t$filtered_destinations = array();\n\t\t$destinations = $this->getDestinationList(); \n\t\tforeach($destinations as $destination){\n\t\t\tif($destination['seasons'] == '' || in_array($destination['seasons'],$crn_s_id)){\n\t\t\t\t$filtered_destinations[$destination['id']] = $destination['name'];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $filtered_destinations;\n\t}",
"public function testSourceObject()\r\n {\r\n $source = \\tabs\\api\\core\\Source::factory(\r\n 'GAD',\r\n 'Google',\r\n 'Internet'\r\n );\r\n $this->assertEquals('GAD', $source->getCode());\r\n $this->assertEquals('Google', $source->getDescription());\r\n $this->assertEquals('Internet', $source->getCategory());\r\n }",
"public function testListPastWebinarFiles()\n {\n }",
"public function getSourceOfListeners() {\n//\t\t# if terrestrial_delay = 0, then the event was from Terrestrial radio\n//\t\t# if terrestrial_delay > 0 then the event was from Streaming radio\n//\t\tSelect count(*)\n//\t\tfrom airshr_events\n//\t\twhere terrestrial_delay > '0' and station_id = '8' and time(created_at) > '06:00' and time(created_at) < '22:00'\n\t\ttry {\n\t\t\t$station = \\Auth::User()->station;\n\t\t\t$timezone = $station->getStationTimezone();\n\t\t\t$station_time = new \\DateTime('now', new \\DateTimeZone($timezone));\n\t\t\t$offset = $station_time->getOffset();\n\n\t\t\t$stream = \\DB::table('airshr_events')\n\t\t\t\t->where('terrestrial_delay', '>', 0)\n\t\t\t\t->where('station_id', '=', $station->id)\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) >= 6*60*60\") //\"MOD(record_timestamp + {$offset}, 86400)\" gets second since midnight\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) < 22*60*60\")// We then compare the hours from midnight to check if it is between the hours we want\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) >= 6')\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) < 22')\n\t\t\t\t->count();\n\n\t\t\t$terrestrial = \\DB::table('airshr_events')\n\t\t\t\t->where('terrestrial_delay', '=', 0)\n\t\t\t\t->where('station_id', '=', $station->id)\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) >= 6*60*60\")\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) < 22*60*60\")\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) >= 6')\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) < 22')\n\t\t\t\t->count();\n\n\t\t\t$streaming_users = \\DB::select(\\DB::raw('select count(*) as count from (select user_id, date(created_at), time(created_at), count(*)\n\t\t\t\t\tfrom airshr_streaming_status\n\t\t\t\t\tgroup by 1\n\t\t\t\t\torder by 4 desc) as T'));\n\t\t\t\n\t\t\treturn response()->json(array('code' => 0, 'stream' => $stream, 'terrestrial' => $terrestrial, 'streaming_users' => $streaming_users));\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\n\t}",
"public function index()\n {\n $sources = $this->source->all();\n\n return view('pipelines::admin.sources.index', compact('sources'));\n }",
"function get_source_list() {\n\t\tglobal $cache;\n\t\tif (($this->txt_files = $cache->get('_gym_config_google_txt')) === false) {\n\t\t\t$this->txt_files = array();\n\t\t\t$RegEx = '`^google_([a-z0-9_-]+)\\.txt`i';\n\t\t\t$txt_dir = @opendir( $this->module_config['google_sources'] );\n\t\t\twhile( ($txt_file = @readdir($txt_dir)) !== false ) {\n\t\t\t\tif(preg_match($RegEx, $txt_file, $matches)) {\n\t\t\t\t\tif (!empty($matches[1])) {\n\t\t\t\t\t\t$this->txt_files[$matches[1]] = $this->module_config['google_sources'] . 'google_' . $matches[1] . '.txt';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t@closedir($txt_dir);\n\t\t\t$cache->put('_gym_config_google_txt', $this->txt_files);\n\t\t}\n\t\treturn;\n\t}",
"public function index()\n {\n $data=$this->source->orderBy('id','DESC')->get();\n return view('admin.enquiry.source.view')->with('sources',$data);\n }",
"function GetSource($sourceId)\n\t{\n\t\t$result = $this->sendRequest(\"GetSource\", array(\"SourceId\"=>$sourceId));\t\n\t\treturn $this->getResultFromResponse($result);\n\t}"
] | [
"0.6901177",
"0.65191364",
"0.6426626",
"0.63242656",
"0.629584",
"0.62681913",
"0.61723316",
"0.60457456",
"0.6038336",
"0.6020853",
"0.5997837",
"0.59823614",
"0.59634876",
"0.59297264",
"0.5911417",
"0.5820473",
"0.5787737",
"0.5678517",
"0.55984485",
"0.5593288",
"0.55798537",
"0.55737126",
"0.556476",
"0.5561604",
"0.5540862",
"0.55156046",
"0.54493487",
"0.541854",
"0.5409731",
"0.5362894",
"0.5356093",
"0.5340589",
"0.5303025",
"0.53007054",
"0.5285229",
"0.5276863",
"0.52762675",
"0.5247384",
"0.5246517",
"0.52423155",
"0.5225143",
"0.5182119",
"0.512685",
"0.51190734",
"0.5109703",
"0.51091105",
"0.5014486",
"0.50103813",
"0.50086904",
"0.50032675",
"0.50020736",
"0.4998773",
"0.49961838",
"0.49832284",
"0.4964444",
"0.49637038",
"0.4960792",
"0.49592212",
"0.49463314",
"0.494014",
"0.49373028",
"0.4932938",
"0.49304476",
"0.49278897",
"0.4927406",
"0.4927298",
"0.49232218",
"0.49224204",
"0.49163207",
"0.4914765",
"0.49076736",
"0.48952776",
"0.4891558",
"0.48673943",
"0.48415658",
"0.48351762",
"0.47857293",
"0.47784582",
"0.477005",
"0.476788",
"0.4766375",
"0.4750629",
"0.4744678",
"0.4742424",
"0.47368774",
"0.47298753",
"0.47270688",
"0.47252652",
"0.47199062",
"0.47013804",
"0.46944734",
"0.4692103",
"0.46903145",
"0.46428272",
"0.46417665",
"0.46400455",
"0.4631671",
"0.46251437",
"0.46092385",
"0.46073386"
] | 0.6181071 | 6 |
Test case for listPastWebinarFiles List Past Webinar Files. | public function testListPastWebinarFiles()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_test_file_uploads()\n {\n }",
"public function testListPastWebinarPollResults()\n {\n }",
"public function testGetFilesList()\n {\n $remoteFolder = \"TestData/In\";\n\n $localName = \"Book1.xlsx\";\n $remoteName = \"Book1.xlsx\";\n\n CellsApiTestBase::ready( $this->instance,$localName ,$remoteFolder . \"/\" . $remoteName , \"\");\n \n $request = new GetFilesListRequest();\n $request->setPath( $remoteFolder);\n $request->setStorageName( \"\");\n $this->instance->getFilesList($request);\n }",
"public function testListPastWebinarQA()\n {\n }",
"public function getFiles() {}",
"public function test_listUnsupportedFileTypes() {\n\n }",
"public function getFiles ();",
"public function getFiles();",
"public function getFiles();",
"public function getFiles();",
"public function files();",
"public function files();",
"public function files();",
"public function getUploadedFiles() {}",
"public function testListAttachments()\n {\n //Wordsets but no origin\n $templating = $this->createMock(\\Twig\\Environment::class);;\n $attacher = new ReportMailerAttacher(\n $this->mockEntityManager(),\n $templating\n );\n $testUser = new User();\n $origin = new Origin();\n $origin->setName(\"aqui\");\n $testUser->addOrigin($origin);\n $fileList = $attacher->listAttachments($testUser, \"2020-01-01\");\n $this->assertEquals([\"wv_2020-01-01_wordsetA_aqui.html\"], $fileList);\n // 2 origins\n $attacher = new ReportMailerAttacher(\n $this->mockEntityManager(),\n $templating\n );\n $testUser = new User();\n $origin = new Origin();\n $origin->setName(\"aqui\");\n $origin2 = new Origin();\n $origin2->setName(\"alla\");\n $testUser->addOrigin($origin);\n $testUser->addOrigin($origin2);\n $fileList = $attacher->listAttachments($testUser, \"2020-01-01\");\n $this->assertEquals(\n [\n \"wv_2020-01-01_wordsetA_aqui.html\",\n \"wv_2020-01-01_wordsetA_alla.html\"\n ],\n $fileList\n );\n }",
"public function get_files()\n {\n }",
"public function testMediaFilesGet()\n {\n $client = static::createClient();\n\n $path = '/media/files';\n\n $crawler = $client->request('GET', $path);\n }",
"public function getUploadedFiles()\n {\n }",
"public function files($index){\n $this->httpRequest->files($index);\n }",
"private function getTestFileList() {\n\t\treturn [\n\t\t\tself::makeFileInfo('a.txt', 4, 2.3 * \\pow(10, 9)),\n\t\t\tself::makeFileInfo('q.txt', 5, 150),\n\t\t\tself::makeFileInfo('subdir2', 87, 128, true),\n\t\t\tself::makeFileInfo('b.txt', 2.2 * \\pow(10, 9), 800),\n\t\t\tself::makeFileInfo('o.txt', 12, 100),\n\t\t\tself::makeFileInfo('subdir', 88, 125, true),\n\t\t];\n\t}",
"public function list_of_fileuploads() {\n $request = $_GET;\n $result = $this->fileupload_model->load_list_of_fileuploads($request, array());\n $result = getUtfData($result);\n echo json_encode($result);\n exit;\n }",
"public function files() {\n\t\t$files = $this->ApiFile->fileList($this->path);\n\t\t$this->set('files', $files);\n\t}",
"public function testShouldGetFileInfo() {\n\t\t$this->assertEquals(\n\t\t\t$this->_testFilesId[0],\n\t\t\t$this->_Files->run(['ids' => $this->_testFilesId])[0]['id']\n\t\t);\n\t}",
"function get_all_video_files($vdetails,$count_only=false,$with_path=false)\r\n{\r\n $details = get_video_file($vdetails,true,$with_path,true,$count_only);\r\n if($count_only)\r\n return count($details);\r\n return $details;\r\n}",
"public function testGetFiles()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function ajaxlistfiles(){\n\n\t\t//Glob all files in uploaddir\n\t\t$files = array();\n\t\tforeach(glob($this->uploaddir.'*') as $file){\n\n\t\t\t//Strip path\n\t\t\t$filename = str_replace($this->uploaddir,'',$file);\n\n\t\t\t$files[$filename]['filename']=$filename;\n\t\t\t$files[$filename]['filesize']=filesize($file) / 1024 / 1024; //Mb\n\t\t\t$files[$filename]['modified']=filemtime($file); //Mb\n\n\t\t\t//Check torrent\n\t\t\tif( file_exists( $this->torrentdir.$filename.'.torrent' )){\n\n\t\t\t\t//Add torrent file\n\t\t\t\t$files[$filename]['torrent']=$filename.'.torrent';\n\n\t\t\t\t//Check database table phptracker_peers for torrent peers:\n\t\t\t\tif($torrent = $this->Torrent->findByName($filename)){\n\t\t\t\t\tif($peers = $this->Peer->findAllByInfoHash($torrent['Torrent']['info_hash'])){\n\t\t\t\t\t\t$files[$filename]['peers']=$peers;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->set('files',$files);\n\n\t\t$this->layout = 'ajax';\n\t}",
"public function generate_filelist_preview() : void {\n CrawlQueue::truncate();\n DeployQueue::truncate();\n\n $initial_file_list_count =\n FilesHelper::buildInitialFileList(\n true,\n SiteInfo::getPath( 'uploads' ),\n $this->settings\n );\n\n if ( $initial_file_list_count < 1 ) {\n $err = 'Initial file list unable to be generated';\n http_response_code( 500 );\n echo $err;\n WsLog::l( $err );\n throw new WP2StaticException( $err );\n }\n\n $via_ui = filter_input( INPUT_POST, 'ajax_action' );\n\n if ( is_string( $via_ui ) ) {\n echo $initial_file_list_count;\n }\n }",
"abstract function list_files($path = '.');",
"public function testPastWebinars()\n {\n }",
"public function getOtherFiles(): array;",
"public function testListAttachmentsVoid()\n {\n //first when there are no origins in the user.\n $templating = $this->createMock(\\Twig\\Environment::class);;\n $attacher = new ReportMailerAttacher($this->mockEntityManagerVoid(), $templating);\n $testUser = new User();\n $fileList = $attacher->listAttachments($testUser, \"2020-01-01\");\n $this->assertEquals([], $fileList);\n //now we add an origin to the user, but there are no wordsets.\n $attacher = new ReportMailerAttacher($this->mockEntityManagerVoid(), $templating);\n $origin = new Origin();\n $testUser->addOrigin($origin);\n $fileList = $attacher->listAttachments($testUser, \"2020-01-01\");\n $this->assertEquals([], $fileList);\n //Wordsets but no origin\n $attacher = new ReportMailerAttacher(\n $this->mockEntityManager(),\n $templating\n );\n $testUser = new User();\n $fileList = $attacher->listAttachments($testUser, \"2020-01-01\");\n $this->assertEquals([], $fileList);\n }",
"function ciniki_lapt_fileList($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access to tnid as owner, or sys admin.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'lapt', 'private', 'checkAccess');\n $rc = ciniki_lapt_checkAccess($ciniki, $args['tnid'], 'ciniki.lapt.fileList');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Get the list of files\n //\n $strsql = \"SELECT ciniki_lapt_files.id, \"\n . \"ciniki_lapt_files.document_id, \"\n . \"ciniki_lapt_files.name, \"\n . \"ciniki_lapt_files.permalink, \"\n . \"ciniki_lapt_files.flags, \"\n . \"ciniki_lapt_files.org_filename, \"\n . \"ciniki_lapt_files.extension \"\n . \"FROM ciniki_lapt_files \"\n . \"WHERE ciniki_lapt_files.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.lapt', array(\n array('container'=>'files', 'fname'=>'id', \n 'fields'=>array('id', 'document_id', 'name', 'permalink', 'flags', 'org_filename', 'extension')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['files']) ) {\n $files = $rc['files'];\n $file_ids = array();\n foreach($files as $iid => $file) {\n $file_ids[] = $file['id'];\n }\n } else {\n $files = array();\n $file_ids = array();\n }\n\n return array('stat'=>'ok', 'files'=>$files, 'nplist'=>$file_ids);\n}",
"public function testGetReplenishmentFiles()\n {\n }",
"function manageVideoPopPlusFiles() {\r\n\t\t// Get List\r\n\t\tif (isset($_GET['get_list'])) {\r\n\t\t\t$start = 0;\r\n\t\t\tif (isset($_GET['start']) && is_numeric($_GET['start']))\r\n\t\t\t\t$start = $_GET['start'];\r\n\r\n\t\t\t// Open file and fill array with unserialized data\r\n\t\t\tif (!is_array($this->vids))\r\n\t\t\t\t$this->vids = $this->_loadDataText();\r\n\r\n\t\t\t$out .= $this->_videoLists($_GET['get_list'], $this->vids, $start, ($_GET['get_list']=='1' ? $this->options['manage_list_max'] : $this->options['post_list_max']));\r\n\t\t\techo $out;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Check write permissions\r\n\t\tif($this->_checkDir()) {\r\n\r\n\t\t\t// IF Video is uploaded\r\n\t\t\tif ( current_user_can( $this->options['user_lvl'] ) ) {\r\n\t\t\t\tif(isset($_POST['lynkvp_upload']) && $this->_valInput()) {\r\n\t\t\t\t\t// defaults\r\n\t\t\t\t\t$vid_url = '';\r\n\t\t\t\t\t$vid_file = '';\r\n\t\t\t\t\t$vid_id = time(); // use timestamp for unique id\r\n\t\t\t\t\t$vid_image_file = '';\r\n\t\t\t\t\t$vid_image_url = '';\r\n\r\n\t\t\t\t\t// Save file\r\n\t\t\t\t\tif(is_uploaded_file($_FILES['lynkvp_file']['tmp_name'])) {\r\n\t\t\t\t\t\t$vid_file = $vid_id.'.'.$_POST['lynkvp_type']; // filename+extension\r\n\t\t\t\t\t\tif(!move_uploaded_file($_FILES['lynkvp_file']['tmp_name'], $this->data_dir . $vid_file))\r\n\t\t\t\t\t\t\t$this->note .= __(\"The file couldn't be saved on your server\", $this->textdomain_name);\r\n\t\t\t\t\t} elseif(!empty($_POST['lynkvp_url'])) {\r\n\t\t\t\t\t\t$vid_url = ltrim($_POST['lynkvp_url'],'http://');\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Save Thumbnail file\r\n\t\t\t\t\tif(is_uploaded_file($_FILES['lynkvp_image_file']['tmp_name'])) {\r\n\t\t\t\t\t\t$vid_image_file = $vid_id.'.thum.'.preg_replace('/^.*\\.(gif|jpe?g|png|bmp)$/i', '$1', $_FILES['lynkvp_image_file']['name']); // filename+extension\r\n\t\t\t\t\t\tif(file_exists($this->data_dir . $vid_image_file)) @unlink($this->data_dir . $vid_image_file);\r\n\t\t\t\t\t\tif(move_uploaded_file($_FILES['lynkvp_image_file']['tmp_name'], $this->data_dir . $vid_image_file)) {\r\n\t\t\t\t\t\t\t$vid_image_url = ltrim($this->data_url . $vid_image_file, 'http://');\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$this->note .= __(\"The file couldn't be saved on your server\", $this->textdomain_name);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t} elseif(!empty($_POST['lynkvp_image_url'])) {\r\n\t\t\t\t\t\t$vid_image_url = ltrim($_POST['lynkvp_image_url'],'http://');\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Open file and fill array with unserialized data\r\n\t\t\t\t\tif (!is_array($this->vids))\r\n\t\t\t\t\t\t$this->vids = $this->_loadDataText();\r\n\r\n\t\t\t\t\t// Add data to array\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_id'] = $vid_id;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_filename'] = $vid_file;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_url'] = $vid_url;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_type'] = $_POST['lynkvp_type'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_size'] = $_POST['lynkvp_size'];\r\n\t\t\t\t\tif (isset($this->videosizes[$_POST['lynkvp_size']])) {\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_width'] = $this->videosizes[$_POST['lynkvp_size']]['width'];\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_height'] = $this->videosizes[$_POST['lynkvp_size']]['height'];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_width'] = $_POST['lynkvp_width'];\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_height'] = $_POST['lynkvp_height'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_name'] = $_POST['lynkvp_name'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_caption'] = $_POST['lynkvp_caption'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_image'] = $vid_image_url;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_image_filename'] = $vid_image_file;\r\n\r\n\t\t\t\t\t// Save ser. array\r\n\t\t\t\t\t$this->_saveDataText($this->vids);\r\n\r\n\t\t\t\t\t$this->note .= __('<strong>Done!</strong>', $this->textdomain_name);\r\n\t\t\t\t\tunset($_POST);\r\n\r\n\t\t\t\t} elseif(isset($_POST['lynkvp_edit2']) && $this->_valInput2()) {\r\n\t\t\t\t\t// Open file and fill array with unserialized data\r\n\t\t\t\t\tif (!is_array($this->vids)) {$this->vids = $this->_loadDataText();}\r\n\t\t\t\t\t$vid_id = $_POST['lynkvp_editid'];\r\n\t\t\t\t\t$vid_image_file = '';\r\n\t\t\t\t\t$vid_image_url = '';\r\n\r\n\t\t\t\t\t// Save Thumbnail file\r\n\t\t\t\t\tif(is_uploaded_file($_FILES['lynkvp_image_file']['tmp_name'])) {\r\n\t\t\t\t\t\t$vid_image_file = $vid_id.'.thum.'.preg_replace('/^.*\\.(gif|jpe?g|png|bmp)$/i', '$1', $_FILES['lynkvp_image_file']['name']); // filename+extension\r\n\t\t\t\t\t\tif(file_exists($this->data_dir . $vid_image_file)) @unlink($this->data_dir . $vid_image_file);\r\n\t\t\t\t\t\tif(move_uploaded_file($_FILES['lynkvp_image_file']['tmp_name'], $this->data_dir . $vid_image_file))\r\n\t\t\t\t\t\t\t$vid_image_url = ltrim($this->data_url . $vid_image_file, 'http://');\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$this->note .= __(\"The file couldn't be saved on your server\", $this->textdomain_name);\r\n\r\n\t\t\t\t\t} elseif(!empty($_POST['lynkvp_image_url'])) {\r\n\t\t\t\t\t\t$vid_image_url = ltrim($_POST['lynkvp_image_url'],'http://');\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$vid_image_url = $this->vids[$vid_id]['lynkvp_image'];\r\n\t\t\t\t\t\t$vid_image_file = $this->vids[$vid_id]['lynkvp_image_filename'];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Add data to array\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_id'] = $vid_id;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_filename'] = $_POST['lynkvp_filename'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_url'] = $_POST['lynkvp_url'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_type'] = $_POST['lynkvp_type'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_size'] = $_POST['lynkvp_size'];\r\n\t\t\t\t\tif (isset($this->videosizes[$_POST['lynkvp_size']])) {\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_width'] = $this->videosizes[$_POST['lynkvp_size']]['width'];\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_height'] = $this->videosizes[$_POST['lynkvp_size']]['height'];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_width'] = $_POST['lynkvp_width'];\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_height'] = $_POST['lynkvp_height'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_name'] = $_POST['lynkvp_name'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_caption'] = $_POST['lynkvp_caption'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_image'] = $vid_image_url;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_image_filename'] = $vid_image_file;\r\n\r\n\t\t\t\t\t// Save ser. array\r\n\t\t\t\t\t$this->_saveDataText($this->vids);\r\n\r\n\t\t\t\t\t$this->note .= __('<strong>Done!</strong>', $this->textdomain_name);\r\n\t\t\t\t\tunset($_POST);\r\n\r\n\t\t\t\t} elseif(isset($_POST['lynkvp_del'])) {\r\n\t\t\t\t\t// Open file and fill array with unserialized data\r\n\t\t\t\t\tif (!is_array($this->vids))\r\n\t\t\t\t\t\t$this->vids = $this->_loadDataText();\r\n\t\t\t\t\t$a_id = array_flip($_POST['lynkvp_del']);\r\n\r\n\t\t\t\t\t// Remove Video\r\n\t\t\t\t\tif(file_exists($this->data_dir . $this->vids[$a_id[__('delete', $this->textdomain_name)]]['lynkvp_filename']))\r\n\t\t\t\t\t\t@unlink($this->data_dir . $this->vids[$a_id[__('delete', $this->textdomain_name)]]['lynkvp_filename']);\r\n\t\t\t\t\tif(file_exists($this->data_dir . $this->vids[$a_id[__('delete', $this->textdomain_name)]]['lynkvp_image_filename']))\r\n\t\t\t\t\t\t@unlink($this->data_dir . $this->vids[$a_id[__('delete', $this->textdomain_name)]]['lynkvp_image_filename']);\r\n\r\n\t\t\t\t\tforeach($this->vids as $key=>$value) {\r\n\t\t\t\t\t\tif($key != $a_id[__('delete', $this->textdomain_name)])\r\n\t\t\t\t\t\t\t$a_vids2[$key] = $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->vids = $a_vids2;\r\n\t\t\t\t\tunset($a_vids2);\r\n\r\n\t\t\t\t\t// Save ser. images\r\n\t\t\t\t\t$this->_saveDataText($this->vids);\r\n\r\n\t\t\t\t\t$this->note .= __('<strong>Done!</strong>', $this->textdomain_name);\r\n\t\t\t\t\tunset($_POST);\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// IF edit\r\n\t\t\tif ( current_user_can( $this->options['user_lvl'] ) ) {\r\n\t\t\t\tif ( isset($_POST['lynkvp_edit']) ) {\r\n\t\t\t\t\t// Video ID\r\n\t\t\t\t\t$a_id = array_flip($_POST['lynkvp_edit']);\r\n\r\n\t\t\t\t\t// Open file and fill array with unserialized data\r\n\t\t\t\t\tif (!is_array($this->vids))\r\n\t\t\t\t\t\t$this->vids = $this->_loadDataText();\r\n\r\n\t\t\t\t\t// Populate POST & strip slashes array\r\n\t\t\t\t\t$_POST = $this->stripArray($this->vids[$a_id[__('edit', $this->textdomain_name)]]);\r\n\r\n\t\t\t\t\t$out .= \"<div class=\\\"wrap\\\" style=\\\"text-align:left;\\\">\\n\";\r\n\t\t\t\t\t$out .= \"<h2>\".__('Video Edit', $this->textdomain_name).\"</h2>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<form method=\\\"post\\\" action=\\\"\".$this->admin_manage.\"\\\" enctype=\\\"multipart/form-data\\\">\\n\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"hidden\\\" name=\\\"lynkvp_type\\\" value=\\\"\".$_POST['lynkvp_type'].\"\\\" />\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<table border=\\\"0\\\" cellpadding=\\\"2\\\" cellspacing=\\\"0\\\">\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Name','videopop_plus').\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td><input type=\\\"text\\\" name=\\\"lynkvp_name\\\" value=\\\"\".$_POST['lynkvp_name'].\"\\\" /></td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Caption','videopop_plus').\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td><input type=\\\"text\\\" name=\\\"lynkvp_caption\\\" value=\\\"\".$_POST['lynkvp_caption'].\"\\\" /></td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\tif(!empty($_POST['lynkvp_url'])) {\r\n\t\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td>\".__('URL', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td>http://<input type=\\\"text\\\" name=\\\"lynkvp_url\\\" value=\\\"\".$_POST['lynkvp_url'].\"\\\" style=\\\"width:400px;\\\" /></td>\\n\";\r\n\t\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t\t$out .= $this->_getTypeSelect().\"\\n\";\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td>\".__('Video type', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td>\".$_POST['lynkvp_type'].\"</td>\\n\";\r\n\t\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td><span style=\\\"display:\".($_POST['lynkvp_type']!='flv'?'none':'block').\"\\\">\";\r\n\t\t\t\t\t\t$out .= __('Thumbnail', $this->textdomain_name).\":\";\r\n\t\t\t\t\t\t$out .= \"</span></td>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td><span style=\\\"display:\".($_POST['lynkvp_type']!='flv'?'none':'block').\"\\\">\";\r\n\t\t\t\t\t\t$out .= \"<input type=\\\"file\\\" name=\\\"lynkvp_image_file\\\" /> \\n\";\r\n\t\t\t\t\t\t$out .= __('<strong>or</strong>', $this->textdomain_name).' ';\r\n\t\t\t\t\t\t$out .= __('URL', $this->textdomain_name).\": \";\r\n\t\t\t\t\t\t$out .= \"http:// <input type=\\\"text\\\" name=\\\"lynkvp_image_url\\\" style=\\\"width:400px;\\\" value=\\\"\".$_POST['lynkvp_image'].\"\\\" />\";\r\n\t\t\t\t\t\t$out .= \"</span></td>\\n\";\r\n\t\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Size', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\\n\";\r\n\t\t\t\t\t$out .= \"<select name=\\\"lynkvp_size\\\" onchange=\\\"javascript:\";\r\n\t\t\t\t\t$out .= \"document.getElementById('input_size').style.display=(this.value==999?'inline':'none');\";\r\n\t\t\t\t\t$out .= \"\\\">\";\r\n\t\t\t\t\t$out .= \"<option value=\\\"0\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'],'0').\">\".__('Select size', $this->textdomain_name).\"</option>\\n\";\r\n\t\t\t\t\t$out .= \"<!-- Video sizes, one each line -->\\n\";\r\n\t\t\t\t\tforeach($this->videosizes as $key=>$value) {\r\n\t\t\t\t\t\t$out .= \"<option value=\\\"\".$key.\"\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'],$key).\">\".$value['width'].\" x \".$value['height'].$value['note'].\"</option>\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$out .= \"<option value=\\\"999\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'], '999').\">\".__('Free Size', $this->textdomain_name).\"</option>\\n\";\r\n\t\t\t\t\t$out .= \"</select> \\n\";\r\n\t\t\t\t\t$out .= \"<span id=\\\"input_size\\\" style=\\\"display:\".($_POST['lynkvp_size']!=999?'none':'inline').\"\\\">\\n\";\r\n\t\t\t\t\t$out .= __('Width').\": <input type=\\\"text\\\" name=\\\"lynkvp_width\\\" value=\\\"\".$_POST['lynkvp_width'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \" x \";\r\n\t\t\t\t\t$out .= __('Height').\": <input type=\\\"text\\\" name=\\\"lynkvp_height\\\" value=\\\"\".$_POST['lynkvp_height'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"</span>\\n\";\r\n\t\t\t\t\t$out .= \"</td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"</table>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<br />\\n\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"hidden\\\" name=\\\"lynkvp_editid\\\" value=\\\"\".$_POST['lynkvp_id'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"hidden\\\" name=\\\"lynkvp_filename\\\" value=\\\"\".$_POST['lynkvp_filename'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"submit\\\" name=\\\"lynkvp_edit2\\\" class=\\\"button\\\" value=\\\"\".__('Upload', $this->textdomain_name).\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"</form>\\n\";\r\n\t\t\t\t\t$out .= \"</div>\\n\";\r\n\r\n\t\t\t\t\tunset($_POST);\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// strip slashes array\r\n\t\t\t\t\t$_POST = $this->stripArray($_POST);\r\n\r\n\t\t\t\t\t// BLOCK Upload\r\n\t\t\t\t\t$out .= \"<div class=\\\"wrap\\\" style=\\\"text-align:left;\\\">\\n\";\r\n\t\t\t\t\t$out .= \"<h2>\".__('Video Upload', $this->textdomain_name).\"</h2>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<form method=\\\"post\\\" action=\\\"\".$this->admin_manage.\"\\\" enctype=\\\"multipart/form-data\\\">\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<table border=\\\"0\\\" cellpadding=\\\"2\\\" cellspacing=\\\"0\\\">\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Name', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td><input type=\\\"text\\\" name=\\\"lynkvp_name\\\" value=\\\"\".$_POST['lynkvp_name'].\"\\\" /></td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Caption', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td><input type=\\\"text\\\" name=\\\"lynkvp_caption\\\" value=\\\"\".$_POST['lynkvp_caption'].\"\\\" /></td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Choose video', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"file\\\" name=\\\"lynkvp_file\\\" /> \\n\";\r\n\t\t\t\t\t$out .= __('<strong>or</strong>', $this->textdomain_name).\" \";\r\n\t\t\t\t\t$out .= __('URL', $this->textdomain_name).\": http://<input type=\\\"text\\\" name=\\\"lynkvp_url\\\" style=\\\"width:400px;\\\" value=\\\"\".$_POST['lynkvp_url'].\"\\\" />\";\r\n\t\t\t\t\t$out .= \"</td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= $this->_getTypeSelect().\"\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Size', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\\n\";\r\n\t\t\t\t\t$out .= \"<select name=\\\"lynkvp_size\\\" onchange=\\\"javascript:\";\r\n\t\t\t\t\t$out .= \"document.getElementById('input_size').style.display=(this.value==999?'inline':'none');\";\r\n\t\t\t\t\t$out .= \"\\\">\";\r\n\t\t\t\t\t$out .= \"<option value=\\\"0\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'],'0').\">\".__('Select size', $this->textdomain_name).\"</option>\\n\";\r\n\t\t\t\t\t$out .= \"<!-- Video sizes, one each line -->\\n\";\r\n\t\t\t\t\tforeach($this->videosizes as $key=>$value) {\r\n\t\t\t\t\t\t$out .= \"<option value=\\\"\".$key.\"\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'],$key).\">\".$value['width'].\" x \".$value['height'].$value['note'].\"</option>\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$out .= \"<option value=\\\"999\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'], \"999\").\">\".__('Free Size', $this->textdomain_name).\"</option>\\n\";\r\n\t\t\t\t\t$out .= \"</select> \\n\";\r\n\t\t\t\t\t$out .= \"<span id=\\\"input_size\\\" style=\\\"display:\".(!isset($this->videosizes[$_POST['lynkvp_size']]) ? 'none' : 'inline').\"\\\">\\n\";\r\n\t\t\t\t\t$out .= __('Width').\": <input type=\\\"text\\\" name=\\\"lynkvp_width\\\" value=\\\"\".$_POST['lynkvp_width'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \" x \";\r\n\t\t\t\t\t$out .= __('Height').\": <input type=\\\"text\\\" name=\\\"lynkvp_height\\\" value=\\\"\".$_POST['lynkvp_height'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"</span>\\n\";\r\n\t\t\t\t\t$out .= \"</td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"</table>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<br />\\n\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"submit\\\" name=\\\"lynkvp_upload\\\" class=\\\"button\\\" value=\\\"\".__('Upload', $this->textdomain_name).\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"</form>\\n\";\r\n\t\t\t\t\t$out .= \"</div>\\n\";\r\n\t\t\t\t\tunset($_POST);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// ---------\r\n\t\t\t// ALWAYS DISPLAYED\r\n\r\n\t\t\t// BLOCK Your Videos\r\n\t\t\t$out .= \"<div class=\\\"wrap\\\" style=\\\"text-align:left;padding-bottom:3em;margin-top:2em;\\\">\\n\";\r\n\t\t\t$out .= \"<h2>\".__('My Videos', $this->textdomain_name).\"</h2>\\n\";\r\n\r\n\t\t\t// Open file and fill array with unserialized data\r\n\t\t\tif (!is_array($this->vids)) {$this->vids = $this->_loadDataText();}\r\n\r\n\t\t\t// If any vids uploaded\r\n\t\t\tif(is_array($this->vids)) {\r\n\t\t\t\t// add JS to manage page;\r\n\t\t\t\t$this->_adminHead();\r\n\t\t\t\t$out .= $this->_videoLists('1', $this->vids, 0, $this->options['manage_list_max']);\r\n\t\t\t}\r\n\r\n\t\t\t$out .= \"</div>\\n\";\r\n\t\t}\r\n\r\n\t\t// Output\r\n\t\techo (!empty($this->note) ? \"<div id=\\\"message\\\" class=\\\"updated fade\\\"><p>{$this->note}</p></div>\\n\" : '' ).\"\\n\";\r\n\t\techo ($this->error > 0 ? '' : $out).\"\\n\";\r\n\t}",
"function getFileList() {\n\tglobal $apiBaseURL; // bad practice in production - fine for this example\n\n\t// use the getURL function to call the URL\n\t$response = getURL($apiBaseURL);\n\t// it returned as JSON so lets decode it\n\t$response = json_decode($response);\n\n\t// return the response\n\treturn($response);\n}",
"public function _TestMultipleFiles()\n {\n\n }",
"public function getFiles(): array;",
"public function testWebinarPanelists()\n {\n }",
"private function testFiles(array &$list, array &$callback) { \n foreach ($list as $file) {\n $test = call_user_func(array(\"self\", $callback), $file);\n if ($test != FALSE) {\n $keep_list[] = $file;\n }\n }\n return $keep_list;\n }",
"public function getEmbeddedFiles() {}",
"function get_list_of_published_files() {\n $result = $this->pdo->query('SELECT * FROM files WHERE publishedfile = 1 ORDER BY date DESC');\n return $result;\n }",
"public function listFiles($dir);",
"protected function _FILES()\n\t{\n\t\t\n\t}",
"function _generateFilesList() {\n return array();\n }",
"public function getRemoteExtListFile() {}",
"function get_video_files($vdetails,$return_default=true,$with_path=true,$multi=false,$count_only=false,$hq=false){\r\n\r\n global $Cbucket;\r\n # checking if there is any other functions\r\n # available\r\n define('VIDEO_VERSION',$vdetails['video_version']);\r\n\r\n if(is_array($Cbucket->custom_video_file_funcs))\r\n foreach($Cbucket->custom_video_file_funcs as $func)\r\n if(function_exists($func))\r\n {\r\n $func_returned = $func($vdetails, $hq);\r\n if($func_returned)\r\n return $func_returned;\r\n }\r\n \r\n \r\n $fileDirectory = \"\";\r\n if(isset($vdetails['file_directory']) && !empty($vdetails['file_directory'])){\r\n $fileDirectory = \"{$vdetails['file_directory']}/\";\r\n }\r\n //dump($vdetails['file_name']);\r\n\r\n \r\n \r\n #Now there is no function so lets continue as\r\n\r\n if(isset($vdetails['file_name'])){\r\n if(VIDEO_VERSION == '2.7'){\r\n $vid_files = glob(VIDEOS_DIR.\"/\".$fileDirectory . $vdetails['file_name'].\"*\");\r\n }\r\n else{\r\n $vid_files = glob(VIDEOS_DIR.\"/\".$vdetails['file_name'].\"*\"); \r\n }\r\n }\r\n // if($hq){\r\n // var_dump(glob(VIDEOS_DIR.\"/\".$fileDirectory . $vdetails['file_name'].\"*\"));\r\n // }\r\n\r\n #replace Dir with URL\r\n if(is_array($vid_files))\r\n foreach($vid_files as $file)\r\n {\r\n // if($hq){\r\n // echo \"filesize = \" . filesize($file); \r\n // }\r\n if(filesize($file) < 100) continue;\r\n $files_part = explode('/',$file);\r\n $video_file = $files_part[count($files_part)-1];\r\n\r\n if($with_path){\r\n if(VIDEO_VERSION == '2.7')\r\n $files[] = VIDEOS_URL.'/' . $fileDirectory. $video_file ;\r\n else if(VIDEO_VERSION == '2.6')\r\n $files[] = VIDEOS_URL.'/' . $video_file ;\r\n }\r\n else\r\n $files[] = $video_file;\r\n }\r\n\r\n if(count($files)==0 && !$multi && !$count_only)\r\n {\r\n if($return_default)\r\n {\r\n\r\n if($with_path)\r\n return VIDEOS_URL.'/no_video.mp4';\r\n else\r\n return 'no_video.mp4';\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }\r\n else\r\n {\r\n return $files;\r\n }\r\n\r\n\r\n}",
"public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/purrrr.php',\n 'data_custom/images/lolcats/index.html',\n 'data_custom/images/lolcats/thumbs/index.html',\n 'data_custom/images/lolcats/funny-pictures-basement-cat-has-pink-sheets.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-ai-calld-jenny-craig.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-asks-you-for-a-favor.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-asks-you-to-pay-fine.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-can-poop-rainbows.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-comes-to-save-day.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-decides-what-to-do.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-does-math.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-does-not-see-your-point.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-eyes-steak.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-has-a-beatle.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-has-a-close-encounter.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-has-had-fun.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-has-trophy-wife.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-hates-your-tablecloth.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-is-a-doctor.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-is-a-hoarder.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-is-a-people-lady.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-is-on-steroids.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-is-stuck-in-drawer.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-is-very-comfortable.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-kermit-was-about.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-looks-like-a-vase.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-looks-like-boots.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-ok-captain-obvious.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-pounces-on-deer.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-sits-in-box.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-sits-on-your-laptop.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-special-delivery.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-winks-at-you.jpg',\n 'data_custom/images/lolcats/funny-pictures-cats-are-in-a-musical.jpg',\n 'data_custom/images/lolcats/funny-pictures-cats-have-war.jpg',\n 'data_custom/images/lolcats/funny-pictures-fish-and-cat-judge-your-outfit.jpg',\n 'data_custom/images/lolcats/funny-pictures-kitten-drops-a-nickel-under-couch.jpg',\n 'data_custom/images/lolcats/funny-pictures-kitten-ends-meeting2.jpg',\n 'data_custom/images/lolcats/funny-pictures-kitten-fixes-puppy.jpg',\n 'data_custom/images/lolcats/funny-pictures-kitten-tries-to-stay-neutral.jpg',\n 'data_custom/images/lolcats/funny-pictures-kittens-dispose-of-boyfriend.jpg',\n 'data_custom/images/lolcats/funny-pictures-kittens-yell-at-eachother.jpg',\n 'data_custom/images/lolcats/ridiculous_poses_moddles.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-basement-cat-has-pink-sheets.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-ai-calld-jenny-craig.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-asks-you-for-a-favor.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-asks-you-to-pay-fine.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-can-poop-rainbows.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-comes-to-save-day.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-decides-what-to-do.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-does-math.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-does-not-see-your-point.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-eyes-steak.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-has-a-beatle.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-has-a-close-encounter.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-has-had-fun.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-has-trophy-wife.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-hates-your-tablecloth.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-is-a-doctor.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-is-a-hoarder.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-is-a-people-lady.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-is-on-steroids.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-is-stuck-in-drawer.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-is-very-comfortable.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-kermit-was-about.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-looks-like-a-vase.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-looks-like-boots.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-ok-captain-obvious.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-pounces-on-deer.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-sits-in-box.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-sits-on-your-laptop.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-special-delivery.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-winks-at-you.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cats-are-in-a-musical.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cats-have-war.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-fish-and-cat-judge-your-outfit.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-kitten-drops-a-nickel-under-couch.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-kitten-ends-meeting2.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-kitten-fixes-puppy.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-kitten-tries-to-stay-neutral.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-kittens-dispose-of-boyfriend.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-kittens-yell-at-eachother.jpg',\n 'data_custom/images/lolcats/thumbs/ridiculous_poses_moddles.jpg',\n );\n }",
"public abstract function getStagedFiles();",
"public function testMediaFilesSearchGet()\n {\n $client = static::createClient();\n\n $path = '/media/files/search';\n\n $crawler = $client->request('GET', $path);\n }",
"public function getAllFiles()\n {\n }",
"abstract protected function getFilesDestination();",
"public function loadFilesProduction()\r\n {\r\n $id = Input::get('ID');\r\n $project = Project::find($id);\r\n $files=[];\r\n if($project!=null)\r\n {\r\n $internalFiles = $project->filesByType(array('vendor','university','designer','writer','attorney','2d'));\r\n foreach($internalFiles as $file)\r\n {\r\n $files[]=['id'=>$file->id,'name'=>$file->fileName,'url'=>$file->url,'date'=>$file->created_at];\r\n }\r\n }\r\n return json_encode($files);\r\n }",
"function _load_files(&$app, &$c) {\n\t\t$files = $c->param('app.view_http.request.files');\n\t\tif (is_array($files)) {\n\t\t\tforeach($files as $k => $file) {\n\t\t\t\tif (is_array($file['size'])) {\n\t\t\t\t\tfor($i=0;$i<count($file['size']);$i++) {\n\t\t\t\t\t\tif (($file['size'][$i] > 0) && (!empty($file['tmp_name'][$i])))\n\t\t\t\t\t\t\t$this->_http->addFile($file['name'][$i], $file['tmp_name'][$i], $file['type'][$i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tif (($file['size'] > 0) && (!empty($file['tmp_name'])))\n\t\t\t\t\t\t$this->_http->addFile($file['name'], $file['tmp_name'], $file['type']);\n\t\t\t}\n\t\t}\n\t}",
"public function getFiles()\n {\n return isset($this->source['files']) && is_array($this->source['files']) ? $this->source['files'] : [];\n }",
"public function loadFilesLaunch()\r\n {\r\n $id = Input::get('ID');\r\n $project = Project::find($id);\r\n $files=[];\r\n if($project!=null)\r\n {\r\n $internalAndPublicFiles = $project->filesByType(array('public','clientVendor'));\r\n foreach($internalAndPublicFiles as $file)\r\n {\r\n $files[]=['id'=>$file->id,'name'=>$file->fileName,'url'=>$file->url,'projectId'=>$id];\r\n }\r\n }\r\n return json_encode($files);\r\n }",
"public function getLocalExtListFile() {}",
"function list_files () {\n\t\t$root = $this->get_root();\n\t\t\n\t\treturn $this->_list_files($root);\n\t}",
"public function getUploads($maxResults);",
"public function loadFilesAttCS()\r\n {\r\n $id = Input::get('ID');\r\n $project = Project::find($id);\r\n $files=[];\r\n if($project!=null)\r\n {\r\n $internalFiles = $project->filesByType(array('attorney'));\r\n foreach($internalFiles as $file)\r\n {\r\n $created = date('m-d-Y',strtotime(str_replace('-','/',$file->created_at)));\r\n $files[]=['id'=>$file->id,'name'=>$file->fileName,'url'=>$file->url,'created'=>$created];\r\n }\r\n }\r\n return json_encode($files);\r\n }",
"public function collectInfoFiles()\r\n {\r\n $files_found = $this->findFiles($this->destination_dir, array('md', '1st', 'txt'));\r\n\r\n if($files_found)\r\n $this->file_list = array_merge($this->file_list, $files_found);\r\n }",
"public function listAction() {\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n $photo_id = (int) $this->_getParam('photo_id');\n\n // CHECK AUTHENTICATION\n // CHECK AUTHENTICATION\n if (Engine_Api::_()->core()->hasSubject('sitereview_listing')) {\n $sitereview = $subject = Engine_Api::_()->core()->getSubject('sitereview_listing');\n } else if (Engine_Api::_()->core()->hasSubject('sitereview_photo')) {\n $photo = $subject = Engine_Api::_()->core()->getSubject('sitereview_photo');\n $listing_id = $photo->listing_id;\n $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n }\n $bodyResponse = $tempResponse = array();\n $listing_singular_uc = ucfirst($this->_listingType->title_singular);\n $can_edit = $sitereview->authorization()->isAllowed($viewer, \"edit_listtype_$sitereview->listingtype_id\");\n $listingtype_id = $this->_listingType->listingtype_id;\n //AUTHORIZATION CHECK\n $allowed_upload_photo = Engine_Api::_()->authorization()->isAllowed($sitereview, $viewer, \"photo_listtype_$listingtype_id\");\n if (Engine_Api::_()->sitereview()->hasPackageEnable()) {\n $photoCount = Engine_Api::_()->getItem('sitereviewpaidlisting_package', $sitereview->package_id)->photo_count;\n $paginator = $sitereview->getSingletonAlbum()->getCollectiblesPaginator();\n\n if (Engine_Api::_()->sitereviewpaidlisting()->allowPackageContent($sitereview->package_id, \"photo\")) {\n $allowed_upload_photo = $allowed_upload_photo;\n if (empty($photoCount))\n $allowed_upload_photo = $allowed_upload_photo;\n elseif ($photoCount <= $paginator->getTotalItemCount())\n $allowed_upload_photo = 0;\n } else\n $allowed_upload_photo = 0;\n } else\n $allowed_upload_photo = $allowed_upload_photo;\n\n //GET ALBUM\n $album = $sitereview->getSingletonAlbum();\n\n\n /* RETURN THE LIST OF IMAGES, IF FOLLOWED THE FOLLOWING CASES: \n * - IF THERE ARE GET METHOD AVAILABLE.\n * - iF THERE ARE NO $_FILES AVAILABLE.\n */\n if (empty($_FILES) && $this->getRequest()->isGet()) {\n $requestLimit = $this->getRequestParam(\"limit\", 10);\n $page = $requestPage = $this->getRequestParam(\"page\", 1);\n\n //GET PAGINATOR\n $album = $sitereview->getSingletonAlbum();\n $paginator = $album->getCollectiblesPaginator();\n\n $bodyResponse[' totalPhotoCount'] = $totalItemCount = $bodyResponse['totalItemCount'] = $paginator->getTotalItemCount();\n $paginator->setItemCountPerPage($requestLimit);\n $paginator->setCurrentPageNumber($requestPage);\n // Check the Page Number for pass photo_id.\n if (!empty($photo_id)) {\n for ($page = 1; $page <= ceil($totalItemCount / $requestLimit); $page++) {\n $paginator->setCurrentPageNumber($page);\n $tmpGetPhotoIds = array();\n foreach ($paginator as $photo) {\n $tmpGetPhotoIds[] = $photo->photo_id;\n }\n if (in_array($photo_id, $tmpGetPhotoIds)) {\n $bodyResponse['page'] = $page;\n break;\n }\n }\n }\n\n if ($totalItemCount > 0) {\n foreach ($paginator as $photo) {\n $tempImages = $photo->toArray();\n\n // Add images\n $getContentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($photo);\n $tempImages = array_merge($tempImages, $getContentImages);\n\n $tempImages['user_title'] = $photo->getOwner()->getTitle();\n $tempImages['likes_count'] = $photo->likes()->getLikeCount();\n $tempImages['is_like'] = ($photo->likes()->isLike($viewer)) ? 1 : 0;\n \n //Sitereaction Plugin work start here\n if (Engine_Api::_()->getApi('Siteapi_Feed', 'advancedactivity')->isSitereactionPluginLive()) {\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitereaction') && Engine_Api::_()->getApi('settings', 'core')->getSetting('sitereaction.reaction.active', 1)) {\n $popularity = Engine_Api::_()->getApi('core', 'sitereaction')->getLikesReactionPopularity($photo);\n $feedReactionIcons = Engine_Api::_()->getApi('Siteapi_Core', 'sitereaction')->getLikesReactionIcons($popularity, 1);\n $tempImages['reactions']['feed_reactions'] =$tempImages['feed_reactions'] = $feedReactionIcons;\n\n if (isset($viewer_id) && !empty($viewer_id)) {\n $myReaction = $photo->likes()->getLike($viewer);\n if (isset($myReaction) && !empty($myReaction) && isset($myReaction->reaction) && !empty($myReaction->reaction)) {\n $myReactionIcon = Engine_Api::_()->getApi('Siteapi_Core', 'sitereaction')->getIcons($myReaction->reaction, 1);\n $tempImages['reactions']['my_feed_reaction'] =$tempImages['my_feed_reaction'] = $myReactionIcon;\n }\n }\n }\n }\n //Sitereaction Plugin work end here\n if (!empty($viewer) && ($tempMenu = $this->getRequestParam('menu', 1)) && !empty($tempMenu)) {\n $menu = array();\n\n if ($photo->user_id == $viewer_id) {\n $menu[] = array(\n 'label' => $this->translate('Edit'),\n 'name' => 'edit',\n 'url' => 'listings/photo/edit/' . $sitereview->getIdentity(),\n 'urlParams' => array(\n \"photo_id\" => $photo->getIdentity()\n )\n );\n\n $menu[] = array(\n 'label' => $this->translate('Delete'),\n 'name' => 'delete',\n 'url' => 'listings/photo/delete/' . $sitereview->getIdentity(),\n 'urlParams' => array(\n \"photo_id\" => $photo->getIdentity()\n )\n );\n }\n $menu[] = array(\n 'label' => $this->translate('Share'),\n 'name' => 'share',\n 'url' => 'activity/index/share',\n 'urlParams' => array(\n \"type\" => $photo->getType(),\n \"id\" => $photo->getIdentity()\n )\n );\n\n $menu[] = array(\n 'label' => $this->translate('Report'),\n 'name' => 'report',\n 'url' => 'report/create/subject/' . $photo->getGuid()\n );\n\n $menu[] = array(\n 'label' => $this->translate('Make Profile Photo'),\n 'name' => 'make_profile_photo',\n 'url' => 'members/edit/external-photo',\n 'urlParams' => array(\n \"photo\" => $photo->getGuid()\n )\n );\n\n $tempImages['menu'] = $menu;\n }\n\n if (isset($tempImages) && !empty($tempImages))\n $bodyResponse['images'][] = $tempImages;\n }\n }\n $bodyResponse['canUpload'] = $allowed_upload_photo;\n $this->respondWithSuccess($bodyResponse, true);\n } else if (isset($_FILES) && $this->getRequest()->isPost()) { // UPLOAD IMAGES TO RESPECTIVE EVENT\n if (empty($viewer_id) || empty($allowed_upload_photo))\n $this->respondWithError('unauthorized');\n $tablePhoto = Engine_Api::_()->getDbtable('photos', 'sitereview');\n $db = $tablePhoto->getAdapter();\n $db->beginTransaction();\n\n try {\n $viewer = Engine_Api::_()->user()->getViewer();\n $album = $sitereview->getSingletonAlbum();\n $rows = $tablePhoto->fetchRow($tablePhoto->select()->from($tablePhoto->info('name'), 'order')->order('order DESC')->limit(1));\n $order = 0;\n if (!empty($rows)) {\n $order = $rows->order + 1;\n }\n $params = array(\n 'collection_id' => $album->getIdentity(),\n 'album_id' => $album->getIdentity(),\n 'listing_id' => $sitereview->getIdentity(),\n 'user_id' => $viewer->getIdentity(),\n 'order' => $order\n );\n $photoCount = count($_FILES);\n if (isset($_FILES['photo']) && $photoCount == 1) {\n $photo_id = Engine_Api::_()->getApi('Siteapi_Core', 'sitereview')->createPhoto($params, $_FILES['photo'])->photo_id;\n if (!$sitereview->photo_id) {\n $sitereview->photo_id = $photo_id;\n $sitereview->save();\n }\n } else if (!empty($_FILES) && $photoCount > 1) {\n foreach ($_FILES as $photo) {\n Engine_Api::_()->getApi('Siteapi_Core', 'sitereview')->createPhoto($params, $photo);\n }\n }\n\n $db->commit();\n $this->successResponseNoContent('no_content', true);\n } catch (Exception $e) {\n $db->rollBack();\n }\n }\n }",
"public function getFileNames();",
"function get_github_file_list($manual_id) {\n $result = array();\n if (MANUAL_LOCAL_FILES_REQUEST) {\n $result = get_local_file_list($manual_id);\n } elseif (!MANUAL_DEBUG_NO_FILELIST_REQUEST) {\n $result = json_decode(get_content_from_github(GITHUB_FILESLIST_URL), true);\n put_cache_json('content_github.json', $result, $manual_id);\n } else {\n $result = get_cache_json('content_github.json', $manual_id);\n }\n // debug('get_github_file_list result', $result);\n return $result;\n}",
"public function testGetFilesParams()\n {\n $files = $this->_req->getFilesParams();\n $picture = $files['picture'];\n $this->assertInstanceOf('Mad_Controller_FileUpload', $picture);\n\n $icon = $files['document']['icon'];\n $this->assertInstanceOf('Mad_Controller_FileUpload', $icon);\n\n $photo = $files['document']['photo'];\n $this->assertInstanceOf('Mad_Controller_FileUpload', $photo);\n }",
"function get_video_file($vdetails,$return_default=true,$with_path=true,$multi=false,$count_only=false,$hq=false)\r\n{\r\n global $Cbucket;\r\n # checking if there is any other functions\r\n # available\r\n if(is_array($Cbucket->custom_video_file_funcs))\r\n foreach($Cbucket->custom_video_file_funcs as $func)\r\n if(function_exists($func))\r\n {\r\n $func_returned = $func($vdetails, $hq);\r\n if($func_returned)\r\n return $func_returned;\r\n }\r\n\r\n\r\n $fileDirectory = \"\";\r\n if(isset($vdetails['file_directory']) && !empty($vdetails['file_directory'])){\r\n $fileDirectory = \"{$vdetails['file_directory']}/\";\r\n }\r\n //dump($vdetails['file_name']);\r\n\r\n #Now there is no function so lets continue as\r\n if(isset($vdetails['file_name']))\r\n $vid_files = glob(VIDEOS_DIR.\"/\".$fileDirectory . $vdetails['file_name'].\"*\");\r\n // if($hq){\r\n // var_dump(glob(VIDEOS_DIR.\"/\".$fileDirectory . $vdetails['file_name'].\"*\"));\r\n // }\r\n\r\n #replace Dir with URL\r\n if(is_array($vid_files))\r\n foreach($vid_files as $file)\r\n {\r\n // if($hq){\r\n // echo \"filesize = \" . filesize($file); \r\n // }\r\n if(filesize($file) < 100) continue;\r\n $files_part = explode('/',$file);\r\n $video_file = $files_part[count($files_part)-1];\r\n\r\n if($with_path)\r\n $files[] = VIDEOS_URL.'/' . $fileDirectory . $video_file;\r\n else\r\n $files[] = $video_file;\r\n }\r\n\r\n\r\n if(count($files)==0 && !$multi && !$count_only)\r\n {\r\n if($return_default)\r\n {\r\n\r\n if($with_path)\r\n return VIDEOS_URL.'/no_video.flv';\r\n else\r\n return 'no_video.flv';\r\n }else{\r\n return false;\r\n }\r\n }else{\r\n if($multi)\r\n return $files;\r\n if($count_only)\r\n return count($files);\r\n\r\n\r\n foreach($files as $file)\r\n {\r\n if($hq)\r\n {\r\n if(getext($file)=='mp4')\r\n {\r\n return $file;\r\n break;\r\n }\r\n }else{\r\n return $file;\r\n break;\r\n }\r\n }\r\n return $files[0];\r\n }\r\n}",
"public function files()\n\t{\n\t\treturn $this->hasMany('Src\\Core\\Entities\\File', 'pasta', 'id');\n\t}",
"function list_files($file_paths, $root_path, $student_class_folder, array $code_exts, array $validation_exts) {\n // Prepare header row\n $output = \"<table>\\n<tr>\";\n $output .= \"<th>Permission</th>\";\n //$output .= \"<th>User</th>\";\n //$output .= \"<th>Group</th>\";\n $output .= \"<th>File</th>\";\n $output .= \"<th>Modify Date</th>\";\n $output .= \"<th>Size</th>\";\n $output .= \"<th>Extra</th>\";\n $output .= \"</tr>\\n\";\n\n foreach ($file_paths as $file_path) {\n $relative_path = substr($file_path, strlen($root_path) + 1);\n // $split = split(\"/\", $relative_path);\n $split = explode(\"/\", $relative_path);\n $filename = $split[count($split) - 1];\n $stat = @stat($file_path);\n\n $output .= '<tr>';\n $output .= '<td>' . perms($stat['mode']) . '</td>';\n //$output .= '<td>' . $stat['uid'] . '</td>';\n //$output .= '<td>' . $stat['gid'] . '</td>';\n // Display the correct link to our files\n if (is_dir($file_path))\n $output .= \"<td><a class=\\\"folder\\\" href=\\\"?folder=$relative_path\\\"\";\n elseif (in_array(strtolower(pathinfo($file_path, PATHINFO_EXTENSION)), $code_exts))\n $output .= \"<td><a class=\\\"code\\\" href=\\\"?file=$relative_path\\\"\";\n else\n $output .= \"<td><a class=\\\"show\\\" target=\\\"_blank\\\" href=\\\"/${student_class_folder}/${relative_path}\\\"\";\n $output .= \">\" . $relative_path . \"</a></td>\"; //. $filename \n\n // Show the date. Depending on the due date color the text\n $ctime = date('Y-m-d H:i:s', $stat['ctime']);\n $mtime = date('Y-m-d H:i:s', $stat['mtime']);\n $output .= \"<td\";\n \n $output .= \">$mtime</td>\";\n\n // Add a cell for the size. Ignore directories\n if (is_dir($file_path))\n $output .= \"<td> </td>\";\n else\n $output .= '<td class=\"right\">' . $stat['size'] . '</td>';\n\n // Add a cell for a validation link. Only do it for files we're checking.\n if (in_array(strtolower(pathinfo($file_path, PATHINFO_EXTENSION)), $validation_exts)) {\n $server_name = filter_input(INPUT_SERVER, 'SERVER_NAME');\n $url = \"https://${server_name}/${student_class_folder}/${relative_path}\";\n $output .= \"<td><a target=\\\"_blank\\\" href=\\\"http://validator.w3.org/check?uri=$url\\\">Validate</a></td>\";\n } elseif (is_dir($file_path))\n $output .= \"<td><a class=\\\"code\\\" href=\\\"?files=${relative_path}\\\">View Code</a></td>\";\n\n //$output .= \"<td> </td>\";\n\n $output .= \"</tr>\\n\";\n }\n $output .= \"</table>\\n\";\n\n if (count($file_paths) == 0)\n $output .= \"<p class=\\\"error\\\">There are no files to display</p>\";\n\n return $output;\n}",
"public function testAddReplenishmentFileByURL()\n {\n }",
"public function testFindingFilesPrioritizesStatusCodeOverMethodTemplate()\n {\n $assembly = $this->commonFindingTemplate(array(\n 'resourceName' => $this->resourceName,\n 'options' => array('type' => 'html', 'method' => 'GET', 'status' => 200),\n 'foundFiles' => array('FooResource.200.html.php', 'FooResource.GET.html.php')\n ));\n $this->assertEquals('FooResource.200.html.php', $assembly->getFile());\n }",
"public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/idolisr.php',\n 'sources_custom/hooks/modules/members/idolisr.php',\n 'sources_custom/miniblocks/main_stars.php',\n 'sources_custom/miniblocks/side_recent_points.php',\n 'themes/default/templates_custom/POINTS_GIVE.tpl',\n 'themes/default/templates_custom/BLOCK_MAIN_STARS.tpl',\n 'themes/default/templates_custom/BLOCK_SIDE_RECENT_POINTS.tpl',\n );\n }",
"public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/wiki_sync.php',\n '_tests/tests/unit_tests/wiki_sync.php',\n 'lang_custom/EN/wiki_sync.ini',\n 'sources_custom/wiki_sync.php',\n 'sources_custom/hooks/systems/config/wiki_alt_changes_link_stub.php',\n 'sources_custom/hooks/systems/config/wiki_enable_git_sync.php',\n 'sources_custom/hooks/systems/config/wiki_enable_wysiwyg.php',\n 'sources_custom/hooks/systems/config/wiki_sync_media_directory.php',\n 'sources_custom/hooks/systems/config/wiki_sync_page_directory.php',\n 'sources_custom/hooks/systems/cron/wiki_sync_git.php',\n 'sources_custom/hooks/systems/notifications/wiki_failed_git_pull.php',\n 'sources_custom/wiki.php',\n 'site/pages/modules_custom/wiki.php',\n 'cms/pages/modules_custom/cms_wiki.php',\n );\n }",
"public function testGetFiles() : void {\n $expected = 0;\n $this->assertEquals($expected, count($this->dataManager->getFiles([])));\n }",
"public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/trickstr.php',\n 'sources_custom/programe/.htaccess',\n 'sources_custom/programe/aiml/.htaccess',\n 'sources_custom/programe/aiml/index.html',\n 'sources_custom/programe/index.html',\n 'sources_custom/hooks/modules/chat_bots/knowledge.txt',\n 'sources_custom/hooks/modules/chat_bots/trickstr.php',\n 'sources_custom/programe/aiml/readme.txt',\n 'sources_custom/programe/aiml/startup.xml',\n 'sources_custom/programe/aiml/std-65percent.aiml',\n 'sources_custom/programe/aiml/std-pickup.aiml',\n 'sources_custom/programe/botloaderfuncs.php',\n 'sources_custom/programe/customtags.php',\n 'sources_custom/programe/db.sql',\n 'sources_custom/programe/graphnew.php',\n 'sources_custom/programe/respond.php',\n 'sources_custom/programe/util.php',\n );\n }",
"private function getUploadedFiles()\n {\n $list = array();\n \n if(isset($_REQUEST['files']))\n {\n $files = explode('::', $_REQUEST['files']);\n foreach($files as $index => $item)\n {\n list($name, $src, $size) = explode(':', $item);\n \n $list[] = array(\n 'name' => $name,\n 'src' => $src,\n 'size' => $size \n );\n }\n }\n \n return $list;\n }",
"function get_list_of_new_files() {\n $result = $this->pdo->query('SELECT * FROM files WHERE newfile = 1 ORDER BY date DESC');\n return $result;\n }",
"private function getDownloadableFileUrls() {\n if (!$this->wooData->getDownloadableMediaFiles()) return null;\n\n return array_map(function($mediaFile) {\n /** @var MediaFile $mediaFile */\n\n return Utils::view('site-tester.partial.attachment-item')\n ->with(['item' => $mediaFile])\n ->render();\n }, $this->wooData->getDownloadableMediaFiles());\n }",
"public function testIfPdfPrinterListWillReturnData(): void\n {\n $response = new PdfPrinterMockResponse(200, [\n [\n 'file' => 'XXX.pdf',\n 'path' => 'test/XXX.pd',\n 'created_at' => '2020-06-27T22:27:09.876Z',\n 'updated_at' => '2020-06-27T22:27:09.876Z',\n ],\n ]);\n\n $pdfPrinter = $this->createApiMock([$response]);\n $result = $pdfPrinter->listFiles();\n\n $this->assertNotNull($result);\n $this->assertEquals(1, $result->count());\n }",
"protected function getFilesInDirCreateTestDirectory() {}",
"public function getAllowedFiles(){\n return self::$allowed_files;\n }",
"public static function filelist()\n\t{\n\t\tglobal $g_relative_file_directory;\t// '../../UPLOADS/';\n\t\tglobal $g_relative_root_directory;\t// 'UPLOADS/';\n\n\t\t$actualdirectory = $_POST['actualdir'];\n\t\tif(!$actualdirectory)\n\t\t\t$actualdirectory='';\n\n\t\t$result = [];\n\t\t$result['directory'] = $g_relative_root_directory;\n\t\t$result['actualdir'] = $actualdirectory;\n\n\t\tif(strlen($actualdirectory)>0)\n\t\t\t$actualdirectory.=\"/\";\n\n\t\t$reldir = $g_relative_file_directory.$actualdirectory;\n\t\t$dirs=[];\n\t\tforeach(glob($reldir.'*', GLOB_ONLYDIR) as $d)\n\t\t{\n\t\t\t$fn=str_replace($reldir,'',$d);\n\t\t\t$dirs[] = $fn;\n\t\t}\n\t\t$result['dirs']=$dirs;\n\t\t//$result['reldir']=$reldir;\n\n\t\t$filenames = [];\n\t\tforeach(array_filter(glob($reldir.'*.*'), 'is_file') as $file)\n\t\t{\n\t\t\t$farray = [];\n\t\t\t$fn=str_replace($reldir,'',$file);\n\n\t\t\t$f=filesize($file);\n\t\t\t$fe=\"bytes\";\n\t\t\tif($f/1024 > 1)\n\t\t\t{\n\t\t\t\t$f/=1024;\n\t\t\t\t$fe=\"kb\";\n\t\t\t\tif($f/1024 > 1)\n\t\t\t\t{\n\t\t\t\t\t$f/=1024;\n\t\t\t\t\t$fe=\"Mb\";\n\t\t\t\t\tif($f/1024 > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$f/=1024;\n\t\t\t\t\t\t$fe=\"GB\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$farray['Filename'] = $fn;\n\t\t\t$farray['Filesize'] = number_format($f,1);\n\t\t\t$farray['FilesizeDeterminant'] = $fe;\n\n\t\t\t$filenames[] = $farray;\n\t\t}\n\t\t$result['files']=$filenames;\n\n\t\theader('Content-Type: application/json');\n\t\techo(json_encode($result));\n\t}",
"public function testGetPhpFiles()\n {\n // Files arrays\n $files = [];\n $phpFiles = [];\n\n // For every specified folder\n foreach ($this->phpFolders as $folder) {\n\n // Get files from directory\n $files = array_merge($files, FileHelper::directoryFiles($folder));\n }\n\n // Select php only files\n foreach ($files as $file) {\n if (substr($file, -4) === '.php') {\n $phpFiles[] = $file;\n }\n }\n\n // Check that we have at least 10 php files across all collected\n $count = count($phpFiles);\n $this->assertTrue($count > 10, json_encode([\n 'count' => $count,\n 'expected' => 'total number of php files must exceed 10 files',\n ], JSON_UNESCAPED_SLASHES));\n\n // Return end point data\n return $phpFiles;\n }",
"public function fileclerk__list()\n\t{\n\t\t// Force AJAX, except in dev\n\t\tif ( ! Request::isAjax() && FILECLERK_ENV != 'dev' ) {\n\t\t\techo FILECLERK_AJAX_WARNING;\n\t\t\texit;\n\t\t}\n\n\t\t// Destination config parameter\n\t\t$destination = Request::get('destination');\n\t\t$destination = is_null($destination) ? 0 : $destination;\n\n\t\t// Merge configs before we proceed\n\t\t$this->config = $this->tasks->merge_configs( $destination );\n\n\t\t// Setup client\n\t\tself::load_s3();\n\n\t\t// Set default error to false\n\t\t$error = false;\n\n\t\t// Do some werk to setup paths\n\t\t$bucket = $this->config['bucket'];\n\t\t$directory = $this->config['directory'];\n\t\t$uri = Request::get('uri');\n\t\t$uri = explode('?', $uri);\n\t\t$uri = reset($uri);\n\t\t$s3_url = Url::tidy( 's3://' . join('/', array($bucket, $directory, $uri)) );\n\n\t\t// Let's make sure we have a valid URL before movin' on\n\t\tif ( Url::isValid( $s3_url ) ) {\n\t\t\t// Just messing around native SDK methods get objects\n\t\t\tif ( FALSE ) {\n\t\t\t\t// Trying out listIterator\n\t\t\t\t$iterator = $this->client->getIterator( 'ListObjects', array(\n\t\t\t\t\t'Bucket' => $this->config['bucket'],\n\t\t\t\t\t'Delimiter' => '/',\n\t\t\t\t\t// 'Prefix' => 'balls/',\n\t\t\t\t), array(\n\t\t\t\t\t'limit' => 1000,\n\t\t\t\t\t'return_prefixes' => true,\n\t\t\t\t));\n\n\t\t\t\t//dd($iterator);\n\n\t\t\t\techo '<pre>';\n\t\t\t\tforeach ( $iterator as $object ) {\n\t\t\t\t\t//if( ! isset($object['Prefix']) ) continue; // Skip non-directories\n\n\t\t\t\t\techo var_dump($object) . '<br>';\n\t\t\t\t\t//echo var_dump($object) . '<br>';\n\t\t\t\t}\n\t\t\t\techo '</pre>';\n\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t// Finder instance\n\t\t\t$finder = new Finder();\n\n\t\t\t// Finder call\n\t\t\ttry {\n\t\t\t\t$finder\n\t\t\t\t\t->ignoreUnreadableDirs()\n\t\t\t\t\t->ignoreDotFiles(true)\n\t\t\t\t\t->in($s3_url)\n\t\t\t\t\t->depth('== 0') // Do not allow access above the starting directory\n\t\t\t\t;\n\n\t\t\t\t$results = iterator_to_array($finder);\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\t$error = $e->getMessage();\n\n\t\t\t\theader('Content-Type', 'application/json');\n\t\t\t\techo self::build_response_json(false, true, FILECLERK_S3_ERROR, $error, 'error', null, null, null);\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t// Data array for building out view\n\t\t\t$data = array(\n\t\t\t\t'crumbs' => explode('/', $uri), // Array of the currently request URI.\n\t\t\t\t'destination' => $destination, // Array of the currently request URI.\n\t\t\t\t'list' => array(), // Files and dirs mixed\n\t\t\t);\n\n\t\t\t// Prepare breadcrumbs\n\t\t\tforeach ( $data['crumbs'] as $key => $value ) {\n\t\t\t\t$path = explode('/', $uri, ($key + 1) - (count($data['crumbs'])));\n\t\t\t\t$path = implode('/', $path);\n\t\t\t\t//$path = Url::tidy( $path . '/?' . $querystring );\n\t\t\t\t$path = Url::tidy( $path );\n\t\t\t\t$data['crumbs'][$key] = array(\n\t\t\t\t\t'name' => $value,\n\t\t\t\t\t'path' => $path\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Build breadcrumb\n\t\t\t$breadcrumb = Parse::template( self::get_view('_list-breadcrumb'), $data );\n\n\t\t\t/**\n\t\t\t * Let's make sure we've got somethin' up in this mutha.\n\t\t\t */\n\t\t\tif( $finder->count() > 0 ) {\n\t\t\t\tforeach ($finder as $file) {\n\t\t\t\t\t// Get the filename\n\t\t\t\t\t$filename = $file->getFilename();\n\n\t\t\t\t\t// Set the S3 key string for the objet\n\t\t\t\t\t$key = Url::tidy( join('/', array($directory, $uri, $filename)) );\n\n\t\t\t\t\t// File / directory attributes\n\t\t\t\t\t$this->data = $this->tasks->get_file_data_array();\n\n\t\t\t\t\t// Set some file data\n\t\t\t\t\t$file_data = array(\n\t\t\t\t\t\t'basename' => $file->getBasename( '.' . $file->getExtension() ),\n\t\t\t\t\t\t'destination' => $destination,\n\t\t\t\t\t\t'extension' => $file->getExtension(),\n\t\t\t\t\t\t'file' => $file->getPathname(),\n\t\t\t\t\t\t'filename' => $file->getFilename(),\n\t\t\t\t\t\t'last_modified' => $file->isDir() ? '--' :$file->getMTime(),\n\t\t\t\t\t\t'is_file' => $file->isFile(),\n\t\t\t\t\t\t'is_directory' => $file->isDir(),\n\t\t\t\t\t\t'size' => $file->isDir() ? '--' : File::getHumanSize($file->getSize()),\n\t\t\t\t\t\t'size_bytes' => $file->getSize(),\n\t\t\t\t\t\t'uri' => $uri,\n\t\t\t\t\t);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Need to set the uri value\n\t\t\t\t\t */\n\t\t\t\t\tif ( $file->isFile() ) {\n\t\t\t\t\t\t// Check if file is an iamge\n\t\t\t\t\t\t$file_data['is_image'] = self::is_image($file_data['extension']);\n\n\t\t\t\t\t\t// Set filesize data\n\t\t\t\t\t\t$file_data['size_kilobytes'] = $this->tasks->get_size_kilobytes($file_data['size_bytes']);\n\t\t\t\t\t\t$file_data['size_megabytes'] = $this->tasks->get_size_megabytes($file_data['size_bytes']);\n\t\t\t\t\t\t$file_data['size_gigabytes'] = $this->tasks->get_size_gigabytes($file_data['size_bytes']);\n\t\t\t\t\t} elseif ( $file->isDir() ) {\n\t\t\t\t\t\tif( is_null($uri) ) {\n\t\t\t\t\t\t\t$file_data['uri'] = Url::tidy( '/' . join('/', array($file_data['filename'])) );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$file_data['uri'] = Url::tidy( '/' . join('/', array($uri,$file_data['filename'])) );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Keep on movin' on.\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set the URL\n\t\t\t\t\t$file_data['url'] = Url::tidy( self::get_url_prefix($uri) . '/' . $filename );\n\n\t\t\t\t\t// Push file data to a new array with the filename as the key for sorting.\n\t\t\t\t\t$data['list'][$filename] = $file_data;\n\t\t\t\t\tunset( $file_data );\n\t\t\t\t}\n\t\t\t// Nothing returned from Finder\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * Return an error of type dialog that should show a message to the user\n\t\t\t\t * that there are is nothing to see her. Doh!\n\t\t\t\t * @return [array] JSON\n\t\t\t\t * @todo See `self::set_json_return`.\n\t\t\t\t */\n\t\t\t\t// echo self::build_response_json(false, true, FILECLERK_LIST_NO_RESULTS, 'No results returned.');\n\t\t\t\t// exit;\n\n\t\t\t\t$no_results_template = File::get( __DIR__ . '/views/error-no-results.html');\n\n\t\t\t\tend($data['crumbs']);\n\t\t\t\t$previous_directory = prev($data['crumbs']);\n\n\t\t\t\techo json_encode( array(\n\t\t\t\t\t'error'\t\t\t=> TRUE,\n\t\t\t\t\t'type'\t\t\t=> 'dialog',\n\t\t\t\t\t'code'\t\t\t=> FILECLERK_LIST_NO_RESULTS,\n\t\t\t\t\t'breadcrumb'\t=> $breadcrumb,\n\t\t\t\t\t'html'\t\t\t=> Parse::template( $no_results_template, array('previous_directory' => $previous_directory['path']) ),\n\t\t\t\t));\n\n\t\t\t\texit;\n\n\t\t\t}\n\t\t}\n\n\t\t// Need to pass in the destination for root requests.\n\t\t$data['destination'] = $destination;\n\n\t\t// Sort this fucking multi-dimensional array already.\n\t\tuksort( $data['list'], 'strcasecmp');\n\t\t//array_multisort( array_keys($data['list']), SORT_FLAG_CASE, $data['list'] );\n\n\t\t/**\n\t\t * THIS ONLY WORKS IN PHP 5.4+. FUCK!\n\t\t */\n\t\t// array_multisort( array_keys($data['list']), SORT_NATURAL | SORT_FLAG_CASE, $data['list'] );\n\n\t\t// Now we need to tweak the array for parsing.\n\t\tforeach ( $data['list'] as $filename => $filedata ) {\n\t\t\t$data['list'][] = $filedata;\n\t\t\tunset($data['list'][$filename]);\n\t\t}\n\n\t\t// We're basically parsing template partials here to build out the larger view.\n\t\t$parsed_data = array(\n\t\t\t'list' => Parse::template( self::get_view('_list'), $data ),\n\t\t);\n\n\t\t// Put it all together\n\t\t$ft_template = File::get( __DIR__ . '/views/list.html');\n\n\t\t// Return JASON\n\t\theader('Content-Type', 'application/json');\n\t\techo self::build_response_json(true, false, FILECLERK_LIST_SUCCESS, null, null, $data, $breadcrumb, Parse::template($ft_template, $parsed_data));\n\t\texit;\n\t}",
"public function index()\n {\n $files = $this->files\n ->getFilesPaginated(config('core.sys.file.default_per_page'))\n ->items();\n return $this->handler\n ->apiResponse($files);\n }",
"protected function processChangedAndNewFiles() {}",
"public function browse_files()\n {\n // Scan file directory, render the images.\n if (is_dir($this->file_path)) {\n $files = preg_grep('/^([^.])/', scandir($this->file_path));\n return $files;\n }\n \n }",
"public function media_upload_picasa_list()\n\t{\n\t\t$this->api->check_authentication();\n\n\t\tif(isset($_POST['picasa_embed']))\n\t\t{\n\t\t\t$photo_id = $_POST['photo_id'];\n\t\t\t$link_url = esc_url($_POST['link_url']);\n\t\t\t$size = esc_attr($_POST['size']);\n\t\t\t$alignment = esc_attr($_POST['alignment']);\n\n\t\t\t$this->insert_photo($photo_id, compact('link_url', 'size', 'alignment'));\n\t\t}\n\n\t\twp_iframe(array(&$this, 'media_upload_picasa_list_content'));\n\t}",
"function getFiles()\r\n\t{\r\n\t\treturn $this->files;\r\n\t}",
"public function testListDocuments()\n {\n }",
"private function set_files_by_published()\n\t\t{\n\t\t\t$this->files = Filesystem::ls(PATH_POSTS, '*.*.*.*.NULL.*.*.*.*.*.*', 'xml', false, false, true);\n\t\t\t$this->files_count = count( $this->files );\n\t\t}",
"function getListOfFiles(){\n $result = \"\";\n $directoryFiles = scandir(\"uploads/\");\n $amount = count($directoryFiles);\n if($amount > 2){\n $result .= '<div class=\"listFile\"><ul class=\"blue\">'; \n $r = 0;\n for ($i = 2; $i < $amount; $i++) { \n $r++;\n if (preg_match(\"/(jpg|jpeg|png|gif)$/\", $directoryFiles[$i])) {\n $result .= '<li><a href=\"uploads/'. $directoryFiles[$i] . '\" download><img class=\"minIcon\" src=\"uploads/'.\n $directoryFiles[$i] . '\" alt=\"' . $directoryFiles[$i] . '\">';\n $filesize = filesize('uploads/'. $directoryFiles[$i]);\n $newFileSize = convertFileSize($filesize);\n $result .= '<span>' . $directoryFiles[$i] . ' (Size is: ' . $newFileSize . ')</span></a></li>';\n } \n }\n $result .= '</ul></div>';\n }\n\n return $result; \n }",
"public function listApplicationFiles() {\r\n\t\t$preload = array(\r\n\t\t\t\"config/main.js\"\r\n\t\t);\r\n\t\t\r\n\t\t$return = array();\r\n\t\t$fullPath = $this->applicationPath;\r\n\t\r\n\t\tforeach($preload as $file) {\r\n\t\t\t$return[] = $fullPath.\"/\".$file;\r\n\t\t}\r\n\t\t\r\n\t\t$options = array(\r\n\t\t\t\"fileTypes\" => array(\"js\"),\r\n\t\t\t\"exclude\" => array_merge($preload, array(\r\n\t\t\t\t\"data\", \"messages\", \"compiled.js\"\r\n\t\t\t))\r\n\t\t);\r\n\t\t\r\n\t\t$return = array_merge($return, CFileHelper::findFiles($fullPath,$options));\r\n\t\t\r\n\t\t\r\n\t\treturn $return;\r\n\t}",
"abstract protected function _attachmentsList();",
"function get_list_of_files() {\n $result = $this->pdo->query('SELECT * FROM files ORDER BY filename ASC');\n return $result;\n }",
"public function testReadingFiles()\n {\n $dir = __DIR__;\n $f = $this->adapter->java('java.io.File', $dir);\n $paths = $f->listFiles();\n foreach ($paths as $path) {\n self::assertFileExists((string) $path);\n }\n }",
"function fileList(){\n\t\tchdir('./../cloud/books/'); //Move to template directory\n\t\t\n\t\tif ($handle = opendir(getcwd())) { //Open dir\n\t\t echo '<ul class=\"list-group\">';\n\t\t while (false !== ($entry = readdir($handle))) { //While directory not end - return files list\n\t\t \tif ($entry != \".\" && $entry != \".DS_Store\" && $entry != \"..\") { //Filter trash\n\t\t \t\tif(is_dir($entry)){ //IF dir then return button with folder icon \n\t\t \t\t\techo '<a href=\"#\" class=\"list-group-item cat\"><i class=\"fa fa-folder-o\" aria-hidden=\"true\"></i> '.$entry.'</a>';\n\t\t \t\t}else{ //else return file button\n\t\t \t\t\t$FileInfo = new SplFileInfo($entry); //Get file info\n\t\t \t\t\t$ext = $FileInfo->getExtension(); //Get file extension\n\t\t \t\t\tif($ext == \"png\" or $ext == \"jpg\" or $ext == \"bmp\") //IF file is image then return button with image icon\n\t\t \t\t\t\techo '<a href=\"/files/cloud/books/'.$entry.'\" class=\"list-group-item file\"><i class=\"fa fa-file-image-o\" aria-hidden=\"true\"></i> '.$entry.'</a>';\n\t\t \t\t\telse //Else return button with file-code icon\n\t\t \t\t\t\techo '<a href=\"/files/cloud/books/'.$entry.'\" class=\"list-group-item file\"><i class=\"fa fa-file-o\" aria-hidden=\"true\"></i> '.$entry.'</a>';\n\t\t \t\t}\n\t\t \t}\n\t\t }\n\t\t echo '</ul>';\n\t\t closedir($handle); //Close dir\n\t\t}\n\t}",
"public function getFileList() {\n return $this->fileList;\n }",
"public function testFileRefs() {}",
"public function testRecordingListPage(): void\n {\n $recordingListPage = self::$recordingListPage;\n\n $this->assertInstanceOf(RecordingListPage::class, $recordingListPage);\n $this->assertSame(25, count($recordingListPage));\n\n $recording = $recordingListPage[0];\n\n $this->assertInstanceOf(Recording::class, $recording);\n }",
"public function get_content_file_video(){\r\n\t\t$path = storage_path().'/data_video/';\r\n\t\t$dir = scandir($path);\r\n\t\tforeach ($dir as $key => $value) {\r\n\t\t\tif(preg_match(\"/\\.json$/\",$value)){\r\n\t\t\t\t$data = (json_decode(file_get_contents($path.$value)));\r\n\t\t\t\tforeach ($data as $key2 => $value2) {\r\n\t\t\t\t\tforeach ($value2->items as $key3 => $value3) {\r\n\t\t\t\t\t\t$params[$key3][\"videoId\"] = $value3->snippet->resourceId->videoId;\r\n\t\t\t\t\t\t$params[$key3][\"title\"] = $value3->snippet->title;\r\n\t\t\t\t\t\t$params[$key3][\"description\"] = $value3->snippet->description;\r\n\t\t\t\t\t\t$params[\"keywords\"] = str_replace(\".json\", \"\", $value);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->save_video_by_array($params);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function getFileList()\n {\n return array_map(\n function (FileEntry $file) {\n return $file->getFilename();\n },\n $this->pharchive->getFiles()\n );\n }"
] | [
"0.58834845",
"0.5769307",
"0.5767245",
"0.57574075",
"0.572067",
"0.56012434",
"0.5557108",
"0.5524374",
"0.5524374",
"0.5524374",
"0.54968965",
"0.54968965",
"0.54968965",
"0.54705936",
"0.5462373",
"0.5406382",
"0.5346848",
"0.5325001",
"0.531251",
"0.5304454",
"0.5276892",
"0.52477914",
"0.52467114",
"0.5202889",
"0.51756936",
"0.51748455",
"0.51662654",
"0.5151146",
"0.5139908",
"0.5114939",
"0.5113251",
"0.50840575",
"0.50736773",
"0.50437576",
"0.50327045",
"0.50131476",
"0.5010468",
"0.5005318",
"0.50043124",
"0.49986628",
"0.4996285",
"0.4993664",
"0.49873498",
"0.49823958",
"0.4979119",
"0.49772885",
"0.49728853",
"0.49445763",
"0.49376324",
"0.49179837",
"0.49105048",
"0.4897405",
"0.48821035",
"0.48773474",
"0.48755488",
"0.48747483",
"0.48672003",
"0.4833246",
"0.4831795",
"0.4826943",
"0.48244956",
"0.4822391",
"0.48213714",
"0.48197094",
"0.48194307",
"0.48178685",
"0.4816187",
"0.4809828",
"0.48082992",
"0.48033357",
"0.48030818",
"0.47973356",
"0.47936246",
"0.47914004",
"0.4789865",
"0.47774246",
"0.47658968",
"0.4746246",
"0.47434318",
"0.47430965",
"0.47366866",
"0.4735342",
"0.47347227",
"0.47345617",
"0.47322398",
"0.47289407",
"0.47275424",
"0.47270048",
"0.4720098",
"0.47179753",
"0.47159728",
"0.47120196",
"0.47013456",
"0.47004923",
"0.46994743",
"0.46991667",
"0.4686933",
"0.46815187",
"0.46804056",
"0.46677214"
] | 0.82050633 | 0 |
Test case for listPastWebinarPollResults List Past Webinar Poll Results. | public function testListPastWebinarPollResults()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testListPastWebinarQA()\n {\n }",
"public function testPastEvents()\n {\n // otherwise test will fail.\n // Other approach is to use fake data or mock it.\n \n $response = $this->json('GET', '/events/expired');\n \n $response\n ->assertStatus(200)\n ->assertJson([\n ['name' => 'Fashion Show']\n ]);\n }",
"public function testListPastWebinarFiles()\n {\n }",
"public function testWebinarPanelists()\n {\n }",
"public function test119DisplayBookingListAfterClickOnEachLinkOfPagination()\n {\n $ssoData = $this->getSSOData();\n\n // current bookings\n $this->createBookings(20, date('Y-m-d'), 15);\n\n //$this->mockApi($data, 'empty_ok');\n\n $responseBefore = $this->ajax($this->getUrlByParams(['page' => 1, 'per_page' => 10]))->json();\n $responseAfter = $this->ajax($this->getUrlByParams(['page' => 2, 'per_page' => 10]))->json();\n\n $listBefore = $responseBefore['current_list'];\n $listAfter = $responseAfter['current_list'];\n\n $this->assertFalse($listBefore == $listAfter);\n }",
"public function getPastEvents(){\n\t\t// get the events\n\t\t$events = $this->getEvents();\n\n\t\t$pastEvents = [];\n\t\t$eventNumber = sizeof($events);\n\n\t\t// extracts the events which has not happened yet, which date is not passed\n\t\tfor ($i = 0; $i < $eventNumber; $i++){\n\t\t\t$event = array_shift($events);\n\t\t\tif($event['is_approved'] == 1 && $event['date'] < date('Y-m-d')){\n\t\t\t\tarray_push($pastEvents, $event);\n\t\t\t}\n\t\t}\n\n\t\treturn $pastEvents;\n\t}",
"public function testPastEmbargo()\n {\n $page = $this->objFromFixture(SiteTree::class, 'pastEmbargo');\n\n $page = $this->finishWorkflow($page);\n\n $this->assertNotEquals(0, $page->PublishJobID);\n $this->assertEquals(0, $page->UnPublishJobID);\n\n $publish = strtotime($page->PublishJob()->StartAfter ?? '');\n $this->assertFalse($publish);\n }",
"public function loop_through_past_posts($callback){\n return call_user_func_array($this->loop_through_posts(array(\"meta_key\" => \"_event_upcoming_label\", \"meta_value\" => \"Past\")), [$callback]);\n }",
"public function testWebinarPollGet()\n {\n }",
"public function testPastWebinars()\n {\n }",
"public function testPastExpiry()\n {\n $page = $this->objFromFixture(SiteTree::class, 'pastExpiry');\n\n $page = $this->finishWorkflow($page);\n\n $this->assertEquals(0, $page->PublishJobID);\n $this->assertNotEquals(0, $page->UnPublishJobID);\n\n $unpublish = strtotime($page->UnPublishJob()->StartAfter ?? '');\n\n $this->assertFalse($unpublish);\n }",
"public function test118DisplayPaginationLinksWhenTotalRecordsHigherThan10()\n {\n $ssoData = $this->getSSOData();\n\n // current bookings\n $this->createBookings(11, date('Y-m-d'), 11);\n\n //$this->mockApi($data, 'empty_ok');\n\n $params = [\n 'page' => 1,\n 'per_page' => 10,\n ];\n $response = $this->ajax($this->getUrlByParams($params))->json();\n\n $this->assertTrue(is_array($response));\n $this->assertArrayHasKey('current_list', $response);\n\n $list = $response['current_list'];\n $totalRowsInList = substr_count($list, '<ul class=\"pagination\"');\n\n $this->assertEquals(1, $totalRowsInList);\n }",
"public function testWebinarPolls()\n {\n }",
"public function pastTrips()\n\t{\n\t\t\n\t\t$now = \\Carbon\\Carbon::now()->format('Y-m-d');\n\t\t\n\t\t// Ensure only the logged in user's bookings are being pulled\n\t\t$listings = Booking::where('traveller_id', '=', Auth::user()->id)\n\t\t\t->where('end_date', '<', $now)\n\t\t\t->whereNotNull('transaction_id')\n\t\t\t->whereNull('canceled_at')\n\t\t\t->leftJoin('listings', 'listings.id', '=', 'bookings.listing_id')\n\t\t\t->leftJoin('listing_addresses', 'listing_addresses.id', '=', 'listings.id')\n\t\t\t->leftJoin(DB::raw(\"(select url, listing_id \n\t\t\t\t\t\t\tfrom `listings_images` \n\t\t\t\t\t\t\twhere `primary` = 1) as `list_images`\"), 'list_images.listing_id', '=', 'listings.id')\n\t\t\t->leftJoin(DB::raw(\"(select booking_id as review from `reviews`) as `listing_review`\"), 'listing_review.review', '=', 'bookings.id')\n\t\t\t->get();\n\t\t\n\t\t\n\t\treturn view('dashboard.traveller.past')\n\t\t\t->with('listings', $listings);\n\t}",
"public function pastschedule() {\n //\n $currentDate = \\Helpers\\DateHelper::getLocalUserDate(date('Y-m-d H:i:s'));\n \n $scheduleDays = \\Helpers\\DateHelper::getScheduleDays($currentDate);\n $scheduleDays = array_reverse($scheduleDays);\n \n return view('user/pastschedule', ['scheduleDays' => $scheduleDays, 'number_of_day' => 1])\n ->with('target_areas', json_decode($this->target_areas, true))\n ->with('movements', json_decode($this->movements, true));\n }",
"public function pastEvents()\n {\n $banner = array(\n 'title' => 'Past Events',\n 'subtitle' => 'A recap of our past events.',\n );\n\n $today = Carbon::today()->toDateString();\n $events = Event::whereDate('event_date', '<', $today);\n\n // Filter by url param\n if ($month = request('month')) {\n $events->whereMonth('event_date', Carbon::parse($month)->month);\n }\n\n if ($year = request('year')) {\n $events->whereYear('event_date', $year);\n }\n\n $events = $events->orderBy('event_date', 'desc')\n ->paginate(5);\n\n\n // Temporary\n $archives = Event::selectRaw('year(event_date) year, monthname(event_date) month, count(*) published')\n ->whereDate('event_date', '<', $today)\n ->groupBy('year', 'month')\n ->orderByRaw('min(event_date) desc')\n ->get()\n ->toArray();\n\n return view('events.past_events', compact('banner','events', 'archives'));\n }",
"public function testPastEmbargoExpiry()\n {\n $page = $this->objFromFixture(SiteTree::class, 'pastEmbargoExpiry');\n\n $page = $this->finishWorkflow($page);\n\n $this->assertEquals(0, $page->PublishJobID);\n $this->assertNotEquals(0, $page->UnPublishJobID);\n\n $unpublish = strtotime($page->UnPublishJob()->StartAfter ?? '');\n\n $this->assertFalse($unpublish);\n }",
"public function past()\n {\n $events = Event::orderBy('start_datetime')->past()->paginate();\n\n return view('auth.residents.events.past', compact('events'));\n }",
"public function test117NoDisplayPaginationLinksWhenTotalRecordsLessThan10()\n {\n $ssoData = $this->getSSOData();\n\n // current bookings\n $this->createBookings(9, date('Y-m-d'), 9);\n\n //$this->mockApi($data, 'empty_ok');\n\n $params = [\n 'page' => 1,\n 'per_page' => 10,\n ];\n $response = $this->ajax($this->getUrlByParams($params))->json();\n\n $this->assertTrue(is_array($response));\n $this->assertArrayHasKey('current_list', $response);\n\n $list = $response['current_list'];\n $totalRowsInList = substr_count($list, '<div class=\"contract_item\"');\n\n $this->assertLessThan(10, $totalRowsInList);\n }",
"public function testWebinarPanelistCreate()\n {\n }",
"public function testWebinarAbsentees()\n {\n }",
"public function testPastEmbargoAfterExpiry()\n {\n $page = $this->objFromFixture(SiteTree::class, 'pastEmbargoAfterExpiry');\n\n $page = $this->finishWorkflow($page);\n\n $this->assertEquals(0, $page->PublishJobID);\n $this->assertEquals(0, $page->UnPublishJobID);\n }",
"public function testPastEmbargoFutureExpiry()\n {\n $page = $this->objFromFixture(SiteTree::class, 'pastEmbargoFutureExpiry');\n\n $page = $this->finishWorkflow($page);\n\n $this->assertNotEquals(0, $page->PublishJobID);\n $this->assertNotEquals(0, $page->UnPublishJobID);\n\n $publish = strtotime($page->PublishJob()->StartAfter ?? '');\n $unpublish = strtotime($page->UnPublishJob()->StartAfter ?? '');\n\n $this->assertFalse($publish);\n $this->assertNotFalse($unpublish);\n }",
"function testStopPast() {\n $startDate = Carbon::now()->subDays(3)->toDateString();\n $stopDate = Carbon::now()->subDays(1)->toDateString();\n \n //Test precondition\n $this->tester->seeInDatabase('History', ['counterId'=>2, 'startDate'=>$startDate, 'endDate'=>null]);\n\n Counter::findOne(2)->stop($stopDate);\n\n //Test the results after reset\n $this->tester->seeInDatabase('History', ['counterId'=>2, 'startDate'=>$startDate, 'endDate'=>$stopDate]);\n $this->tester->dontSeeInDatabase('History', ['counterId'=>2, 'endDate'=>null]);\n }",
"public function testListingWithFilters()\n {\n $filters[] = ['limit' => 30, 'page' => 30];\n $filters[] = ['listing_type' => 'public'];\n foreach ($filters as $k => $v) {\n $client = static::createClient();\n $client->request('GET', '/v2/story', $v, [], $this->headers);\n $this->assertStatusCode(200, $client);\n\n $response = json_decode($client->getResponse()->getContent(), true);\n $this->assertTrue(is_array($response));\n }\n }",
"public function testWebinarPollUpdate()\n {\n }",
"public function testTwentySevenResults()\n {\n $response = $this->json('get', '/example', ['count' => 27]);\n $json = $response->json();\n $this->assertCount(27, $json['data']);\n $response->assertStatus(200);\n }",
"public function testUpcomingEvents()\n {\n // otherwise test will fail.\n // Other approach is to use fake data or mock it.\n \n $response = $this->json('GET', '/events');\n \n $response\n ->assertStatus(200)\n ->assertJson([\n ['name' => 'IT Expo']\n ]);\n }",
"function pi_list_browseresults($showResultCount = 1, $divParams = '', $spacer = false, $total_bodycount = 0) {\n\t\t\t// Initializing variables:\n\t\t$pointer = intval($this->piVars['pointer']);\n\t\t$count = $this->internal['res_count'];\n\t\t$results_at_a_time = t3lib_div::intInRange($this->internal['results_at_a_time'],1,1000);\n\t\t$maxPages = t3lib_div::intInRange($this->internal['maxPages'],1,100);\n\n\t\t$pR1 = $pointer * $results_at_a_time + 1;\n\t\t$pR2 = $pointer * $results_at_a_time + $results_at_a_time;\n\n\t\t$max = t3lib_div::intInRange(ceil($count/$results_at_a_time), 1, $maxPages);\n\n\n\t\t$links=array();\n\n\t\t\t// Make browse-table/links:\n\t\tif ($this->pi_alwaysPrev>=0) {\n\t\t\tif ($pointer > 0) {\n\t\t\t\t$links[] = $this->pi_linkTP_keepPIvars($this->pi_getLL('pi_list_browseresults_prev','< Previous',TRUE),array('pointer'=>($pointer-1 ? $pointer-1 : '')), 1);\n\t\t\t} elseif ($this->pi_alwaysPrev) {\n\t\t\t\t$links[] = $this->pi_getLL('pi_list_browseresults_prev','< Previous',TRUE);\n\t\t\t}\n\t\t}\n\n\t\tif ($max > 1) {\n\t\t\tif ($pointer >= $maxPages - 2) {\n\t\t\t\t$a = (integer) ($pointer - ($maxPages/2));\n\t\t\t} else {\n\t\t\t\t$a = 0;\n\t\t\t}\n\t\t\tif ($a < 0) {\n\t\t\t\t$a = 0;\n\t\t\t}\n\t\t\t// in order to have a correct value for $max we must include the value of the actual $pointer in the calculation\n\t\t\tfor($i=0; $i<$max; $i++) {\n\t\t\t\t$temp_links = array();\n\t\t\t\t// check that the starting point (equivalent of $pR1) doesn't exceed the total $count\n\t\t\t\tif($a * $results_at_a_time + 1 > $count){\n\t\t\t\t\t$i = $max; //quitt!!!\n\t\t\t\t}else{\n\t\t\t\t\t$temp_links[] = '';\n\t\t\t\t\t//beginning:\n\t\t\t\t\tif($pointer == $a){\n\t\t\t\t\t\t$temp_links[] .= '<span '.$this->pi_classParam('browsebox-SCell').'><strong>';\n\t\t\t\t\t}\n\t\t\t\t\t$temp_links[] .= $this->pi_linkTP_keepPIvars(trim($this->pi_getLL('pi_list_browseresults_page', 'Page', TRUE).' '.($a + 1)), array('pointer' => ( $a ? $a : '' )), 1);\n\t\t\t\t\t//ending:\n\t\t\t\t\tif($pointer == $a){\n\t\t\t\t\t\t$temp_links[] .= '</strong></span>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$a++;\n\t\t\t\t$links[] = implode('', $temp_links);\n\t\t\t}// end foreach\n\t\t}// end if max\n\n\t\t// neither $pointer nor the number-link ($a) must exceed the result of the calculation below!\n\t\tif ($pointer < ceil($count/$results_at_a_time)-1) {\n\t\t\t$links[] = $this->pi_linkTP_keepPIvars($this->pi_getLL('pi_list_browseresults_next','Next >',TRUE), array('pointer' => $pointer+1),1);\n\t\t}\n\t$sBox = '';\n\n\t\t$sBox .= '<!-- List browsing box: -->\n\t\t\t\t\t<div'.$this->pi_classParam('browsebox').'>';\n\t\tif($showResultCount){\n\t\t\t$sBox .= '<p>'; //paragraph for 'elements 1 to 20'\n\t\t\tif($this->internal['res_count']){\n\t\t\t\t$from_number = $this->internal['res_count'] > 0 ? $pR1 : 0;\n\t\t\t\t$to_number = min(array($this->internal['res_count'], $pR2));\n\n\n\t\t\t\t// don't know why I need this, found out by trial and error\n\t\t\t\tif($total_bodycount > 0 && !$this->piVars['char']){\n\t\t\t\t\t$to_number -= $total_bodycount;\n\t\t\t\t}\n\n\t\t\t\t$sBox .= sprintf(\n str_replace(\n\t\t\t\t\t\t\t\t\t\t\t'###SPAN_BEGIN###',\n\t\t\t\t\t\t\t\t\t\t\t'<span'.$this->pi_classParam('browsebox-strong').'>',\n\t\t\t\t\t\t\t\t\t\t\t$this->pi_getLL('pi_list_browseresults_displays', 'Displaying results ###SPAN_BEGIN###%s to %s</span> out of ###SPAN_BEGIN###%s</span>')\n\t\t\t\t\t\t\t\t\t\t),\n $from_number,\n\t\t\t\t\t\t\t\t\t\t//to (must substract local_bodycount here!!!)\n $to_number,\n //of a total of\n $this->internal['res_count']\n );\n\n\n\n\t\t\t}else{\n\t\t\t\t$sBox .= $this->pi_getLL('pi_list_browseresults_noResults','Sorry, no items were found.');\n\t\t\t}\n\t\t\t$sBox .= '</p>';\n\t\t}\n\t\t$sBox .= '<'.trim('p '.$divParams).'>'.implode($spacer, $links).'</p>';\n\t\t$sBox .= '</div>';\n\t\treturn $sBox;\n\t}",
"protected function _getLists() {\n\t\t/** @var Thrive_Dash_Api_WebinarJamStudio $api */\n\t\t$api = $this->getApi();\n\t\ttry {\n\t\t\t$lists = array();\n\t\t\t$webinars = $api->getUpcomingWebinars();\n\t\t\tforeach ( $webinars as $key => $item ) {\n\t\t\t\t$lists [] = array(\n\t\t\t\t\t'id' => $item['webinar_id'],\n\t\t\t\t\t'name' => $item['name']\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $lists;\n\t\t} catch ( Thrive_Dash_Api_WebinarJamStudio_Exception $e ) {\n\t\t\t$this->_error = $e->getMessage();\n\n\t\t\treturn false;\n\t\t}\n\n\t}",
"public function testLastRuns()\n {\n LastRun::truncate();\n LastRun::factory()->count(30)->create();\n\n $headers['Accept'] = 'application/json';\n\n $response = $this->get('/api/v1/runner/1/form-data', $headers);\n\n $response->assertStatus(200)->assertJsonStructure(['success', 'data' => ['last_runs'], 'status']);\n }",
"public function episodePremiumVisibleInDistantFuture(AcceptanceTester $I)\n {\n $I->wantTo('Verify that \"Never\" is displayed in the portal when Premium visible date is in the distant future. - C225103');\n $I->amOnPage(ContentPage::$URL_ingest);\n\n ContentUtils::clickTableRowOfTitle($I, \"CXCMS_Ingest_ContentWindows_\" . BuildNo::$build . \" Episode Paid Distant Future\");\n ContentUtils::clickTableRowOfTitle($I, \"CXCMS_Ingest_ContentWindows_\" . BuildNo::$build . \" Episode Paid Distant Future Season\");\n ContentUtils::clickTableRowOfTitle($I, \"CXCMS_Ingest_ContentWindows_\" . BuildNo::$build . \" Episode Paid Distant Future Title\");\n\n //CXCMS-1738 - This is bugged and will always fail\n $I->waitForText('Ingest Testing', 30, ContentPage::$channelRow);\n $I->seeInField(ContentPage::$windowing_listingBegin_input, 'Never');\n }",
"public function moviePremiumVisibleInDistantFuture(AcceptanceTester $I)\n {\n $I->wantTo('Verify that \"Never\" is displayed in the portal when Premium visible date is in the distant future. - C225105');\n $I->amOnPage(ContentPage::$URL_ingest);\n\n ContentUtils::clickTableRowOfTitle($I, \"CXCMS_Ingest_ContentWindows_\" . BuildNo::$build . \" Movie Paid Distant Future\");\n\n //CXCMS-1738 - This should say Never. Change when fixed.\n $I->waitForText('Ingest Testing', 30, ContentPage::$channelRow);\n $I->seeInField(ContentPage::$windowing_listingBegin_input, 'Never');\n }",
"public function testListSites()\n {\n }",
"public function tournamentCountPast()\n\t{\n\t\t$date = new DateTime();\n\t\treturn $this->tournamentCount($date->format(\"Y-m-d\"), true);\n\t}",
"public function testSuccessfulResponse()\n {\n $client = new DebugClient($_SERVER['FANTASY_DATA_API_KEY'], Subscription::KEY_DEVELOPER);\n\n /** @var \\GuzzleHttp\\Command\\Model $result */\n $result = $client->NewsByTeam(['Team' => 'NE']);\n\n $response = $client->mHistory->getLastResponse();\n\n $this->assertEquals('200', $response->getStatusCode());\n\n $check_news = function ( $pNews )\n {\n /** we expect 9 stats */\n $this->assertCount( 9, $pNews );\n\n $cloned_array = $pNews;\n\n /** this function helps us assure that we're not missing any keys in the Enum list */\n $process_key = function ( $pKey ) use ( $pNews, &$cloned_array )\n {\n $this->assertArrayHasKey( $pKey, $pNews );\n unset( $cloned_array[$pKey] );\n };\n\n /** test all the keys */\n $process_key( PlayerNews\\Property::KEY_CONTENT );\n $process_key( PlayerNews\\Property::KEY_NEWS_ID );\n $process_key( PlayerNews\\Property::KEY_PLAYER_ID );\n $process_key( PlayerNews\\Property::KEY_SOURCE );\n $process_key( PlayerNews\\Property::KEY_TEAM );\n $process_key( PlayerNews\\Property::KEY_TERMS_OF_USE );\n $process_key( PlayerNews\\Property::KEY_TITLE );\n $process_key( PlayerNews\\Property::KEY_UPDATED );\n $process_key( PlayerNews\\Property::KEY_URL );\n\n $this->assertEmpty( $cloned_array );\n };\n\n $stats = $result->toArray();\n\n array_walk( $stats, $check_news );\n }",
"public function testWebinarPollCreate()\n {\n }",
"public function testPastSameEmbargoExpiry()\n {\n $page = $this->objFromFixture(SiteTree::class, 'pastSameEmbargoExpiry');\n\n $page = $this->finishWorkflow($page);\n\n $this->assertEquals(0, $page->PublishJobID);\n $this->assertEquals(0, $page->UnPublishJobID);\n }",
"public function _get_past_prices_details(){\n \t$past_prices = $this\n\t\t\t->past_price\n\t\t\t->select('id, price, created')\n\t\t\t->order_by('created', 'desc')\n\t\t\t->get();\n\n\t\t$values = array();\n\t\tforeach($past_prices as $past_price){\n\t\t\t$values[] = format_currency($past_price->price) . ' - ' . format_date($past_price->created, 'default_date_format');\n\t\t}\n\t\treturn ul($values);\n }",
"public function testGetAllPolls()\n {\n Passport::actingAs(\n factory(\"App\\User\")->create(),\n ['*']\n );\n $polls= factory(\"App\\Poll\",5)->create();\n $response = $this->get('/polls');\n $response->assertStatus(200);\n $response->assertJson($polls->toArray());\n }",
"protected function wrapResults($outputs)\n {\n return new LastFm_User_GetPastEvents_Results($outputs);\n }",
"public function get_test_scheduled_events()\n {\n }",
"public function episodePremiumWatchableInDistantFuture(AcceptanceTester $I)\n {\n $I->wantTo('Verify that \"Never\" is displayed in the portal when Premium watchable date is in the distant future. - C225102');\n $I->amOnPage(ContentPage::$URL_ingest);\n\n ContentUtils::clickTableRowOfTitle($I, \"CXCMS_Ingest_ContentWindows_\" . BuildNo::$build . \" Episode Paid Distant Future\");\n ContentUtils::clickTableRowOfTitle($I, \"CXCMS_Ingest_ContentWindows_\" . BuildNo::$build . \" Episode Paid Distant Future Season\");\n ContentUtils::clickTableRowOfTitle($I, \"CXCMS_Ingest_ContentWindows_\" . BuildNo::$build . \" Episode Paid Distant Future Title\");\n\n $I->waitForText('Ingest Testing', 30, ContentPage::$channelRow);\n $I->seeInField(ContentPage::$windowing_premiumStartOfWindow_input, 'Never');\n }",
"public function otherList()\n\t{\n\t\techo json_encode($this->other_schedule->fetchData());\n\t}",
"public static function getHTMLForHistory($history, $laptops = false)\n\t{\n\t\tglobal $issueTypes;\n\t\t$output = \"\";\n \n\t\tforeach ($history as $row)\n\t\t{\n $recorded_by = new Student($row['initiated_by']);\n $recorded_by_string = \"\";\n if ( !empty($row['initiated_by']) && $recorded_by )\n $recorded_by_string = \"- Recorded by \".$recorded_by->getProperty(\"name\");\n \n\t\t\tif ( $row['type'] == ACTION_CREATE )\n\t\t\t{\n\t\t\t\t$output .= \"<div class=\\\"alert action-info\\\"><strong>Created</strong><br>\";\n\t\t\t\t$output .= ($laptops?$laptops[$row['laptop']['id']]['assetTag']:\"This computer\").\" was added to the database.<br>\";\n\t\t\t\t$output .= \"<small>Recorded on \".date(\"M d, Y\", $row['timestamp']).\" at \".date(\"g:i A\", $row['timestamp']).\" \".$recorded_by_string.\"</small>\";\n\t\t\t\t$output .= \"</div>\";\n\t\t\t}\n\t\t\telse if ( $row['type'] == ACTION_UNASSIGN )\n\t\t\t{\n\t\t\t\t$output .= \"<div class=\\\"alert\\\"><strong>Returned</strong><br>\";\n\t\t\t\t$output .= ($laptops?$laptops[$row['laptop']['id']]['assetTag']:\"This computer\").\" was returned.<br>\";\n\t\t\t\t$output .= \"<small>Recorded on \".date(\"M d, Y\", $row['timestamp']).\" at \".date(\"g:i A\", $row['timestamp']).\" \".$recorded_by_string.\"</small>\";\n\t\t\t\t$output .= \"</div>\";\n\t\t\t}\n\t\t\telse if ( $row['type'] == ACTION_ASSIGN )\n\t\t\t{\n\t\t\t\t$output .= \"<div class=\\\"alert alert-success\\\"><strong>Assigned</strong><br>\";\n\t\t\t\t$output .= ($laptops?$laptops[$row['laptop']['id']]['assetTag']:\"This computer\").\" was assigned to <a href=\\\"../students/student.php?sid=\".$row['student'].\"\\\">\".$row['student'].\"</a><br>\";\n\t\t\t\t$output .= \"<small>Recorded on \".date(\"M d, Y\", $row['timestamp']).\" at \".date(\"g:i A\", $row['timestamp']).\" \".$recorded_by_string.\"</small>\";\n\t\t\t\t$output .= \"</div>\";\n\t\t\t}\n\t\t\telse if ( $row['type'] == HISTORYEVENT_SERVICE )\n\t\t\t{\n\t\t\t\t$output .= \"<div class=\\\"alert alert-info\\\"><strong>Service - \".$issueTypes[$row['subtype']].\"</strong><br>\";\n\t\t\t\t$output .= stripcslashes(nl_fix($row['body'])).\"<br>\";\n\t\t\t\t$output .= \"<small>Recorded on \".date(\"M d, Y\", $row['timestamp']).\" at \".date(\"g:i A\", $row['timestamp']).\" \".$recorded_by_string.\"</small>\";\n\t\t\t\t$output .= \"</div>\";\n\t\t\t}\n\t\t}\n\t\treturn $output;\n\t}",
"public function testAction()\n {\n if ($this->identity()) {\n $summoners = $this->account()->getSummoners();\n $summoner = $summoners[0];\n $response = $this->getServiceLocator()->get('youtube_service')->findByQuery(\"league of legends\", null, 20, \"this_week\");\n $videos = $response->getVideos(true);\n foreach ($videos as $video) {\n echo $video->getScore() . '<br />';\n }\n # $feeds = $this->getServiceLocator()->get('feed_service')->getLolProFeeds(array(\"Ahri\",\"Aatrox\",\"Jayce\"));\n return new ViewModel();\n } else {\n return $this->notFoundAction();\n }\n }",
"public function testGetParliamentaryCandidateWithVoteCast()\n {\n $pollingStation = $this->em->getRepository('VtallyBundle:PollingStation')->find(1);\n $candidates = $pollingStation->getParliamentaryCandidateWithVoteCast();\n $this->assertEquals($candidates[0]->getFirstName(), 'Jhon');\n $this->assertEquals($candidates[0]->getVoteCast(), 100);\n $this->assertEquals($candidates[1]->getFirstName(), 'Jannette');\n $this->assertEquals($candidates[1]->getVoteCast(), 280);\n $this->assertEquals($candidates[2]->getFirstName(), 'Sondra');\n $this->assertEquals($candidates[2]->getVoteCast(), 98);\n $this->assertEquals($candidates[3]->getFirstName(), 'Fadde');\n $this->assertEquals($candidates[3]->getVoteCast(), 0);\n $this->assertEquals($candidates[4]->getFirstName(), 'Vivien');\n $this->assertEquals($candidates[4]->getVoteCast(), 100);\n $this->assertEquals($candidates[5]->getFirstName(), 'Joella');\n $this->assertEquals($candidates[5]->getVoteCast(), 7);\n $this->assertEquals($candidates[6]->getFirstName(), 'Adde');\n $this->assertEquals($candidates[6]->getVoteCast(), 2);\n }",
"public function moviePremiumWatchableInDistantFuture(AcceptanceTester $I)\n {\n $I->wantTo('Verify that \"Never\" is displayed in the portal when Premium watchable date is in the distant future. - C225107');\n $I->amOnPage(ContentPage::$URL_ingest);\n\n ContentUtils::clickTableRowOfTitle($I, \"CXCMS_Ingest_ContentWindows_\" . BuildNo::$build . \" Movie Paid Distant Future\");\n\n $I->waitForText('Ingest Testing', 30, ContentPage::$channelRow);\n $I->seeInField(ContentPage::$windowing_premiumStartOfWindow_input, 'Never');\n }",
"public function testWebinarStatus()\n {\n }",
"public function testAjaxGetVenueListCanBeAccessed()\n {\n $this->dispatch('/venue/ajax-get-venue-list');\n $this->assertResponseStatusCode(200);\n }",
"public function index(Request $request)\n {\n /**\n * Past questions are being returned with both approved and unapproved past questions\n * Unapproved past questions should be separated during render\n */\n if ($request->input('status')){\n \n // Get all past questions that are active/approved or inactive/unapproved\n $past_questions = PastQuestion::where('approved', (boolean)$request->input('status'))\n ->with([\n 'image',\n 'document',\n 'comment',\n ])->orderBy('created_at', 'desc')\n ->take(500)\n ->paginate(10);\n\n } elseif ($request->input('properties')){\n \n // Get all past questions with all their relations\n $past_questions = PastQuestion::with([\n 'image',\n 'document',\n 'comment',\n ])->orderBy('created_at', 'desc')\n ->take(500)\n ->paginate(10);\n\n } elseif ($request->input('deleted')){\n\n // Get all deleted past questions with all their relations\n $past_questions = PastQuestion::onlyTrashed()->with([\n 'image',\n 'document',\n 'comment',\n ])->orderBy('created_at', 'desc')\n ->take(500)\n ->paginate(10);\n\n } else {\n\n // Get all past questions with out their relations\n $past_questions = PastQuestion::orderBy('created_at', 'desc')\n ->take(500)\n ->paginate(10);\n }\n\n if ($past_questions) {\n \n if (count($past_questions) > 0) {\n return $this->success($past_questions);\n } else {\n return $this->notFound('Past questions were not found');\n }\n\n } else {\n return $this->requestConflict('Currently unable to search for past questions');\n }\n }",
"function get_not_top_5_best_polls($reviewer)\n{\n $reviewer = (int)$reviewer;\n $limit = mysql_result(mysql_query(\"SELECT Value FROM parameter WHERE Short_name = 'Reviews_to_give'\"), 0);\n $query = mysql_query(\"SELECT ID, Reviewee, Score FROM candidate_poll WHERE Reviewer=$reviewer ORDER BY Score DESC LIMIT 100 OFFSET $limit\");\n if (!$query || mysql_num_rows($query) <= 0) {\n echo mysql_error();\n return false;\n } else {\n while ($row = mysql_fetch_assoc($query)) {\n $polls[] = array(\n 'ID' => $row['ID'],\n 'Reviewee' => $row['Reviewee'],\n 'Score' => $row['Score']\n );\n }\n return $polls;\n }\n}",
"public function testIsOnTasksListPage()\n {\n $this->addTestFixtures();\n $this->logInAsUser();\n $this->client->request('GET', '/tasks');\n\n $response = $this->client->getResponse();\n $responseContent = $response->getContent();\n\n $statusCode = $response->getStatusCode();\n $this->assertEquals(200, $statusCode);\n $this->assertContains($this->task->getTitle(), $responseContent);\n $this->assertContains($this->task->getContent(), $responseContent);\n }",
"public function testGetRetweetersFailure()\n\t{\n\t\t$id = 217781292748652545;\n\t\t$count = 5;\n\n\t\t$returnData = new stdClass;\n\t\t$returnData->code = 200;\n\t\t$returnData->body = $this->rateLimit;\n\n\t\t$path = $this->object->fetchUrl('/application/rate_limit_status.json', array(\"resources\" => \"statuses\"));\n\n\t\t$this->client->expects($this->at(0))\n\t\t->method('get')\n\t\t->with($path)\n\t\t->will($this->returnValue($returnData));\n\n\t\t$returnData = new stdClass;\n\t\t$returnData->code = 500;\n\t\t$returnData->body = $this->errorString;\n\n\t\t// Set request parameters.\n\t\t$data['id'] = $id;\n\t\t$data['count'] = $count;\n\n\t\t$path = $this->object->fetchUrl('/statuses/retweeters/ids.json', $data);\n\n\t\t$this->client->expects($this->at(1))\n\t\t->method('get')\n\t\t->with($path)\n\t\t->will($this->returnValue($returnData));\n\n\t\t$this->object->getRetweeters($id, $count);\n\t}",
"public function countAllPastTournamentsWithEvents()\n\t{\n\t\t$date = new DateTime();\n\t\treturn $this->countAllTournamentsWithEvents($date->format(\"Y-m-d\"), true);\n\t}",
"function getUpcomingWebinars()\n {\n $path = $this->getPathRelativeToOrganizer('upcomingWebinars');\n\n return $this->sendRequest('GET', $path, $parameters = null, $payload = null);\n }",
"public function testListDocumentsFromTo()\n {\n echo \"\\nTesting the document retrieval by ID...\";\n $response = $this->listDocumentsFromTo(0,26);\n //echo $response;\n $result = json_decode($response);\n \n $hits = $result->hits;\n //echo \"\\nCOUNT:\".count($hits);\n $this->assertTrue(count($hits)==26);\n }",
"public function findPastPanelsWithoutFeedbackEmailSent()\n {\n $now = new \\DateTime();\n $today = $now->format('Y-m-d');\n\n $query = $this->createQuery();\n $query->getQuerySettings()->setRespectStoragePage(false);\n $query->matching(\n $query->logicalAnd(\n $query->lessThanOrEqual('date', $today),\n $query->equals('feedbackMailSent', false)\n )\n );\n return $query->execute();\n\n }",
"public function testReportsReputationHistoryGet()\n {\n }",
"function get_past_event_view_url($view) {\n $display = $view->current_display;\n $parameters = $view->getUrl()->getRouteParameters();\n\n switch ($display) {\n // Set the past events link for a topic filtered display.\n case 'page_3': // Event topic display\n case 'page_5': // Past topic display\n return Url::fromRoute('view.events.page_5', $parameters)->toString();\n\n // Set the past events link for a department filtered display.\n case 'page_4': // Event department display\n case 'page_6': // Past department display\n return Url::fromRoute('view.events.page_6', $parameters)->toString();\n\n // Set the past events link for the all events display.\n case 'page_1': // Event all display\n case 'page_2': // Past all display\n default:\n return '/past-events';\n }\n}",
"public function get_all_past()\n\t{\n\t\t// Clean cache for testing\n\t\t//@$this->cache->delete('active_deals');\n\t\t\n\t\tif ($past_deals = $this->cache->get('past_deals'))\n\t\t{\n\t\t\t// Prepare the data\n\t\t\tforeach ($past_deals as $key=>$past_deal)\n\t\t\t{\n\t\t\t\t$past_deals[$key] = $this->prepare($past_deal);\n\t\t\t}\n\t\t\t\n\t\t\treturn $past_deals;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Get 'em \n\t\t\t$past_deals = $this->db->from($this->deal_table.' AS e')\n\t\t\t ->where('e.f_expires_at < UNIX_TIMESTAMP()')\n\t\t\t\t\t\t\t ->where('published_at <=', now())\n\t\t\t ->order_by('published_at', 'DESC')\n\t\t\t ->get()->result()\n\t\t\t ;\n\t\t\t\n\t\t\t// Prepare the data\n\t\t\tif ($past_deals)\n\t\t\t{\n\t\t\t\tforeach ($past_deals as $key=>$past_deal)\n\t\t\t\t{\n\t\t\t\t\t$past_deals[$key] = $this->prepare($past_deal);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $past_deals;\n\t\t}\n\t\t\n\t\treturn null;\n\t\t\t\n\t}",
"public function testGetViewingHistoryWithNoVideo()\n\t{\n\t\t$this->be(User::first());\n\t\t$response = $this->action('GET', 'ApiViewingHistoryController@getIndex');\n\t\t\n\t\t$this->assertInstanceOf('Illuminate\\Http\\JsonResponse', $response);\n\t\t$this->assertResponseStatus(404);\n\t}",
"public function show(PastWinner $pastWinner)\n {\n //\n }",
"public function process()\n\t{\n\t\tif (Phpfox::getUserBy('profile_page_id') > 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($iVideoId = $this->request()->getInt('video_id'))\n\t\t{\n\t\t\tlist($iCnt, $aVideos) = Phpfox::getService('video')->getRelatedVideos($iVideoId, $this->request()->get('video_title'), ($this->request()->getInt('page_number') + 1));\n\t\t\t\n\t\t\tif (!count($aVideos))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\t\t\t\n\n\t\t\tPhpfox::getLib('pager')->set(array('page' => $this->request()->getInt('page_number'), 'size' => Phpfox::getParam('video.total_related_videos'), 'count' => $iCnt));\t\t\t\n\t\t\tif (Phpfox::getLib('pager')->getLastPage() <= $this->request()->getInt('page_number'))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t$this->template()->assign(array(\n\t\t\t\t\t'aRelatedVideos' => $aVideos,\n\t\t\t\t\t'bIsLoadingMore' => true\t\t\t\t\t\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$aVideo = $this->getParam('aVideo');\n\t\t\t\n\t\t\tlist($iCnt, $aVideos) = Phpfox::getService('video')->getRelatedVideos($aVideo['video_id'], $aVideo['title'], 1, true);\n\t\t\t\t\t\n\t\t\tif (!count($aVideos))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$this->template()->assign(array(\n\t\t\t\t\t'sHeader' => Phpfox::getPhrase('video.suggestions'),\n\t\t\t\t\t'aRelatedVideos' => $aVideos\n\t\t\t\t)\n\t\t\t);\t\n\n\t\t\tPhpfox::getLib('pager')->set(array('page' => $this->request()->getInt('page_number'), 'size' => Phpfox::getParam('video.total_related_videos'), 'count' => $iCnt));\n\t\t\tif ($iCnt >= Phpfox::getParam('video.total_related_videos'))\n\t\t\t{\n\t\t\t\t$this->template()->assign(array(\n\t\t\t\t\t\t'aFooter' => array(\n\t\t\t\t\t\t\tPhpfox::getPhrase('video.load_more_suggestions') => '#'\n\t\t\t\t\t\t)\t\t\t\t\n\t\t\t\t\t)\n\t\t\t\t);\t\n\t\t\t}\n\t\t\t\n\t\t\treturn 'block';\t\t\n\t\t}\t\t\n\t}",
"public function BrowserPollResults(){\n \t//get dataobjects, group list adds ability to group records\n \t$submissions = new GroupedList(BrowserPollSubmission::get());\n\n \t//count them\n \t$total = $submissions->Count();\n \t//put them in an array\n \t$list = new ArrayList();\n\n \t//get all the results, group them by browser and display in array as key Browsername and value browsersubmission\n \tforeach($submissions->groupBy('Browser') as $browserName => $browserSubmissions){\n \t\t//get all results, count them, find recentage\n \t\t$percentage = (int) ($browserSubmissions->Count() / $total * 100);\n \t\t//give the list the new data, displayed under name with percentage\n \t\t$list->push(new ArrayData(array(\n \t\t\t'Browser' => $browserName,\n \t\t\t'Percentage' => $percentage\n \t\t)));\n\n \t}\n \treturn $list;\n }",
"public function testGetListFailure() \n { \n $failingUserId = \"-1\";\n $request = $this->newRequest('/todo/getlist/'.$failingUserId);\n $response = $this->responseFromRun(); \n\n // no headers?\n // [\"reasonPhrase\":\"Zend\\Diactoros\\Response\":private]= string(9) \"Not Found\"\n $this->assertRelayResponse($response, 404, [], \"\");\n }",
"public function verifyResultsPageInYourProjectShowsImpressionEvent(): void\n {\n print \"Go to your project's results page and verify decisions events are showing (5 min delay)\";\n }",
"public function verifyResultsPageInYourProjectShowsImpressionEvent(): void\n {\n print \"Go to your project's results page and verify decisions events are showing (5 min delay)\";\n }",
"function new_since_last_visit() {\n $this->skip_layout = $this->request->isAsyncCall();\n\n $page = (integer) $this->request->get('page');\n if($page < 1) {\n $page = 1;\n } // if\n\n list($objects, $pagination) = ProjectObjects::paginateNew($this->logged_user, $page, 10);\n\n $this->smarty->assign(array(\n 'objects' => $objects,\n 'pagination' => $pagination,\n ));\n }",
"function printOfferList() {\n\n\t\t// disable caching of target booking page\n\t\t$conf = array(\n\t\t // Link to booking page\n\t\t 'parameter' => $this->lConf['gotoPID'],\n\t\t // We must add cHash because we use parameters\n\t\t 'useCacheHash' => false,\n\t\t);\n\n\t\t$contentError = array();\n\t\t$offers['numOffers'] = 0;\n\t\t$i = 0;\n\n\t\t$productIds = explode(',', $this->lConf['ProductID']);\n\n\t\tforeach ( $productIds as $key => $uid ) {\n\n\t\t\tif (($this->lConf['productDetails'][$uid]['capacitymin']+$this->lConf['productDetails'][$uid]['capacitymax']) > 0) {\n\t\t\t\t$product = $this->lConf['productDetails'][$uid];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// skip because empty or OffTimeProductID\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$i++;\n\t\t\t$offers[$i] = '';\n\t\t\tunset($interval);\n\t\t\tunset($contentError);\n\n\t\t\tif (sizeof($this->lConf['OffTimeProductIDs']) > 0)\n\t\t\t\t$offTimeProducts = ','.implode(',', $this->lConf['OffTimeProductIDs']);\n\n\t\t\tif ($product['maxAvailable'] < $this->lConf['daySelector']) {\n\t\t\t\t$interval['limitedVacancies'] = $availableMaxDate;\n\t\t\t\t$bookNights = $product['maxAvailable'];\n\t\t\t\tif ($product['maxAvailable'] == 1)\n\t\t\t\t\t$text_periods = ' '.$this->pi_getLL('period');\n\t\t\t\telse\n\t\t\t\t\t$text_periods = ' '.$this->pi_getLL('periods');\n\n\t\t\t\t$contentError[] = sprintf($this->pi_getLL('error_vacancies_limited'), $product['maxAvailable'].' '.$text_periods);\n\t\t\t} else {\n\t\t\t\t$bookNights = $this->lConf['daySelector'];\n\t\t\t}\n\n\t\t\tif ($product['minimumStay'] > $this->lConf['daySelector']) {\n\t\t\t\tif ($product['minimumStay'] == 1)\n\t\t\t\t\t$text_periods = ' '.$this->pi_getLL('period');\n\t\t\t\telse\n\t\t\t\t\t$text_periods = ' '.$this->pi_getLL('periods');\n\n\t\t\t\t$contentError[] = sprintf($this->pi_getLL('error_minimumStay'), $product['minimumStay'].' '.$text_periods);\n\t\t\t\tif ($bookNights < $product['minimumStay'])\n\t\t\t\t\t$bookNights = $product['minimumStay'];\n\t\t\t}\n\n\t\t\t// check if checkIn is ok for startDate\n\t\t\tif ($product['prices'][$this->lConf['startDateStamp']]['checkInOk'] === '0') {\n\t\t\t\t$contentError[] = $this->pi_getLL('error_no_checkIn_on').' '.strftime('%a, %x', $this->lConf['startDateStamp']);\n\t\t\t\t$enableBookingLink = 0;\n\t\t\t\tfor ($j=$this->lConf['startDateStamp']; $j < strtotime('+14 day', $this->lConf['startDateStamp']); $j=strtotime('+1 day', $j)) {\n\n\t\t\t\t\tif ($product['prices'][$j]['checkInOk'] == '1') {\n\t\t\t\t\t\t$interval['startDate'] = $j;\n\n\t\t\t\t\t\tif ($this->lConf['enableBookingLink']) {\n\t\t\t\t\t\t\t$params_united = $interval['startDate'].'_'.$bookNights.'_'.$this->lConf['adultSelector'].'_'.$product['uid'].$offTimeProducts.'_'.$this->lConf['uidpid'].'_'.$this->lConf['PIDbooking'].'_bor1';\n\t\t\t\t\t\t\t$conf['additionalParams'] = '&'.$this->prefixId.'[ABx]='.$params_united;\n\t\t\t\t\t\t\t$url = $this->cObj->typoLink(strftime('%a, %x', $interval['startDate']), $conf);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$url = strftime('%a, %x', $j);\n\n\t\t\t\t\t\t$contentError[] = $this->pi_getLL('error_next_checkIn_on').' '.$url;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\t$enableBookingLink = $this->lConf['enableBookingLink'];\n\n\t\t\t// show calendar list only up to the vacant day\n\t\t\tif (empty($interval['startDate']))\n\t\t\t\t$interval['startDate'] = $this->lConf['startDateStamp'];\n\t\t\t$interval['endDate'] = strtotime('+'.$bookNights.' day', $this->lConf['startDateStamp']);\n\n\t\t\t$params_united = $interval['startDate'].'_'.$bookNights.'_'.$this->lConf['adultSelector'].'_'.$product['uid'].$offTimeProducts.'_'.$this->lConf['uidpid'].'_'.$this->lConf['PIDbooking'].'_bor1';\n\n\t\t\tif (!empty($product['uiddetails']) && !empty($product['detailsRaw']['header'])) {\n\t\t\t\t// get detailed description:\n\t\t\t\t$title = $product['detailsRaw']['header'];\n \n\t\t\t} else {\n\t\t\t\t$title = $product['title'];\n\t\t\t}\n\n\t\t\tif (!empty($product['detailsRaw']['bodytext']) && !empty($product['uiddetails'])) {\n\n\t\t\t\t$mconf['tables'] = 'tt_content';\n\t\t\t\t$mconf['source'] = explode('#', $product['uiddetails'])[1];\n\t\t\t\t$mconf['dontCheckPid'] = 1;\n\n\t\t\t\t$bodytext = $this->cObj->cObjGetSingle('RECORDS', $mconf);\n\n\t\t\t} else {\n\n\t\t\t\tunset($bodytext);\n\n\t\t\t}\n\n\t\t\tif ($enableBookingLink) {\n\t\t\t\t$conf['additionalParams'] = '&'.$this->prefixId.'[ABx]='.$params_united.'&'.$this->prefixId.'[abnocache]=1';\n\t\t\t\t$link = $this->cObj->typoLink($title, $conf);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$link = $title;\n\n\t\t\t$linkBookNow = '';\n\t\t\tif ($product['maxAvailable'] > 0) {\n\t\t\t\t$offers['numOffers']++;\n\t\t\t\t$offers[$i] .= '<li class=\"offerList\"><div class=\"productTitle\">'.$link.' <b>'.strtolower($this->pi_getLL('result_available')).'</b></div>';\n\t\t\t\t$availableMaxDate = strtotime('+ '.$product['maxAvailable'].' days', $this->lConf['startDateStamp']);\n\n\t\t\t\tif (count($contentError)>0) {\n\t\t\t\t\t$offers[$i] .= '<ul class=\"errorHints\">';\n\t\t\t\t\tforeach ($contentError as $error)\n\t\t\t\t\t\t$offers[$i] .= '<li>'.$error.'</li>';\n\t\t\t\t\t$offers[$i] .= '</ul>';\n\t\t\t\t}\n\t\t\t\t$offers[$i] .= $bodytext;\n\n\t\t\t\tif ($enableBookingLink)\n\t\t\t\t\t$offers[$i] .='<form class=\"requestForm\" action=\"'.$this->pi_getPageLink($this->lConf['gotoPID']).'\" method=\"POST\">';\n\n\t\t\t\t$offers[$i] .= $this->printCalculatedRates($uid, $bookNights, 1, 1);\n\n\t\t\t\tif ($enableBookingLink)\n\t\t\t\t\t$linkBookNow = '<input type=\"hidden\" name=\"'.$this->prefixId.'[ABx]\" value=\"'.$params_united.'\">\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"'.$this->prefixId.'[abnocache]\" value=\"1\">\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"'.$this->prefixId.'[ABwhatToDisplay]\" value=\"BOOKING\"><br/>\n\t\t\t\t\t\t\t\t\t<input class=\"submit\" type=\"submit\" name=\"'.$this->prefixId.'[submit_button]\" value=\"'.htmlspecialchars($this->pi_getLL('bookNow')).'\">\n\t\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t';\n\n\t\t\t} else {\n\t\t\t\t$offers[$i] .= '<li class=\"offerList\"><div class=\"productTitle\"><b>'.$title.' '.strtolower($this->pi_getLL('result_occupied')).'</b> </div>';\n\t\t\t}\n\n\t\t\t// show calendars following TS settings\n\t\t\tif ($this->lConf['form']['showCalendarMonth']>0) {\n\t\t\t\tif (intval($this->lConf['form']['showMonthsBeforeStart'])>0)\n\t\t\t\t\t$intval['startDate'] = strtotime('-'.$this->lConf['form']['showMonthsBeforeStart'].' months', $interval['startDate']);\n\t\t\t\telse\n\t\t\t\t\t$intval['startDate'] = $interval['startDate'];\n\t\t\t\t$intval['endDate'] = strtotime('+'.$this->lConf['form']['showCalendarMonth'].' months', $intval['startDate']);\n\t\t\t\t$offers[$i] .= tx_abbooking_div::printAvailabilityCalendarDiv($product['uid'].$offTimeProducts, $intval, $this->lConf['form']['showCalendarMonth'], 0);\n\n\t\t\t} else if ($this->lConf['form']['showCalendarWeek']>0) {\n\t\t\t\t\t$intval['startDate'] = $interval['startDate'];\n\t\t\t\t$intval['endDate'] = strtotime('+'.$this->lConf['form']['showCalendarWeek'].' weeks', $intval['startDate']);\n\t\t\t\t$offers[$i] .= tx_abbooking_div::printAvailabilityCalendarLine($product['uid'].$offTimeProducts, $intval);\n\t\t\t} else\n\t\t\t\t$offers[$i] .= tx_abbooking_div::printAvailabilityCalendarLine($product['uid'].$offTimeProducts, $interval);\n\n\t\t\tif ($enableBookingLink)\n\t\t\t\t$offers[$i] .= $linkBookNow;\n\t\t\t// close list item...\n\t\t\t$offers[$i] .= '</li>';\n\t\t}\n\t$offers['amount'] = $i;\n\treturn $offers;\n\t}",
"function obj_cx_events_list_inner( $events, $bottom_banner, $pagination, $event_list_deets = null ) {\n echo '<h3 class=\"section-title green\">Upcoming events</h3>';\n obj_do_cx_events_list_filter( $events );\n obj_do_cx_events_list( $events );\n obj_do_cx_event_bottom_banner_output( $bottom_banner );\n obj_do_cx_events_list_pagination( $pagination );\n}",
"protected function getPendingAppointments($args) {\n\n if ($args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '1');\n\n if (is_array($returned))\n return $returned;\n\n// $curr_date = date('Y-m-d H:i:s', time());\n// $curr_date_bfr_30min = date('Y-m-d H:i:s', time() - 1800);\n// $curr_date_bfr_1hr = date('Y-m-d H:i:s', time() - 3600);\n\n\n $selectAppntsQry = \"select p.profile_pic,p.first_name,p.phone,p.email,a.appt_lat,a.appt_long,a.appointment_dt,a.extra_notes,a.address_line1,a.address_line2,a.status,a.booking_type from appointment a, slave p \";\n $selectAppntsQry .= \" where p.slave_id = a.slave_id and a.status = 1 and a.mas_id = '\" . $this->User['entityId'] . \"' order by a.appointment_dt DESC\"; // and a.appointment_dt >= '\" . $curr_date_bfr_1hr . \"'\n\n $selectAppntsRes = mysql_query($selectAppntsQry, $this->db->conn);\n\n if (mysql_num_rows($selectAppntsRes) <= 0)\n return $this->_getStatusMessage(30, $selectAppntsQry);\n\n $pending_appt = array();\n\n while ($appnt = mysql_fetch_assoc($selectAppntsRes)) {\n\n if ($appnt['profile_pic'] == '')\n $appnt['profile_pic'] = $this->default_profile_pic;\n\n $pending_appt[] = array('apntDt' => $appnt['appointment_dt'], 'pPic' => $appnt['profile_pic'], 'email' => $appnt['email'],\n 'fname' => $appnt['first_name'], 'phone' => $appnt['phone'], 'apntTime' => date('H:i', strtotime($appnt['appointment_dt'])),\n 'apntDate' => date('Y-m-d', strtotime($appnt['appointment_dt'])), 'apptLat' => (double) $appnt['appt_lat'], 'apptLong' => (double) $appnt['appt_long'],\n 'addrLine1' => urldecode($appnt['address_line1']), 'addrLine2' => urldecode($appnt['address_line2']), 'notes' => $appnt['extra_notes'], 'bookType' => $appnt['booking_type']);\n }\n\n\n $errMsgArr = $this->_getStatusMessage(31, 2);\n\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'appointments' => $pending_appt); //,'test'=>$selectAppntsQry,'test1'=>$appointments);\n }",
"public function testListTasks()\n {\n $this->withoutMiddleware();\n $get = $this->json('GET','/api/v1/tasks');\n $this->assertResponseOk();\n $response = json_decode($get->response->getContent(), true);\n $this->assertNotNull($response, 'Test if is a valid json');\n $this->assertTrue(json_last_error() == JSON_ERROR_NONE, 'Test if the response was ok');\n $this->assertCount(0,$response, 'Test if query count is zero');\n //Test for a non empty list\n $tasks = factory(Task::class,2)->create();\n $get = $this->json('GET', 'api/v1/tasks');\n $this->assertResponseOk();\n $response = json_decode($get->response->getContent(), true);\n $this->assertNotNull($response, 'Test if is a valid json');\n $this->assertTrue(json_last_error() == JSON_ERROR_NONE, 'Test if the response was ok');\n $this->assertCount(2, $response, 'Test if query count is 2');\n\n $tasks->each(function($item, $key) use ($response){\n $this->assertObjectEqualsExclude($item,$response[$key]);\n });\n }",
"protected function wrapResults($outputs)\n {\n return new LastFm_Artist_GetPastEvents_Results($outputs);\n }",
"public function testListQrcodesPagination()\n {\n $this->makeData(self::NUMBER_RECORD_CREATE);\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('/admin/qrcodes');\n $elements = $browser->elements('#list-qrcodes tbody tr');\n $this->assertCount(config('define.qrcodes.limit_rows'), $elements);\n $this->assertNotNull($browser->element('.pagination'));\n $paginate_element = $browser->elements('.pagination li');\n $number_page = count($paginate_element) - 2;\n $this->assertTrue($number_page == ceil((self::NUMBER_RECORD_CREATE + 1) / (config('define.qrcodes.limit_rows'))));\n });\n }",
"public function get_plugin_stories_list_page() {\r\n\t\tglobal $wpdb;\r\n\r\n\t\t$stories = $wpdb->get_results( $wpdb->prepare(\"SELECT * FROM `{$this->table_mf_timeline_stories}`\" ), 'ARRAY_A' );\r\n\t?>\r\n\t\t\r\n\t\t<p>Timeline stories enable you to add content to the timeline without the need to create individual posts. You can manage all your timeline stores from this area.</p><br />\r\n\t\t<p><a href=\"?page=mf-timeline&tab=stories&action=editor\" class=\"add-new-h2\">Add New Story</a></p>\r\n\t\t\r\n\t\t<table class=\"widefat post fixed\" cellspacing=\"0\">\r\n\t\t\t<thead>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th class=\"manage-column\" scope=\"col\" width=\"40\">ID</th>\r\n\t\t\t\t\t<th class=\"manage-column column-title\" scope=\"col\">Story Title</th>\r\n\t\t\t\t\t<th scope=\"col\" width=\"225\">Author</th>\r\n\t\t\t\t\t<th scope=\"col\" width=\"125\">Timeline Date</th>\r\n\t\t\t\t</tr>\t\t\t\r\n\t\t\t</thead>\r\n\t\t\t<tfoot>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th class=\"manage-column\" scope=\"col\" width=\"40\">ID</th>\r\n\t\t\t\t\t<th class=\"manage-column column-title\" scope=\"col\">Story Title</th>\r\n\t\t\t\t\t<th scope=\"col column-title\" width=\"225\">Author</th>\r\n\t\t\t\t\t<th scope=\"col column-date\" width=\"125\">Timeline Date</th>\r\n\t\t\t\t</tr>\t\t\t\r\n\t\t\t</tfoot>\r\n\t\t\r\n\t\t\t<tbody>\r\n\t\t\t\t<?php foreach( $stories as $story ) :?>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th scope=\"row\">\r\n\t\t\t\t\t\t\t<?php echo $story['story_id']; ?>\r\n\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t<td class=\"column-title\">\r\n\t\t\t\t\t\t\t<strong><a class=\"row-title\" href=\"#\"><?php echo stripslashes( $story['story_title'] ); ?></a></strong>\r\n\t\t\t\t\t\t\t<div class=\"row-actions\">\r\n\t\t\t\t\t\t\t\t<span class=\"edit\"><a href=\"?page=mf-timeline&tab=stories&action=editor&story_id=<?php echo $story['story_id']; ?>\">Edit</a> | </span>\r\n\t\t\t\t\t\t\t\t<span class=\"edit\"><a href=\"?page=mf-timeline&tab=stories&action=delete&story_id=<?php echo $story['story_id']; ?>\">Delete Permanently</a></span>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td class=\"column-author\">\r\n\t\t\t\t\t\t\t<?php $user = get_userdata( $story['story_author'] );?>\r\n\t\t\t\t\t\t\t<a href=\"#\"><?php echo $user->display_name; ?></a>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<?php echo date( 'Y/m/d', strtotime( $story['timeline_date'] ) );?>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t<?php endforeach;?>\r\n\t\t\t</tbody>\r\n\t\t</table>\r\n\t<?php\t\r\n\t}",
"public function indexAction() {\n if (!Engine_Api::_()->core()->hasSubject('sitereview_listing') && !Engine_Api::_()->core()->hasSubject('sitereview_review')) {\n return $this->setNoRender();\n }\n\n if (Engine_Api::_()->core()->hasSubject('sitereview_listing')) {\n $this->view->sitereview = $sitereview = Engine_Api::_()->core()->getSubject();\n } elseif (Engine_Api::_()->core()->hasSubject('sitereview_review')) {\n $this->view->sitereview = $sitereview = Engine_Api::_()->core()->getSubject()->getParent();\n }\n\n //GET SUBJECT\n $this->view->sitereview = $sitereview = Engine_Api::_()->core()->getSubject();\n\n $this->view->viewType = $this->_getParam('viewType', 0);\n $this->view->statistics = $this->_getParam('statistics', array(\"likeCount\", \"reviewCount\", \"commentCount\"));\n Engine_Api::_()->sitereview()->setListingTypeInRegistry($sitereview->listingtype_id);\n $listingtypeArray = Zend_Registry::get('listingtypeArray' . $sitereview->listingtype_id);\n\n //SEND REVIEW TITLE TO TPL\n $this->view->reviewTitleSingular = $listingtypeArray->review_title_singular ? $listingtypeArray->review_title_singular : 'Review';\n $this->view->reviewTitlePlular = $listingtypeArray->review_title_plural ? $listingtypeArray->review_title_plural : 'Reviews';\n \n if (!empty($this->view->statistics) && empty($listingtypeArray->reviews) || $listingtypeArray->reviews == 1) {\n $key = array_search('reviewCount', $this->view->statistics);\n if (!empty($key)) {\n unset($this->view->statistics[$key]);\n }\n }\n\n $values = array();\n $values['listing_id'] = $sitereview->listing_id;\n $this->view->count = $limit = $values['limit'] = $this->_getParam('itemCount', 3);\n $values['similar_items_order'] = 1;\n $this->view->title_truncation = $this->_getParam('truncation', 24);\n $values['ratingType'] = $this->view->ratingType = $this->_getParam('ratingType', 'rating_avg');\n $listingTable = Engine_Api::_()->getDbTable('listings', 'sitereview');\n\n $similar_items = Engine_Api::_()->getDbTable('otherinfo', 'sitereview')->getColumnValue($sitereview->listing_id, 'similar_items');\n $similarItems = array();\n if (!empty($similar_items)) {\n $similarItems = Zend_Json_Decoder::decode($similar_items);\n }\n\n $showSameCategoryListings = $this->_getParam('showSameCategoryListings', 1);\n \n if (!empty($similar_items) && !empty($similarItems) && Count($similarItems) >= 0) {\n $values['similarItems'] = $similarItems;\n $this->view->listings = $listingTable->getListing('', $values);\n } else {\n \n if(!$showSameCategoryListings) {\n return $this->setNoRender();\n } \n \n $values['listingtype_id'] = $sitereview->listingtype_id;\n\n if ($sitereview->subsubcategory_id) {\n $values['subsubcategory_id'] = $sitereview->subsubcategory_id;\n } elseif ($sitereview->subcategory_id) {\n $values['subcategory_id'] = $sitereview->subcategory_id;\n } elseif ($sitereview->category_id) {\n $values['category_id'] = $sitereview->category_id;\n } else {\n return $this->setNoRender();\n }\n\n $this->view->listings = $listingTable->getListing('', $values);\n }\n\n if (Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n $this->_childCount = count($this->view->listings);\n } else {\n $this->view->listings->setCurrentPageNumber($this->_getParam('page'));\n $this->view->listings->setItemCountPerPage($limit);\n $this->_childCount = $this->view->listings->getTotalItemCount();\n }\n\n if ($this->_childCount <= 0) {\n return $this->setNoRender();\n }\n\n $this->view->columnWidth = $this->_getParam('columnWidth', '180');\n $this->view->columnHeight = $this->_getParam('columnHeight', '328');\n }",
"public function testNineResults()\n {\n $response = $this->json('get', '/example', ['count' => 9]);\n $json = $response->json();\n $this->assertCount(9, $json['data']);\n $response->assertStatus(200);\n }",
"public function testGetViewingHistory()\n\t{\n\t\t$this->be(User::first());\n\t\t$video_id = Video::first()->id;\n\t\t$response = $this->action('GET', 'ApiViewingHistoryController@getIndex',[],['video_id' => $video_id]);\n\t\t\n\t\t$this->assertInstanceOf('Illuminate\\Http\\JsonResponse', $response);\n\t\t$this->assertResponseOk();\n\t}",
"public function testReportsSpamchecksHistoryGet()\n {\n }",
"public function showpollsAction()\n {\n $polls = $this->getDoctrine()->getRepository('PollPollBundle:PollImpl')->findAll();\n return $this->render('PollPollBundle:Poll:show_polls.html.twig', array(\"polls\" => array_reverse($polls)));\n }",
"public function testWebSearchForSite()\n {\n $webResultSet = $this->_yahoo->webSearch('php', ['site' => 'www.php.net']);\n\n $this->assertTrue($webResultSet instanceof Zend_Service_Yahoo_WebResultSet);\n\n $this->assertTrue($webResultSet->totalResultsAvailable > 10);\n $this->assertEquals(10, $webResultSet->totalResultsReturned);\n $this->assertEquals(10, $webResultSet->totalResults());\n $this->assertEquals(1, $webResultSet->firstResultPosition);\n\n foreach ($webResultSet as $webResult) {\n $this->assertTrue($webResult instanceof Zend_Service_Yahoo_WebResult);\n }\n }",
"public function testIgnoringMinusOneLapTimes()\n {\n // The path to the data source\n $file_path = realpath(\n __DIR__.'/logs/assettocorsa/3.sessions.with.-1.times.json');\n\n // Get qualify\n $session = Data_Reader::factory($file_path)->getSession(2);\n\n // Test pole\n $participants = $session->getParticipants();\n $participant = $participants[0];\n $this->assertSame('Andrea G', $participant->getDriver()->getName());\n $this->assertSame(72.665, $participant->getbestLap()->getTime());\n $this->assertCount(8, $participant->getLaps());\n\n // Invalid lap (cuts)\n $this->assertNull($participant->getLap(6)->getTime());\n $this->assertSame(0, count($participant->getLap(6)->getSectorTimes()));\n $cuts = $participant->getLap(6)->getCuts();\n // Not values known\n $this->assertSame(null, $cuts[0]->getCutTime());\n $this->assertSame(null, $cuts[0]->getTimeSkipped());\n $this->assertSame(null, $cuts[0]->getElapsedSeconds());\n $this->assertSame(null, $cuts[0]->getDate());\n\n }",
"public function getLtst() {\n $query = \"SELECT * FROM movies ORDER BY id DESC LIMIT 24\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n $result = $stmt->fetchAll(PDO::FETCH_CLASS);\n if($result) {\n return json_response(200, \"success\", $result);\n } else {\n return json_response(404, \"No titles found\");\n }\n }",
"public function testGetMessageListAppointments()\r\n\t{\r\n\t\t// Create an event to make sure we have at least one\r\n\t\t$obj = CAntObject::factory($this->dbh, \"calendar_event\", null, $this->user);\r\n\t\t$obj->setValue(\"name\", \"My Test Event\");\r\n\t\t$obj->setValue(\"ts_start\", date(\"m/d/Y\") . \" 12:00 PM\");\r\n\t\t$obj->setValue(\"ts_end\", date(\"m/d/Y\") . \" 01:00 PM\");\r\n\t\t$eid = $obj->save();\r\n\r\n\t\t// Get events\r\n\t\t$events = $this->backend->GetMessageList(\"calendar_root\", time()); // second param cuts off to today\r\n\t\t$found = false;\r\n\t\tforeach ($events as $evt)\r\n\t\t{\r\n\t\t\tif ($evt[\"id\"] == $eid)\r\n\t\t\t\t$found = true;\r\n\t\t}\r\n\t\t$this->assertTrue($found);\r\n\r\n\t\t// Cleanup\r\n\t\t$obj->removeHard();\r\n\t}",
"function testFindBooksResults() {\n\n /* test title */\n echo '<h2 style=\"color: black;\">testFindBookResults...</h2>';\n\n /* can't page layout because of the indeterminate nature of\n * results (i.e. we can't guarantee there's a book in the \n * production database, and the page layout depends on whether\n * or not there's a result)*/\n\n /* a fix for this could be to possibly display the\n * container (div or whatever) for results, then just\n * not populate it with anything if no results */\n\n $this->assertTrue(1);\n\n }",
"public function testEventsList()\n {\n $response = $this->get('/events');\n\n $response->assertStatus(200);\n }",
"public function run(&$results)\n {\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.1', '\\Flexio\\Base\\Util::createPageRangeArray(); invalid page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"invalid\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.2', '\\Flexio\\Base\\Util::createPageRangeArray(); invalid page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\",\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.3', '\\Flexio\\Base\\Util::createPageRangeArray(); invalid page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"-\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.4', '\\Flexio\\Base\\Util::createPageRangeArray(); invalid page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\",,-,,\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.5', '\\Flexio\\Base\\Util::createPageRangeArray(); invalid page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1,\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.6', '\\Flexio\\Base\\Util::createPageRangeArray(); invalid page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\",1\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.7', '\\Flexio\\Base\\Util::createPageRangeArray(); invalid page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1-\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.8', '\\Flexio\\Base\\Util::createPageRangeArray(); invalid page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1,invalid\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.9', '\\Flexio\\Base\\Util::createPageRangeArray(); invalid page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1 2\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.10', '\\Flexio\\Base\\Util::createPageRangeArray(); invalid page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1 last\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.11', '\\Flexio\\Base\\Util::createPageRangeArray(); invalid page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1 2,3 4\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.12', '\\Flexio\\Base\\Util::createPageRangeArray(); invalid page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1,,2\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.13', '\\Flexio\\Base\\Util::createPageRangeArray(); invalid page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1--2\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.14', '\\Flexio\\Base\\Util::createPageRangeArray(); invalid page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1,null,3\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.14', '\\Flexio\\Base\\Util::createPageRangeArray(); invalid page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1,false,3\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.14', '\\Flexio\\Base\\Util::createPageRangeArray(); invalid page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1,2.1,3\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.15', '\\Flexio\\Base\\Util::createPageRangeArray(); basic delimited page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1.1-2\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.16', '\\Flexio\\Base\\Util::createPageRangeArray(); basic delimited page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"2-3.1\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.17', '\\Flexio\\Base\\Util::createPageRangeArray(); basic delimited page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1-LAST\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.18', '\\Flexio\\Base\\Util::createPageRangeArray(); basic delimited page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"true\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.19', '\\Flexio\\Base\\Util::createPageRangeArray(); basic delimited page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1-true\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('A.20', '\\Flexio\\Base\\Util::createPageRangeArray(); basic delimited page input', $actual, $expected, $results);\n\n\n // TEST: \\Flexio\\Base\\Util::createPageRangeArray(); basic delimited page input\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"none\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('B.1', '\\Flexio\\Base\\Util::createPageRangeArray(); basic delimited page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"-1\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('B.2', '\\Flexio\\Base\\Util::createPageRangeArray(); basic delimited page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"0\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('B.3', '\\Flexio\\Base\\Util::createPageRangeArray(); basic delimited page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1\", 10);\n $expected = [1];\n \\Flexio\\Tests\\Check::assertArray('B.4', '\\Flexio\\Base\\Util::createPageRangeArray(); basic delimited page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"10\", 10);\n $expected = [10];\n \\Flexio\\Tests\\Check::assertArray('B.5', '\\Flexio\\Base\\Util::createPageRangeArray(); basic delimited page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"11\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('B.6', '\\Flexio\\Base\\Util::createPageRangeArray(); basic delimited page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\" 1,2 , 9 ,10 \", 10);\n $expected = [1,2,9,10];\n \\Flexio\\Tests\\Check::assertArray('B.7', '\\Flexio\\Base\\Util::createPageRangeArray(); basic delimited page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"0,1,2,9,10,11\", 10);\n $expected = [1,2,9,10];\n \\Flexio\\Tests\\Check::assertArray('B.8', '\\Flexio\\Base\\Util::createPageRangeArray(); basic delimited page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"last\", 10);\n $expected = [10];\n \\Flexio\\Tests\\Check::assertArray('B.9', '\\Flexio\\Base\\Util::createPageRangeArray(); basic delimited page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1,last\", 10);\n $expected = [1,10];\n \\Flexio\\Tests\\Check::assertArray('B.10', '\\Flexio\\Base\\Util::createPageRangeArray(); basic delimited page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"last,1\", 10);\n $expected = [1,10];\n \\Flexio\\Tests\\Check::assertArray('B.11', '\\Flexio\\Base\\Util::createPageRangeArray(); basic delimited page input', $actual, $expected, $results);\n\n\n // TEST: \\Flexio\\Base\\Util::createPageRangeArray(); basic range page input\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"0-1\", 10);\n $expected = [1];\n \\Flexio\\Tests\\Check::assertArray('C.1', '\\Flexio\\Base\\Util::createPageRangeArray(); basic range page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"10-11\", 10);\n $expected = [10];\n \\Flexio\\Tests\\Check::assertArray('C.2', '\\Flexio\\Base\\Util::createPageRangeArray(); basic range page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1-2,9-10\", 10);\n $expected = [1,2,9,10];\n \\Flexio\\Tests\\Check::assertArray('C.3', '\\Flexio\\Base\\Util::createPageRangeArray(); basic range page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1-last\", 10);\n $expected = [1,2,3,4,5,6,7,8,9,10];\n \\Flexio\\Tests\\Check::assertArray('C.4', '\\Flexio\\Base\\Util::createPageRangeArray(); basic range page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"2-last\", 10);\n $expected = [2,3,4,5,6,7,8,9,10];\n \\Flexio\\Tests\\Check::assertArray('C.5', '\\Flexio\\Base\\Util::createPageRangeArray(); basic range page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"9-last\", 10);\n $expected = [9,10];\n \\Flexio\\Tests\\Check::assertArray('C.6', '\\Flexio\\Base\\Util::createPageRangeArray(); basic range page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"2-1\", 10);\n $expected = [];\n \\Flexio\\Tests\\Check::assertArray('C.7', '\\Flexio\\Base\\Util::createPageRangeArray(); basic range page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1-2,4-3\", 10);\n $expected = [1,2];\n \\Flexio\\Tests\\Check::assertArray('C.8', '\\Flexio\\Base\\Util::createPageRangeArray(); basic range page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"4-3,1-2\", 10);\n $expected = [1,2];\n \\Flexio\\Tests\\Check::assertArray('C.9', '\\Flexio\\Base\\Util::createPageRangeArray(); basic range page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1-2,last-9\", 10);\n $expected = [1,2];\n \\Flexio\\Tests\\Check::assertArray('C.10', '\\Flexio\\Base\\Util::createPageRangeArray(); basic range page input', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"last-9,1-2\", 10);\n $expected = [1,2];\n \\Flexio\\Tests\\Check::assertArray('C.11', '\\Flexio\\Base\\Util::createPageRangeArray(); basic range page input', $actual, $expected, $results);\n\n\n // TEST: \\Flexio\\Base\\Util::createPageRangeArray(); sort and remove duplicates\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1,1\", 10);\n $expected = [1];\n \\Flexio\\Tests\\Check::assertArray('D.1', '\\Flexio\\Base\\Util::createPageRangeArray(); sort and remove duplicates', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"last,last\", 10);\n $expected = [10];\n \\Flexio\\Tests\\Check::assertArray('D.2', '\\Flexio\\Base\\Util::createPageRangeArray();sort and remove duplicates', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"10,last\", 10);\n $expected = [10];\n \\Flexio\\Tests\\Check::assertArray('D.3', '\\Flexio\\Base\\Util::createPageRangeArray();sort and remove duplicates', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"2,1\", 10);\n $expected = [1,2];\n \\Flexio\\Tests\\Check::assertArray('D.4', '\\Flexio\\Base\\Util::createPageRangeArray();sort and remove duplicates', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"1,3,2-4\", 10);\n $expected = [1,2,3,4];\n \\Flexio\\Tests\\Check::assertArray('D.5', '\\Flexio\\Base\\Util::createPageRangeArray();sort and remove duplicates', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"6-8,1-3,2-4,3-7\", 10);\n $expected = [1,2,3,4,5,6,7,8];\n \\Flexio\\Tests\\Check::assertArray('D.6', '\\Flexio\\Base\\Util::createPageRangeArray();sort and remove duplicates', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"9-11,last\", 10);\n $expected = [9,10];\n \\Flexio\\Tests\\Check::assertArray('D.7', '\\Flexio\\Base\\Util::createPageRangeArray();sort and remove duplicates', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"last,9-11\", 10);\n $expected = [9,10];\n \\Flexio\\Tests\\Check::assertArray('D.8', '\\Flexio\\Base\\Util::createPageRangeArray();sort and remove duplicates', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"11-9,last\", 10);\n $expected = [10];\n \\Flexio\\Tests\\Check::assertArray('D.9', '\\Flexio\\Base\\Util::createPageRangeArray();sort and remove duplicates', $actual, $expected, $results);\n\n // BEGIN TEST\n $actual = \\Flexio\\Base\\Util::createPageRangeArray(\"last,11-9\", 10);\n $expected = [10];\n \\Flexio\\Tests\\Check::assertArray('D.10', '\\Flexio\\Base\\Util::createPageRangeArray();sort and remove duplicates', $actual, $expected, $results);\n }",
"public function test_admin_tribe_list_b()\n {\n $this->request('GET', ['pages/Assignments', 'tribe_list']);\n $this->assertResponseCode(404);\n }",
"public function testCurrentEvents()\n {\n // otherwise test will fail.\n // Other approach is to use fake data or mock it.\n \n $response = $this->json('GET', '/events/current');\n \n $response\n ->assertStatus(200)\n ->assertJson([\n ['name' => 'Electrical Seminar']\n ]);\n }",
"public function findAllByDatePassed($daysPast)\n {\n $sql = <<<SQL\n SELECT s.*, p.title as program_name \n FROM ec_shows s, ec_programs p\n WHERE airdate < ?\n AND s.program_id = p.id\nSQL;\n $sqlQuery = new SqlQuery($sql);\n $targetDate = strtotime($daysPast.\" days\");\n\n $sqlQuery->set(date('Y-m-d', $targetDate));\n return $this->getList($sqlQuery);\n }",
"public function testResults()\n {\n $search_term = $this->getSearchTerm();\n $website = $this->getWebsite();\n $limit = $this->getLimit();\n\n $request = $this->mockHttpRequest([\n 'query' => $search_term,\n 'website' => $website\n ]);\n $service = $this->mockGoogleSearchServiceForSearch($search_term, $website, $limit);\n\n $controller = new SearchResultsController($request, $service);\n\n $result = $controller->results();\n\n $this->assertInstanceOf(Views\\Listing::class, $result);\n $this->assertIsArray($result->getData());\n $this->assertEquals($result->getData(), [\n 'search_results' => [],\n 'total_mentions' => 0,\n 'query' => $search_term,\n 'website' => $website,\n 'total_searched' => $limit\n ]);\n }",
"public function iN_ListQuestionAnswerFromLanding() {\n\t\t$query = mysqli_query($this->db, \"SELECT * FROM i_landing_qa WHERE qa_status = '1'\") or die(mysqli_error($this->db));\n\t\twhile ($row = mysqli_fetch_array($query, MYSQLI_ASSOC)) {\n\t\t\t// Store the result into array\n\t\t\t$data[] = $row;\n\t\t}\n\t\tif (!empty($data)) {\n\t\t\treturn $data;\n\t\t}\n\t}",
"function list_schedules_screen( $vars ) {\r\n $vars['schedules'] = $this->has_schedules();\r\n $vars['assignments'] = BPSP_Assignments::has_assignments();\r\n \r\n if( empty( $vars['schedules'] ) && empty( $vars['assignments'] ) )\r\n $vars['message'] = __( 'No schedules exist.', 'bpsp' );\r\n \r\n $vars['name'] = 'list_schedules';\r\n $vars['trail'] = array(\r\n __( 'Available Schedules', 'bpsp' ) => ''\r\n );\r\n return $vars;\r\n }",
"public function testMovieStatus()\n {\n // Find from back date so that results are returned\n $response = $this->get('/api/movies?genre=Animation&showTime=2018-02-01T00:09:00');\n $response->assertStatus(200);\n }",
"public function index()\n {\n $hostedEvents = \\Auth::user()->events()\n ->where('event_date', '>', date('Y-m-d H:i'))\n ->orderBy('event_date', 'desc')\n ->get();\n\n foreach($hostedEvents as $event) {\n $event->playersCount = \\DB::table('event_user')\n ->where('event_id', $event->id)\n ->where('status', 'approved')\n ->count();\n }\n\n $appliedEvents = \\DB::table('events')\n ->join('event_user', 'events.id', '=', 'event_user.event_id')\n ->select('events.*', 'event_user.status')\n ->where('event_user.user_id', \\Auth::id())\n ->whereIn('event_user.status', ['pending', 'approved'])\n ->orderBy('event_date', 'desc')\n ->where('event_date', '>', date('Y-m-d H:i'))\n ->get();\n\n foreach($appliedEvents as $event) {\n $event->playersCount = \\DB::table('event_user')\n ->where('event_id', $event->id)\n ->where('status', 'approved')\n ->count();\n }\n\n $pastEvents = \\DB::table('events')\n ->join('event_user', 'event_user.event_id', '=', 'events.id')\n ->where('event_date', '<', date('Y-m-d H:i'))\n ->where('event_user.user_id', '=', \\Auth::id())\n ->orderBy('events.event_date', 'desc')\n ->get(['events.*']);\n\n //$pastEvents = \\Auth::user()->events()->where('event_date', '<', date('Y-m-d H:i'));\n\n return view('events.index')->with('hostedEvents', $hostedEvents)\n ->with('appliedEvents', $appliedEvents)\n ->with('pastEvents', $pastEvents);\n }",
"public function index_should_return_a_collection_of_records()\r\n {\r\n // by year collection\r\n $this->get('/holidays/us/2018/');\r\n $body = json_decode($this->response->getContent(), true );\r\n $this->assertArrayHasKey('holidays', $body);\r\n $this->assertCount(47, $body['holidays']);\r\n $this->assertArrayHasKey('2018-02-19', $body['holidays']);\r\n\r\n $arr= $body['holidays']['2018-02-19'];\r\n $this->assertCount(1, $arr);\r\n $this->assertEquals( $arr[0]['name'], 'Washington\\'s Birthday');\r\n $this->assertEquals( $arr[0]['country'], 'us');\r\n $this->assertEquals( $arr[0]['date'], '2018-02-19');\r\n $this->assertEquals( $arr[0]['public'], '0');\r\n\r\n ///////////////////////////////\r\n // public\r\n $this->get('/holidays/us/2018/?public=1');\r\n $body = json_decode($this->response->getContent(), true );\r\n $this->assertArrayHasKey('holidays', $body);\r\n $this->assertCount(7, $body['holidays']);\r\n $this->assertArrayHasKey('2018-01-01', $body['holidays']);\r\n\r\n $arr= $body['holidays']['2018-01-01'];\r\n $this->assertCount(2, $arr);\r\n $this->assertEquals( $arr[1]['name'], 'New Year\\'s Day');\r\n $this->assertEquals( $arr[1]['country'], 'us');\r\n $this->assertEquals( $arr[1]['date'], '2018-01-01');\r\n $this->assertEquals( $arr[1]['public'], '1');\r\n\r\n ///////////////////////\r\n // month\r\n $this->get('/holidays/us/2018/?month=3')\r\n ->seeJson( [\r\n 'status'=> 200,\r\n 'message'=>'succeeded with content',\r\n 'holidays'=>[\r\n [\r\n 'name'=>'International Women\\'s Day',\r\n 'country'=> 'us',\r\n 'date'=>'2018-03-08',\r\n 'public'=> 0\r\n ],\r\n [\r\n 'name'=>'Saint Patrick\\'s Day',\r\n 'country'=> 'us',\r\n 'date'=>'2018-03-17',\r\n 'public'=> 0\r\n ],\r\n [\r\n 'name'=>'Palm Sunday',\r\n 'country'=> 'us',\r\n 'date'=>'2018-03-25',\r\n 'public'=> 0\r\n ],\r\n [\r\n 'name'=>'Good Friday',\r\n 'country'=> 'us',\r\n 'date'=>'2018-03-30',\r\n 'public'=> 1\r\n ]\r\n ]\r\n ] );\r\n }",
"public function testlistAction() \n {\n $model = new Application_Model_Mapper_Server($vars);\n $result = $model->getTestDetails();\n $data = array();\n $result = json_encode($result);\n $this->view->assign('result', $result);\n $this->_helper->viewRenderer('index');\n }",
"public function testFetchEvents() {\n\t\t$jsonpad = parent::_getJsonpadInstance();\n\t\t\n\t\t// Fetch the events\n\t\t$total = 0;\n\t\t$events = $jsonpad->fetchEvents(1, null, null, $total);\n\t\t$this->assertInternalType(\"array\", $events);\n\t\t$this->assertGreaterThanOrEqual(1, $total);\n\t\t$this->assertInstanceOf(\"\\Jsonpad\\Resource\\Event\", $events[0]);\n\t}",
"public function testJobListFromJobSchedule()\n {\n\n }"
] | [
"0.6463519",
"0.5745448",
"0.54532343",
"0.5325194",
"0.52149856",
"0.5209032",
"0.51816463",
"0.51735336",
"0.51557595",
"0.5139043",
"0.51316184",
"0.5059295",
"0.5046634",
"0.5028113",
"0.501984",
"0.4969596",
"0.491994",
"0.491994",
"0.49058336",
"0.48983213",
"0.4859388",
"0.48249108",
"0.4816857",
"0.47789714",
"0.4742196",
"0.4714494",
"0.46652633",
"0.46232188",
"0.45920423",
"0.4574662",
"0.45481387",
"0.45464778",
"0.45335996",
"0.4533376",
"0.45325708",
"0.45252365",
"0.45197937",
"0.45159265",
"0.45092374",
"0.4505097",
"0.44988826",
"0.44897294",
"0.44817758",
"0.4470502",
"0.44660097",
"0.44567916",
"0.4454706",
"0.44535264",
"0.44465068",
"0.44425544",
"0.4426953",
"0.44260827",
"0.44096062",
"0.44006222",
"0.43991047",
"0.43982372",
"0.43947223",
"0.43925706",
"0.4379028",
"0.43749046",
"0.43669006",
"0.43638477",
"0.43625244",
"0.43611085",
"0.4355479",
"0.435201",
"0.4350446",
"0.4350446",
"0.43490225",
"0.43475217",
"0.4347398",
"0.4347268",
"0.4344163",
"0.43374023",
"0.43259612",
"0.43252635",
"0.43171933",
"0.429502",
"0.42933744",
"0.42887568",
"0.42782602",
"0.42756295",
"0.42669514",
"0.4262158",
"0.42615652",
"0.42575374",
"0.4257504",
"0.42526573",
"0.42445877",
"0.4242206",
"0.4241483",
"0.42393878",
"0.4238355",
"0.42306128",
"0.42305696",
"0.4227768",
"0.42232016",
"0.42123443",
"0.42084444",
"0.42070913"
] | 0.79743946 | 0 |
Test case for listPastWebinarQA List Q&A of Past Webinar. | public function testListPastWebinarQA()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testListPastWebinarPollResults()\n {\n }",
"public function testPastWebinars()\n {\n }",
"public function testWebinarPanelists()\n {\n }",
"public function testListPastWebinarFiles()\n {\n }",
"public function testWebinarPolls()\n {\n }",
"public function testWebinarAbsentees()\n {\n }",
"public function testWebinarRegistrantsQuestionsGet()\n {\n }",
"public function test_all_questions_and_answers_route_when_questioner_has_sitewide_role() {\n global $DB;\n\n // create a user\n $user = $this->getDataGenerator()->create_user();\n $roleid = $DB->get_field('role', 'id', array('shortname' => 'manager'));\n $this->getDataGenerator()->role_assign($roleid, $user->id);\n\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // create a course module\n $videoquanda = $this->getDataGenerator()->create_module('videoquanda', array(\n 'course' => $course->id\n ));\n\n $now = time();\n\n $this->loadDataSet($this->createArrayDataSet(array(\n 'videoquanda_questions' => array(\n array('id', 'instanceid', 'userid', 'timecreated', 'timemodified' ,'seconds', 'text'),\n array(1, $videoquanda->id, $user->id, $now, $now + 1, 2, 'dummy text')\n )\n )));\n\n $this->setUser($user);\n $client = new Client($this->_app);\n $client->request('GET', '/api/v1/' . $videoquanda->id . '/questions');\n $json = $client->getResponse()->getContent();\n $this->assertEquals(200, $client->getResponse()->getStatusCode());\n $array = (array) json_decode($json);\n $this->assertCount(1, $array);\n }",
"public function testListQrcodes()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('/admin')\n ->clickLink('Qrcodes')\n ->assertPathIs('/admin/qrcodes')\n ->assertSee('List Qrcodes');\n });\n }",
"public function testWebinarPanelistCreate()\n {\n }",
"public function testPastEmbargo()\n {\n $page = $this->objFromFixture(SiteTree::class, 'pastEmbargo');\n\n $page = $this->finishWorkflow($page);\n\n $this->assertNotEquals(0, $page->PublishJobID);\n $this->assertEquals(0, $page->UnPublishJobID);\n\n $publish = strtotime($page->PublishJob()->StartAfter ?? '');\n $this->assertFalse($publish);\n }",
"public function test_admin_squad_list_b()\n {\n $this->request('GET', ['pages/Assignments', 'squad_list']);\n $this->assertResponseCode(404);\n }",
"public function test_admin_tribe_list_b()\n {\n $this->request('GET', ['pages/Assignments', 'tribe_list']);\n $this->assertResponseCode(404);\n }",
"public function testGetSurveyQuestionChoices0()\n {\n }",
"public function testGetSurveyQuestionChoices0()\n {\n }",
"public function testWebinar()\n {\n }",
"public function test_post_question() {\n global $DB;\n\n // Create user\n $user = $this->getDataGenerator()->create_user();\n\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // enrol the user on the course\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $DB->get_field('role', 'id', array(\n 'shortname' => 'student',\n )));\n\n // create a course module\n $videoquanda = $this->getDataGenerator()->create_module('videoquanda', array(\n 'course' => $course->id\n ));\n\n // enrol the user on the course\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $DB->get_field('role', 'id', array(\n 'shortname' => 'student',\n )));\n\n $question = array(\n 'seconds' => '2',\n 'text' => 'dummy text'\n );\n\n $this->setUser($user);\n\n $client = new Client($this->_app);\n $client->request('POST', '/api/v1/' . $videoquanda->id . '/questions', array(), array(), array(), json_encode($question));\n\n $this->assertEquals(201, $client->getResponse()->getStatusCode());\n $this->assertEquals(1, $DB->count_records('videoquanda_questions', array('instanceid' => $videoquanda->id)));\n }",
"public function testGetSurveyQuestions0()\n {\n }",
"public function testGetSurveyQuestions0()\n {\n }",
"public function test_admin_training_list_b()\n {\n $this->request('GET', ['pages/MemberSkills', 'training_programs']);\n $this->assertResponseCode(404);\n }",
"public function testQna(): void\n {\n $stream = $this->getFeed('/wellformed/atom10/qna.xml');\n $parser = $this->simplepie->parseXml($stream);\n $feed = $parser->getFeed();\n $entry = $feed->getEntries()[0];\n\n static::assertEquals('Q&A session', (string) $entry->getTitle());\n static::assertEquals(Serialization::HTML, $entry->getTitle()->getSerialization());\n }",
"public function test_admin_squad_list()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/Assignments', 'squad_list']);\n $this->assertResponseCode(404);\n }",
"public function episodePremiumWatchableInDistantFuture(AcceptanceTester $I)\n {\n $I->wantTo('Verify that \"Never\" is displayed in the portal when Premium watchable date is in the distant future. - C225102');\n $I->amOnPage(ContentPage::$URL_ingest);\n\n ContentUtils::clickTableRowOfTitle($I, \"CXCMS_Ingest_ContentWindows_\" . BuildNo::$build . \" Episode Paid Distant Future\");\n ContentUtils::clickTableRowOfTitle($I, \"CXCMS_Ingest_ContentWindows_\" . BuildNo::$build . \" Episode Paid Distant Future Season\");\n ContentUtils::clickTableRowOfTitle($I, \"CXCMS_Ingest_ContentWindows_\" . BuildNo::$build . \" Episode Paid Distant Future Title\");\n\n $I->waitForText('Ingest Testing', 30, ContentPage::$channelRow);\n $I->seeInField(ContentPage::$windowing_premiumStartOfWindow_input, 'Never');\n }",
"public function moviePremiumWatchableInDistantFuture(AcceptanceTester $I)\n {\n $I->wantTo('Verify that \"Never\" is displayed in the portal when Premium watchable date is in the distant future. - C225107');\n $I->amOnPage(ContentPage::$URL_ingest);\n\n ContentUtils::clickTableRowOfTitle($I, \"CXCMS_Ingest_ContentWindows_\" . BuildNo::$build . \" Movie Paid Distant Future\");\n\n $I->waitForText('Ingest Testing', 30, ContentPage::$channelRow);\n $I->seeInField(ContentPage::$windowing_premiumStartOfWindow_input, 'Never');\n }",
"public function testWebinarStatus()\n {\n }",
"public function testPastEvents()\n {\n // otherwise test will fail.\n // Other approach is to use fake data or mock it.\n \n $response = $this->json('GET', '/events/expired');\n \n $response\n ->assertStatus(200)\n ->assertJson([\n ['name' => 'Fashion Show']\n ]);\n }",
"public function _testMultipleInventories()\n {\n\n }",
"public function testPastEmbargoAfterExpiry()\n {\n $page = $this->objFromFixture(SiteTree::class, 'pastEmbargoAfterExpiry');\n\n $page = $this->finishWorkflow($page);\n\n $this->assertEquals(0, $page->PublishJobID);\n $this->assertEquals(0, $page->UnPublishJobID);\n }",
"public function testWebinarRegistrantQuestionUpdate()\n {\n }",
"public function test_admin_tribe_list()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/Assignments', 'tribe_list']);\n $this->assertResponseCode(404);\n }",
"public function testQuestionSharev1questions()\n {\n\n }",
"public function testPastEmbargoExpiry()\n {\n $page = $this->objFromFixture(SiteTree::class, 'pastEmbargoExpiry');\n\n $page = $this->finishWorkflow($page);\n\n $this->assertEquals(0, $page->PublishJobID);\n $this->assertNotEquals(0, $page->UnPublishJobID);\n\n $unpublish = strtotime($page->UnPublishJob()->StartAfter ?? '');\n\n $this->assertFalse($unpublish);\n }",
"public function testQuestionSharev1questionslast()\n {\n\n }",
"public function testListExperts()\n {\n }",
"public function testQuestionSharev1questions0()\n {\n\n }",
"public function testWebinarPollGet()\n {\n }",
"public function testPastEmbargoFutureExpiry()\n {\n $page = $this->objFromFixture(SiteTree::class, 'pastEmbargoFutureExpiry');\n\n $page = $this->finishWorkflow($page);\n\n $this->assertNotEquals(0, $page->PublishJobID);\n $this->assertNotEquals(0, $page->UnPublishJobID);\n\n $publish = strtotime($page->PublishJob()->StartAfter ?? '');\n $unpublish = strtotime($page->UnPublishJob()->StartAfter ?? '');\n\n $this->assertFalse($publish);\n $this->assertNotFalse($unpublish);\n }",
"public function episodePremiumVisibleInDistantFuture(AcceptanceTester $I)\n {\n $I->wantTo('Verify that \"Never\" is displayed in the portal when Premium visible date is in the distant future. - C225103');\n $I->amOnPage(ContentPage::$URL_ingest);\n\n ContentUtils::clickTableRowOfTitle($I, \"CXCMS_Ingest_ContentWindows_\" . BuildNo::$build . \" Episode Paid Distant Future\");\n ContentUtils::clickTableRowOfTitle($I, \"CXCMS_Ingest_ContentWindows_\" . BuildNo::$build . \" Episode Paid Distant Future Season\");\n ContentUtils::clickTableRowOfTitle($I, \"CXCMS_Ingest_ContentWindows_\" . BuildNo::$build . \" Episode Paid Distant Future Title\");\n\n //CXCMS-1738 - This is bugged and will always fail\n $I->waitForText('Ingest Testing', 30, ContentPage::$channelRow);\n $I->seeInField(ContentPage::$windowing_listingBegin_input, 'Never');\n }",
"public function iN_ListQuestionAnswerFromLanding() {\n\t\t$query = mysqli_query($this->db, \"SELECT * FROM i_landing_qa WHERE qa_status = '1'\") or die(mysqli_error($this->db));\n\t\twhile ($row = mysqli_fetch_array($query, MYSQLI_ASSOC)) {\n\t\t\t// Store the result into array\n\t\t\t$data[] = $row;\n\t\t}\n\t\tif (!empty($data)) {\n\t\t\treturn $data;\n\t\t}\n\t}",
"public function testQuestionSharev1questionstopExperts()\n {\n\n }",
"public function moviePremiumVisibleInDistantFuture(AcceptanceTester $I)\n {\n $I->wantTo('Verify that \"Never\" is displayed in the portal when Premium visible date is in the distant future. - C225105');\n $I->amOnPage(ContentPage::$URL_ingest);\n\n ContentUtils::clickTableRowOfTitle($I, \"CXCMS_Ingest_ContentWindows_\" . BuildNo::$build . \" Movie Paid Distant Future\");\n\n //CXCMS-1738 - This should say Never. Change when fixed.\n $I->waitForText('Ingest Testing', 30, ContentPage::$channelRow);\n $I->seeInField(ContentPage::$windowing_listingBegin_input, 'Never');\n }",
"public function testVenueQuestionnaire()\n {\n $this->buildVenueSurvey();\n\n $response = $this->json('GET', \"survey/questionnaire\", ['slot_id' => $this->slot->id, 'type' => Survey::TRAINING]);\n $response->assertStatus(200);\n\n $survey = $this->survey;\n $venueGroup = $this->venueGroup;\n $venueQ = $this->venueQuestion;\n $trainerGroup = $this->trainerGroup;\n $trainerQ = $this->trainerQuestion;\n\n $response->assertJson([\n 'survey' => [\n 'id' => $survey->id,\n 'type' => Survey::TRAINING,\n 'year' => $survey->year,\n 'title' => $survey->title,\n ]\n ]);\n\n $response->assertJson([\n 'survey' => [\n 'survey_groups' => [\n [\n 'id' => $venueGroup->id,\n 'title' => $venueGroup->title,\n 'description' => $venueGroup->description,\n 'survey_questions' => [\n [\n 'id' => $venueQ->id,\n 'sort_index' => $venueQ->sort_index,\n 'type' => $venueQ->type,\n 'description' => $venueQ->description,\n ]\n ]\n ],\n\n [\n 'id' => $trainerGroup->id,\n 'title' => $trainerGroup->title,\n 'description' => $trainerGroup->description,\n 'survey_questions' => [\n [\n 'id' => $trainerQ->id,\n 'sort_index' => $trainerQ->sort_index,\n 'type' => $trainerQ->type,\n 'description' => $trainerQ->description,\n ]\n ]\n\n ]\n ]\n ]\n ]);\n\n $trainer = $this->trainer;\n\n $response->assertJson([\n 'trainers' => [\n [\n 'id' => $trainer->id,\n 'callsign' => $trainer->callsign,\n 'position_id' => Position::TRAINER\n ]\n ]\n ]);\n\n $slot = $this->slot;\n $response->assertJson([\n 'slot' => [\n 'id' => $slot->id,\n 'begins' => $slot->begins\n ]\n ]);\n //return response()->json(['survey' => $survey, 'trainers' => $trainers, 'slot' => $slot]);\n\n }",
"public function testGetSurveys0()\n {\n }",
"public function testGetSurveys0()\n {\n }",
"public function testGetSurvey0()\n {\n }",
"public function testGetSurvey0()\n {\n }",
"public function test_changing_question() {\n global $DB;\n\n // create a user\n $user = $this->getDataGenerator()->create_user();\n\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // create a course module\n $videoquanda = $this->getDataGenerator()->create_module('videoquanda', array(\n 'course' => $course->id\n ));\n\n $time = mktime(9, 0, 0, 11, 7, 2013);\n\n $this->loadDataSet($this->createArrayDataSet(array(\n 'videoquanda_questions' => array(\n array('id', 'instanceid', 'userid', 'timecreated', 'timemodified' ,'seconds', 'text'),\n array(1, $videoquanda->id, $user->id, $time, $time, 2, 'dummy text')\n )\n )));\n\n $question = array(\n 'text' => 'I have updated my question.',\n 'timemodified' => time()\n );\n\n // enrol the user on the course\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $DB->get_field('role', 'id', array(\n 'shortname' => 'student',\n )));\n\n // login the user\n $this->setUser($user);\n\n $client = new Client($this->_app);\n $client->request('PUT', '/api/v1/' . $videoquanda->id . '/questions/1', array(), array(), array(), json_encode($question));\n\n $this->assertEquals(200, $client->getResponse()->getStatusCode());\n $this->assertGreaterThan($time, $DB->get_field('videoquanda_questions', 'timemodified', array('id' => 1)));\n }",
"public function testJobListFromJobSchedule()\n {\n\n }",
"public function testRun4(){\n\t\t$param = $this->urlParam;\n\n\t\t$listItem = $this->listItems('newsletterCampaignEntry');\n\t\t$this->assertNotNull($listItem->list->attributes);\n\n\t\t$param['{params}'] = \"?get_key={$listItem->uniqueId}\";\n\t\t$this->assertTrackCampaignClick($listItem,$param,$listItem->uniqueId);\n\t\t// It should have exited without doing anything else.\n\t\t$this->assertNoTrackGeneric();\n\t}",
"function AddTesteeQuestions($testEntryID, $examQAs)\n {\n try\n {\n if (count($examQAs) < 1)\n {\n return;\n }\n \n $db = GetDBConnection();\n \n $qCount = 1;\n $questions = array();\n foreach ($examQAs as $qa)\n {\n $questionID = $qa->GetQuestionId();\n $question = GetQuestion($questionID);\n \n if ($question != FALSE)\n {\n $aCount = 1;\n $answers = GetQuestionAnswers($questionID);\n \n for ($i = 0; $i < count($answers); $i++)\n {\n $chosen = '0';\n $answer = $answers[$i];\n $answer['AnswerNo'] = $aCount;\n \n if ($answer[GetAnswerIdIdentifier()] == $qa->GetAnswerId())\n {\n $chosen = '1';\n }\n \n $answer['Chosen'] = $chosen;\n \n $answers[$i] = $answer;\n \n $aCount++;\n }\n \n $question['QuestionNo'] = $qCount;\n $question['Answers'] = $answers;\n \n $questions[] = $question;\n \n $qCount++;\n }\n }\n \n $qQuery = 'INSERT INTO ' . GetTesteeQuestionsIdentifier()\n . ' (' . GetTestIdIdentifier()\n . ', ' . 'QuestionNo'\n . ', ' . 'Level'\n . ', ' . 'Instructions'\n . ', ' . 'Question' . ') VALUES';\n \n $aQuery = 'INSERT INTO ' . GetTesteeAnswersIdentifier()\n . ' (' . GetTestIdIdentifier()\n . ', ' . 'QuestionNo'\n . ', ' . 'AnswerNo'\n . ', ' . 'Answer'\n . ', ' . 'Correct'\n . ', ' . 'Chosen' . ') VALUES';\n \n foreach($questions as $question)\n {\n $answers = $question['Answers'];\n $questionNo = $question['QuestionNo'];\n \n $qQuery .= ' (:' . GetTestIdIdentifier()\n . ', :' . 'QuestionNo' . $questionNo\n . ', :' . 'Level' . $questionNo\n . ', :' . 'Instructions' . $questionNo\n . ', :' . 'Question' . $questionNo . '),';\n \n foreach($answers as $answer)\n {\n $answerNo = $answer['AnswerNo'];\n \n $aQuery .= ' (:' . GetTestIdIdentifier()\n . ', :' . 'QuestionNo' . $questionNo . $answerNo\n . ', :' . 'AnswerNo' . $questionNo . $answerNo\n . ', :' . 'Answer' . $questionNo . $answerNo\n . ', :' . 'Correct' . $questionNo . $answerNo\n . ', :' . 'Chosen' . $questionNo . $answerNo . '),';\n }\n }\n \n $qQuery = rtrim($qQuery, ',') . ';';\n $aQuery = rtrim($aQuery, ',') . ';';\n \n $qStatement = $db->prepare($qQuery);\n $aStatement = $db->prepare($aQuery);\n \n foreach($questions as $question)\n {\n $answers = $question['Answers'];\n $questionNo = $question['QuestionNo'];\n \n foreach($answers as $answer)\n {\n $answerNo = $answer['AnswerNo'];\n \n $aStatement->bindValue(':' . GetTestIdIdentifier(), $testEntryID);\n $aStatement->bindValue(':' . 'QuestionNo' . $questionNo . $answerNo, $questionNo);\n $aStatement->bindValue(':' . 'AnswerNo' . $questionNo . $answerNo, $answerNo);\n $aStatement->bindValue(':' . 'Answer' . $questionNo . $answerNo, $answer[GetNameIdentifier()]);\n $aStatement->bindValue(':' . 'Chosen' . $questionNo . $answerNo, $answer['Chosen']);\n $aStatement->bindValue(':' . 'Correct' . $questionNo . $answerNo, $answer['Correct']);\n }\n \n $qStatement->bindValue(':' . GetTestIdIdentifier(), $testEntryID);\n $qStatement->bindValue(':' . 'QuestionNo' . $questionNo, $questionNo);\n $qStatement->bindValue(':' . 'Level' . $questionNo, $question['Level']);\n $qStatement->bindValue(':' . 'Instructions' . $questionNo, $question['Instructions']);\n $qStatement->bindValue(':' . 'Question' . $questionNo, $question[GetNameIdentifier()]);\n }\n \n $qStatement->execute();\n $qStatement->closeCursor();\n \n $aStatement->execute();\n $aStatement->closeCursor();\n }\n catch (PDOException $ex)\n {\n LogError($ex);\n }\n }",
"public function test_all_questions_and_answers_route_when_questioner_is_admin() {\n // create a user\n $user = $this->getDataGenerator()->create_user();\n\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // enrolment\n $this->getDataGenerator()->enrol_user($user->id, $course->id);\n\n // create a course module\n $videoquanda = $this->getDataGenerator()->create_module('videoquanda', array(\n 'course' => $course->id\n ));\n\n $now = time();\n\n $this->loadDataSet($this->createArrayDataSet(array(\n 'videoquanda_questions' => array(\n array('id', 'instanceid', 'userid', 'timecreated', 'timemodified' ,'seconds', 'text'),\n array(1, $videoquanda->id, 2, $now, $now + 1, 2, 'dummy text'),\n array(2, $videoquanda->id, $user->id, $now, $now + 1, 2, 'dummy text')\n )\n )));\n\n $this->setAdminUser();\n $client = new Client($this->_app);\n $client->request('GET', '/api/v1/' . $videoquanda->id . '/questions');\n $json = $client->getResponse()->getContent();\n $this->assertEquals(200, $client->getResponse()->getStatusCode());\n $array = (array) json_decode($json);\n $this->assertCount(2, $array);\n }",
"function testGetAllFaqsPages() {\n $faqspage = $this->fixture->objFromFixture('FaqsPage', 'faq1');\n $this->assertContains('Faq Number 1', $faqspage->Title);\n \n $faqspage = $this->fixture->objFromFixture('FaqsPage', 'faq2');\n $this->assertContains('Faq Number 2', $faqspage->Title); \n }",
"public function testPastSameEmbargoExpiry()\n {\n $page = $this->objFromFixture(SiteTree::class, 'pastSameEmbargoExpiry');\n\n $page = $this->finishWorkflow($page);\n\n $this->assertEquals(0, $page->PublishJobID);\n $this->assertEquals(0, $page->UnPublishJobID);\n }",
"public function testWebinarPanelistsDelete()\n {\n }",
"public function testWebinarPanelistDelete()\n {\n }",
"public function testWebinarPollCreate()\n {\n }",
"public function test_post_question_not_allowed_content() {\n global $DB;\n\n // Create user\n $user = $this->getDataGenerator()->create_user();\n\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // enrol the user on the course\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $DB->get_field('role', 'id', array(\n 'shortname' => 'student',\n )));\n\n // create a course module\n $videoquanda = $this->getDataGenerator()->create_module('videoquanda', array(\n 'course' => $course->id\n ));\n\n // enrol the user on the course\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $DB->get_field('role', 'id', array(\n 'shortname' => 'student',\n )));\n\n $question = array(\n 'seconds' => '2',\n 'text' => '<script>alert(\"This content is not allowed!\")</script>'\n );\n\n $this->setUser($user);\n\n $client = new Client($this->_app);\n $client->request('POST', '/api/v1/' . $videoquanda->id . '/questions', array(), array(), array(), json_encode($question));\n\n $this->assertEquals(201, $client->getResponse()->getStatusCode());\n $this->assertEquals(1, $DB->count_records('videoquanda_questions', array('instanceid' => $videoquanda->id)));\n $this->assertEquals('alert(\"This content is not allowed!\")', $DB->get_field('videoquanda_questions', 'text', array('instanceid' => $videoquanda->id)));\n }",
"public function testListSites()\n {\n }",
"public function testGetSurveyResponses0()\n {\n }",
"public function testGetSurveyResponses0()\n {\n }",
"public function testCreateSurveyQuestion0()\n {\n }",
"public function testCreateSurveyQuestion0()\n {\n }",
"public function testPastExpiry()\n {\n $page = $this->objFromFixture(SiteTree::class, 'pastExpiry');\n\n $page = $this->finishWorkflow($page);\n\n $this->assertEquals(0, $page->PublishJobID);\n $this->assertNotEquals(0, $page->UnPublishJobID);\n\n $unpublish = strtotime($page->UnPublishJob()->StartAfter ?? '');\n\n $this->assertFalse($unpublish);\n }",
"public function test_admin_training_list()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/MemberSkills', 'training_programs']);\n $this->assertResponseCode(404);\n }",
"public function testGetChallengeActivities()\n {\n }",
"public function test_all_questions_and_answers_route_when_in_groupmode_with_sitewide_role() {\n global $DB;\n\n // create a user\n $user = $this->getDataGenerator()->create_user();\n $roleid = $DB->get_field('role', 'id', array('shortname' => 'manager'));\n $this->getDataGenerator()->role_assign($roleid, $user->id);\n\n // create a course\n $course = $this->getDataGenerator()->create_course([\n 'groupmode' => SEPARATEGROUPS,\n 'groupmodeforce' => true,\n ]);\n\n // create a course module\n $videoquanda = $this->getDataGenerator()->create_module('videoquanda', array(\n 'course' => $course->id\n ));\n\n $now = time();\n\n $this->loadDataSet($this->createArrayDataSet(array(\n 'videoquanda_questions' => array(\n array('id', 'instanceid', 'userid', 'timecreated', 'timemodified', 'seconds', 'text'),\n array(1, $videoquanda->id, $user->id, $now, $now + 1, 2, 'dummy text')\n )\n )));\n\n $this->setUser($user);\n $client = new Client($this->_app);\n $client->request('GET', '/api/v1/' . $videoquanda->id . '/questions');\n $json = $client->getResponse()->getContent();\n $this->assertEquals(200, $client->getResponse()->getStatusCode());\n $array = (array) json_decode($json);\n $this->assertCount(1, $array);\n }",
"function qa_q_list_page_content($questions, $pagesize, $start, $count, $sometitle, $nonetitle,\n\t$navcategories, $categoryid, $categoryqcount, $categorypathprefix, $feedpathprefix, $suggest,\n\t$pagelinkparams = null, $categoryparams = null, $dummy = null)\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\trequire_once QA_INCLUDE_DIR . 'app/format.php';\n\trequire_once QA_INCLUDE_DIR . 'app/updates.php';\n\n\t$userid = qa_get_logged_in_userid();\n\n\n\t// Chop down to size, get user information for display\n\n\tif (isset($pagesize)) {\n\t\t$questions = array_slice($questions, 0, $pagesize);\n\t}\n\n\t$usershtml = qa_userids_handles_html(qa_any_get_userids_handles($questions));\n\n\n\t// Prepare content for theme\n\n\t$qa_content = qa_content_prepare(true, array_keys(qa_category_path($navcategories, $categoryid)));\n\n\t$qa_content['q_list']['form'] = array(\n\t\t'tags' => 'method=\"post\" action=\"' . qa_self_html() . '\"',\n\n\t\t'hidden' => array(\n\t\t\t'code' => qa_get_form_security_code('vote'),\n\t\t),\n\t);\n\n\t$qa_content['q_list']['qs'] = array();\n\n\tif (count($questions)) {\n\t\t$qa_content['title'] = $sometitle;\n\n\t\t$defaults = qa_post_html_defaults('Q');\n\t\tif (isset($categorypathprefix)) {\n\t\t\t$defaults['categorypathprefix'] = $categorypathprefix;\n\t\t}\n\n\t\tforeach ($questions as $question) {\n\t\t\t$fields = qa_any_to_q_html_fields($question, $userid, qa_cookie_get(), $usershtml, null, qa_post_html_options($question, $defaults));\n\n\t\t\tif (!empty($fields['raw']['closedbyid'])) {\n\t\t\t\t$fields['closed'] = array(\n\t\t\t\t\t'state' => qa_lang_html('main/closed'),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$qa_content['q_list']['qs'][] = $fields;\n\t\t}\n\t} else {\n\t\t$qa_content['title'] = $nonetitle;\n\t}\n\n\tif (isset($userid) && isset($categoryid)) {\n\t\t$favoritemap = qa_get_favorite_non_qs_map();\n\t\t$categoryisfavorite = @$favoritemap['category'][$navcategories[$categoryid]['backpath']];\n\n\t\t$qa_content['favorite'] = qa_favorite_form(QA_ENTITY_CATEGORY, $categoryid, $categoryisfavorite,\n\t\t\tqa_lang_sub($categoryisfavorite ? 'main/remove_x_favorites' : 'main/add_category_x_favorites', $navcategories[$categoryid]['title']));\n\t}\n\n\tif (isset($count) && isset($pagesize)) {\n\t\t$qa_content['page_links'] = qa_html_page_links(qa_request(), $start, $pagesize, $count, qa_opt('pages_prev_next'), $pagelinkparams);\n\t}\n\n\t$qa_content['canonical'] = qa_get_canonical();\n\n\tif (empty($qa_content['page_links'])) {\n\t\t$qa_content['suggest_next'] = $suggest;\n\t}\n\n\tif (qa_using_categories() && count($navcategories) && isset($categorypathprefix)) {\n\t\t$qa_content['navigation']['cat'] = qa_category_navigation($navcategories, $categoryid, $categorypathprefix, $categoryqcount, $categoryparams);\n\t}\n\n\t// set meta description on category pages\n\tif (!empty($navcategories[$categoryid]['content'])) {\n\t\t$qa_content['description'] = qa_html($navcategories[$categoryid]['content']);\n\t}\n\n\tif (isset($feedpathprefix) && (qa_opt('feed_per_category') || !isset($categoryid))) {\n\t\t$qa_content['feed'] = array(\n\t\t\t'url' => qa_path_html(qa_feed_request($feedpathprefix . (isset($categoryid) ? ('/' . qa_category_path_request($navcategories, $categoryid)) : ''))),\n\t\t\t'label' => strip_tags($sometitle),\n\t\t);\n\t}\n\n\treturn $qa_content;\n}",
"public function test119DisplayBookingListAfterClickOnEachLinkOfPagination()\n {\n $ssoData = $this->getSSOData();\n\n // current bookings\n $this->createBookings(20, date('Y-m-d'), 15);\n\n //$this->mockApi($data, 'empty_ok');\n\n $responseBefore = $this->ajax($this->getUrlByParams(['page' => 1, 'per_page' => 10]))->json();\n $responseAfter = $this->ajax($this->getUrlByParams(['page' => 2, 'per_page' => 10]))->json();\n\n $listBefore = $responseBefore['current_list'];\n $listAfter = $responseAfter['current_list'];\n\n $this->assertFalse($listBefore == $listAfter);\n }",
"public function testWebinarRegistrants()\n {\n }",
"public function testGetVendorComplianceSurveyByFilter()\n {\n }",
"public function testWebinarUpdate()\n {\n }",
"public function show(pregunta_test $pregunta_test)\n {\n //\n }",
"public function testListQrcodesPagination()\n {\n $this->makeData(self::NUMBER_RECORD_CREATE);\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('/admin/qrcodes');\n $elements = $browser->elements('#list-qrcodes tbody tr');\n $this->assertCount(config('define.qrcodes.limit_rows'), $elements);\n $this->assertNotNull($browser->element('.pagination'));\n $paginate_element = $browser->elements('.pagination li');\n $number_page = count($paginate_element) - 2;\n $this->assertTrue($number_page == ceil((self::NUMBER_RECORD_CREATE + 1) / (config('define.qrcodes.limit_rows'))));\n });\n }",
"public function testWebinarPollUpdate()\n {\n }",
"public function testIndexSurvey()\n {\n $year = 2018;\n Survey::factory()->create(['year' => $year]);\n\n $response = $this->json('GET', 'survey', ['year' => $year]);\n $response->assertStatus(200);\n $this->assertCount(1, $response->json()['survey']);\n }",
"public function testAjaxGetVenueListCanBeAccessed()\n {\n $this->dispatch('/venue/ajax-get-venue-list');\n $this->assertResponseStatusCode(200);\n }",
"public function __construct(SiteQa $qa)\n {\n $this->qa = $qa;\n }",
"public function test_that_authorized_user_can_view_courses_within_other_periods()\n {\n \n }",
"public function testJobListPreparationAndReleaseTaskStatus()\n {\n\n }",
"public function show(Question_Test $question_Test)\n {\n //\n }",
"public function testFaqControllerManageQuestion()\r\n {\r\n\t\t//model a login user\r\n\t\t$memberController = &getController(\"member\");\r\n\t\t$output = $memberController->procMemberLogin('xe_admin','@xe_part@');\r\n\r\n\t\t//model: get a faq module\r\n\t\t$oModuleAdminModel = &getAdminModel(\"module\");\r\n\t\t$args->module = 'faq';\r\n\t\t$faq_modules = $oModuleAdminModel->getModuleMidList($args)->data;\r\n\t\t$obj->module_srl = $faq_modules[1]->module_srl;\r\n\r\n\t\t//test for insert a question to the faq\r\n\t\t$this->faqModel->init();\r\n\t\t$question_list = $this->faqModel->getQuestionList($obj)->data;\r\n\t\t$before_question_count = sizeOf($question_list);\r\n\t\t$this->InsertFaqQuestion($obj->module_srl);\r\n\t\t$question_list = $this->faqModel->getQuestionList($obj)->data;\r\n\t\t$after_question_count = sizeOf($question_list);\r\n\t\t//assert the number of faq questions increased by 1\r\n\t\t$this->assertEquals(1, $after_question_count-$before_question_count);\r\n\r\n\t\t//test for update the question of the faq\r\n\t\t$question_srl = $question_list[1]->question_srl;\r\n\t\t$this->UpdateFaqQuestion($question_srl);\r\n\t\t$this->faqModel->init();\r\n\t\tunset($GLOBALS['XE_QUESTION_LIST'][$question_srl]);\r\n\t\t$oQuestion = $this->faqModel->getQuestion($question_srl);\r\n\t\t//assert the question and answer have been updated\r\n\t\t$this->assertEquals('test question update', $oQuestion->get('question'));\r\n\t\t$this->assertEquals('test answer update', $oQuestion->get('answer'));\r\n\r\n\t\t//test for delete the question of the faq\r\n\t\t$before_question_count = sizeOf($question_list);\r\n\t\t$this->DeleteFaqQuestion($question_srl);\r\n\t\t$question_list = $this->faqModel->getQuestionList($obj)->data;\r\n\t\t$after_question_count = sizeOf($question_list);\r\n\t\t//assert the number of faq questions decreased by 1\r\n\t\t$this->assertEquals(1, $before_question_count-$after_question_count);\r\n\r\n\t}",
"public function testReportsSpamchecksHistoryGet()\n {\n }",
"public function testUpcomingEvents()\n {\n // otherwise test will fail.\n // Other approach is to use fake data or mock it.\n \n $response = $this->json('GET', '/events');\n \n $response\n ->assertStatus(200)\n ->assertJson([\n ['name' => 'IT Expo']\n ]);\n }",
"public function testWebinarCreate()\n {\n }",
"public function testQuestionSharev1questionsidQuestionanswer()\n {\n\n }",
"public function testQuizRead_Title()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/quizzes')\n ->clickLink('View Quiz')\n ->assertSee('General Knowledge')\n ->screenshot('RoleEdit/QuizRead');\n });\n }",
"public function testJobList()\n {\n\n }",
"public function testReportsSkillv1reportsskillsidgaps()\n {\n\n }",
"public function test_for_quiz_question()\n {\n $this->withOutExceptionHandling();\n\n $user = $this->actingAs(User::factory()->make());\n\n $session = QuizSession::factory()->create();\n $schedule = ClassSchedule::factory()->create();\n\n $response = $this->post('api/v1/quiz/question',\n array_merge($this->data(), [\n 'quiz_session_id' => $session->id,\n 'class_schedule_id' => $schedule->id,\n ]\n )\n );\n\n $response->assertStatus(200);\n }",
"public function test_post_question_as_guest() {\n global $DB;\n\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // create a course module\n $videoquanda = $this->getDataGenerator()->create_module('videoquanda', array(\n 'course' => $course->id\n ));\n\n // set the instance of the 'guest' enrolment plugin to enabled\n $DB->set_field('enrol', 'status', ENROL_INSTANCE_ENABLED, array(\n 'courseid' => $course->id,\n 'enrol' => 'guest',\n ));\n\n // login as guest\n $this->setGuestUser();\n\n // create a dummy question to post\n $question = array(\n 'seconds' => '2',\n 'text' => 'dummy text'\n );\n\n // try to post a question\n $client = new Client($this->_app);\n $client->request('POST', '/api/v1/' . $videoquanda->id . '/questions', array(), array(), array(\n 'HTTP_X_REQUESTED_WITH' => 'XMLHttpRequest',\n ), json_encode($question));\n $this->assertTrue($client->getResponse()->isClientError());\n $this->assertEquals('application/json', $client->getResponse()->headers->get('Content-Type'));\n $this->assertEquals(get_string('jsonapi:submitquestionasguestdenied', $this->_app['plugin']), json_decode($client->getResponse()->getContent()));\n $this->assertEquals(0, $DB->count_records('videoquanda_questions', array('instanceid' => $videoquanda->id)));\n }",
"function test_cinesport_embed_shortcode_works() {\n\t\t//Videos\n\t\t$content = '[cinesport url=\"http://cinesport.boston.com/boston-globe-sports/manning-reflects-win-over-brady-pats/\"]';\n\t\t$output = do_shortcode( $content );\n\t\t$this->assertEquals( '<div class=\"content-media__video content-media__video--cinesport\"><iframe frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" src=\"http://cinesport.boston.com/embed/boston-globe-sports/manning-reflects-win-over-brady-pats/#autostart=on;titles=on;nolink=on;\"></iframe></div>', $output );\n\n\t\t// Bad URL should return nothing\n\t\t$content = '[cinesport url=\"https://boston.com\"]';\n\t\t$output = do_shortcode( $content );\n\t\t$this->assertEquals( '', $output );\n\t}",
"public function test_admin_usecase_list_b()\n {\n $this->request('GET', ['pages/Assignments', 'usecase_list']);\n $this->assertResponseCode(404);\n }",
"public function testMovieReviewPage(): void\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(new MovieReview())\n ->assertSee('Machine Learning with Scikit Learn');\n });\n }",
"public function testReportsSkillv1reportsskillsgaps()\n {\n\n }",
"public function test_changing_question_from_other_user() {\n global $DB;\n\n // create a user\n $user = $this->getDataGenerator()->create_user();\n\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // create a course module\n $videoquanda = $this->getDataGenerator()->create_module('videoquanda', array(\n 'course' => $course->id\n ));\n\n $time = mktime(9, 0, 0, 11, 7, 2013);\n\n $this->loadDataSet($this->createArrayDataSet(array(\n 'videoquanda_questions' => array(\n array('id', 'instanceid', 'userid', 'timecreated', 'timemodified' ,'seconds', 'text'),\n array(1, $videoquanda->id, 99, $time, $time, 2, 'dummy text')\n )\n )));\n\n $question = array(\n 'text' => 'I have updated my question.',\n 'timemodified' => time()\n );\n\n // enrol the user on the course\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $DB->get_field('role', 'id', array(\n 'shortname' => 'student',\n )));\n\n // login the user\n $this->setUser($user);\n\n $client = new Client($this->_app);\n $client->request('PUT', '/api/v1/' . $videoquanda->id . '/questions/1', array(), array(), array(), json_encode($question));\n\n $this->assertEquals(405, $client->getResponse()->getStatusCode());\n $this->assertEquals($time, $DB->get_field('videoquanda_questions', 'timemodified', array('id' => 1)));\n }",
"public function testRightSubmission()\n {\n $client = static::createClient();\n $client->followRedirects();\n\n $crawler = $client->request('GET', '/play');\n\n $movieId = $crawler->filter('#quizz_movie')->attr('value');\n $actorId = $crawler->filter('#quizz_actor')->attr('value');\n\n $movieRepo = $client->getContainer()->get('doctrine')->getRepository('AppBundle:Movie');\n $personRepo = $client->getContainer()->get('doctrine')->getRepository('AppBundle:Person');\n\n $movie = $movieRepo->find($movieId);\n $person = $personRepo->find($actorId);\n\n if ($movie->isActor($person)) {\n $form = $crawler->selectButton('quizz_yes')->form();\n } else {\n $form = $crawler->selectButton('quizz_no')->form();\n }\n\n $client->submit($form);\n\n $request = $client->getRequest();\n $this->assertEquals('/play', $request->getPathInfo(), 'on a good submission, the player is redirected on /play');\n }",
"public function test1() \n {\n /*$url = \"https://integralads.com/careers/\";\n $html = file_get_contents($url);\n\n $link_text = [\"w Opening\", \"View All Openings\", \"View Jobs\", \"Openings\", \"Jobs\", \"Careers\"];\n $link = \"\";\n $text_string = \"\";\n\n foreach($link_text as $text) {\n \n $text_string = $text;\n $link = $rh->getLinkFromText($html, $text);\n if (!empty($link)) break;\n\n }\n \n print $text_string.\"<br>\";\n print $link;\n */\n //$rh->QACareerPage(625);\n // $rh->convertRobotCompanyToRoleSentryCompany(625);\n //print env('CLOUDAMQP_PORT');\n //dd(config('app.env'));\n // print $_ENV[\"CLOUDAMQP_HOST\"];\n print config(\"app.cloudampq_host\");\n print config(\"app.cloudampq_user\");\n print config(\"app.cloudampq_pw\");\n print config(\"app.cloudampq_port\");\n\n\n }",
"public function showResults(){\n $this->extractQuestions();\n }",
"public function getSubpasta()\r\n\t{\r\n\t\treturn $this->subpasta;\r\n\t}",
"function getTests(){\n $listOfAvailableTests = parent::getTests();\n $url = get_instance()->uri->uri_string();\n $listOfSubTests = trim(Text::getSubstringAfter($url, '/subtests/'));\n if($listOfSubTests){\n $listOfSubTests = explode(',', $listOfSubTests);\n foreach($listOfSubTests as $key => &$subTest){\n $subTest = trim($subTest);\n if(!in_array($subTest, $listOfAvailableTests)){\n unset($listOfSubTests[$key]);\n echo \"Test '$subTest' does not exist as a test within \" . $this->getLabel() . \"<br/>\";\n }\n }\n $listOfSkippedTests = array_diff($listOfAvailableTests, $listOfSubTests);\n $this->reporter->paintSkip(count($listOfSkippedTests) . \" tests not run.\");\n $listOfAvailableTests = $listOfSubTests;\n }\n return $listOfAvailableTests;\n }"
] | [
"0.6955456",
"0.59452575",
"0.58298326",
"0.5821201",
"0.5732911",
"0.56243193",
"0.54987425",
"0.54416364",
"0.5420459",
"0.5414977",
"0.54115117",
"0.53685975",
"0.5187622",
"0.5177601",
"0.5177601",
"0.5174332",
"0.51445574",
"0.5130628",
"0.5130628",
"0.51046103",
"0.5099534",
"0.5075157",
"0.5072695",
"0.50662506",
"0.5065194",
"0.50571734",
"0.503583",
"0.5025018",
"0.50246006",
"0.50206214",
"0.50134397",
"0.50114036",
"0.5000283",
"0.49865717",
"0.49842677",
"0.49822646",
"0.4968814",
"0.493449",
"0.49330547",
"0.49241048",
"0.4918006",
"0.49175656",
"0.49127823",
"0.49127823",
"0.49115115",
"0.49115115",
"0.4902912",
"0.49023113",
"0.49003765",
"0.48902777",
"0.4882712",
"0.48610276",
"0.48436254",
"0.48371762",
"0.47857833",
"0.47512135",
"0.47480956",
"0.47461835",
"0.4745878",
"0.4745878",
"0.4735489",
"0.4735489",
"0.47283322",
"0.47234628",
"0.47086474",
"0.4697165",
"0.46916217",
"0.46845365",
"0.4683474",
"0.4683121",
"0.4672734",
"0.46694398",
"0.46605536",
"0.46579194",
"0.46534812",
"0.46523213",
"0.46451613",
"0.46431202",
"0.46422997",
"0.46300086",
"0.46282497",
"0.46227774",
"0.46154258",
"0.4614964",
"0.46074247",
"0.4605818",
"0.45966026",
"0.45958063",
"0.45947877",
"0.45805246",
"0.4571644",
"0.45714563",
"0.45487213",
"0.4540947",
"0.4539712",
"0.4530619",
"0.45106888",
"0.45100933",
"0.4508143",
"0.44920698"
] | 0.7940479 | 0 |
Test case for pastWebinars List Past Webinar Instances. | public function testPastWebinars()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testListPastWebinarQA()\n {\n }",
"public function testListPastWebinarPollResults()\n {\n }",
"public function testWebinarPanelists()\n {\n }",
"public function testWebinarPanelistCreate()\n {\n }",
"public function testListPastWebinarFiles()\n {\n }",
"public function testWebinarPolls()\n {\n }",
"public function testWebinar()\n {\n }",
"public function testWebinarAbsentees()\n {\n }",
"public function testWebinarStatus()\n {\n }",
"public function testWebinarRegistrants()\n {\n }",
"public function testWebinars()\n {\n }",
"public function testWebinarCreate()\n {\n }",
"public function testWebinarPanelistsDelete()\n {\n }",
"public function testListSites()\n {\n }",
"public function testWebinarPanelistDelete()\n {\n }",
"public function testWebinarUpdate()\n {\n }",
"public function testWebinarPollGet()\n {\n }",
"public function testWebinarRegistrantStatus()\n {\n }",
"public function testWebinarPollCreate()\n {\n }",
"public function testWebinarRegistrantGet()\n {\n }",
"public function testListSiteMemberships()\n {\n }",
"public function _testMultipleInventories()\n {\n\n }",
"public function testWebinarRegistrantsQuestionsGet()\n {\n }",
"private static function removeAllTestingWebinars(): void\n {\n foreach (self::$driverHandler->getWebinars() as $webinar) {\n if (str_starts_with($webinar->slug, 'test-')) {\n self::$driverHandler->removeWebinar($webinar->id);\n }\n }\n }",
"public function testWebinarRegistrantCreate()\n {\n }",
"public function testMovieShow()\n {\n $client = static::createClient();\n // On va sur la home\n $crawler = $client->request('GET', '/');\n // On cherche le lien du film dans la page, à partir de la sidebar\n // On mémorise le texte du lien (le film cliqué)\n $movieTitle = $crawler->filter('#sidebar a:first-of-type')->text();\n // On chope l'URL du lien\n $link = $crawler->filter('#sidebar a:first-of-type')->link();\n // On stock le titre du lien\n // On demande au client de cliquer sur le lien\n // On récupère le crawler du lien cliqué\n $crawler = $client->click($link);\n // On vérifie qu'on a un statut 200\n $this->assertEquals(200, $client->getResponse()->getStatusCode());\n // On vérifie qu'on a le même titre que précédemment\n // Ici, titre de la pasge cliquée\n $newMovieTitle = $crawler->filter('h1#header-margin')->text();\n // On vérifie que les deux titres sont les mêmes\n $this->assertEquals(trim($movieTitle), trim($newMovieTitle));\n }",
"public function testWebinarDelete()\n {\n }",
"public function testListSiteMembershipsForPerson()\n {\n }",
"public function testMovieReviewPage(): void\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(new MovieReview())\n ->assertSee('Machine Learning with Scikit Learn');\n });\n }",
"public function testCreateSite()\n {\n }",
"public function test_instances_route() {\n // request the page\n $client = new Client($this->_app);\n $client->request('GET', '/instances/' . $this->_course->id);\n $this->assertTrue($client->getResponse()->isOk());\n\n // check the page content\n foreach (range(1, count($this->_walls)) as $i) {\n $this->assertContains('Community wall ' . $i, $client->getResponse()->getContent());\n }\n $this->assertNotContains('Community wall ' . (count($this->_walls) + 1), $client->getResponse()->getContent());\n }",
"public function testListSiteMembershipRequestsForPerson()\n {\n }",
"public function test119DisplayBookingListAfterClickOnEachLinkOfPagination()\n {\n $ssoData = $this->getSSOData();\n\n // current bookings\n $this->createBookings(20, date('Y-m-d'), 15);\n\n //$this->mockApi($data, 'empty_ok');\n\n $responseBefore = $this->ajax($this->getUrlByParams(['page' => 1, 'per_page' => 10]))->json();\n $responseAfter = $this->ajax($this->getUrlByParams(['page' => 2, 'per_page' => 10]))->json();\n\n $listBefore = $responseBefore['current_list'];\n $listAfter = $responseAfter['current_list'];\n\n $this->assertFalse($listBefore == $listAfter);\n }",
"public function testListSiteContainers()\n {\n }",
"public function testSiteShow()\n {\n \t$siteShow = factory(Site::class)->create();\n factory(RoomTypes::class)->create(); //Avoid no room type message\n \t$this->be($this->employees[1], 'admin');\n\n \t//Employee can see site details\n \t$this->get('admin/site/'. $siteShow->id_site)\n \t\t->assertStatus(200)\n \t\t->assertSeeText(e($siteShow->name))\n \t\t->assertSeeText(e($siteShow->address))\n ->assertSeeText('Supprimer')\n ->assertSeeText('Modifier')\n ->assertSeeText('Ajouter un horaire')\n ->assertSeeText('Ajouter une salle');\n\n\t\tAuth::logout();\n\n $this->be($this->employees[2], 'admin');\n $this->get('admin/site/'. $siteShow->id_site)\n ->assertStatus(200)\n ->assertSeeText(e($siteShow->name))\n ->assertSeeText(e($siteShow->address))\n ->assertSeeText('Supprimer')\n ->assertSeeText('Modifier')\n ->assertSeeText('Ajouter un horaire')\n ->assertSeeText('Ajouter une salle');\n\n Auth::logout();\n\n $this->be($this->user, 'web');\n\n //Normal user can't see site details\n $this->get('admin/site/'. $siteShow->id_site)->assertRedirect('admin/login');\n\n\t\tAuth::logout();\n\n\t\t//Unauthenticated user can't see site details\n\t\t$this->get('admin/site/'. $siteShow->id_site)->assertRedirect('admin/login');\n\n \t//Access test\n for ($i = 0; $i < 4 ; $i++) { \n if($i == 1 || $i == 2) continue;\n\n $this->be($this->employees[$i], 'admin');\n $this->get('admin/site/'. $siteShow->id_site)\n ->assertStatus(200)\n ->assertSeeText(e($siteShow->name))\n ->assertSeeText(e($siteShow->address))\n ->assertDontSeeText('Supprimer')\n ->assertDontSeeText('Modifier')\n ->assertDontSeeText('Ajouter un horaire')\n ->assertDontSeeText('Ajouter une salle');\n\n Auth::logout();\n }\n }",
"public function testListingWithFilters()\n {\n $filters[] = ['limit' => 30, 'page' => 30];\n $filters[] = ['listing_type' => 'public'];\n foreach ($filters as $k => $v) {\n $client = static::createClient();\n $client->request('GET', '/v2/story', $v, [], $this->headers);\n $this->assertStatusCode(200, $client);\n\n $response = json_decode($client->getResponse()->getContent(), true);\n $this->assertTrue(is_array($response));\n }\n }",
"public function testClubInHomepage()\n {\n \t$club = Club::where('name','=','EscBasket')->first();\n $this->visit('/')\n ->see($club->name);\n }",
"public function testWebinarPollUpdate()\n {\n }",
"public function testPastEmbargo()\n {\n $page = $this->objFromFixture(SiteTree::class, 'pastEmbargo');\n\n $page = $this->finishWorkflow($page);\n\n $this->assertNotEquals(0, $page->PublishJobID);\n $this->assertEquals(0, $page->UnPublishJobID);\n\n $publish = strtotime($page->PublishJob()->StartAfter ?? '');\n $this->assertFalse($publish);\n }",
"public function test_show_available_seats_for_each_movie()\n {\n $movie=Movie::factory()->create();\n $response = $this->get(route('show.movie', [$movie->id]));\n $response->assertStatus(Response::HTTP_OK);\n }",
"public function test_byinstanceid_route() {\n list(, , $talkpoint) = $this->_setup_single_user_in_single_talkpoint();\n\n // request the page\n $client = new Client($this->_app);\n $client->request('GET', '/' . $talkpoint->id);\n $this->assertTrue($client->getResponse()->isOk());\n\n $this->assertContains('<h2>Talkpoint activity name</h2>', $client->getResponse()->getContent());\n }",
"function getUpcomingWebinars()\n {\n $path = $this->getPathRelativeToOrganizer('upcomingWebinars');\n\n return $this->sendRequest('GET', $path, $parameters = null, $payload = null);\n }",
"public function testShowDetailHotelInPageShowPlace()\n { \n $this->makePlace(7);\n $place = Place::find(1);\n $this->makeHotelOfPlace($place->id);\n $this->browse(function (Browser $browser) use ($place) {\n $selector = '.container .row div:nth-child(2) .room-thumb .mask .content';\n $hotel = Hotel::find(1);\n $browser->visit('/places/'.$place->slug)\n ->assertSee($place->name)\n ->mouseover($selector)\n ->whenAvailable($selector, function ($selectorAvailable) {\n $selectorAvailable->click('.btn');\n })\n ->assertPathIs('/hotels/'.$hotel->slug);\n \n });\n }",
"public function testExample()\n {\n $this->visit(\"http://localhost/laravel/cdp/public/project/1/visitor\");\n $this->seePageIs('http://localhost/laravel/cdp/public/project/1/visitor');\n }",
"public function test_get_all_viewable_by_instanceid() {\n $times = [\n mktime( 9, 0, 0, 11, 5, 2013),\n mktime( 7, 0, 0, 11, 5, 2013),\n mktime( 6, 0, 0, 11, 5, 2013),\n mktime( 8, 0, 0, 11, 5, 2013),\n mktime(10, 0, 0, 11, 5, 2013),\n mktime(11, 0, 0, 11, 5, 2013),\n ];\n $course = $this->getDataGenerator()->create_course();\n $module = $this->getDataGenerator()->create_module('talkpoint', [\n 'course' => $course->id,\n ]);\n $user = $this->getDataGenerator()->create_user();\n $this->loadDataSet($this->createArrayDataSet([\n 'talkpoint_talkpoint' => [\n ['id', 'instanceid', 'userid', 'title', 'uploadedfile', 'nimbbguid', 'mediatype', 'closed', 'timecreated', 'timemodified'],\n [1, $module->id, 2, 'Talkpoint 001', '', 'ABC123', 'webcam', 0, $times[0], $times[0]],\n [2, $module->id, 2, 'Talkpoint 002', '', 'DEF456', 'webcam', 0, $times[1], $times[1]],\n [3, $module->id, 2, 'Talkpoint 003', 'foo.webm', null, 'file', 0, $times[2], $times[2]],\n [4, $module->id, 2, 'Talkpoint 004', 'foo.ogv', null, 'file', 0, $times[3], $times[3]],\n [5, $module->id, 2, 'Talkpoint 005', 'foo.mp4', null, 'file', 0, $times[4], $times[4]],\n [6, $module->id, $user->id, 'Talkpoint 006', 'bar.webm', null, 'file', 0, $times[5], $times[5]],\n ],\n 'talkpoint_video_conversion' => [\n ['talkpointid', 'src', 'dst', 'is_converting', 'timecreated'],\n [3, 'foo.webm', 'foo.webm.mp4', 1, $times[2]],\n [4, 'foo.ogv', 'foo.ogv.mp4', 0, $times[3]],\n [6, 'bar.webm', 'bar.webm.mp4', 0, $times[5]],\n ],\n ]));\n $this->_cut->set_userid($user->id);\n $talkpoints = $this->_cut->get_all_viewable_by_instanceid($module->id);\n $this->assertCount(4, $talkpoints);\n $this->assertEquals(6, $talkpoints[0]['id']);\n $this->assertEquals(5, $talkpoints[1]['id']);\n $this->assertEquals(1, $talkpoints[2]['id']);\n $this->assertEquals(2, $talkpoints[3]['id']);\n }",
"public function testWebSearchForSite()\n {\n $webResultSet = $this->_yahoo->webSearch('php', ['site' => 'www.php.net']);\n\n $this->assertTrue($webResultSet instanceof Zend_Service_Yahoo_WebResultSet);\n\n $this->assertTrue($webResultSet->totalResultsAvailable > 10);\n $this->assertEquals(10, $webResultSet->totalResultsReturned);\n $this->assertEquals(10, $webResultSet->totalResults());\n $this->assertEquals(1, $webResultSet->firstResultPosition);\n\n foreach ($webResultSet as $webResult) {\n $this->assertTrue($webResult instanceof Zend_Service_Yahoo_WebResult);\n }\n }",
"public function testRecordingListPage(): void\n {\n $recordingListPage = self::$recordingListPage;\n\n $this->assertInstanceOf(RecordingListPage::class, $recordingListPage);\n $this->assertSame(25, count($recordingListPage));\n\n $recording = $recordingListPage[0];\n\n $this->assertInstanceOf(Recording::class, $recording);\n }",
"public function test_instances_route() {\n global $DB;\n\n // create a user\n $user = $this->getDataGenerator()->create_user();\n\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // enrol the user on the course\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $DB->get_field('role', 'id', array(\n 'shortname' => 'student',\n )));\n\n // create a handful of modules within the course\n foreach (range(1, 5) as $i) {\n $module = $this->getDataGenerator()->create_module('talkpoint', array(\n 'course' => $course->id,\n ));\n }\n\n // login the user\n $this->setUser($user);\n\n // request the page\n $client = new Client($this->_app);\n $client->request('GET', '/instances/' . $course->id);\n $this->assertTrue($client->getResponse()->isOk());\n\n // check the page content\n foreach (range(1, 5) as $i) {\n $this->assertContains('Talkpoint ' . $i, $client->getResponse()->getContent());\n }\n $this->assertNotContains('Talkpoint 6', $client->getResponse()->getContent());\n }",
"public function testListTasksInstanceIdentityLinks()\n {\n }",
"public function testSiteSchedule()\n {\n \t$siteSchedule = factory(Site::class)->create();\n $this->be($this->employees[1], 'admin');\n\n $this->get('admin/site/'. $siteSchedule->id_site)->assertStatus(200);\n\n //Employee can create schedule\n //Submit invalid form\n $this->post('/schedule' , array('id_site' => $siteSchedule->id_site))\n\t\t\t\t->assertRedirect('/admin/site/'. $siteSchedule->id_site)\n\t\t\t\t->assertSessionHasErrors();\n\t\tsession()->forget('errors');\n\n\t\t$this->post('/schedule' , array('id_site' => $siteSchedule->id_site, 'day'=>1, 'hour_opening'=> 'date', 'hour_closing' => '17:00'))\n\t\t\t\t->assertRedirect('/admin/site/'. $siteSchedule->id_site)\n\t\t\t\t->assertSessionHasErrors();\n\t\tsession()->forget('errors');\n\n\t\t$this->post('/schedule' , array('id_site' => $siteSchedule->id_site, 'day'=>1, 'hour_opening'=> '18:00', 'hour_closing' => '17:00'))\n\t\t\t\t->assertRedirect('/admin/site/'. $siteSchedule->id_site)\n\t\t\t\t->assertSessionHasErrors();\n\t\tsession()->forget('errors');\n\n\t\tfor ($i = 0 ; $i < 7 ; $i++)\n\t\t{ \n\t\t\n\t\t\t//Submit valid form\n\t\t\t$this->post('/schedule' , array('id_site' => $siteSchedule->id_site, 'day'=> $i, 'hour_opening'=> '0'.$i.':00', 'hour_closing' => ($i+10).':00'))\n\t\t\t\t->assertRedirect('/admin/site/'. $siteSchedule->id_site)\n\t\t\t\t->assertSessionHas('ok', 'L\\'horaire a été créé.');\n\t\t\tsession()->forget('ok');\n\t\t\t$this->assertDatabaseHas('site_schedules', array('day' => $i, 'hour_opening'=> '0'.$i.':00', 'hour_closing' => '0'.($i+10).':00'));\n\n \t//See schedule in list\n \t$this->get('admin/site/'. $siteSchedule->id_site)->assertSeeText($i.':00')->assertSeeText(($i+10).':00');\n\n \t//Delete the schedule\n \t\t$this->delete('schedule/'.($i+1))->assertRedirect('admin/site/'. $siteSchedule->id_site)->assertSessionHas('ok','L\\'horaire a été supprimé.');\n \t\tsession()->forget('ok');\n \t\t$this->assertDatabaseMissing('site_schedules', array('day' => $i, 'hour_opening'=> '0'.$i.':00', 'hour_closing' => '0'.($i+10).':00'));\n\n \t//Don't see the schedule anymore in the list\n \t\t$this->get('admin/site/'. $siteSchedule->id_site)->assertDontSeeText($i.':00')->assertDontSeeText(($i+10).':00');\n\n\t\t}\n\n Auth::logout();\n $this->be($this->user, 'web');\n\n //Normal user can't create nor destroy a schedule\n //Submit invalid form\n $this->post('/schedule' , array('id_site' => $siteSchedule->id_site))\n\t\t\t\t->assertRedirect('/admin/login')\n\t\t\t\t->assertSessionMissing('errors');\n\n\t\t//Submit valid form\n\t\t$this->post('/schedule' , array('id_site' => $siteSchedule->id_site, 'day'=> 2, 'hour_opening'=> '02:00', 'hour_closing' => '10:00'))\n\t\t\t->assertRedirect('/admin/login')\n\t\t\t->assertSessionMissing('ok');\n\t\tsession()->forget('ok');\n\t\t$this->assertDatabaseMissing('site_schedules', array('day' => 2, 'hour_opening'=> '02:00', 'hour_closing' => '10:00'));\n\n\t\t$schedule = factory(Schedule::class)->create(['id_site' => $siteSchedule->id_site]);\n\t\t$this->delete('schedule/'. $schedule->id_schedule)->assertRedirect('admin/login')->assertSessionMissing('ok');\n\n Auth::logout();\n\n //Unauthenticated user can't create nor destroy a schedule\n //Submit invalid form\n $this->post('/schedule' , array('id_site' => $siteSchedule->id_site))\n\t\t\t\t->assertRedirect('/admin/login')\n\t\t\t\t->assertSessionMissing('errors');\n\n\t\t//Submit valid form\n\t\t$this->post('/schedule' , array('id_site' => $siteSchedule->id_site, 'day'=> 2, 'hour_opening'=> '02:00', 'hour_closing' => '10:00'))\n\t\t\t->assertRedirect('/admin/login')\n\t\t\t->assertSessionMissing('ok');\n\t\tsession()->forget('ok');\n\t\t$this->assertDatabaseMissing('site_schedules', array('day' => 2, 'hour_opening'=> '02:00', 'hour_closing' => '10:00'));\n\n\t\t$schedule = factory(Schedule::class)->create(['id_site' => $siteSchedule->id_site]);\n\t\t$this->delete('schedule/'. $schedule->id_schedule)->assertRedirect('admin/login')->assertSessionMissing('ok');\n\n //Access test\n $this->be($this->employees[2], 'admin');\n $this->post('/schedule' , array('id_site' => $siteSchedule->id_site, 'day'=> 3, 'hour_opening'=> '22:00', 'hour_closing' => '23:00'))\n ->assertRedirect('/admin/site/'. $siteSchedule->id_site)\n ->assertSessionHas('ok', 'L\\'horaire a été créé.');\n session()->forget('ok');\n $this->assertDatabaseHas('site_schedules', array('day' => 3, 'hour_opening'=> '22:00', 'hour_closing' => '23:00'));\n\n Auth::logout();\n\n for ($i = 0; $i < 4 ; $i++) { \n if($i == 1 || $i == 2) continue;\n\n $this->be($this->employees[$i], 'admin');\n\n $this->post('/schedule' , array('id_site' => $siteSchedule->id_site, 'day'=> 3, 'hour_opening'=> '22:10', 'hour_closing' => '23:10'))\n ->assertStatus(403)\n ->assertSessionMissing('ok');\n $this->assertDatabaseMissing('site_schedules', array('day' => 3, 'hour_opening'=> '22:10', 'hour_closing' => '23:10'));\n\n\n Auth::logout();\n }\n }",
"public function testGetSite()\n {\n }",
"public function testViewPosts()\n {\n $posts = factory(\\App\\Models\\Post::class, 22)->create();\n $this->browse(function (Browser $browser) use ($posts) {\n $title = $this->faker->sentence();\n $browser->visit(\"/\")\n ->assertSee($posts[0]->title)\n ->assertSee($posts[19]->title)\n ->visit(\"/?page=2\")\n ->assertSee($posts[20]->title)\n ->assertSee($posts[21]->title)\n ->screenshot(\"testViewPosts\");\n });\n }",
"public function testGetChallengeActivities()\n {\n }",
"function test_cinesport_embed_shortcode_works() {\n\t\t//Videos\n\t\t$content = '[cinesport url=\"http://cinesport.boston.com/boston-globe-sports/manning-reflects-win-over-brady-pats/\"]';\n\t\t$output = do_shortcode( $content );\n\t\t$this->assertEquals( '<div class=\"content-media__video content-media__video--cinesport\"><iframe frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" src=\"http://cinesport.boston.com/embed/boston-globe-sports/manning-reflects-win-over-brady-pats/#autostart=on;titles=on;nolink=on;\"></iframe></div>', $output );\n\n\t\t// Bad URL should return nothing\n\t\t$content = '[cinesport url=\"https://boston.com\"]';\n\t\t$output = do_shortcode( $content );\n\t\t$this->assertEquals( '', $output );\n\t}",
"public function testPastEvents()\n {\n // otherwise test will fail.\n // Other approach is to use fake data or mock it.\n \n $response = $this->json('GET', '/events/expired');\n \n $response\n ->assertStatus(200)\n ->assertJson([\n ['name' => 'Fashion Show']\n ]);\n }",
"public function testBlacklistFromShowPage(): void {\n // go to the show page of the second item.\n $crawler = $this->logInSuperAdmin();\n $client = $this->getClient();\n $crawler = $client->click($crawler->filter(\"#navbar\")->selectLink(\"Gestion des contacts\")->link());\n $tbodyRow = $crawler->filter(\"#contacts-container > table > tbody > tr\");\n $crawler = $client->click($tbodyRow->eq(1)->children()->eq(5)->filter(\"ul > li\")->selectLink(\"Voir les détails\")->link());\n\n // Verify if the blacklist button is displayed and submit the form.\n $actionButtons = $crawler->filter(\"#admin-container .card .actions\")->children();\n $this->count(3, $actionButtons, \"1.1. Two action buttons are expected.\");\n $this->assertContains(\"Ip sur liste noire\", $actionButtons->eq(2)->text(), \"1.2. The label of the third button is not ok.\");\n $this->assertContains('<i class=\"fas fa-user-slash\"></i>', $actionButtons->eq(2)->html(), \"1.3. The icon of the third button is not ok.\");\n\n // blacklist the message ip and verify the result\n $client->submit($actionButtons->eq(2)->selectButton('Ip sur liste noire')->form());\n $crawler = $client->followRedirect();\n $this->assertEquals(200, $this->getClient()->getResponse()->getStatusCode(), \"2.1 The status code expected is not ok.\");\n $this->assertEquals(\"/sadmin/contact\", $client->getRequest()->getRequestUri(), \"2.2 The request uri expected is not ok.\");\n $this->assertNotNull($crawler->filter(\"#admin-container .message-container\"), \"2.3 The message container is missing\");\n $this->assertCount(1, $crawler->filter(\"#admin-container .message-container .alert-success\"), \"2.4 One success message is expected\");\n $this->assertRegExp(\"~L'ip \\\"[0-9\\.]+\\\" a été blacklistée avec succès !~\", $crawler->filter(\"#admin-container .message-container .alert-success\")->text(),\n \"2.5 The success message is not ok\");\n $tbodyRow = $crawler->filter(\"#contacts-container > table > tbody > tr\");\n $this->assertContains('<i class=\"fas fa-user-slash\"></i>', $tbodyRow->eq(1)->children()->eq(3)->html(), \"2.6 The blacklisted icon is not expected\");\n $this->assertCount(2, $tbodyRow->eq(1)->children()->eq(5)->filter(\"ul > li\"), \"2.7 Two actions button are expected\");\n }",
"public function testAjaxGetVenueListCanBeAccessed()\n {\n $this->dispatch('/venue/ajax-get-venue-list');\n $this->assertResponseStatusCode(200);\n }",
"public function testShowListSuccessfully(): void\n {\n $list = $this->createList(static::$listData);\n\n $this->get(\\sprintf('/mailchimp/lists/%s', $list->getId()));\n $content = \\json_decode($this->response->content(), true);\n\n $this->assertResponseOk();\n\n self::assertArrayHasKey('list_id', $content);\n self::assertEquals($list->getId(), $content['list_id']);\n\n foreach (static::$listData as $key => $value) {\n self::assertArrayHasKey($key, $content);\n self::assertEquals($value, $content[$key]);\n }\n }",
"public function testJobListFromJobSchedule()\n {\n\n }",
"protected function recentTestInstanceExists() {}",
"public function testPastSameEmbargoExpiry()\n {\n $page = $this->objFromFixture(SiteTree::class, 'pastSameEmbargoExpiry');\n\n $page = $this->finishWorkflow($page);\n\n $this->assertEquals(0, $page->PublishJobID);\n $this->assertEquals(0, $page->UnPublishJobID);\n }",
"public function testRun4(){\n\t\t$param = $this->urlParam;\n\n\t\t$listItem = $this->listItems('newsletterCampaignEntry');\n\t\t$this->assertNotNull($listItem->list->attributes);\n\n\t\t$param['{params}'] = \"?get_key={$listItem->uniqueId}\";\n\t\t$this->assertTrackCampaignClick($listItem,$param,$listItem->uniqueId);\n\t\t// It should have exited without doing anything else.\n\t\t$this->assertNoTrackGeneric();\n\t}",
"public function testProfilePrototypeCreateLikes()\n {\n\n }",
"function testSeriesEpisode(): void\n {\n // https://www.imdb.com/title/tt0708758/\n\n // get German version.\n Global $config;\n $config['http_header_accept_language'] = 'de-DE,en;q=0.9';\n\n $id = '0708758';\n $data = engineGetData($id, 'imdb', false);\n\n $this->assertNotEmpty($data);\n // $this->printData($data);\n\n $this->assertEquals(1, $data['istv']);\n $this->assertEquals('0092455', $data['tvseries_id']);\n $this->assertEquals('Raumschiff Enterprise: Das nächste Jahrhundert', $data['title']);\n $this->assertEquals('Q Who', $data['subtitle']);\n $this->assertEquals('1989', $data['year']);\n $this->assertMatchesRegularExpression('#https://m.media-amazon.com/images/M/.+?.jpg#', $data['coverurl']);\n $this->assertEquals('Rob Bowman', $data['director']);\n $this->assertTrue($data['rating'] >= 8);\n $this->assertTrue($data['rating'] <= 9);\n $this->assertEquals('Vereinigte Staaten', $data['country']);\n $this->assertEquals('englisch', $data['language']);\n $this->assertEquals('Action, Abenteuer, Science-Fiction', join(', ', $data['genres']));\n\n $cast = explode(\"\\n\", $data['cast']);\n\n $this->assertTrue(in_array('Patrick Stewart::Captain Jean-Luc Picard::imdb:nm0001772', $cast));\n $this->assertTrue(in_array(\"Jonathan Frakes::Commander William Thomas 'Will' Riker::imdb:nm0000408\", $cast));\n $this->assertTrue(in_array('Marina Sirtis::Counselor Deanna Troi::imdb:nm0000642', $cast));\n $this->assertTrue(in_array('John de Lancie::Q (as John deLancie)::imdb:nm0209496', $cast));\n $this->assertTrue(in_array('Rob Bowman::Borg (voice) (uncredited)::imdb:nm0101385', $cast));\n\n $this->assertTrue(sizeof($cast) > 15);\n $this->assertTrue(sizeof($cast) < 30);\n\n $this->assertEquals(46, $data['runtime']);\n\n $this->assertMatchesRegularExpression('/Q bewirbt sich als Crewmitglied, wird aber von Picard abgewiesen./', $data['plot']);\n }",
"public function testMovieStatus()\n {\n // Find from back date so that results are returned\n $response = $this->get('/api/movies?genre=Animation&showTime=2018-02-01T00:09:00');\n $response->assertStatus(200);\n }",
"public function testIndexAction()\n {\n $this->url('http://localhost/hacker-news/index.php');\n $this->assertEquals('Hacker News - Github', $this->title());\n }",
"public function testProfilePrototypeCreateReviews()\n {\n\n }",
"public function testPageShow()\n {\n $page = Page::inRandomOrder()->first();\n $response = $this->actingAs(User::inRandomOrder()->first(), 'api')->json('GET', '/api/pages/' . $page->slug);\n $response\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n \"name\",\n \"id\",\n \"slug\",\n ],\n 'links' => [\n \"self\",\n ],\n 'relationships' => [\n \"body\" => [\n \"links\" => [\n \"self\",\n ],\n \"data\" => [\n \"type\",\n \"content\",\n ],\n ],\n\n ],\n ]);\n }",
"public function create()\n {\n //\n //First crawl the \"Soccerway\" home-page.\n $crawler = $this->client->request('GET', 'https://us.soccerway.com');\n $crawler->filter('th[class=\"competition-link\"] > a[href*=\"regular-season\"]')->each(function($node){\n //Try: $crawler->filter('th[class=\"competition-link\"] > a:not(a[href*=\"group\"], a[href*=\"final\"], a[href*=\"cup\"])')->each(function($node){\n //$node->attr('href');\n\n //get matches for each link\n $compLink = $this->append.$node->attr('href');\n $crawler1 = $this->client->request('GET', $compLink);\n $crawler1->filter(\"a[href^=\\\"/matches/$this->myDate\\\"][href*=\\\"ICID\\\"]\")->each(function ($node){\n //i added this parameter into the filter which i believe directed to many irrelevant pages: , a[href^=\\\"/national/\\\"][href*=\\\"ICID\\\"]\n\n //go to the match url\n $matches = $this->append.$node->attr('href');\n $matches = $this->client->request('GET', $matches);\n $matches->filter(\"a[href^=\\\"/matches/$this->myDate\\\"][href$=\\\"head2head/\\\"]\")->each(function($node){\n \n //go to head2head page, get the data and save into database\n $numbers = new Numbers;\n \n $head2head = $this->append.$node->attr('href');\n //database url\n $numbers->URL = $head2head;\n \n $head2head = $this->client->request('GET', $head2head);\n $H_MP = $head2head->filterXPath('//*[@id=\"page_match_1_block_h2hsection_team_9_block_h2h_general_statistics_1\"]/table/tbody/tr[2]/td[2]')->each(function($node){\n //echo \"Home team average matches played: \".$node->text().\"<br>\";\n return trim($node->text());\n });\n $numbers->Home_MP = $H_MP[0];\n \n $A_MP = $head2head->filterXPath('//*[@id=\"page_match_1_block_h2hsection_team_9_block_h2h_general_statistics_1\"]/table/tbody/tr[2]/td[6]')->each(function($node){\n //echo \"Away team average matches played: \".$node->text().\"<br>\";\n return trim($node->text());\n }); \n $numbers->Away_MP = $A_MP[0];\n \n $H_AGS = $head2head->filterXPath('//*[@id=\"page_match_1_block_h2hsection_team_9_block_h2h_general_statistics_1\"]/table/tbody/tr[10]/td[2]')->each(function($node){\n //echo \"Home team average goals scored: \".$node->text().\"<br>\";\n return trim($node->text());\n });\n $numbers->Home_AGS = $H_AGS[0];\n \n $A_AGS = $head2head->filterXPath('//*[@id=\"page_match_1_block_h2hsection_team_9_block_h2h_general_statistics_1\"]/table/tbody/tr[10]/td[6]')->each(function($node){\n //echo \"Away team average goals scored: \".$node->text().\"<br>\";\n return trim($node->text());\n });\n $numbers->Away_AGS = $A_AGS[0]; \n \n $H_AGC = $head2head->filterXPath('//*[@id=\"page_match_1_block_h2hsection_team_9_block_h2h_general_statistics_1\"]/table/tbody/tr[11]/td[2]')->each(function($node){\n //echo \"Home team average goals conceded: \".$node->text().\"<br>\";\n return trim($node->text());\n });\n $numbers->Home_AGC = $H_AGC[0];\n \n $A_AGC = $head2head->filterXPath('//*[@id=\"page_match_1_block_h2hsection_team_9_block_h2h_general_statistics_1\"]/table/tbody/tr[11]/td[6]')->each(function($node){\n //echo \"Away team average goals conceded: \".$node->text().\"<br>\";\n return trim($node->text());\n });\n\n $numbers->Away_AGC = $A_AGC[0];\n\n $numbers->save();\n \n //echo \"<br> <br>\";\n \n });\n });\n\n\n });\n \n \n \n return view('home');\n }",
"public function testGetInstitutionsUsingGET()\n {\n }",
"public function test_admin_tribe_list()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/Assignments', 'tribe_list']);\n $this->assertResponseCode(404);\n }",
"public function testLeaseCalendarFrontEnd()\n {\n $this->get(route('lease.calendar'))->assertStatus(200);\n }",
"public function testLeaseIndexFrontEnd()\n {\n $this->get(route('lease'))->assertStatus(200);\n }",
"public function testProfilePrototypeGetReviews()\n {\n\n }",
"public function testIndex()\n {\n $this->browse(function (Browser $browser) {\n $bill_1 = Bill::factory()->create(['contract_id' => $this->contract->id, 'tenant_id' => $this->tenant->id]);\n $bill_2 = Bill::factory()->create(['contract_id' => $this->contract->id, 'tenant_id' => $this->tenant->id]);\n\n $browser->loginAs($this->user)\n ->visit('/tenants/'.$this->tenant->id.'?tab=bills#tab')\n ->assertSee($bill_1->number)\n ->assertSee($bill_2->number);\n });\n }",
"public function authorizedTest(WebTestCase $webTestCase);",
"public function testGetSiteMembershipForPerson()\n {\n }",
"public function test_all_movies_list_should_be_accessible()\n {\n $response=$this->get(route('index.movies'));\n $response->assertStatus(Response::HTTP_OK);\n }",
"public function testStands()\n {\n // otherwise test will fail.\n // Other approach is to use fake data or mock it.\n \n $response = $this->json('GET', '/events/1');\n \n $response\n ->assertStatus(200)\n ->assertJson([\n ['name' => 'Stand Alpha']\n ]);\n }",
"public function testAutoreportDaily()\n {\n echo \"\\n ---- Page : autoreport/daily ---- \\n\";\n $response = $this->visit('autoreport/daily');\n $this->assertResponseStatus($response->response->getStatusCode());\n echo \"Response is \". $response->response->getStatusCode();\n echo \"\\n\";\n }",
"function testSeriesEpisode2(): void\n {\n // https://www.imdb.com/title/tt0359476\n\n // get English version.\n Global $config;\n $config['http_header_accept_language'] = 'en-US,en;q=0.9';\n\n $id = '0359476';\n $data = engineGetData($id, 'imdb', false);\n\n $this->assertNotEmpty($data);\n // $this->printData($data);\n\n $this->assertEquals(1, $data['istv']);\n $this->assertEquals('0988820', $data['tvseries_id']);\n $this->assertEquals('The Inspector Lynley Mysteries', $data['title']);\n $this->assertEquals('Playing for the Ashes', $data['subtitle']);\n $this->assertMatchesRegularExpression('/200\\d/', $data['year']);\n $this->assertMatchesRegularExpression('#https://m.media-amazon.com/images/M/.+?.jpg#', $data['coverurl']);\n $this->assertEquals('Richard Spence', $data['director']);\n $this->assertTrue($data['rating'] >= 5);\n $this->assertTrue($data['rating'] <= 8);\n $this->assertEquals('United Kingdom', $data['country']);\n $this->assertEquals('english', $data['language']);\n $this->assertEquals( 'Crime, Drama, Mystery', join(', ', $data['genres']));\n\n $cast = explode(\"\\n\", $data['cast']);\n\n $this->assertTrue(in_array('Clare Swinburne::Gabriella Patten::imdb:nm0842673', $cast));\n $this->assertTrue(in_array('Mark Anthony Brighton::Kenneth Waring (as Mark Brighton)::imdb:nm1347940', $cast));\n $this->assertTrue(in_array('Nathaniel Parker::Thomas Lynley::imdb:nm0662511', $cast));\n $this->assertTrue(in_array('Andrew Clover::Hugh Patten::imdb:nm0167249', $cast));\n $this->assertTrue(in_array('Anjalee Patel::Hadiyyah::imdb:nm1347125', $cast));\n $this->assertTrue(sizeof($cast) > 12);\n $this->assertTrue(sizeof($cast) < 30);\n\n $this->assertMatchesRegularExpression('/Lynley seeks the help of profiler Helen Clyde when he investigates the asphyxiation death of superstar cricketer with a dysfunctional personal life./', $data['plot']);\n }",
"public function test_index()\n {\n Instrument::factory(2)->create();\n $response = $this->get('instrument');\n $response->assertStatus(200);\n }",
"public function testGetViewingHistory()\n\t{\n\t\t$this->be(User::first());\n\t\t$video_id = Video::first()->id;\n\t\t$response = $this->action('GET', 'ApiViewingHistoryController@getIndex',[],['video_id' => $video_id]);\n\t\t\n\t\t$this->assertInstanceOf('Illuminate\\Http\\JsonResponse', $response);\n\t\t$this->assertResponseOk();\n\t}",
"public function test_user_can_view_a_published_concert_listings()\n {\n // Arrange\n $concert = factory(Concert::class)->states('published')->create([\n 'date' => Carbon::parse('December 1, 2017 8:00pm'),\n ]);\n\n // Act\n $this->browse(function (Browser $browser) use ($concert) {\n // Assert\n $browser->visit(\"/concerts/{$concert->id}\")\n ->assertSee($concert->title)\n ->assertSee($concert->subtitle)\n ->assertSee('December 1, 2017')\n ->assertSee('8:00pm')\n ->assertSee('20.00')\n ->assertSee($concert->venue)\n ->assertSee($concert->venue_address)\n ->assertSee($concert->city)\n ->assertSee($concert->state)\n ->assertSee($concert->zip)\n ->assertSee($concert->additional_information);\n });\n }",
"public function testIsOnTasksListPage()\n {\n $this->addTestFixtures();\n $this->logInAsUser();\n $this->client->request('GET', '/tasks');\n\n $response = $this->client->getResponse();\n $responseContent = $response->getContent();\n\n $statusCode = $response->getStatusCode();\n $this->assertEquals(200, $statusCode);\n $this->assertContains($this->task->getTitle(), $responseContent);\n $this->assertContains($this->task->getContent(), $responseContent);\n }",
"public function testIndexActionCanBeAccessed()\n {\n $this->dispatch('/venue');\n $this->assertResponseStatusCode(200);\n }",
"public function testTaskVisibleOnPage(): void\n {\n $this->client->request('GET', '/');\n self::assertResponseIsSuccessful();\n self::assertSelectorTextContains('.widget-heading', 'Test Task');\n self::assertSelectorTextContains('.widget-subheading', 'Mike');\n }",
"public function testProfilePrototypeGetPosts()\n {\n\n }",
"public function testGetSiteMembership()\n {\n }",
"public function testGetWaiversDefault()\n {\n $numWaivers = 5;\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, APISuccessResponses::waivers($numWaivers));\n\n $waivers = $sw->getWaiverSummaries();\n\n $this->assertCount($numWaivers, $waivers);\n foreach($waivers as $waiver) {\n $this->assertInstanceOf(SmartwaiverWaiverSummary::class, $waiver);\n }\n\n $this->checkGetRequests($container, ['/v4/waivers?limit=20']);\n }",
"public function testGetWaiversDefault()\n {\n $numWaivers = 5;\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, APISuccessResponses::waivers($numWaivers));\n\n $waivers = $sw->getWaiverSummaries();\n\n $this->assertCount($numWaivers, $waivers);\n foreach($waivers as $waiver) {\n $this->assertInstanceOf(SmartwaiverWaiverSummary::class, $waiver);\n }\n\n $this->checkGetRequests($container, ['/v4/waivers?limit=20']);\n }",
"public function testConnection() {\n\t\t/** @var Thrive_Dash_Api_WebinarJamStudio $api */\n\t\t$api = $this->getApi();\n\t\t/**\n\t\t * just try getting the list of the webinars as a connection test\n\t\t */\n\t\ttry {\n\t\t\t$api->getUpcomingWebinars(); // this will throw the exception if there is a connection problem\n\t\t} catch ( Thrive_Dash_Api_WebinarJamStudio_Exception $e ) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\n\t\treturn true;\n\t}",
"public function testCreateSiteMembership()\n {\n }",
"public function testGetTaskInstanceIdentityLinks()\n {\n }",
"public function testGetTimesheets()\n {\n }",
"public function testUpcomingEvents()\n {\n // otherwise test will fail.\n // Other approach is to use fake data or mock it.\n \n $response = $this->json('GET', '/events');\n \n $response\n ->assertStatus(200)\n ->assertJson([\n ['name' => 'IT Expo']\n ]);\n }",
"public function testProfilePrototypeCreatePosts()\n {\n\n }",
"public function test_example()\n {\n $response = $this->get('/futureevents');\n $response->assertStatus(200)\n ->assertJsonCount(2)\n ->assertJsonPath('0.name', 'Laravel convention 2021')\n ->assertJsonPath('0.workshops.0.name', 'The new Eloquent - load more with less')\n ->assertJsonPath('0.workshops.1.name', 'AutoEx - handles exceptions 100% automatic')\n ->assertJsonPath('1.name', 'React convention 2021')\n ->assertJsonPath('1.workshops.0.name', '#NoClass pure functional programming')\n ->assertJsonPath('1.workshops.1.name', 'Navigating the function jungle');\n }",
"public function testPastEmbargoAfterExpiry()\n {\n $page = $this->objFromFixture(SiteTree::class, 'pastEmbargoAfterExpiry');\n\n $page = $this->finishWorkflow($page);\n\n $this->assertEquals(0, $page->PublishJobID);\n $this->assertEquals(0, $page->UnPublishJobID);\n }",
"public function videoListDisplayed(AcceptanceTester $I)\n {\n $I->wantTo('Verify Video List is displayed on the Edit Episode page. - C15640');\n if(EpisodeEditCest::$environment == 'staging')\n {\n $guid = TestContentGuids::$episodeViewData_staging;\n }\n else //proto0\n {\n $guid = TestContentGuids::$episodeViewData_proto0;\n }\n $I->amOnPage(ContentPage::$contentUrl . $guid);\n\n $I->expect('Video List is displayed.');\n $I->waitForElementVisible(ContentPage::$clickableTable, 30);\n $I->see('VIDEOS');\n $I->see('series_view_filled_data_automation_1_episode_1_media_id', ContentPage::$videoTable);\n }"
] | [
"0.75248724",
"0.71009386",
"0.70813674",
"0.66979647",
"0.6605723",
"0.63274664",
"0.6326167",
"0.620112",
"0.6040194",
"0.5924122",
"0.5862991",
"0.58378124",
"0.57749337",
"0.57353455",
"0.5725397",
"0.55372953",
"0.5521609",
"0.5470786",
"0.541347",
"0.53778094",
"0.5348435",
"0.53157437",
"0.5310557",
"0.5295312",
"0.5259259",
"0.52124864",
"0.52067626",
"0.5186865",
"0.51709443",
"0.5167423",
"0.51659095",
"0.5144777",
"0.5135171",
"0.51097214",
"0.50923747",
"0.50850976",
"0.5080613",
"0.505581",
"0.50454754",
"0.5043208",
"0.5038454",
"0.50069964",
"0.49949038",
"0.4986736",
"0.4978508",
"0.49529353",
"0.49508184",
"0.49283484",
"0.49145725",
"0.4896976",
"0.4892673",
"0.48839623",
"0.48685905",
"0.4861542",
"0.4850694",
"0.48383468",
"0.4833383",
"0.48242098",
"0.48215553",
"0.4790315",
"0.47817263",
"0.47803724",
"0.4773434",
"0.47732368",
"0.47659177",
"0.47656056",
"0.47625995",
"0.4761074",
"0.47545144",
"0.47515556",
"0.47514126",
"0.47488996",
"0.47407407",
"0.47346494",
"0.47345608",
"0.47308016",
"0.47281975",
"0.47267398",
"0.4719576",
"0.47169605",
"0.47127366",
"0.47099397",
"0.47088966",
"0.4701464",
"0.46999916",
"0.4698572",
"0.4688923",
"0.4686923",
"0.4684713",
"0.4682998",
"0.4682998",
"0.46796516",
"0.4678753",
"0.46750602",
"0.4673531",
"0.46700484",
"0.46628466",
"0.46624792",
"0.46563557",
"0.46518514"
] | 0.66735214 | 4 |
Test case for webinar Get a Webinar. | public function testWebinar()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testWebinarPollGet()\n {\n }",
"public function testWebinarRegistrantGet()\n {\n }",
"function citrixonline_get_webinar($webinarKey) \n {\n\t\tif(!$this->organizer_key or !$this->access_token)\n\t\t\treturn 0;\n\t\t\t\n\t\t$return_array = array();\n\n\t\t$reponse = json_decode($this->make_request(\"https://api.citrixonline.com/G2W/rest/organizers/\".$this->organizer_key.\"/webinars/\".$webinarKey.\"?oauth_token=\".$this->access_token), true);\n\t\t\n\t\tif(isset($reponse['int_err_code']) and $reponse['int_err_code'] != '')\n\t\t{\n\t\t\t$this->set_access_token('');\n\t\t\t$this->set_organizer_key('');\t\t\t\t\n\t\t\tthrow new Exception($reponse['int_err_code']);\n\t\t}\n\t\t\n\t\treturn $reponse;\n\t}",
"public function testWebinarStatus()\n {\n }",
"public function testWebinarPolls()\n {\n }",
"function getWebinar($webinarKey)\n {\n $path = $this->getPathRelativeToOrganizer(sprintf('webinars/%s', $webinarKey));\n\n return $this->sendRequest('GET', $path, $parameters = null, $payload = null);\n }",
"public function testWebinarRegistrantsQuestionsGet()\n {\n }",
"public function testWebinarCreate()\n {\n }",
"public function testGetInstitutionsUsingGET()\n {\n }",
"public function testWebinarUpdate()\n {\n }",
"public function testWebinarAbsentees()\n {\n }",
"public function testListPastWebinarPollResults()\n {\n }",
"public function testListPastWebinarQA()\n {\n }",
"public function testWebinarRegistrants()\n {\n }",
"public function testGetInstitutionUsingGET()\n {\n }",
"public function testWebinarPollCreate()\n {\n }",
"public function testWebinarRegistrantStatus()\n {\n }",
"public function index()\n {\n $webinar = Webinar::with('user')->get();\n return response()->json($webinar);\n \n }",
"public function testWebinarPollUpdate()\n {\n }",
"public function testWebinarDelete()\n {\n }",
"public function testGetPromotionCampaignApplicationUsingGET()\n {\n }",
"public function getEvent()\n {\n // get event\n $this\n ->get('/event')\n ->assertStatus(200);\n }",
"public function testWebinarRegistrantCreate()\n {\n }",
"public function testGetAccountScheduledPaymentsUsingGET()\n {\n }",
"public function testSingle() {\n $client = new Client();\n $request = $client->get('http://web/v1/combined/ibuprofen');\n $response = $request;\n $this->assertEquals(200, $response->getStatusCode());\n }",
"public function testWebinarPanelists()\n {\n }",
"public function testRentalCalendar()\n {\n $this->visit(route('rental.frontend-calendar'));\n $this->seeStatusCode(200);\n $this->see('Verhuur kalender.');\n }",
"public function testCurrentEvents()\n {\n // otherwise test will fail.\n // Other approach is to use fake data or mock it.\n \n $response = $this->json('GET', '/events/current');\n \n $response\n ->assertStatus(200)\n ->assertJson([\n ['name' => 'Electrical Seminar']\n ]);\n }",
"public function testListPastWebinarFiles()\n {\n }",
"public function testEventito(){\r\n\t\t$destino = Enhance::getCodeCoverageWrapper('EventosControllerClass');\r\n\t\t$destino->eventito();\r\n\t\t$this->call('GET', 'eventos');\r\n\t\t$this->assertResponseOk();\r\n\t}",
"public function testGetPromotionCampaignsUsingGET()\n {\n }",
"public function testLeaseCalendarFrontEnd()\n {\n $this->get(route('lease.calendar'))->assertStatus(200);\n }",
"public function show($id)\n {\n $webinar = Webinar::where('id', $id)->first();\n return response()->json($webinar);\n \n }",
"public function testWebinarPanelistCreate()\n {\n }",
"public function testGetWaiver()\n {\n $paths = [\n '/v4/waivers/6jebdfxzvrdkd?pdf=false',\n '/v4/waivers/6jebdfxzvrdkd?pdf=false',\n '/v4/waivers/6jebdfxzvrdkd?pdf=true',\n ];\n\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, APISuccessResponses::waiver(), count($paths));\n\n $waiver = $sw->getWaiver('6jebdfxzvrdkd');\n $this->assertInstanceOf(SmartwaiverWaiver::class, $waiver);\n\n $sw->getWaiver('6jebdfxzvrdkd', false);\n $sw->getWaiver('6jebdfxzvrdkd', true);\n\n $this->checkGetRequests($container, $paths);\n }",
"public function testGetWaiver()\n {\n $paths = [\n '/v4/waivers/6jebdfxzvrdkd?pdf=false',\n '/v4/waivers/6jebdfxzvrdkd?pdf=false',\n '/v4/waivers/6jebdfxzvrdkd?pdf=true',\n ];\n\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, APISuccessResponses::waiver(), count($paths));\n\n $waiver = $sw->getWaiver('6jebdfxzvrdkd');\n $this->assertInstanceOf(SmartwaiverWaiver::class, $waiver);\n\n $sw->getWaiver('6jebdfxzvrdkd', false);\n $sw->getWaiver('6jebdfxzvrdkd', true);\n\n $this->checkGetRequests($container, $paths);\n }",
"public function testDashboardGet()\n {\n $this->visit('/dashboard/articless')\n ->see('Nieuws');\n }",
"function getWebinarID($eventId) {\n\t$result;\n\t$customField = CRM_NcnCiviZoom_Utils::getWebinarCustomField();\n\ttry {\n\t\t$apiResult = civicrm_api3('Event', 'get', [\n\t\t 'sequential' => 1,\n\t\t 'return' => [$customField],\n\t\t 'id' => $eventId,\n\t\t]);\n\t\t$result = null;\n\t\tif(!empty($apiResult['values'][0][$customField])){\n\t\t\t// Remove any empty spaces\n\t\t\t$result = trim($apiResult['values'][0][$customField]);\n\t\t\t$result = str_replace(' ', '', $result);\n\t\t}\n\t} catch (Exception $e) {\n\t\tthrow $e;\n\t}\n\n\treturn $result;\n}",
"function getUpcomingWebinars()\n {\n $path = $this->getPathRelativeToOrganizer('upcomingWebinars');\n\n return $this->sendRequest('GET', $path, $parameters = null, $payload = null);\n }",
"public function testAPIWorking()\n\t{\t\t \n\t\t$data = $this->get(route('ride-data'));\n\t\t \n\t\tif (!empty($data))\n\t\t{\n\t\t\t$this->assertTrue(TRUE);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->assertTrue(FALSE);\n\t\t}\n\t}",
"public function Get_Bookings_Test()\n {\n $this->get('/bookings')->seeJson(['Test' => 'Test Data']);\n }",
"public function test_happy_flow_get()\n {\n $_SERVER['REQUEST_METHOD'] = 'GET';\n $_GET['sp-entity-id'] = 'http://mock-sp';\n\n $request = new Request($_GET, $_POST, [], [], [], $_SERVER);\n\n $this->assertTrue($this->validator->isValid($request));\n }",
"public function test_example()\n {\n $response = $this->get('/futureevents');\n $response->assertStatus(200)\n ->assertJsonCount(2)\n ->assertJsonPath('0.name', 'Laravel convention 2021')\n ->assertJsonPath('0.workshops.0.name', 'The new Eloquent - load more with less')\n ->assertJsonPath('0.workshops.1.name', 'AutoEx - handles exceptions 100% automatic')\n ->assertJsonPath('1.name', 'React convention 2021')\n ->assertJsonPath('1.workshops.0.name', '#NoClass pure functional programming')\n ->assertJsonPath('1.workshops.1.name', 'Navigating the function jungle');\n }",
"public function testIndexSurvey()\n {\n $year = 2018;\n Survey::factory()->create(['year' => $year]);\n\n $response = $this->json('GET', 'survey', ['year' => $year]);\n $response->assertStatus(200);\n $this->assertCount(1, $response->json()['survey']);\n }",
"public function testDemoteAutomatchUrlUsingGET()\n {\n }",
"public static function getType() {\n\t\treturn 'webinar';\n\t}",
"public function testWebinars()\n {\n }",
"public function testAuthenticationsInweboIdGet()\n {\n }",
"public function test_index()\n {\n Instrument::factory(2)->create();\n $response = $this->get('instrument');\n $response->assertStatus(200);\n }",
"public function testGetAccountPeriodicPaymentsUsingGET()\n {\n }",
"public function testGetEnrollmentRequest()\n {\n }",
"static public function getWebinarStatistics( DateTime $start, DateTime $end ) {\n $loc = __CLASS__ . '::' . __FUNCTION__;\n error_log($loc);\n error_log( print_r( $start, true ) );\n error_log( print_r( $end, true ) );\n \n global $wpdb;\n $sql = \"SELECT u.display_name as username\n , m.meta_key\n , m.meta_value as val\n FROM {$wpdb->prefix}usermeta m\n INNER JOIN {$wpdb->prefix}users u on u.ID = m.user_id\n where meta_key = '%s' \";\n $query = $wpdb->prepare( $sql, RecordUserWebinarProgress::META_KEY );\n $result = $wpdb->get_results( $query, ARRAY_A );\n\n $retval = array();\n foreach( Webinar::getWebinarDefinitions() as $webinar ) {\n $retval[$webinar['name']] = [RecordUserWebinarProgress::PENDING=>0\n ,RecordUserWebinarProgress::COMPLETED=>0];\n } \n // error_log(\"Webinar Definitions:\");\n // error_log( print_r($retval, true) ); \n // error_log(\"Query results:\");\n // error_log( print_r($result, true) ); \n\n error_log(\"Each query result:\");\n $ctr = 0;\n foreach( $result as $meta ) {\n ++$ctr;\n $webinars = maybe_unserialize( $meta['val'] );\n error_log( \"Meta value #{$ctr}:\" );\n error_log( print_r( $webinars, true ) );\n\n if( !is_array( $webinars ) ) continue;\n\n foreach( $webinars as $webinar ) {\n error_log( \"Webinar:\" );\n error_log( print_r( $webinar, true ) );\n $strStartDate = @$webinar['startDate'] ? $webinar['startDate'] : '1970-01-01';\n $strEndDate = @$webinar['endDate'] ? $webinar['endDate'] : $strStartDate;\n \n $webinarStartDate = DateTime::createFromFormat('Y-m-d', $strStartDate );\n if( false === $webinarStartDate ) {\n $webinarStartDate = DateTime::createFromFormat('d-m-Y', $strStartDate);\n if( false === $webinarStartDate ) {\n error_log( DateTime::getLastErrors(), \"Error processing start date\" );\n $webinarStartDate = DateTime::createFromFormat( 'Y-m-d', '1970-01-01');\n }\n }\n \n $webinarEndDate = DateTime::createFromFormat('Y-m-d', $strEndDate );\n if( false === $webinarEndDate ) {\n $webinarEndDate = DateTime::createFromFormat('d-m-Y', $strEndDate);\n if( false === $webinarEndDate ) {\n error_log( DateTime::getLastErrors(), \"Error processing end date\" );\n $webinarEndDate = $webinarStartDate;\n }\n }\n\n $showStart = $webinarStartDate->format('Y-m-d');\n $showEnd = $webinarEndDate->format('Y-m-d');\n error_log(\"Webinar start: {$showStart} end: {$showEnd}\");\n \n if( $webinarStartDate < $start || $webinarStartDate > $end ) continue;\n \n $status = @$webinar['status'] ? $webinar['status'] : RecordUserWebinarProgress::PENDING;\n switch( $status ) {\n case RecordUserWebinarProgress::COMPLETED:\n $retval[$webinar['name']][RecordUserWebinarProgress::COMPLETED]++;\n break;\n default:\n $retval[$webinar['name']][RecordUserWebinarProgress::PENDING]++;\n break;\n }\n }\n }\n error_log(\"Webinar Stats\");\n error_log( print_r( $retval, true ) );\n\n\t\treturn $retval;\n }",
"public function testAjaxGetVenueListCanBeAccessed()\n {\n $this->dispatch('/venue/ajax-get-venue-list');\n $this->assertResponseStatusCode(200);\n }",
"public function testWorkflowsGet()\n {\n }",
"public function show(){\n $interestId = request()->interest;\n $interest = Interest::find($interestId);\n if($interest){\n return new InterestResource($interest);\n }else{\n $response = new Response(['response'=>'This interest does not exist !!..']);\n return $response->setStatusCode(404);\n }\n }",
"public function testGetAllHospitals(){\r\n\t\t$this->http = new Client(['base_uri' => 'http://localhost/casecheckapp/public/index.php/']);\r\n\t\r\n\t\t//Test HTTP status ok\r\n\t\t$response= $this->http->request('GET','api/v1/hospitals');\r\n\t\t$this->assertEquals(200,$response->getStatusCode());\r\n\t\r\n\t\t//Test JSON content\r\n\t\t$contentType = $response->getHeaders()[\"Content-Type\"][0];\r\n\t\t$this->assertEquals(\"application/json\", $contentType);\r\n\t\r\n\t\t//Stopping the connexion with Guzzle\r\n\t\t$this->http = null;\r\n\t\r\n\t}",
"public function testUpcomingEvents()\n {\n // otherwise test will fail.\n // Other approach is to use fake data or mock it.\n \n $response = $this->json('GET', '/events');\n \n $response\n ->assertStatus(200)\n ->assertJson([\n ['name' => 'IT Expo']\n ]);\n }",
"function get_registrants_of_webinars($webinar_id=false) \n {\n\t\tif($webinar_id)\n\t\t{\n\t\t\tif(!$this->organizer_key or !$this->access_token)\n\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t$return_array = array();\n\t\t\t\n\t\t\t$return_array = json_decode($this->make_request(\"https://api.citrixonline.com/G2W/rest/organizers/\".$this->organizer_key.\"/webinars/{$webinar_id}/registrants?oauth_token=\".$this->access_token), true);\n\n\t\t\tif(isset($reponse['int_err_code']) and $reponse['int_err_code'] != '')\n\t\t\t{\n\t\t\t\t$this->set_access_token('');\n\t\t\t\t$this->set_organizer_key('');\t\t\t\t\n\t\t\t\tthrow new Exception($reponse['int_err_code']);\n\t\t\t}\n\t\t}\n\t\t\t\n return $return_array;\n\t}",
"public function testIndexActionGet()\n {\n $request = $this->di->get(\"request\");\n $request->setGet(\"ip\", \"8.8.8.8\");\n\n\n $res = $this->controller->indexActionGet();\n\n $body = $res->getBody();\n\n // var_dump($body);\n $this->assertInstanceOf(\"Anax\\Response\\ResponseUtility\", $res);\n $this->assertContains(\"Kolla vädret\", $body);\n }",
"public function testGetWaiverTemplate()\n {\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, APISuccessResponses::template());\n\n $template = $sw->getWaiverTemplate('TestingTemplateId');\n $this->assertInstanceOf(SmartwaiverTemplate::class, $template);\n\n $this->checkGetRequests($container, ['/v4/templates/TestingTemplateId']);\n }",
"public function testGetWaiverTemplate()\n {\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, APISuccessResponses::template());\n\n $template = $sw->getWaiverTemplate('TestingTemplateId');\n $this->assertInstanceOf(SmartwaiverTemplate::class, $template);\n\n $this->checkGetRequests($container, ['/v4/templates/TestingTemplateId']);\n }",
"public function testListEnrollmentRequests()\n {\n }",
"public function testGetAccountUsingGET()\n {\n }",
"public function testPromoteAutomatchUrlUsingGET()\n {\n }",
"public function testGetBrandsUsingGET()\n {\n }",
"public function testSearchUsingGET()\n {\n\n }",
"public function testGetFeatureDetailsUsingGET()\n {\n }",
"public function viewAction() {\n if (!Engine_Api::_()->core()->hasSubject('siteevent_organizer'))\n $this->respondWithError('unauthorized');\n\n $showEvents = $this->_getParam('showEvents', 1);\n $profileTabs = $this->_getParam('profileTabs', 1);\n $getInfo = $this->_getParam('getInfo', null);\n\n\n $viewtype = $this->_getParam('viewType', 'upcoming');\n\n //GET EVENT SUBJECT\n $organizer = Engine_Api::_()->core()->getSubject();\n if (empty($organizer)) {\n return $this->respondWithError('no_record');\n }\n $response = $organizer->toArray();\n\n $suffix = '';\n if (strpos($response['web_url'], \"http\") === false)\n $suffix = \"http://\";\n if (isset($response['facebook_url']) && !empty($response['facebook_url']))\n $response['facebook_url'] = 'https://facebook.com/' . $response['facebook_url'];\n if (isset($response['twitter_url']) && !empty($response['twitter_url']))\n $response['twitter_url'] = 'https://twitter.com/' . $response['twitter_url'];\n if (isset($response['web_url']) && !empty($response['web_url']))\n $response['web_url'] = $suffix . $response['web_url'];\n\n $contentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($organizer);\n $response = array_merge($response, $contentImages);\n $response['countOrganizedEvent'] = $organizer->countOrganizedEvent();\n $response['addedBy'] = $organizer->getOwner()->displayname;\n\n if (isset($getInfo) && !empty($getInfo)) {\n $getInfoArray['Added By'] = $response['addedBy'];\n $getInfoArray['Events Hosted '] = $organizer->countOrganizedEvent();\n\n $allowedInfo = Engine_Api::_()->getApi('settings', 'core')->getSetting('siteevent.hostinfo', array('body', 'sociallinks'));\n\n if (in_array('body', $allowedInfo)) {\n if (isset($response['description']) && !empty($response['description']))\n $getInfoArray['Description'] = strip_tags($response['description']);\n }\n\n if (in_array('sociallinks', $allowedInfo)) {\n if (isset($response['facebook_url']) && !empty($response['facebook_url']))\n $getInfoArray['Facebook URL'] = $response['facebook_url'];\n if (isset($response['twitter_url']) && !empty($response['twitter_url']))\n $getInfoArray['Twitter URL'] = $response['twitter_url'];\n if (isset($response['web_url']) && !empty($response['web_url']))\n $getInfoArray['Web URL'] = $response['web_url'];\n }\n\n $ratingEnable = Engine_Api::_()->getApi('settings', 'core')->getSetting('siteevent.reviews', 2);\n if ($ratingEnable) {\n $tempRating = Engine_Api::_()->getDbtable('events', 'siteevent')->avgTotalRating(\n array('host_type' => $organizer->getType(), 'host_id' => $organizer->getIdentity(), 'more_than' => 0));\n\n // Added variable for rating to show rating bar\n if (_CLIENT_TYPE && ((_CLIENT_TYPE == 'ios') && _IOS_VERSION && _IOS_VERSION >= '1.5.3') || (_CLIENT_TYPE == 'android') && _ANDROID_VERSION && _ANDROID_VERSION >= '1.7') {\n if (isset($tempRating) && !empty($tempRating))\n $getInfoArray['total_rating'] = $tempRating;\n } else {\n if (isset($tempRating) && !empty($tempRating))\n $getInfoArray['Total Rating'] = $tempRating;\n }\n }\n\n // Added variable for description to show full description\n if (_CLIENT_TYPE && ((_CLIENT_TYPE == 'ios') && _IOS_VERSION && _IOS_VERSION >= '1.5.3') || (_CLIENT_TYPE == 'android') && _ANDROID_VERSION && _ANDROID_VERSION >= '1.7') {\n if (in_array('body', $allowedInfo)) {\n if (isset($response['description']) && !empty($response['description'])) {\n $getInfoArray['description'] = strip_tags($response['description']);\n if (isset($getInfoArray['Description']) && !empty($getInfoArray['Description']))\n unset($getInfoArray['Description']);\n }\n }\n }\n\n if (isset($getInfoArray) && !empty($getInfoArray))\n $this->respondWithSuccess($getInfoArray, true);\n }\n\n// //GET EVENTS PAGINATOR\n// $paginator = Engine_Api::_()->getDbTable('events', 'siteevent')->getSiteeventsPaginator($values, $customProfileFields);\n// $paginator->setItemCountPerPage($this->getRequestParam(\"limit\", 20));\n// $paginator->setCurrentPageNumber($this->getRequestParam(\"page\", 1));\n//\n// //SET VIEW\n// Engine_Api::_()->getApi('Core', 'siteapi')->setView();\n// $response['canCreate'] = Engine_Api::_()->authorization()->isAllowed('siteevent_event', $viewer, 'create');\n// $response[\"getTotalItemCount\"] = $getTotalItemCount = $paginator->getTotalItemCount();\n//\n//\n// if (isset($showEvents) && !empty($showEvents) && empty($getInfo)) {\n// try {\n// $values['viewType'] = $viewtype;\n// $values['host_type'] = 'siteevent_organizer';\n// $values['host_id'] = $organizer->getIdentity();\n//\n//\n// if (!empty($getTotalItemCount)) {\n// foreach ($paginator as $eventObj) {\n// $event = $eventObj->toArray();\n//\n// // ADD OWNER IMAGES\n// $getContentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($eventObj, true);\n// $event = array_merge($event, $getContentImages);\n// $event[\"owner_title\"] = $eventObj->getOwner()->getTitle();\n//\n// // ADD EVENT IMAGES\n// $getContentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($eventObj);\n// $event = array_merge($event, $getContentImages);\n// $tempResponse[] = $event;\n// }\n// $response['events'] = $tempResponse;\n// }\n// } catch (Exception $e) {\n// \n// }\n// }\n\n\n if (isset($profileTabs) && !empty($profileTabs) && empty($getInfo)) {\n $profileTabsArray[] = array(\n 'name' => 'organizer_info',\n 'label' => $this->translate('Info'),\n 'url' => 'advancedevents/organizer/' . $organizer->getIdentity(),\n 'urlParams' => array(\n 'getInfo' => 1\n )\n );\n\n if ($organizer->countOrganizedEvent() > 0) {\n $profileTabsArray[] = array(\n 'name' => 'organizer_events',\n 'label' => $this->translate('Events'),\n 'url' => 'advancedevents/',\n 'totalItemCount' => $organizer->countOrganizedEvent(),\n 'urlParams' => array(\n 'host_type' => 'siteevent_organizer',\n 'host_id' => $organizer->getIdentity()\n )\n );\n }\n\n $response['profileTabs'] = $profileTabsArray;\n }\n $this->respondWithSuccess($response, true);\n }",
"public function testReportsReferralsGet()\n {\n }",
"public function index_should_return_single_record()\r\n {\r\n // Single day\r\n $this->get('/holidays/us/2018/?month=3&day=25')\r\n ->seeJson( [\r\n 'status'=> 200,\r\n 'message'=>'succeeded with content',\r\n 'holidays'=>[\r\n [\r\n 'name'=>'Palm Sunday',\r\n 'country'=> 'us',\r\n 'date'=>'2018-03-25',\r\n 'public'=> 0\r\n ]\r\n ]\r\n ] );\r\n\r\n // previous Single day\r\n $this->get('/holidays/us/2018/?month=3&day=25&previous=1')\r\n ->seeJson( [\r\n 'status'=> 200,\r\n 'message'=>'succeeded with content',\r\n 'holidays'=>[\r\n [\r\n 'name'=>'Saint Patrick\\'s Day',\r\n 'country'=> 'us',\r\n 'date'=>'2018-03-17',\r\n 'public'=> 0\r\n ],\r\n ]\r\n ] );\r\n\r\n // upcoming Single day\r\n $this->get('/holidays/us/2018/?month=3&day=25&upcoming=1')\r\n ->seeJson( [\r\n 'status'=> 200,\r\n 'message'=>'succeeded with content',\r\n 'holidays'=>[\r\n [\r\n 'name'=>'Good Friday',\r\n 'country'=> 'us',\r\n 'date'=>'2018-03-30',\r\n 'public'=> 1\r\n ],\r\n ]\r\n ] );\r\n }",
"public function testTeamsGet()\n {\n $this->get('/api/v1/teams', ['Content-Type' => 'application/json', 'Accept' => 'application/json'])\n ->seeJsonStructure([\n '*' => [\n 'id',\n 'name',\n 'nickname',\n 'acronym',\n 'coach',\n 'location',\n ]\n ]);\n }",
"public function testMultiple() {\n $client = new Client();\n $request = $client->get('http://web/v1/combined/CRESTOR/BENICAR/ASPIRIN');\n $response = $request;\n $this->assertEquals(200, $response->getStatusCode());\n }",
"public function testGetWaiversParams()\n {\n $paths = [\n '/v4/waivers?limit=5',\n '/v4/waivers?limit=20&verified=true',\n '/v4/waivers?limit=20&templateId=alkagaldeab',\n '/v4/waivers?limit=20&fromDts='.urlencode('2016-11-01 00:00:00'),\n '/v4/waivers?limit=20&toDts='.urlencode('2016-11-01 00:00:00'),\n ];\n\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, APISuccessResponses::waivers(1), count($paths));\n\n $sw->getWaiverSummaries(5);\n $sw->getWaiverSummaries(20, true);\n $sw->getWaiverSummaries(20, null, 'alkagaldeab');\n $sw->getWaiverSummaries(20, null, '', '2016-11-01 00:00:00');\n $sw->getWaiverSummaries(20, null, '', '', '2016-11-01 00:00:00');\n\n $this->checkGetRequests($container, $paths);\n }",
"public function testAutoreportDaily()\n {\n echo \"\\n ---- Page : autoreport/daily ---- \\n\";\n $response = $this->visit('autoreport/daily');\n $this->assertResponseStatus($response->response->getStatusCode());\n echo \"Response is \". $response->response->getStatusCode();\n echo \"\\n\";\n }",
"public function testProjectProjectIDInviteGet()\n {\n }",
"public function testGetWaiversDefault()\n {\n $numWaivers = 5;\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, APISuccessResponses::waivers($numWaivers));\n\n $waivers = $sw->getWaiverSummaries();\n\n $this->assertCount($numWaivers, $waivers);\n foreach($waivers as $waiver) {\n $this->assertInstanceOf(SmartwaiverWaiverSummary::class, $waiver);\n }\n\n $this->checkGetRequests($container, ['/v4/waivers?limit=20']);\n }",
"public function testGetWaiversDefault()\n {\n $numWaivers = 5;\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, APISuccessResponses::waivers($numWaivers));\n\n $waivers = $sw->getWaiverSummaries();\n\n $this->assertCount($numWaivers, $waivers);\n foreach($waivers as $waiver) {\n $this->assertInstanceOf(SmartwaiverWaiverSummary::class, $waiver);\n }\n\n $this->checkGetRequests($container, ['/v4/waivers?limit=20']);\n }",
"public function test_library_verseInfo() {\n\t\t$path = route('v2_library_verseInfo', [], false);\n\t\t$verse = \\DB::connection('sophia')->table('AAIWBT_vpl')->inRandomOrder()->first();\n\t\t$book = Book::where('id_usfx',$verse->book)->first();\n\t\t$chapter = $verse->chapter;\n\t\t$verse_start = $verse->verse_start;\n\t\t$verse_end = $verse->verse_start + 5;\n\n\t\t$this->params['bible_id'] = \"AAIWBT\";\n\t\t$this->params['book_id'] = $book->id;\n\t\t$this->params['chapter'] = $chapter;\n\t\t$this->params['verse_start'] = $verse_start;\n\t\t$this->params['verse_end'] = $verse_end;\n\n\t\techo \"\\nTesting: \" . route('v2_library_verseInfo', $this->params);\n\t\t$response = $this->get(route('v2_library_verseInfo'), $this->params);\n\t\t$response->assertSuccessful();\n\t\t// TODO: Get a working example of v2\n\t\t// $response->assertJsonStructure([$this->getSchemaKeys('LibraryVerseInfo')]);\n\t\t// $this->compareToOriginal($path,[$this->getSchemaKeys('LibraryVerseInfo')]);\n\t}",
"public function testWebinarPollDelete()\n {\n }",
"public function testRequestEnrollment()\n {\n }",
"public function testGetChallengeActivities()\n {\n }",
"public function testIndex()\n {\n $requestInstance = null;\n\n $this->router->get('/customers/{id}/relationships/{relationship}', [\n 'middleware' => ['request', 'response'],\n function(\\Luminary\\Http\\Requests\\Index $request, $id, $relationship) use(&$requestInstance) {\n $requestInstance = $request;\n }\n ]);\n\n $this->get('/customers/1234/relationships/location');\n\n $this->assertResponseOk();\n $this->assertInstanceOf(\\Luminary\\Http\\Requests\\Index::class, $requestInstance);\n $this->assertInstanceOf(CustomerAuthorize::class, $requestInstance->getAuthorize());\n }",
"public function testCGetAction200()\n {\n self::$_client->request(Request::METHOD_GET, self::RUTA_API);\n $response = self::$_client->getResponse();\n self::assertTrue($response->isSuccessful());\n self::assertJson($response->getContent());\n $users = json_decode($response->getContent(), true);\n self::assertArrayHasKey('users', $users);\n }",
"public function testGetSuppliersUsingGET()\n {\n }",
"public function testGetOembed()\n\t{\n\t\t$id = 217781292748652545;\n\t\t$maxwidth = 300;\n\t\t$hide_media = true;\n\t\t$hide_thread = true;\n\t\t$omit_script = true;\n\t\t$align = 'center';\n\t\t$related = 'twitter';\n\t\t$lang = 'fr';\n\n\t\t$returnData = new stdClass;\n\t\t$returnData->code = 200;\n\t\t$returnData->body = $this->rateLimit;\n\n\t\t$path = $this->object->fetchUrl('/application/rate_limit_status.json', array(\"resources\" => \"statuses\"));\n\n\t\t$this->client->expects($this->at(0))\n\t\t->method('get')\n\t\t->with($path)\n\t\t->will($this->returnValue($returnData));\n\n\t\t$returnData = new stdClass;\n\t\t$returnData->code = 200;\n\t\t$returnData->body = $this->sampleString;\n\n\t\t// Set request parameters.\n\t\t$data['id'] = $id;\n\t\t$data['maxwidth'] = $maxwidth;\n\t\t$data['hide_media'] = $hide_media;\n\t\t$data['hide_thread'] = $hide_thread;\n\t\t$data['omit_script'] = $omit_script;\n\t\t$data['align'] = $align;\n\t\t$data['related'] = $related;\n\t\t$data['lang'] = $lang;\n\n\t\t$path = $this->object->fetchUrl('/statuses/oembed.json', $data);\n\n\t\t$this->client->expects($this->at(1))\n\t\t->method('get')\n\t\t->with($path)\n\t\t->will($this->returnValue($returnData));\n\n\t\t$this->assertThat(\n\t\t\t$this->object->getOembed($id, null, $maxwidth, $hide_media, $hide_thread, $omit_script, $align, $related, $lang),\n\t\t\t$this->equalTo(json_decode($this->sampleString))\n\t\t);\n\t}",
"public function testReportsPaymentsHistoryGet()\n {\n }",
"public function testActivityRetrieve()\n {\n }",
"public function testAction()\n {\n if ($this->identity()) {\n $summoners = $this->account()->getSummoners();\n $summoner = $summoners[0];\n $response = $this->getServiceLocator()->get('youtube_service')->findByQuery(\"league of legends\", null, 20, \"this_week\");\n $videos = $response->getVideos(true);\n foreach ($videos as $video) {\n echo $video->getScore() . '<br />';\n }\n # $feeds = $this->getServiceLocator()->get('feed_service')->getLolProFeeds(array(\"Ahri\",\"Aatrox\",\"Jayce\"));\n return new ViewModel();\n } else {\n return $this->notFoundAction();\n }\n }",
"public function testClubInHomepage()\n {\n \t$club = Club::where('name','=','EscBasket')->first();\n $this->visit('/')\n ->see($club->name);\n }",
"public function test_get_wall_route() {\n $client = new Client($this->_app);\n $client->request('GET', '/wall/3');\n $this->assertTrue($client->getResponse()->isOk());\n $this->assertContains('Wall 003', $client->getResponse()->getContent());\n }",
"public function testEmailCampaignsGet()\n {\n }",
"public function testGetSingleHospital(){\r\n\t\t$this->http = new Client(['base_uri' => 'http://localhost/casecheckapp/public/index.php/']);\r\n\t\r\n\t\t//Test HTTP status ok for id=3\r\n\t\t$response= $this->http->request('GET','api/v1/hospital/3');//Change ID here\r\n\t\t$this->assertEquals(200,$response->getStatusCode());\r\n\r\n\t\t//Test JSON content\r\n\t\t$contentType = $response->getHeaders()[\"Content-Type\"][0];\r\n\t\t$this->assertEquals(\"application/json\", $contentType);\r\n\r\n\t\t//Test single element\r\n\t\t$jsonPHP=json_decode($response->getBody());\r\n\t\t$this->assertCount(1, $jsonPHP);\r\n\r\n\t\t//Stopping the connexion with Guzzle\r\n\t\t$this->http = null;\r\n\t\t\r\n\t}",
"public function testGet()\n {\n $all_results = self::$api->getAll();\n usleep(AUTH0_PHP_TEST_INTEGRATION_SLEEP);\n $this->assertNotEmpty($all_results);\n\n $expected_client_id = $all_results[0]['client_id'] ?: null;\n $this->assertNotNull($expected_client_id);\n\n $expected_audience = $all_results[0]['audience'] ?: null;\n $this->assertNotNull($expected_audience);\n\n $audience_results = self::$api->getByAudience($expected_audience);\n usleep(AUTH0_PHP_TEST_INTEGRATION_SLEEP);\n $this->assertNotEmpty($audience_results);\n $this->assertEquals($expected_audience, $audience_results[0]['audience']);\n\n $client_id_results = self::$api->getByClientId($expected_client_id);\n usleep(AUTH0_PHP_TEST_INTEGRATION_SLEEP);\n $this->assertNotEmpty($client_id_results);\n $this->assertEquals($expected_client_id, $client_id_results[0]['client_id']);\n }",
"public function testGetAccountsUsingGET()\n {\n }",
"public function testInboundDocumentGet()\n {\n }",
"public function testGetWaiversParams()\n {\n $paths = [\n '/v4/waivers?limit=5',\n '/v4/waivers?limit=20&verified=true',\n '/v4/waivers?limit=20&templateId=alkagaldeab',\n '/v4/waivers?limit=20&fromDts='.urlencode('2016-11-01 00:00:00'),\n '/v4/waivers?limit=20&toDts='.urlencode('2016-11-01 00:00:00'),\n '/v4/waivers?limit=20&firstName=Kyle',\n '/v4/waivers?limit=20&lastName=Smith',\n '/v4/waivers?limit=20&tag=testing'\n ];\n\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, APISuccessResponses::waivers(1), count($paths));\n\n $sw->getWaiverSummaries(5);\n $sw->getWaiverSummaries(20, true);\n $sw->getWaiverSummaries(20, null, 'alkagaldeab');\n $sw->getWaiverSummaries(20, null, '', '2016-11-01 00:00:00');\n $sw->getWaiverSummaries(20, null, '', '', '2016-11-01 00:00:00');\n $sw->getWaiverSummaries(20, null, '', '', '', 'Kyle');\n $sw->getWaiverSummaries(20, null, '', '', '', '', 'Smith');\n $sw->getWaiverSummaries(20, null, '', '', '', '', '', 'testing');\n\n $this->checkGetRequests($container, $paths);\n }",
"public function testEmailCampaignGet()\n {\n }",
"public function testReportsReferralsPayoutHistoryGet()\n {\n }",
"public function testProjectProjectIDInviteeInviteIDGet()\n {\n }",
"public function testGetVendorComplianceSurveyById()\n {\n }"
] | [
"0.7406451",
"0.72042817",
"0.6972393",
"0.68113136",
"0.66887724",
"0.66683817",
"0.65163314",
"0.64829504",
"0.6445188",
"0.63958526",
"0.63770664",
"0.63015765",
"0.6289565",
"0.62525797",
"0.62279373",
"0.60562813",
"0.59522325",
"0.586234",
"0.5843812",
"0.5733904",
"0.5730702",
"0.57175666",
"0.5696677",
"0.56849486",
"0.5638479",
"0.56284773",
"0.5595539",
"0.55800027",
"0.5571376",
"0.5561215",
"0.55540293",
"0.55148757",
"0.5490633",
"0.5447666",
"0.54238415",
"0.54238415",
"0.54117966",
"0.539077",
"0.5356931",
"0.53486735",
"0.5279103",
"0.5261282",
"0.52534044",
"0.52438575",
"0.5235985",
"0.52235377",
"0.5218429",
"0.52160925",
"0.519016",
"0.5187914",
"0.5183533",
"0.51759064",
"0.5164384",
"0.51509845",
"0.51306725",
"0.5122383",
"0.5118512",
"0.5114661",
"0.5103269",
"0.5090731",
"0.5090731",
"0.50818795",
"0.5078548",
"0.507537",
"0.50731623",
"0.50645304",
"0.50564456",
"0.50553703",
"0.5054351",
"0.5052873",
"0.5048549",
"0.5034025",
"0.50275344",
"0.50236243",
"0.5023435",
"0.5020879",
"0.5020879",
"0.50161827",
"0.50155586",
"0.5015339",
"0.50080425",
"0.50073487",
"0.5004151",
"0.5004077",
"0.49962822",
"0.49952102",
"0.49914202",
"0.49905658",
"0.4989794",
"0.49870497",
"0.49864683",
"0.49836713",
"0.4981333",
"0.49806252",
"0.49783581",
"0.49740496",
"0.4971886",
"0.49636388",
"0.4962396",
"0.49527836"
] | 0.7168888 | 2 |
Test case for webinarAbsentees Get Webinar Absentees. | public function testWebinarAbsentees()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testListPastWebinarPollResults()\n {\n }",
"public function testListPastWebinarQA()\n {\n }",
"public function testListEnrollmentRequests()\n {\n }",
"public function testGetEventsIdSchedulesOut()\n {\n $eventId = '1';\n\n $result = $this->visit('events/' . $eventId . '/schedules')\n ->see('create your suaray account')\n ->see('welcome to suaray')\n ->seePageIs('/account/register');\n }",
"public function testGetEventsEventSchedulesIdOut()\n {\n $eventId = '1';\n $id = '1';\n\n $result = $this->visit('events/' . $eventId . '/schedules/' . $id)\n ->see('create your suaray account')\n ->see('welcome to suaray')\n ->seePageIs('/account/register');\n }",
"public function testListUserEnrollments()\n {\n }",
"public function testWebinar()\n {\n }",
"public function testWebinarPollGet()\n {\n }",
"public function testIndexEvents()\n {\n \t$caldendarEvents = CalendarEvent::factory()->count(5)->create();\n \t$user = User::find($caldendarEvents[0]->user_id );\n\n\t\t/*\n\t\t * Confirm the visibility of all of a user's calendar events.\n\t\t */\n \t$response = $this->actingAs( $user )\n \t->get( route( 'event-planner.events.index' ) );\n \tforeach( $caldendarEvents as $calendarEvent ){\n \t\t$response->assertSee( $calendarEvent->location )\n \t\t->assertSee( $calendarEvent->type )\n \t\t->assertSee( $calendarEvent->showStartDate() );\n \t}\n\n }",
"public function testWebinarPolls()\n {\n }",
"public function testVolunteerHourIndexForContactFailure_Inactive()\n {\n $this->session([\n 'username' => $this->inactiveUser->username, \n 'access_level' => $this->inactiveUser->access_level\n ]);\n \n // Set test user as current authenticated user\n $this->be($this->inactiveUser);\n \n $volunteerID = 2;\n // Call route under test\n $response = $this->call('GET', 'volunteerhours/volunteer/'.$volunteerID);\n \n // Assert redirected to access denied page\n $this->assertRedirectedToRoute('unauthorized');\n }",
"public function testWebinarStatus()\n {\n }",
"public function testPastEvents()\n {\n // otherwise test will fail.\n // Other approach is to use fake data or mock it.\n \n $response = $this->json('GET', '/events/expired');\n \n $response\n ->assertStatus(200)\n ->assertJson([\n ['name' => 'Fashion Show']\n ]);\n }",
"public function testWebinarRegistrantGet()\n {\n }",
"public function index_should_not_return_any_collection()\r\n {\r\n $this->get('/holidays/gr/2018')->seeStatusCode(200);\r\n $this\r\n ->get('/holidays/gr/2018')\r\n ->seeJson( [\r\n 'status'=> 204,\r\n 'message'=>'succeeded with no content.',\r\n 'holidays' => []\r\n ] );\r\n $this->get('/holidays/?country=gr&year=2018')->seeStatusCode(200);\r\n $this\r\n ->get('/holidays/?country=gr&year=2018')\r\n ->seeJson( [\r\n 'status'=> 204,\r\n 'message'=>'succeeded with no content.',\r\n 'holidays' => []\r\n ] );\r\n }",
"public function index()\n {\n //\n $absents = AbsentApplication::whereIn('user_id',\n User::whereIn('id',\n ProjectUser::whereIn('project_id',\n Project::where('managed',\n Auth::user()->id)->get()->pluck('id'))\n ->get()->pluck('user_id'))\n ->get()->pluck('id'))\n ->where('state', AbsentApplication::getAbsentWaitting())->get();\n\n\n return response()->json([\n 'absents' => $absents,\n ], 200);\n }",
"public function getNegativeRespondedGuests()\n {\n $query = 'select attendees.displayName as attendeeName, users.name as userName from users right join attendees on attendees.userID = users.userID where attendees.isAttending = 0 AND users.isRSVP = 1;';\n if ($this->connectedModel->runQuery($query)) //query\n {\n while ($row = $this->connectedModel->getResultsAssoc())\n {\n $array[] = array('attendeeName' => $row['attendeeName'], 'userName' => $row['userName']);\n }\n return $array;\n }\n else\n {\n return -1;\n } \n }",
"public function testGetAccountDashboardEventOut()\n {\n $eventId = '2';\n\n // Grab Page\n $result = $this->visit('account/dashboard/event/' . $eventId)\n ->see('create your suaray account')\n ->see('welcome to suaray')\n ->seePageIs('/account/register');\n }",
"public function testAutoreportDaily()\n {\n echo \"\\n ---- Page : autoreport/daily ---- \\n\";\n $response = $this->visit('autoreport/daily');\n $this->assertResponseStatus($response->response->getStatusCode());\n echo \"Response is \". $response->response->getStatusCode();\n echo \"\\n\";\n }",
"private function ofertas() {\n\t\t$data = date ( 'Y/m/d' );\n\t\t$params = array (\n\t\t\t\t'OffersUser' => array (\n\t\t\t\t\t\t'conditions' => array (\n\t\t\t\t\t\t\t\t'user_id' => $this->Session->read ( 'userData.User.id' ),\n\t\t\t\t\t\t\t\t'Offer.status' => 'ACTIVE',\n\t\t\t\t\t\t\t\t'Offer.begins_at <= ' => $data,\n\t\t\t\t\t\t\t\t'Offer.ends_at >= ' => $data \n\t\t\t\t\t\t) \n\t\t\t\t),\n\t\t\t\t'Offer' \n\t\t);\n\t\t$contador = $this->Utility->urlRequestToGetData ( 'offers', 'count', $params );\n\t\t\n\t\tif ($this->Session->check ( 'ofertasIds' )) {\n\t\t\t$this->Session->write ( 'HomeOfertas', 'desejos' );\n\t\t} else if (! $contador > 0 && ! $this->Session->check ( 'Ofertas-Assinaturas' )) {\n\t\t\t$this->Session->write ( 'HomeOfertas', 'publico' );\n\t\t} else {\n\t\t\t$this->Session->write ( 'HomeOfertas', 'personalizado' );\n\t\t}\n\t}",
"public function testWebinarRegistrantsQuestionsGet()\n {\n }",
"public function testWebinarRegistrants()\n {\n }",
"public function testAttendeeSetStatusRecurExceptionAllFollowing()\n {\n $from = new Tinebase_DateTime('2012-02-01 00:00:00');\r\n $until = new Tinebase_DateTime('2012-02-29 23:59:59');\r\n \r\n $event = new Calendar_Model_Event(array(\r\n 'summary' => 'Some Daily Event',\r\n 'dtstart' => '2012-02-03 09:00:00',\r\n 'dtend' => '2012-02-03 10:00:00',\r\n 'rrule' => 'FREQ=DAILY;INTERVAL=1',\r\n 'container_id' => $this->_testCalendar->getId(),\r\n 'attendee' => $this->_getAttendee(),\r\n ));\r\n \r\n $persistentEvent = $this->_controller->create($event);\n \n $exceptions = new Tinebase_Record_RecordSet('Calendar_Model_Event');\r\n $recurSet = Calendar_Model_Rrule::computeRecurrenceSet($persistentEvent, $exceptions, $from, $until);\r\n \n // accept for sclever thisandfuture\n $start = $recurSet[10];\n $sclever = Calendar_Model_Attender::getAttendee($start->attendee, $event->attendee[1]);\r\n $sclever->status = Calendar_Model_Attender::STATUS_ACCEPTED;\r\n $this->_controller->attenderStatusCreateRecurException($start, $sclever, $sclever->status_authkey, TRUE);\r\n \n $events = $this->_controller->search(new Calendar_Model_EventFilter(array(\r\n array('field' => 'container_id', 'operator' => 'equals', 'value' => $this->_testCalendar->getId())\r\n )))->sort('dtstart', 'ASC');\n \n // assert two baseEvents\n $this->assertTrue($events[0]->rrule_until instanceof Tinebase_DateTime, 'rrule_until of first baseEvent is not set');\n $this->assertTrue($events[0]->rrule_until < new Tinebase_DateTime('2012-02-14 09:00:00'), 'rrule_until of first baseEvent is not adopted properly');\n $this->assertEquals(Calendar_Model_Attender::STATUS_NEEDSACTION, Calendar_Model_Attender::getAttendee($events[0]->attendee, $event->attendee[1])->status, 'first baseEvent status must not be touched');\n \n $this->assertEquals($events[1]->dtstart, new Tinebase_DateTime('2012-02-14 09:00:00'), 'start of second baseEvent is wrong');\n $this->assertTrue(empty($events[1]->recurid), 'second baseEvent is not a baseEvent');\n $this->assertEquals($events[1]->rrule, $event->rrule, 'rrule of second baseEvent must be set');\n $this->assertFalse($events[1]->rrule_until instanceof Tinebase_DateTime, 'rrule_until of second baseEvent must not be set');\n $this->assertEquals(Calendar_Model_Attender::STATUS_ACCEPTED, Calendar_Model_Attender::getAttendee($events[1]->attendee, $event->attendee[1])->status, 'second baseEvent status is not touched');\n }",
"public function testGetEnrollmentRequest()\n {\n }",
"public function testRequestEnrollment()\n {\n }",
"public function AnomalyPageTest()\n {\n // Test user login\n $user = $this->testAccounts[\"anthro-analyst\"];\n $this->browse(function ($browser) use ($user) {\n $browser->visit(new loginPage)\n ->loginUser($user['email'], $user['password'])\n ->pause(3000)\n ->assertSee('Welcome');\n\n $browser->visit(new specimenPage)\n ->pause(5000)\n ->maximize()\n ->pause(2000)\n\n ->click('@leftSideBar-menu')\n ->pause(2000)\n ->click('@project-report-button')\n ->driver->switchTo()->window(collect($browser->driver->getWindowHandles())->last());\n $browser\n ->pause(3000)\n\n ->click('@anomaly_as')\n ->pause(10000)\n ->assertSee('Accession Number')\n ->assertSee('Bone')\n ->assertSee('Provenance 1')\n ->assertSee('Provenance 2')\n ->assertSee('Side')\n ->assertSee('Anomaly')\n\n ->pause(3000)\n\n\n ->logoutUser();\n });\n }",
"public function testGetWaiversDefault()\n {\n $numWaivers = 5;\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, APISuccessResponses::waivers($numWaivers));\n\n $waivers = $sw->getWaiverSummaries();\n\n $this->assertCount($numWaivers, $waivers);\n foreach($waivers as $waiver) {\n $this->assertInstanceOf(SmartwaiverWaiverSummary::class, $waiver);\n }\n\n $this->checkGetRequests($container, ['/v4/waivers?limit=20']);\n }",
"public function testGetWaiversDefault()\n {\n $numWaivers = 5;\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, APISuccessResponses::waivers($numWaivers));\n\n $waivers = $sw->getWaiverSummaries();\n\n $this->assertCount($numWaivers, $waivers);\n foreach($waivers as $waiver) {\n $this->assertInstanceOf(SmartwaiverWaiverSummary::class, $waiver);\n }\n\n $this->checkGetRequests($container, ['/v4/waivers?limit=20']);\n }",
"public function testReportsReferralsPayoutHistoryGet()\n {\n }",
"public function testWebinarDelete()\n {\n }",
"public function testWebinarPanelists()\n {\n }",
"public function testUpcomingEvents()\n {\n // otherwise test will fail.\n // Other approach is to use fake data or mock it.\n \n $response = $this->json('GET', '/events');\n \n $response\n ->assertStatus(200)\n ->assertJson([\n ['name' => 'IT Expo']\n ]);\n }",
"public function testSuccessfulGetAttendants_NoAttendants()\n {\n $this->ajaxGet('/wap/' . self::ROUTE_PREFIX . '/approved/list?page=1')\n ->seeJsonContains([\n 'code' => 0,\n ]);\n\n $result = json_decode($this->response->getContent(), true);\n Assert::assertEquals(0, $result['pages']);\n Assert::assertEquals([], $result['attendants']);\n }",
"public function testCreateRecurExceptionAllFollowingPreserveAttendeeStatus()\n {\n $from = new Tinebase_DateTime('2012-02-01 00:00:00');\n $until = new Tinebase_DateTime('2012-02-29 23:59:59');\n \n $event = new Calendar_Model_Event(array(\n 'summary' => 'Some Daily Event',\n 'dtstart' => '2012-02-03 09:00:00',\n 'dtend' => '2012-02-03 10:00:00',\n 'rrule' => 'FREQ=DAILY;INTERVAL=1',\n 'container_id' => $this->_testCalendar->getId(),\n 'attendee' => $this->_getAttendee(),\n ));\n \n $persistentEvent = $this->_controller->create($event);\n $persistentSClever = Calendar_Model_Attender::getAttendee($persistentEvent->attendee, $event->attendee[1]);\n \n // accept series for sclever\n $persistentSClever->status = Calendar_Model_Attender::STATUS_ACCEPTED;\n $this->_controller->attenderStatusUpdate($persistentEvent, $persistentSClever, $persistentSClever->status_authkey);\n \n // update \"allfollowing\" w.o. scheduling change\n $persistentEvent = $this->_controller->get($persistentEvent->getId());\n $exceptions = new Tinebase_Record_RecordSet('Calendar_Model_Event');\n $recurSet = Calendar_Model_Rrule::computeRecurrenceSet($persistentEvent, $exceptions, $from, $until);\n \n $recurSet[5]->description = 'From now on, everything will be better'; //2012-02-09 \n $updatedPersistentEvent = $this->_controller->createRecurException($recurSet[5], FALSE, TRUE);\n \n $updatedPersistentSClever = Calendar_Model_Attender::getAttendee($updatedPersistentEvent->attendee, $event->attendee[1]);\n $this->assertEquals(Calendar_Model_Attender::STATUS_ACCEPTED, $updatedPersistentSClever->status, 'status must not change');\n }",
"public function testReportsEventsExportGet()\n {\n }",
"public function testWebinarRegistrantStatus()\n {\n }",
"public function testLeaseCalendarFrontEnd()\n {\n $this->get(route('lease.calendar'))->assertStatus(200);\n }",
"function testGetNotReviewed()\n {\n $events = $this->GroupEvent->getNotReviewed(1);\n $this->assertEqual(Set::extract('/GroupEvent/id', $events), array(1, 2));\n\n //Test invalid event\n $events = $this->GroupEvent->getNotReviewed(999);\n $this->assertEqual(Set::extract('/GroupEvent/id', $events), null);\n }",
"public function index_should_return_a_collection_of_records()\r\n {\r\n // by year collection\r\n $this->get('/holidays/us/2018/');\r\n $body = json_decode($this->response->getContent(), true );\r\n $this->assertArrayHasKey('holidays', $body);\r\n $this->assertCount(47, $body['holidays']);\r\n $this->assertArrayHasKey('2018-02-19', $body['holidays']);\r\n\r\n $arr= $body['holidays']['2018-02-19'];\r\n $this->assertCount(1, $arr);\r\n $this->assertEquals( $arr[0]['name'], 'Washington\\'s Birthday');\r\n $this->assertEquals( $arr[0]['country'], 'us');\r\n $this->assertEquals( $arr[0]['date'], '2018-02-19');\r\n $this->assertEquals( $arr[0]['public'], '0');\r\n\r\n ///////////////////////////////\r\n // public\r\n $this->get('/holidays/us/2018/?public=1');\r\n $body = json_decode($this->response->getContent(), true );\r\n $this->assertArrayHasKey('holidays', $body);\r\n $this->assertCount(7, $body['holidays']);\r\n $this->assertArrayHasKey('2018-01-01', $body['holidays']);\r\n\r\n $arr= $body['holidays']['2018-01-01'];\r\n $this->assertCount(2, $arr);\r\n $this->assertEquals( $arr[1]['name'], 'New Year\\'s Day');\r\n $this->assertEquals( $arr[1]['country'], 'us');\r\n $this->assertEquals( $arr[1]['date'], '2018-01-01');\r\n $this->assertEquals( $arr[1]['public'], '1');\r\n\r\n ///////////////////////\r\n // month\r\n $this->get('/holidays/us/2018/?month=3')\r\n ->seeJson( [\r\n 'status'=> 200,\r\n 'message'=>'succeeded with content',\r\n 'holidays'=>[\r\n [\r\n 'name'=>'International Women\\'s Day',\r\n 'country'=> 'us',\r\n 'date'=>'2018-03-08',\r\n 'public'=> 0\r\n ],\r\n [\r\n 'name'=>'Saint Patrick\\'s Day',\r\n 'country'=> 'us',\r\n 'date'=>'2018-03-17',\r\n 'public'=> 0\r\n ],\r\n [\r\n 'name'=>'Palm Sunday',\r\n 'country'=> 'us',\r\n 'date'=>'2018-03-25',\r\n 'public'=> 0\r\n ],\r\n [\r\n 'name'=>'Good Friday',\r\n 'country'=> 'us',\r\n 'date'=>'2018-03-30',\r\n 'public'=> 1\r\n ]\r\n ]\r\n ] );\r\n }",
"public function testGetEvenUnevenTimes()\n {\n $expectedArray = [ 'even' => 1, 'uneven' => 3 ];\n\n $this->assertEquals($expectedArray, API::countEvenUnevenTimes($this->data), \"TEST 1 - counting visits in even and ueven hours\");\n }",
"public function testVolunteerHourIndexForProjectFailure_Inactive()\n {\n $this->session([\n 'username' => $this->inactiveUser->username, \n 'access_level' => $this->inactiveUser->access_level\n ]);\n \n // Set test user as current authenticated user\n $this->be($this->inactiveUser);\n \n $projectID = 2;\n // Call route under test\n $response = $this->call('GET', 'volunteerhours/project/'.$projectID);\n \n // Assert redirected to access denied page\n $this->assertRedirectedToRoute('unauthorized');\n }",
"public function test_user_can_view_invites_no_invites()\n {\n $user = factory(User::class, 1)->create()->first();\n\n $this->actingAs($user);\n\n $response = $this->get('/invites');\n\n $response->assertStatus(200);\n }",
"public function testThatGetEnrollmentsThrowsExceptionIfUserIdIsMissing()\n {\n $api = new MockManagementApi();\n\n try {\n $api->call()->users()->getEnrollments( '' );\n $caught_message = '';\n } catch (EmptyOrInvalidParameterException $e) {\n $caught_message = $e->getMessage();\n }\n\n $this->assertContains( 'Empty or invalid user_id', $caught_message );\n }",
"public function testShowAllIncidences()\n {\n //1. Preparar el test\n //2. Executar el codi que vull provar.\n //3. Comprovo: assert\n\n $incidences = factory(Incidence::class, 50) -> create();\n\n\n $response = $this->get('/incidences');\n $response->assertStatus(200);\n $response->assertSuccessful();\n $response->assertViewIs('list_events');\n\n\n //TODO faltaria contar que hi ha 50 al resultat\n\n// foreach ( $incidences as $incidence) {\n// $response->assertSeeText($incidence->title);\n// $response->assertSeeText($incidence->description);\n// }\n }",
"public function testAttendeeSetStatusRecurException()\n {\n $event = new Calendar_Model_Event(array(\n 'uid' => Tinebase_Record_Abstract::generateUID(),\n 'summary' => 'Abendessen',\n 'dtstart' => '2009-03-25 18:00:00',\n 'dtend' => '2009-03-25 18:30:00',\n 'originator_tz' => 'Europe/Berlin',\n 'rrule' => 'FREQ=DAILY;INTERVAL=1;UNTIL=2009-03-31 17:30:00',\n 'exdate' => '2009-03-27 18:00:00,2009-03-29 17:00:00',\n 'container_id' => $this->_testCalendar->getId(),\n Tinebase_Model_Grants::GRANT_EDIT => true,\n ));\n $event->attendee = $this->_getAttendee();\n unset($event->attendee[1]);\n \n $persistentEvent = $this->_controller->create($event);\n $attendee = $persistentEvent->attendee[0];\n \n $exceptions = new Tinebase_Record_RecordSet('Calendar_Model_Event');\n $from = new Tinebase_DateTime('2009-03-26 00:00:00');\n $until = new Tinebase_DateTime('2009-04-01 23:59:59');\n $recurSet = Calendar_Model_Rrule::computeRecurrenceSet($persistentEvent, $exceptions, $from, $until);\n \n $exception = $recurSet->getFirstRecord();\n $attendee = $exception->attendee[0];\n $attendee->status = Calendar_Model_Attender::STATUS_ACCEPTED;\n \n $this->_controller->attenderStatusCreateRecurException($exception, $attendee, $attendee->status_authkey);\n \n $events = $this->_controller->search(new Calendar_Model_EventFilter(array(\n array('field' => 'period', 'operator' => 'within', 'value' => array('from' => $from, 'until' => $until)),\n array('field' => 'uid', 'operator' => 'equals', 'value' => $persistentEvent->uid)\n )));\n \n $recurid = array_values(array_filter($events->recurid));\n $this->assertEquals(1, count($recurid), 'only recur instance must have a recurid');\n $this->assertEquals('2009-03-26 18:00:00', substr($recurid[0], -19));\n $this->assertEquals(2, count($events));\n }",
"public function testWebinarUpdate()\n {\n }",
"public function _testMultipleInventories()\n {\n\n }",
"public function testVolunteerHourCreateForContactFailure_Inactive()\n {\n $this->session([\n 'username' => $this->inactiveUser->username, \n 'access_level' => $this->inactiveUser->access_level\n ]);\n \n // Set test user as current authenticated user\n $this->be($this->inactiveUser);\n \n $volunteerID = 2;\n // Call route under test\n $response = $this->call('GET', 'volunteerhours/add/volunteer/'.$volunteerID);\n \n // Assert redirected to access denied page\n $this->assertRedirectedToRoute('unauthorized');\n }",
"public function testEventsList()\n {\n $response = $this->get('/events');\n\n $response->assertStatus(200);\n }",
"public function testWebinarCreate()\n {\n }",
"public function testSuccessfulListApprovedAttendants_NoAttendants()\n {\n $this->ajaxGet('/' . self::ROUTE_PREFIX . '/approved/list?page=1&size=2')\n ->seeJsonContains([\n 'code' => 0,\n ]);\n\n $result = json_decode($this->response->getContent(), true);\n Assert::assertEquals(0, $result['pages']);\n Assert::assertEquals([], $result['attendants']);\n }",
"public function testOfficeDetailsPageIsValidWithoutCrawls() {\n // but at least in our dev/test environments, no crawls have run yet, so the DB should be empty.\n $this->request('GET', 'offices/detail/49015');\n $this->assertResponseCode(200);\n }",
"public function test_admin_member_in_assignmentApp_b()\n {\n $this->request('GET', ['pages/Assignments', 'apprentice_in_assignment']);\n $this->assertResponseCode(404);\n }",
"public function index_should_return_single_record()\r\n {\r\n // Single day\r\n $this->get('/holidays/us/2018/?month=3&day=25')\r\n ->seeJson( [\r\n 'status'=> 200,\r\n 'message'=>'succeeded with content',\r\n 'holidays'=>[\r\n [\r\n 'name'=>'Palm Sunday',\r\n 'country'=> 'us',\r\n 'date'=>'2018-03-25',\r\n 'public'=> 0\r\n ]\r\n ]\r\n ] );\r\n\r\n // previous Single day\r\n $this->get('/holidays/us/2018/?month=3&day=25&previous=1')\r\n ->seeJson( [\r\n 'status'=> 200,\r\n 'message'=>'succeeded with content',\r\n 'holidays'=>[\r\n [\r\n 'name'=>'Saint Patrick\\'s Day',\r\n 'country'=> 'us',\r\n 'date'=>'2018-03-17',\r\n 'public'=> 0\r\n ],\r\n ]\r\n ] );\r\n\r\n // upcoming Single day\r\n $this->get('/holidays/us/2018/?month=3&day=25&upcoming=1')\r\n ->seeJson( [\r\n 'status'=> 200,\r\n 'message'=>'succeeded with content',\r\n 'holidays'=>[\r\n [\r\n 'name'=>'Good Friday',\r\n 'country'=> 'us',\r\n 'date'=>'2018-03-30',\r\n 'public'=> 1\r\n ],\r\n ]\r\n ] );\r\n }",
"function getAttendees(){\n $this->attendees = array();\n $i = 0;\n $schoolTable = 'school_'.$this->schoolId;\n $query = \"SELECT id, name AS attendeeName, logintype, email, phone, hotel, room, \n committee AS committeeId, country AS countryId \n FROM $schoolTable\";\n $result = mysql_query($query) or die(mysql_error());\n while($row = mysql_fetch_array($result)){\n $this->attendees[$i] = array();\n $this->attendees[$i]['id'] = $row['id'];\n $this->attendees[$i]['name'] = $row['attendeeName'];\n $this->attendees[$i]['logintype'] = $row['logintype'];\n $this->attendees[$i]['committeeId'] = $row['committeeId'];\n $this->attendees[$i]['countryId'] = $row['countryId'];\n $this->attendees[$i]['email'] = $row['email'];\n $this->attendees[$i]['phone'] = $row['phone'];\n $this->attendees[$i]['hotel'] = $row['hotel'];\n $this->attendees[$i]['room'] = $row['room'];\n $i++;\n }\n // Populate empty rows if attendees table isn't filled\n for($i; $i<$this->totalAttendees; $i++){\n $this->attendees[$i] = array();\n $this->attendees[$i]['id'] = 0;\n $this->attendees[$i]['name'] = 0;\n $this->attendees[$i]['logintype'] = 0;\n $this->attendees[$i]['committeeId'] = 0;\n $this->attendees[$i]['countryId'] = 0;\n $this->attendees[$i]['email'] = 0;\n $this->attendees[$i]['phone'] = 0;\n $this->attendees[$i]['hotel'] = 0;\n $this->attendees[$i]['room'] = 0;\n }\n }",
"public function testDashboardGet()\n {\n $this->visit('/dashboard/articless')\n ->see('Nieuws');\n }",
"public function testSchedulesUpdateOut()\n {\n $result = $this->visit('events/{event}/schedules/update/{id}')\n ->see('create your suaray account')\n ->see('welcome to suaray')\n ->seePageIs('/account/register');\n }",
"public function testIndexForHr() {\n\t\t$opt = [\n\t\t\t'method' => 'GET',\n\t\t\t'return' => 'vars',\n\t\t];\n\t\t$expected = [\n\t\t\t'deferredSaves' => [\n\t\t\t\t[\n\t\t\t\t\t'Deferred' => [\n\t\t\t\t\t\t'id' => '2',\n\t\t\t\t\t\t'employee_id' => '3',\n\t\t\t\t\t\t'internal' => false,\n\t\t\t\t\t\t'data' => [\n\t\t\t\t\t\t\t'changed' => [\n\t\t\t\t\t\t\t\t'EmployeeEdit' => [\n\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_DISTINGUISHED_NAME => 'CN=Суханова Л.Б.,OU=ОС,OU=Пользователи,DC=fabrikam,DC=com',\n\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_TITLE => 'Ведущий инженер',\n\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_DIVISION => 'Группа №1',\n\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_PHOTO => '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCABgAGADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+/iiiigAooooAKK+If2tP+Cgv7Jv7FkOmj9oH4saZ4X13XLc3/h/wPpFpq/inx7r9uGaze6svCPhuxvb8aUHAB1jVlj0lWQqX3hBX4g+L/wDg5y+EGk/EC7tvBX7Pvj/4g/C9bYC21+51XSvAfiq11EXhP2r+ydYbWLPVtIvLUKWD/wDCP6ppS71kjctuUA/qcor+afwl/wAHOP7JeqX0Np4y+A/7Q/gu2mX5tT0+18BeMLe27Za1svF1jeEjtiz5Gcg1+yf7Kv7df7L/AO2fod9rX7PnxZ0LxncaNBa3PiPwjP8Aa9E8e+FRdOojHiLwfrEdlrNnbtnA1REfSSzKqOxGSAfYtFFFABRRRQAUUUUAFfK/7W37XXwZ/Yt+Dur/ABq+OGs6lp3hPTr+10Ow07QtMOr+KPFGu6rvGn+H/DeiiS2e/wBVnZCUjVwoWOQFhJhT9UV/NB/wc66PeXX7JnwC1uOWY2WkftH2Vvd2JIW3ubjVPht8QLOyuGHTKMZCDng4wBhiQD+Ur9uP9pq8/bB/au+M37RclnqGj2HjvxJaf8IroOr3dndan4e8DaFpGn+GvB+j3xs2Nmc2lp9uZrRiSfvfN0+U6Mk9TmigAr1r4B/G/wCIf7N/xg+Hvxs+Fev6loPjH4feJLTV7SWwuzajVtK+241jw1rC/cvPDfiOzzo2s6MQoBGCMdfJaKAP9Oz9hL9sXwL+3T+zt4W+PvgTSrvw3DrF3quheKPB2oX1tfap4K8ZaBdiy1jw5fXtotqmpqzfZNY0rVYsx6tpOrRTYjLhD9qV/Nb/AMGydnqsP7H/AMcr+6lWbS7v9pnVv7Hh+VfszWnw5+H9lqtyScHLEjkjJwRzuGP6UqACiiigAooooAK/AD/g45TQ7z/gnnLHfajptnr2nfHL4Zaz4d0++u7O21LVfst3qOkawNFtL3/S74Wekay15dixBBABdlBBP7/1/M3/AMHN3w0v/Ef7LvwI+KdrB51p8LPjldaXrrZGLbS/iP4Q1LRre8IxkAaxpOjWrE5BMgB9aAP4o6KKKACiiigD+8L/AINzY9DsP+CesNnZato17r2o/HP4nax4k06wurO61LSrm8vNOs9KXV7Gyzd6Q97pGiLeWgv1UgMdpIDg/v8AV/M5/wAGyfwwvvDn7LXx4+Kl1AIbX4p/Gu00fSGyM3WlfC/whp2i3F2R1AbWNX1m0VgqjKYyccf0x0AFFFFABRRRQAV84/tUfs2eBf2uPgB8Rv2ePiJNf2Xhj4kaKun3OraP9kGveHdSs72z1fR/EWjvdxXdqmraNrFnZ30T7MOVKBgJNx+jqZJ9xvpQB/lE/GP4Z618F/i38TvhF4igWHXfhZ4+8WeANQM9n9lW9ufDGr6lpC3gswOftv2P7bwMkr90YATziv6Gv+DjP9lzS/hB+1f4Q/aB8Ny2sOlftN+G9Xv/ABJoMGRdWvxG+HFnoGi6xq43DP2LxL4b1fw6o6AayNYZTgqT/PLQAV6P8HPhnrfxo+L/AMK/hB4dK/298TvH/hPwBo5g/wBKWyuvE+r6fpH2z7GRj/Q/tZvOQOGGc4584r+hv/g3I/Zf0v4v/tZ+MP2gfEc1rLpf7MnhyzuPDejEf6VdfEb4kWmvaNo+rgBgfsvhzw3ZeL93Ya1rfzZBoA/sV/ZT/Zt8B/sj/s//AAz/AGdfhwb+Xwl8M9EOkWmp6x9kbW/EOo3F5eavrPiLV2tkVZNW1nV7281eVthZWkCHAQEfSFMRNv8AQen/ANf/AD3p9ABRRRQAUUUUAFMk+430pJJBGMn/AD/n8K/Lz9tz/grH+yR+xZo/iPTfEfxI0Hxr8arKwvBoPwU8E3beJvFVzrn2O8OlW3i46Mz2XgfSTfx41W98S3dp5MRZ03lVoA/mI/4L9ftv/BL9rT4x/B/wR8E9W1nxJH+zofiz4W8d6xfeH9Z0PSj4x13WfCFldaRo51kWN7qx0hfB94by6bRSqncqlvvH+f2t7xR4o1jxt4m8V+MvEc3neI/GHiPxF4w16WDH2W71/wAT6xqOr6xeE4G/beXoJ5wMEDnIrBoAK/fr/ggP+298D/2TfjF8YPA/xp1jWfDiftFH4TeF/AWsadoOs65oA8Y6Fq/iGybSNY/sYXt3pP8AbFz4wtP7F1Z7EhySW46fgLW94X8U6x4I8T+FvG3hyY2fiPwh4j8P+MNCmuD/AMeWveGNY07V9G2g9CbyzY44J5B2gEgA/wBZ6NxIufwIqSvy0/Yj/wCCsn7JP7aOj+G9M8N/EPQvBHxqvNPtBr/wa8c3TeG/FUGumzQ6tZ+EP7YZLTxtpS3p2WL+HLu43xRh3w3A/UhH3f0Pr/8AX/z2oAfRRRQBVleKNCTJ5QiHnnjPyjJORzkeoFfj3+2L/wAFtv2Lv2TDqvh2x8X/APC/vivZD7Ofhx8GLu01+20m+O3daeL/AB1vfwh4aAO75RJrHiMAFR4bKkOf5KP+CgX/AAVj/ab/AG0fG/jXw5pXj3xJ8Mv2bzrWraR4R+E/hDVrzwvbav4Xtb37JZ3vxJ1iwUaz4w1nWgw1e9s9Xu/+EbKjA0UAZH5SGMxZ8qHyov8Anhakjv6bVbPcncB6jmgD9g/2wv8Agt5+23+1h/a/h3RvFNt+zx8K9RbyP+EF+EN3e22v6rphBDWfiP4kMbPxJq+c7LwaN/wjGifOw2YLAfj3/wAtJpussw+0TT8g3l7yRkZPBzn5cgk7cjJpfLf+83/kP/4mjy3/ALzf+Of/ABNABRR5b/3m/wDHP/iaPLf+83/jn/xNABRR5b/3m/8AHP8A4mjy3/vN/wCOf/E0AGR5kMsXE0Vz9pil6XlldtliT2UDjjIJIJILYr9g/wBjz/gt5+2z+ygdI8Paz4n/AOGifhbp5s4W8CfF66vLnX9M0wKyEeEviRm88SaUFBKqdbPibRgMYJZVA/Hzy3/vN/45/wDE0eXJ/eb8dmOOmcAHH0IOOhFAH+hj+x1/wW6/Yq/a0Gk+HL/xfL8Avi3qS/Z0+HPxhvLPQrXVr4bibTwh45yvhHxIAdv7syaN4jYfL/wjqAA1+xKzRFEkEgMcoHlnswIyMHqeP/r81/kiPGZYhFLD50X/ADyuScj7oxkcjIDZIyeQo2jIH6uf8E/f+Cs37Tn7GfjvwVoOs+O/EnxN/Zu/trS7Dxj8JfGN5e+J7fSfC91eCz1jWPhxe3n/ABOvDetaOD/a40j/AJFzVs5XSM5IAP/Z',\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'current' => [\n\t\t\t\t\t\t\t\t'EmployeeEdit' => [\n\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_TITLE => 'Зам. начальника отдела - главный специалист',\n\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_DIVISION => '',\n\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_PHOTO => '/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAPAAA/+4ADkFkb2JlAGTAAAAAAf/bAIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoKDBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxscHx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f/8AAEQgAyADIAwERAAIRAQMRAf/EAG0AAAIDAQEBAAAAAAAAAAAAAAIDAAEEBQYIAQEBAQEBAAAAAAAAAAAAAAAAAQIDBBAAAgICAgIBBAIDAQAAAAAAAAECAxEEIQUxEiJBURMGMkJhUhQWEQEBAQEBAAAAAAAAAAAAAAAAAQIREv/aAAwDAQACEQMRAD8A+qQBn4AxbXhlHB3VywOVauQhfqBaiASiASQBIBiZQXsgLU0AxTQRbkUAyKBoAXECvUgrADK/IHS1PoRXZ1vCA2xAsCAVLwBh2Vwyjibi8gcuyPJUAogEoAF6AU4gBKSRAqe1GP1ARPsYL6lArtIfcBtfZQf1CNNe5GX1A0RsUgo0sgT0ApwIAcQCguQOjqLlEV2tbwgNkQLAgFSAx7K4YHG24+TSOZZDkAFEA1EAvUBVrUUBy9zcjBPkDgb3cxhn5EHE2P2HDfyAy/8Ao+f5Aadf9jy18gO1pd6pNfIqPQaXYxmlyFdei1SQGlLIEcAAcAJCHJB0NWPKCuxr+EQa4gWBAKkBlvXBRydqPko5tkOQgPQAlECpcIDmb+yoRfIHj+47T19uSDxXZ9xLL5Irz+x2k23yQZX2U8+QHU9rNPyOjtdd3Uk18i9R7Lp+5z6/Io9p1m+ppclHeosUkgHpZApwAuNfIG3Wj4IrqULgg1RAsCAVIDNeuCjmbMfJRgshyVAegE9AM+zL1iyDyvdbfqpcko8B3O3KTlhmbWuPK7asm2Tq8c+zWsf0J04RLVmvoOnFRommOnGzVVkWi9OPS9Tszi1yOpx7vpN9/HLNSpx7Tr9j2iuSo69XKKG+oBRhyBroiRXQpXBBoiBYEAqQCLlwUc69FGOceSoD0AqUcIDl9hLEWQeI7y1v2M1qR47bplZNmLW5CodPKf0MddJkx/r0mv4jp5Is/Xpf6l6nlnfQST/iOr5FDpJL+pOr5a6OulW1wJUuXoOr9oSRuVyse26i1tI6RivTazzFFRrSAKKA00oit1XggegLAgFMBNvgowXIoyyjyVA+gA2R4A4na8RZKrwvbrMmYrcjlU6inPwcrXbMd7Q6mMkuDHXWR1q+jg1/EdOBs/X4v+pes8ZbP1+P+pOtSEy6KK/qTrXGS/qVH6CVLkqnW9J+DpmuGo9L1PGDrHGx6rT/AIo2w3JcAEgNFJFbqiB6AgEAjARaUYrkUZ3HkqIogBbH4gcDt18WZrUeH7NfNnPTpmEacF7o5V6Mx6nrVHCMOjv68YNIsStDog14KyRbrQ+wWMd1EEnwZrccncpjyQscuVSUzpmuOo63WRw0dZXn1HqdJfFHSOdb1HgqLSA0VIitlZA9AQCARgJsKMlqKhDRREgAtXxIrz/bRzFma1I8T2Vb92c9O2Yya6akcq75jv6FzWDLbuauzwinHQhfwOpwu24dXjDdcRZHO2Je2SLxi/HmRqVjUdXr6sNHXNefUel04/FHWOFjfGPBpgSgA6uJFaq0QOQEAgEYCplGWxFCGioiACxcEWOL2VWYszXTLyPY62ZPg46ejMc+Gu1I512kdHVqksEb46uumiLxthJ4J1eJPLHTjNZW2VOM86GyKGGvyWMWOnpUYaO2XDcdzVhhI6x5tN8I8G3MaiENhEinwRAxAQCARgKsKM1hQiRUUgJKPBFjm71WUzFdMvNb+v8AJ8HLT04YYa69vByr0Ruo1l9iN8a41YIpkURTYwyEovwJmmS566+xAEaFksZ03a1WMHbLzbrq0QwkdY8+muCNOZiQQyKCmxIDAgEAjAVPwUZbWUIZUWgCa4IrHtV5TM1vLgb1PLOWo9GKwKtKRysejNbKUsGXWGyaQaB78k4p9UgzWqOMFZVKKCBjXlmpHPVbdeo65jzbroVQwjrHC0+KKyNAHEBsSAgIBAIwFWeCjJayhDfJQUQGLwQIvjlEqxxN6C5OdjrmuTPCkcq9OKZXYc69GaKVnAdIX+TkNcPpsDNjbXZwGLB+2Sxzp1Ucs3I4aroUVnWPPqtkI8G3OjwVlaAZEKZEgICAQCMBNhRjtZYEN8lBRYDUwFXPgg4u+/Jit5rhXzxI46ejFBC0516c073yZds1EnkOh9YStMJ4Dlqmwnyajjqt2vy0dcvNuuprrhHWOFrXFcFZXgorAQcUFMRAQEAgEYCbHwUYrmaGdvkqIpBR/kIE3W8Eo4+9LOTFWOFs5yzlXbNZ4yaZzsd86aap5Jx3zpphhk46ez48DiXQkxxy1o+rLZqRx1p0tVeDrHn1XUo8HSOda4sqCwUTABJAGiCwIBAKYCbfBRguZqIzSlyUV7gVKwz1Wa63glo5+w/bJijnXU5MVuVllQ0zNjpNLhBonHWbaq8jjfs+KbJxLs6FbY4xdNlFLNSOV06FMMGo52tlbwbjLTCZoNTAIAkAaAgEAgFSAz3Pgo597KMkpcl6isk6oZMzaM9iZnozThkgW6ckUuWrn6EWUP8Ayf4HGpoyGq/sTjXo+vWf2HE9NVWt/gcS1srpwVjp8YYKg0VDYSKHRmVTIyKGRYBoCwIBAKYGa7wBzryjK1yTqIkTqo4kC51kCZVEFKoA1UgCVCCjjrr7A6dChEOnQqSCGxiAXqUX6gWkUEmUHGRQ6Eih0WAQEAgFMDPd4A596IMzjyQFGIBehBTrACVQA/iILVYBqABxgAyMQDUQGKIBKIBegFOJRWAIkUOgUPgUGgIBAKkBntAxWrkyEeoBKJASiBfqBPQCvxoCfjQF/jAJQAJQANQAYogEogXgCmgBaAiQDIIodEoMogEAqQCLfBBjtRAnBASQBJAWkBaQBKIF+pRPUC1EAlEA1EAkgLwBTIBYEAiRQyJQ2JQQEAgFMBNpBjsRAogtAGkBeALSAJFF4AJIC0igkgLwBZBAKYAsCAWgGRKGIoICAQCMBNhBjtAQ2QEmQMQBAQAkUWgCSAJIosCZAgFkFMAWBACQBxKGIoICAQCMBNhBiuYGVy5IDhIB0QDyBMgEgDQBJAWUUBMgQAkBTAFgUASYDIsBkSggIBAI/ACLXwBz9iRBjlPkgbVLIGmL4ALIETAZEA0AQEZRWQJkC0ASAgAsAQImAyLAbEoMCAf/2Q==',\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'created' => '2017-11-16 10:12:44',\n\t\t\t\t\t\t'modified' => '2017-11-16 10:12:44',\n\t\t\t\t\t],\n\t\t\t\t\t'Employee' => [\n\t\t\t\t\t\t'id' => '3',\n\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_NAME => 'Суханова Л.Б.',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'Deferred' => [\n\t\t\t\t\t\t'id' => '3',\n\t\t\t\t\t\t'employee_id' => '4',\n\t\t\t\t\t\t'internal' => false,\n\t\t\t\t\t\t'data' => [\n\t\t\t\t\t\t\t'changed' => [\n\t\t\t\t\t\t\t\t'EmployeeEdit' => [\n\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_DISTINGUISHED_NAME => 'CN=Дементьева А.С.,OU=20-02,OU=ОИТ,OU=Пользователи,DC=fabrikam,DC=com',\n\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_OFFICE_NAME => '216',\n\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_MAIL => '[email protected]',\n\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_MANAGER => '',\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'current' => [\n\t\t\t\t\t\t\t\t'EmployeeEdit' => [\n\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_OFFICE_NAME => '123',\n\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_MAIL => '[email protected]',\n\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_MANAGER => [\n\t\t\t\t\t\t\t\t\t\t'id' => '8',\n\t\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_DISTINGUISHED_NAME => 'CN=Голубев Е.В.,OU=АТО,OU=Пользователи,DC=fabrikam,DC=com',\n\t\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_NAME => 'Голубев Е.В.',\n\t\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_TITLE => 'Водитель',\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'created' => '2017-11-16 12:31:28',\n\t\t\t\t\t\t'modified' => '2017-11-16 12:31:28',\n\t\t\t\t\t],\n\t\t\t\t\t'Employee' => [\n\t\t\t\t\t\t'id' => '4',\n\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_NAME => 'Дементьева А.С.',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'Deferred' => [\n\t\t\t\t\t\t'id' => '4',\n\t\t\t\t\t\t'employee_id' => '6',\n\t\t\t\t\t\t'internal' => false,\n\t\t\t\t\t\t'data' => false,\n\t\t\t\t\t\t'created' => '2017-11-16 14:48:22',\n\t\t\t\t\t\t'modified' => '2017-11-16 14:48:22',\n\t\t\t\t\t],\n\t\t\t\t\t'Employee' => [\n\t\t\t\t\t\t'id' => '6',\n\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_NAME => 'Козловская Е.М.',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'Deferred' => [\n\t\t\t\t\t\t'id' => '5',\n\t\t\t\t\t\t'employee_id' => '2',\n\t\t\t\t\t\t'internal' => false,\n\t\t\t\t\t\t'data' => [\n\t\t\t\t\t\t\t'changed' => [\n\t\t\t\t\t\t\t\t'EmployeeEdit' => [\n\t\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_DISTINGUISHED_NAME => 'CN=Егоров Т.Г.,OU=14-01,OU=ОС,OU=Пользователи,DC=fabrikam,DC=com',\n\t\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_DEPARTMENT => 'ОРС',\n\t\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_OTHER_TELEPHONE_NUMBER => ['+375171000002', '+375171000007'],\n\t\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_OTHER_MOBILE_TELEPHONE_NUMBER => ['+375291000008'],\n\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'current' => [\n\t\t\t\t\t\t\t\t'EmployeeEdit' => [\n\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_DEPARTMENT => 'ОС',\n\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_OTHER_TELEPHONE_NUMBER => ['+375171000002'],\n\t\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_OTHER_MOBILE_TELEPHONE_NUMBER => [],\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'created' => '2017-11-17 09:33:19',\n\t\t\t\t\t\t'modified' => '2017-11-17 09:33:19',\n\t\t\t\t\t],\n\t\t\t\t\t'Employee' => [\n\t\t\t\t\t\t'id' => '2',\n\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_NAME => 'Егоров Т.Г.',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t],\n\t\t\t'groupActions' => [\n\t\t\t\tGROUP_ACTION_DEFERRED_SAVE_DELETE => __('Delete data group'),\n\t\t\t\tGROUP_ACTION_DEFERRED_SAVE_APPROVE => __('Approve data group'),\n\t\t\t\tGROUP_ACTION_DEFERRED_SAVE_REJECT => __('Reject data group'),\n\t\t\t],\n\t\t\t'fieldsLabel' => [\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_NAME => __dx('app_ldap_field_name', 'employee', 'Name'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_DISPLAY_NAME => __dx('app_ldap_field_name', 'employee', 'Name'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_SURNAME => __d('cake_ldap_field_name', 'Surname'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_GIVEN_NAME => __d('cake_ldap_field_name', 'Given name'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_MIDDLE_NAME => __d('cake_ldap_field_name', 'Middle name'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_MAIL => __d('cake_ldap_field_name', 'E-mail'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_SIP_PHONE => __d('cake_ldap_field_name', 'SIP telephone'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_TELEPHONE_NUMBER => __d('app_ldap_field_name', 'Internal telephone'),\n\t\t\t\t'Othertelephone.{n}.value' => __d('app_ldap_field_name', 'Landline telephone'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_MOBILE_TELEPHONE_NUMBER => __d('cake_ldap_field_name', 'Mobile telephone'),\n\t\t\t\t'Othermobile.{n}.value' => __d('app_ldap_field_name', 'Personal mobile telephone'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_OFFICE_NAME => __d('cake_ldap_field_name', 'Office room'),\n\t\t\t\t'Department.value' => __d('cake_ldap_field_name', 'Department'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_DIVISION => __d('cake_ldap_field_name', 'Subdivision'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_TITLE => __d('cake_ldap_field_name', 'Position'),\n\t\t\t\t'Manager.' . CAKE_LDAP_LDAP_ATTRIBUTE_NAME => __d('cake_ldap_field_name', 'Manager'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_BIRTHDAY => __d('cake_ldap_field_name', 'Birthday'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_COMPUTER => __d('cake_ldap_field_name', 'Computer'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_EMPLOYEE_ID => __d('cake_ldap_field_name', 'Employee ID'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_OBJECT_GUID => __d('cake_ldap_field_name', 'GUID'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_DISTINGUISHED_NAME => __d('cake_ldap_field_name', 'Distinguished name'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_PHOTO => __d('cake_ldap_field_name', 'Photo'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_COMPANY => __d('cake_ldap_field_name', 'Company name'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_INITIALS => __d('cake_ldap_field_name', 'Initials'),\n\t\t\t\t'Employee.block' => __d('cake_ldap_field_name', 'Block'),\n\t\t\t],\n\t\t\t'fieldsConfig' => [\n\t\t\t\t'Employee.id' => [\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.department_id' => [\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.manager_id' => [\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_OBJECT_GUID => [\n\t\t\t\t\t'type' => 'guid',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_DISTINGUISHED_NAME => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_NAME => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_DISPLAY_NAME => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_INITIALS => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_SURNAME => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_GIVEN_NAME => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_MIDDLE_NAME => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_TITLE => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => true,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_DIVISION => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => true,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_TELEPHONE_NUMBER => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_MOBILE_TELEPHONE_NUMBER => [\n\t\t\t\t\t'type' => 'telephone_name',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_OFFICE_NAME => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_MAIL => [\n\t\t\t\t\t'type' => 'mail',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_PHOTO => [\n\t\t\t\t\t'type' => 'photo',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_COMPUTER => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => true,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_EMPLOYEE_ID => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_COMPANY => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => true,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_BIRTHDAY => [\n\t\t\t\t\t'type' => 'date',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_SIP_PHONE => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.block' => [\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Department.value' => [\n\t\t\t\t\t'type' => 'department_name',\n\t\t\t\t\t'truncate' => true,\n\t\t\t\t],\n\t\t\t\t'Othertelephone.{n}.value' => [\n\t\t\t\t\t'type' => 'telephone_description',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Othermobile.{n}.value' => [\n\t\t\t\t\t'type' => 'telephone_name',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Manager.' . CAKE_LDAP_LDAP_ATTRIBUTE_NAME => [\n\t\t\t\t\t'type' => 'manager',\n\t\t\t\t\t'truncate' => true,\n\t\t\t\t],\n\t\t\t\t'Subordinate.{n}' => [\n\t\t\t\t\t'type' => 'element',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t],\n\t\t\t'pageHeader' => __('Index of deferred saves'),\n\t\t\t'breadCrumbs' => [\n\t\t\t\t[\n\t\t\t\t\tCakeText::truncate(__('Employees'), CAKE_THEME_BREADCRUMBS_TEXT_LIMIT),\n\t\t\t\t\t[\n\t\t\t\t\t\t'plugin' => null,\n\t\t\t\t\t\t'controller' => 'employees',\n\t\t\t\t\t\t'action' => 'index'\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\tCakeText::truncate(__('Deferred saves'), CAKE_THEME_BREADCRUMBS_TEXT_LIMIT),\n\t\t\t\t\t[\n\t\t\t\t\t\t'plugin' => null,\n\t\t\t\t\t\t'controller' => 'deferred',\n\t\t\t\t\t\t'action' => 'index'\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t__('Index'),\n\t\t\t]\n\t\t];\n\t\t$userRole = USER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES;\n\t\t$userPrefix = 'hr';\n\t\t$userInfo = [\n\t\t\t'role' => $userRole,\n\t\t\t'prefix' => $userPrefix,\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$url = [\n\t\t\t'controller' => 'deferred',\n\t\t\t'action' => 'index',\n\t\t\t'prefix' => $userPrefix,\n\t\t\t$userPrefix => true\n\t\t];\n\t\t$result = $this->testAction($url, $opt);\n\t\t$this->excludeCommonAppVars($result);\n\t\t$this->assertData($expected, $result);\n\t}",
"public function testReportsEventlogGet()\n {\n }",
"public function test_list()\n {\n $response = $this->get('/api/employees');\n\n $response->assertStatus(200);\n }",
"public function testShowSuccessfully()\n {\n $this->seed(\\UserTableSeeder::class);\n\n $employer = User::query()->where('email', '[email protected]')->first();\n Passport::actingAs(\n $employer,\n ['employer']\n );\n\n $response = $this->get('https://api.belsaa.com/employer/employer');\n $response->assertStatus(200);\n $response->assertJsonStructure(['id', 'company_name', 'user_attributes' => ['bio', 'legal_document_url', 'office_photo_url']]);\n $response->assertJsonFragment(['id' => $employer->id]);\n }",
"public function reportPeriodicClassWiseTopAbsentList()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportPeriodicClassWiseTopAbsentList')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }",
"public function test_getAllCalendars() {\n// \t\t$user = TestingUtil::getTestAdminUser();\n// \t\t$userApp = new UserApp();\n// \t\t$userApp->initializeForAppID($user, 5);\n// \t\t$outlookClient = new OutlookClient($user, $userApp);\n// \t\t$outlookCalendar = new OutlookCalendar($outlookClient);\n// \t\t$calendars = $outlookCalendar->getAllCalendars();\n// \t\t$this->assertCount(3, $calendars);\n\t\t$this->assertEquals(1,1);\n\t}",
"public function testIndexForHr()\n {\n $deptId = 1;\n $otherDeptId = 2;\n $userHrAdvisor = factory(User::class)->create([\n 'department_id' => $deptId,\n 'user_role_id' => 4\n ]);\n $hrAdvisor = factory(HrAdvisor::class)->create([\n 'user_id' => $userHrAdvisor->id\n ]);\n $userManagerInDept = factory(User::class)->create([\n 'department_id' => $deptId,\n 'user_role_id' => 2\n ]);\n $managerInDept = factory(Manager::class)->state('upgraded')->create([\n 'user_id' => $userManagerInDept->id\n ]);\n $userManagerOtherDept = factory(User::class)->create([\n 'department_id' => $otherDeptId,\n 'user_role_id' => 2\n ]);\n $managerOtherDept = factory(Manager::class)->state('upgraded')->create([\n 'user_id' => $userManagerOtherDept->id\n ]);\n\n $draftInDept = factory(JobPoster::class)->state('draft')->create([\n 'department_id' => $deptId,\n 'manager_id' => $managerInDept->id,\n ]);\n $draftOtherDept = factory(JobPoster::class)->state('draft')->create([\n 'department_id' => $otherDeptId,\n 'manager_id' => $managerOtherDept->id,\n ]);\n\n $reviewInDept = factory(JobPoster::class)->state('review_requested')->create([\n 'department_id' => $deptId,\n 'manager_id' => $managerInDept->id,\n ]);\n $reviewOtherDept = factory(JobPoster::class)->state('review_requested')->create([\n 'department_id' => $otherDeptId,\n 'manager_id' => $managerOtherDept->id,\n ]);\n\n $openJob = factory(JobPoster::class)->states(['live', 'byUpgradedManager'])->create();\n $closedJob = factory(JobPoster::class)->states(['closed', 'byUpgradedManager'])->create();\n\n $hrResponse = $this->actingAs($hrAdvisor->user)->json('get', route('api.v1.jobs.index'));\n\n $hrResponse->assertJsonMissingExact($this->jobToArray($draftInDept));\n $hrResponse->assertJsonMissingExact($this->jobToArray($draftOtherDept));\n $hrResponse->assertJsonMissingExact($this->jobToArray($reviewOtherDept));\n $hrResponse->assertJsonFragment($this->jobToArray($reviewInDept));\n $hrResponse->assertJsonFragment($this->jobToArray($openJob));\n $hrResponse->assertJsonFragment($this->jobToArray($closedJob));\n }",
"public function testGetWaiversParams()\n {\n $paths = [\n '/v4/waivers?limit=5',\n '/v4/waivers?limit=20&verified=true',\n '/v4/waivers?limit=20&templateId=alkagaldeab',\n '/v4/waivers?limit=20&fromDts='.urlencode('2016-11-01 00:00:00'),\n '/v4/waivers?limit=20&toDts='.urlencode('2016-11-01 00:00:00'),\n ];\n\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, APISuccessResponses::waivers(1), count($paths));\n\n $sw->getWaiverSummaries(5);\n $sw->getWaiverSummaries(20, true);\n $sw->getWaiverSummaries(20, null, 'alkagaldeab');\n $sw->getWaiverSummaries(20, null, '', '2016-11-01 00:00:00');\n $sw->getWaiverSummaries(20, null, '', '', '2016-11-01 00:00:00');\n\n $this->checkGetRequests($container, $paths);\n }",
"public function testGetMessageListAppointments()\r\n\t{\r\n\t\t// Create an event to make sure we have at least one\r\n\t\t$obj = CAntObject::factory($this->dbh, \"calendar_event\", null, $this->user);\r\n\t\t$obj->setValue(\"name\", \"My Test Event\");\r\n\t\t$obj->setValue(\"ts_start\", date(\"m/d/Y\") . \" 12:00 PM\");\r\n\t\t$obj->setValue(\"ts_end\", date(\"m/d/Y\") . \" 01:00 PM\");\r\n\t\t$eid = $obj->save();\r\n\r\n\t\t// Get events\r\n\t\t$events = $this->backend->GetMessageList(\"calendar_root\", time()); // second param cuts off to today\r\n\t\t$found = false;\r\n\t\tforeach ($events as $evt)\r\n\t\t{\r\n\t\t\tif ($evt[\"id\"] == $eid)\r\n\t\t\t\t$found = true;\r\n\t\t}\r\n\t\t$this->assertTrue($found);\r\n\r\n\t\t// Cleanup\r\n\t\t$obj->removeHard();\r\n\t}",
"public function testRentalCalendar()\n {\n $this->visit(route('rental.frontend-calendar'));\n $this->seeStatusCode(200);\n $this->see('Verhuur kalender.');\n }",
"public function test_admin_tribe_list()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/Assignments', 'tribe_list']);\n $this->assertResponseCode(404);\n }",
"public function testSpecificAllowedEmailAddressGet()\n {\n }",
"public function test_search_apartment()\n {\n $response = $this->getJson('/apartments?per_page=5');\n $response->assertStatus(200);\n }",
"public function appointments()\n\t{\n\t\tif (!is_cli())\n\t\t{\n\t\t\techo \"This script can only be accessed via the command line\" . PHP_EOL;\n\t\t\treturn;\n\t\t}\n\n\t\t$participations = $this->participationModel->get_confirmed_participations();\n\t\tforeach ($participations as $participation)\n\t\t{\n\t\t\t$appointment = strtotime($participation->appointment); \n\t\t\tif ($appointment > strtotime('tomorrow') && $appointment <= strtotime('tomorrow + 1 day')) \n\t\t\t{\t\t\t\t\t\n\t\t\t\treset_language(L::DUTCH);\n\t\t\t\t\n\t\t\t\t$participant = $this->participationModel->get_participant_by_participation($participation->id);\n\t\t\t\t$experiment = $this->participationModel->get_experiment_by_participation($participation->id);\n\t\t\t\t$message = email_replace('mail/reminder', $participant, $participation, $experiment);\n\t\t\n\t\t\t\t$this->email->clear();\n\t\t\t\t$this->email->from(FROM_EMAIL, FROM_EMAIL_NAME);\n\t\t\t\t$this->email->to(in_development() ? TO_EMAIL_DEV_MODE : $participant->email);\n\t\t\t\t$this->email->subject('Babylab Utrecht: Herinnering deelname');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t// DEBUG: $this->email->print_debugger();\n\t\t\t}\n\t\t}\n\t}",
"public function itShoulNotSetEndedAt()\n {\n // Arrange...\n $this->login();\n $lecture = factory(Lecture::class)->make();\n\n // Act...\n $this->json('post', 'lectures', array_merge($lecture->toArray(), [\n 'ended_at' => Carbon::yesterday()->toDateTimeString()\n ]));\n\n // Assert...\n $this->seeJson([\n 'endedAt' => null\n ]);\n }",
"public function testFetchEvents() {\n\t\t$jsonpad = parent::_getJsonpadInstance();\n\t\t\n\t\t// Fetch the events\n\t\t$total = 0;\n\t\t$events = $jsonpad->fetchEvents(1, null, null, $total);\n\t\t$this->assertInternalType(\"array\", $events);\n\t\t$this->assertGreaterThanOrEqual(1, $total);\n\t\t$this->assertInstanceOf(\"\\Jsonpad\\Resource\\Event\", $events[0]);\n\t}",
"public function testListPastWebinarFiles()\n {\n }",
"public function testReportsReferralsGet()\n {\n }",
"public function testEndPoint()\n {\n\t$response = $this->json('POST', '/api/module_reminder_assigner', ['contact_email' => '[email protected]']);\n\n\t$response->assertStatus(204);\n }",
"public function testGetWaiversParams()\n {\n $paths = [\n '/v4/waivers?limit=5',\n '/v4/waivers?limit=20&verified=true',\n '/v4/waivers?limit=20&templateId=alkagaldeab',\n '/v4/waivers?limit=20&fromDts='.urlencode('2016-11-01 00:00:00'),\n '/v4/waivers?limit=20&toDts='.urlencode('2016-11-01 00:00:00'),\n '/v4/waivers?limit=20&firstName=Kyle',\n '/v4/waivers?limit=20&lastName=Smith',\n '/v4/waivers?limit=20&tag=testing'\n ];\n\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, APISuccessResponses::waivers(1), count($paths));\n\n $sw->getWaiverSummaries(5);\n $sw->getWaiverSummaries(20, true);\n $sw->getWaiverSummaries(20, null, 'alkagaldeab');\n $sw->getWaiverSummaries(20, null, '', '2016-11-01 00:00:00');\n $sw->getWaiverSummaries(20, null, '', '', '2016-11-01 00:00:00');\n $sw->getWaiverSummaries(20, null, '', '', '', 'Kyle');\n $sw->getWaiverSummaries(20, null, '', '', '', '', 'Smith');\n $sw->getWaiverSummaries(20, null, '', '', '', '', '', 'testing');\n\n $this->checkGetRequests($container, $paths);\n }",
"function getUpcomingWebinars()\n {\n $path = $this->getPathRelativeToOrganizer('upcomingWebinars');\n\n return $this->sendRequest('GET', $path, $parameters = null, $payload = null);\n }",
"public function testGetAllEspMeds()\n {\n \n $controller = new EspMedController();\n $reponse = $controller->index();\n $this->assertJson($reponse);\n \n }",
"public function getAttendances(){\n try{\n $projectCode = Input::get('projectCode');\n $startDate = Input::get('beginDate');\n $endDate = Input::get('endDate');\n// Log::channel('in_sys')\n// ->info('API/IntegrationController - getAttendances data projectCode = '. $projectCode . \" | beginDate = \".$startDate.\" | endDate = \".$endDate);\n $project = Project::where('code', $projectCode)->first();\n\n if(!DB::table('projects')->where('code', $projectCode)->exists()){\n return Response::json([\n 'error' => 'Project code not found!'\n ], 400);\n }\n if(empty($startDate) || empty($endDate)){\n return Response::json([\n 'error' => 'Please provide Begin Date and End Date!'\n ], 400);\n }\n\n $attendanceAbsents = DB::table('attendance_absents')\n ->join('employees', 'attendance_absents.employee_id', '=', 'employees.id')\n ->join('projects', 'attendance_absents.project_id', '=', 'projects.id')\n ->select('attendance_absents.id as attendance_absent_id',\n 'attendance_absents.shift_type as shift_type',\n 'attendance_absents.is_done as is_done',\n 'attendance_absents.date as date',\n 'attendance_absents.date_checkout as date_checkout',\n 'attendance_absents.created_at as created_at',\n 'employees.id as employee_id',\n 'employees.code as employee_code',\n 'projects.name as project_name',\n 'projects.code as project_code')\n ->whereBetween('attendance_absents.created_at', array($startDate.' 00:00:00', $endDate.' 23:59:00'))\n ->where('attendance_absents.project_id', $project->id)\n ->where('attendance_absents.status_id',6)\n ->get();\n\n// $attendanceAbsents = AttendanceAbsent::where('project_id', $project->id)\n// ->where('status_id', 6)\n// ->whereBetween('created_at', array($startDate.' 00:00:00', $endDate.' 23:59:00'))\n// ->get();\n\n $dataModel = collect();\n// Log::channel('in_sys')\n// ->info('API/IntegrationController - getAttendances data 0 '. count($attendanceAbsents));\n if($attendanceAbsents->count() < 1){\n return Response::json([\n 'error' => 'No Attendances found within allocated time range!'\n ], 400);\n }\n\n// timestamp: ...,\n// projectCode: XXX, //assume project codes are synced\n// beginDate: ..., //date YYYY-MM-DD\n// endDate: ..., //date YYYY-MM-DD\n// data: [\n// {\n// employeeId: ...,\n// employeeCode: ...,\n// transDate: ..., //date YYYY-MM-DD\n// shiftCode: ..., // 1|2|3 or A|B|C or whatever\n// attendanceIn: ..., //timestamp YYYY-MM-DD HH:mm:ss\n// attendanceOut: ..., //timestamp YYYY-MM-DD HH:mm:ss\n// attendanceStatus: ..., // H=Hadir, A=Alpa, U=Unknown\n// ]\n// }\n\n foreach ($attendanceAbsents as $attendanceAbsent){\n $status = \"U\";\n $attendanceOut = \"\";\n if($attendanceAbsent->is_done == 0){\n $status = \"A\";\n }\n else{\n if(!empty($attendanceAbsent->date_checkout)){\n $status = \"H\";\n// $attendanceOut = $attendanceAbsent->date_checkout->format('Y-m-d H:i:s');\n $attendanceOut = $attendanceAbsent->date_checkout;\n }\n else{\n $status = \"A\";\n }\n }\n $createdAt = Carbon::parse($attendanceAbsent->created_at);\n $projectCSOModel = ([\n 'employeeId' => $attendanceAbsent->employee_id,\n 'employeeCode' => $attendanceAbsent->employee_code,\n 'transDate' => $createdAt->format('Y-m-d'),\n 'shiftCode' => $attendanceAbsent->shift_type ?? 0,\n 'attendanceIn' => $attendanceAbsent->date,\n 'attendanceOut' => $attendanceOut,\n 'attendanceStatus' => $status,\n ]);\n $dataModel->push($projectCSOModel);\n// Log::channel('in_sys')\n// ->info('API/IntegrationController - getAttendances data 2 '. json_encode($projectCSOModel));\n }\n $date = Carbon::now('Asia/Jakarta')->timestamp;\n $returnModel = collect([\n 'timestamp' => $date,\n 'projectCode' => $projectCode,\n 'beginDate' => $startDate,\n 'endDate' => $endDate,\n 'data' => $dataModel,\n ]);\n// Log::channel('in_sys')\n// ->info('API/IntegrationController - getAttendances data 3 '.json_encode($returnModel));\n return Response::json($returnModel, 200);\n }\n catch (\\Exception $ex){\n Log::channel('in_sys')->error('API/IntegrationController - getAttendances error EX: '. $ex);\n return Response::json([\n 'error' => $ex\n ], 500);\n }\n }",
"public function test_getNotFound() {\n\t\t$this->testAction('/disease/index/1', array('method'=>'get'));\n\t}",
"public function testGetEmployees()\n {\n }",
"public function test_admin_tribe_list_b()\n {\n $this->request('GET', ['pages/Assignments', 'tribe_list']);\n $this->assertResponseCode(404);\n }",
"public function actionIndex()\n { \n $mac=get_client_mac(get_client_ip());\n $employeeModel=Employee::findIdentityByMacAddress($mac);\n \n if($employeeModel!=null){\n if ($employeeModel->Active==0){\n print_r (\"InActive Employee.. Contact Admin\");\n return;\n }\n $model = new AttendanceIn();\n date_default_timezone_set('Asia/Calcutta');\n $model=AttendanceIn::findIdentityByUniqueKeys($employeeModel->id,date(\"Y-m-d\"));\n $month_off=MonthOff::find()->select([\"Dates\"])->where(['BranchId'=>$employeeModel->Branch])->andWhere(['Month'=>date('m')])->andWhere(['Year'=>date(\"Y\")])->all();\n if($month_off)\n $month_off=array_map('intval',explode(',',$month_off[0]['Dates'],-1));\n if($model==null){\n $model= new AttendanceIn();\n $model->EmployeeId=$employeeModel->id;\n $model->Date=date(\"Y-m-d\");\n $model->Time=date(\"H:i:s\");\n $timeSlotModel=TimeSlots::findOne(['id'=>$employeeModel->TimeSlot]);\n if(strcmp($model->Time,$timeSlotModel->Grace)<0){\n if(in_array(date('d'), $month_off)){\n if(!$leaveHistory=LeaveHistory::findOne(['EmployeeId'=>$employeeModel->id, 'LeaveType'=>4])){\n $leaveHistory =new LeaveHistory();\n $leaveHistory->id=$employeeModel->id;\n $leaveHistory->Type=4;\n $leaveHistory->LeaveCount=0;\n $leaveHistory->MaxLeave=0.5;\n }\n else{\n $leaveHistory->MaxLeave+=0.5;\n }\n $leaveHistory->save();\n $model->FirstHalf=\"WP\";\n }\n else\n $model->FirstHalf=\"P\";\n \n }\n else if (strcmp($model->Time,$timeSlotModel->Grace)>0 && strcmp($model->Time,$timeSlotModel->DeadOut)<0){\n if($employeeModel->DeadOutCount>=$timeSlotModel->MaxDeadOutCount)\n $model->FirstHalf=\"A\";\n else{\n $employeeModel->DeadOutCount+=1;\n $employeeModel->save();\n $model->Remark=$employeeModel->DeadOutCount.\" Late Count\";\n if(in_array(date('d'), $month_off)){\n if(!$leaveHistory=LeaveHistory::findOne(['EmployeeId'=>$employeeModel->id, 'LeaveType'=>4])){\n $leaveHistory =new LeaveHistory();\n $leaveHistory->id=$employeeModel->id;\n $leaveHistory->Type=4;\n $leaveHistory->LeaveCount=0;\n $leaveHistory->MaxLeave=0.5;\n }\n else{\n $leaveHistory->MaxLeave+=0.5;\n }\n $leaveHistory->save();\n $model->FirstHalf=\"WP\";\n }\n else\n $model->FirstHalf=\"P\";\n }\n }\n else{\n $model->FirstHalf=\"A\";\n }\n if($model->validate() && $model->save()){\n return $this->renderPartial('attendance-in-success', [\n 'employeeModel'=>$employeeModel,\n 'model'=>$model,\n ]);\n }\n else{\n print_r(\"Error Occured\");\n return;\n }\n }\n return AttendanceInController::actionOut();\n\n }\n else{\n print_r(\"<h1><p style='color:red;background-color:pink;border-color:#c3e6cb;'>No Such Device/Employee Registered</p></h1>\");\n return;\n }\n \n }",
"public function unauthorizedTest(WebTestCase $webTestCase);",
"function selectAttendees($emails, $event, $entity = \"Webinar\") {\n\t// Preparing the query params\n\t$selectEmailString = '';\n\t$qParams = $selectEmails = array();\n\t$i = 1;\n\tforeach ($emails as $email) {\n\t\tif(!empty($email)){\n\t\t\t$qParams[$i] = array($email, 'String');\n\t\t\t$selectEmails[] = '%'.$i;\n\t\t\t$i++;\n\t\t}\n\t}\n\t$selectEmailString = join(', ', $selectEmails);\n\n\tif($entity == \"Webinar\"){\n\t\t// $absenteesEmails = join(\"','\",$emails);\n\n\t\t$selectAttendees = \"\n\t\t\tSELECT\n\t\t\t\te.email,\n\t\t\t\tp.contact_id,\n\t\t\t\tp.id AS participant_id\n\t\t\tFROM civicrm_participant p\n\t\t\tLEFT JOIN civicrm_email e ON p.contact_id = e.contact_id\n\t\t\tWHERE\n\t\t\t\te.email NOT IN ($selectEmailString) AND\n\t\t\t\tp.event_id = {$event}\";\n\t}elseif($entity == \"Meeting\"){\n\t\t// $attendeesEmails = join(\"','\",$emails);\n\n\t\t$selectAttendees = \"\n\t\t\tSELECT\n\t\t\t\te.email,\n\t\t\t\tp.contact_id,\n\t\t\t\tp.id AS participant_id\n\t\t\tFROM civicrm_participant p\n\t\t\tLEFT JOIN civicrm_email e ON p.contact_id = e.contact_id\n\t\t\tWHERE\n\t\t\t\te.email IN ($selectEmailString) AND\n\t\t\t\tp.event_id = {$event}\";\n\t}\n\t// Run query\n\t$query = CRM_Core_DAO::executeQuery($selectAttendees, $qParams);\n\n\t$attendees = [];\n\n\twhile($query->fetch()) {\n\t\tarray_push($attendees, [\n\t\t\t'email' => $query->email,\n\t\t\t'contact_id' => $query->contact_id,\n\t\t\t'participant_id' => $query->participant_id\n\t\t]);\n\t}\n\n\treturn $attendees;\n}",
"public function testGetPayrollCalendars()\n {\n }",
"public function testVolunteerHourProjectStoreFailure_Inactive()\n {\n $this->session([\n 'username' => $this->inactiveUser->username, \n 'access_level' => $this->inactiveUser->access_level\n ]);\n \n // Set test user as current authenticated user\n $this->be($this->inactiveUser);\n \n // Call route under test\n $response = $this->call('POST', 'volunteerhours');\n \n // Assert redirected to access denied page\n $this->assertRedirectedToRoute('unauthorized');\n }",
"public function testShowSpecificOutroCardsForGuest(): void\n {\n // Request\n $response = $this->get('api/v1/outroCards/tenants/1');\n\n // Check response status\n $response->assertStatus(401);\n }",
"public function getEventBookList($eventId){\n\n $sql = \"Select user.firstName, user.lastName, user.email, attending.attendId, attending.event_id, user.role\n from user \n join attending\n on user.userId = attending.user_id\n where attending.event_id = :eventId\";\n\n $pdoQuery = $this->conn->prepare($sql);\n\n $pdoQuery->execute([':eventId' => $eventId]);\n\n $attendees = $pdoQuery->fetchAll();\n\n return($attendees);\n }",
"public function offEmployeeSchedule() {\n \n $employeeLists = $this->EmployeesSchedules->find()\n ->contain('Employees')\n ->where([\n 'Employees.status' => 1, \n 'OR'=> [\n \"Employees.availability_status\" => 1,\n \"Employees.consult_availability_status\" => 1\n ]\n ])\n ->toArray();\n \n if(!empty($employeeLists)) {\n foreach ($employeeLists as $key => $val) {\n \n $timezone = !empty($val->timezone) ? $val->timezone : date_default_timezone_get();\n \n $schedule = json_decode($val->schedule, true);\n $consult_schedule = json_decode($val->consult_schedule, true);\n \n $date = date(\"Y-m-d\");\n $previousDate = date('Y-m-d', strtotime('-1 day'));\n \n if(!empty($schedule)) {\n \n date_default_timezone_set($timezone);\n \n $result = array_filter($schedule, function ($val) use ($date, $previousDate) {\n $compareDate = \\DateTime::createFromFormat('m-d-Y', $val);\n $utime = strtotime($compareDate->format('Y-m-d'));\n return $utime >= strtotime($previousDate) && $utime <= strtotime($date);\n }, ARRAY_FILTER_USE_KEY);\n \n if (! empty($result)) {\n $flag = 0;\n foreach ($result as $r_key => $r_val) {\n $compareDate = \\DateTime::createFromFormat('m-d-Y', $r_key);\n \n if($previousDate == $compareDate->format('Y-m-d')) {\n foreach ($r_val as $previous_key => $previous_val) {\n //pr($previous_val); die;\n $previousTime = explode('-', $previous_val['time']);\n \n $previousStartTime = date('H:i', strtotime(substr($previousTime[0], 0, -1) . ':00 ' . substr($previousTime[0], -1) . 'm'));\n $previousEndTime = date('H:i', strtotime(substr($previousTime[1], 0, -1) . ':00 ' . substr($previousTime[1], -1) . 'm'));\n \n if($previousStartTime > $previousEndTime) {\n // This means schedule is next day shift\n $r_val[0] = [\n 'service_team' => $previous_val['service_team'],\n //'time' => '0a-'.$previousTime[1]\n 'time' => $previous_val['time']\n ];\n } else {\n $flag = 1;\n }\n }\n if($flag) {\n continue;\n }\n }\n \n foreach ($r_val as $v_key => $v_val) {\n if (! empty($v_val['time'])) {\n $time = explode('-', $v_val['time']);\n \n $startTime = date('H:i', strtotime(substr($time[0], 0, -1) . ':00 ' . substr($time[0], -1) . 'm'));\n $endTime = date('H:i', strtotime(substr($time[1], 0, -1) . ':00 ' . substr($time[1], -1) . 'm'));\n \n $currentTime = date('H:i');\n \n $employee = $val->employee;\n \n if(strtotime($endTime) >= strtotime(date(\"H:i\")) && strtotime($endTime) <= strtotime(date(\"H:i\", strtotime('+10 minutes')))) {\n if(!empty($employee)) {\n $employee->availability_status = 0;\n $employee->working_time = '';\n $employee->dirty('modified', true);\n $this->Employees->save($employee);\n \n /* $this->HospitalsEmployees->deleteAll([\n 'employee_id' => $val->employee_id,\n 'hospital_id' => $val->hospital_id\n ]); */\n }\n }\n }\n }\n }\n }\n }\n \n if(!empty($consult_schedule)) {\n date_default_timezone_set($timezone);\n $consultResult = array_filter($consult_schedule, function ($val) use ($date, $previousDate) {\n $compareDate = \\DateTime::createFromFormat('m-d-Y', $val);\n $utime = strtotime($compareDate->format('Y-m-d'));\n return $utime >= strtotime($previousDate) && $utime <= strtotime($date);\n }, ARRAY_FILTER_USE_KEY);\n \n if (! empty($consultResult)) {\n $cFlag = 0;\n $departments = TableRegistry::get('Departments');\n \n foreach ($consultResult as $c_key => $c_val) {\n unset($c_val['service_team']);\n \n $compareDate = \\DateTime::createFromFormat('m-d-Y', $c_key);\n \n if($previousDate == $compareDate->format('Y-m-d')) {\n $i =0;\n foreach ($c_val as $previous_key => $previous_val) {\n $previousTime = explode('-', $previous_val['time']);\n \n $previousStartTime = date('H:i', strtotime(substr($previousTime[0], 0, -1) . ':00 ' . substr($previousTime[0], -1) . 'm'));\n $previousEndTime = date('H:i', strtotime(substr($previousTime[1], 0, -1) . ':00 ' . substr($previousTime[1], -1) . 'm'));\n \n if($previousStartTime > $previousEndTime) {\n // This means schedule is next day shift\n //pr($previous_val);\n $cFlag = 0;\n $c_val[$i] = [\n 'department' => $previous_val['department'],\n 'subdepartment' => $previous_val['subdepartment'],\n 'time' => $previous_val['time'],\n 'is_first_call' => $previous_val['is_first_call'],\n 'is_attending' => $previous_val['is_attending'],\n ];\n } else {\n $cFlag = 1;\n }\n $i++;\n }\n \n if($cFlag) {\n continue;\n }\n }\n \n foreach ($c_val as $v_key => $v_val) {\n // change status of employee\n \n if (! empty($v_val['time'])) {\n $time = explode('-', $v_val['time']);\n \n $startTime = date('H:i', strtotime(substr($time[0], 0, -1) . ':00 ' . substr($time[0], -1) . 'm'));\n $endTime = date('H:i', strtotime(substr($time[1], 0, -1) . ':00 ' . substr($time[1], -1) . 'm'));\n \n $currentTime = date('H:i');\n \n $employee = $val->employee;\n \n if(strtotime($endTime) >= strtotime(date(\"H:i\")) && strtotime($endTime) <= strtotime(date(\"H:i\", strtotime('+10 minutes')))) {\n if(!empty($employee)) {\n $employee->is_consult = 0;\n $employee->working_time = '';\n $employee->is_first_call = 0;\n $employee->is_attending = 0;\n $employee->consult_availability_status = 0;\n $employee->dirty('modified', true);\n $this->Employees->save($employee);\n \n /* $this->HospitalsEmployees->deleteAll([\n 'employee_id' => $val->employee_id,\n 'hospital_id' => $val->hospital_id\n ]); */\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }",
"public function events()\n {\n if (!Sentry::check()) {\n // User is not logged in, or is not activated\n return Redirect::route('landing');\n } else {\n // Gets all appointments from the school\n $user = Sentry::getUser();\n\n // Check if user is superAdmin\n if ($user->hasAccess('school')) {\n $appointments = Appointment::get()->load('group.school')->toArray();\n // Returns JSON response of the user\n return Response::json($appointments)->setCallback(\n Input::get('callback')\n ); //return View::make('calendar.events');\n\n } else {\n // If user is not superAdmin, show groups based on the school of the logged in user\n $user->load('school.groups.appointments.group.school');\n $appointments = [];\n\n // Loop through groups to get all appointments\n foreach ($user->school->groups as $group) {\n foreach ($group->appointments as $appointment) {\n array_push($appointments, $appointment);\n }\n }\n // Returns JSON response of the user\n return Response::json($appointments)->setCallback(Input::get('callback'));\n }\n }\n }",
"public function testGetInvalidEventbyEventId() : void {\n // grab a profile id that exceeds the maximum allowable profile id\n $event = Event::getEventByEventId($this->getPDO(), generateUuidV4());\n $this->assertNull($event);\n }",
"public function testEventimCanBeReached()\n\t{\n\t\t$response = $this->crawler->getClient()->request('GET', 'http://www.eventim.de/yung-hurn-aachen-tickets.html?affiliate=EYA&doc=artistPages%2Ftickets&fun=artist&action=tickets&key=2078585%2410513338&jumpIn=yTix');\n\t\t$this->assertEquals(\n\t\t\t200,\n\t\t\t$response->getStatusCode()\n\t\t);\n\t}",
"public function testVolunteerHourIndexForContactSuccess_Administrator()\n {\n // Set test user as current authenticated user\n $this->be($this->administrator);\n \n $this->session([\n 'username' => $this->administrator->username, \n 'access_level' => $this->administrator->access_level\n ]);\n \n $volunteerID = 2;\n // Call route under test\n $response = $this->call('GET', 'volunteerhours/volunteer/'.$volunteerID);\n \n $this->assertContains('Volunteer Hours for', $response->getContent());\n }",
"public function test_admin_member_internship_b()\n {\n $this->request('GET', ['pages/memberdsc', 'apprenticeship']);\n $this->assertResponseCode(404);\n }",
"public function getAllOfficeEmployers();",
"public function testAllowedEmailAddressGet()\n {\n }",
"public function testEmailCampaignsGet()\n {\n }",
"public function testAdultUsersCanSeeTaskList()\n {\n $this->withoutExceptionHandling();\n Task::factory(3)->create();\n $adult = User::create([\n 'name' => 'vanessa',\n 'role' => 'adult',\n 'points' => 0,\n 'email' => '[email protected]',\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n 'remember_token' => Str::random(10)\n ]);\n\n $response = $this->actingAs($adult)\n ->get(route('dashboard.tasks'));\n $response->assertStatus(200)\n ->assertViewIs('dashboard.task-list')\n ->assertViewHas('taskList');\n }"
] | [
"0.6012117",
"0.5984477",
"0.5918694",
"0.5873598",
"0.58436704",
"0.58301497",
"0.58196026",
"0.5788358",
"0.5774703",
"0.57724416",
"0.5754003",
"0.57515645",
"0.570997",
"0.5703932",
"0.5624342",
"0.5612756",
"0.560048",
"0.5572901",
"0.5554806",
"0.55531824",
"0.5505148",
"0.54856896",
"0.5482735",
"0.5421839",
"0.5401551",
"0.5383251",
"0.53681713",
"0.53681713",
"0.5366429",
"0.5337543",
"0.5324751",
"0.53141177",
"0.5298602",
"0.529098",
"0.5289157",
"0.52801704",
"0.52797365",
"0.5267547",
"0.52590257",
"0.5252092",
"0.52469325",
"0.5246158",
"0.5245664",
"0.52451736",
"0.52416354",
"0.52327436",
"0.523025",
"0.522886",
"0.5226553",
"0.51884824",
"0.5170073",
"0.5170028",
"0.516116",
"0.51609397",
"0.51608527",
"0.5152351",
"0.5136934",
"0.5133371",
"0.51329917",
"0.5132185",
"0.51300853",
"0.5121005",
"0.51187205",
"0.51179993",
"0.51026267",
"0.5098142",
"0.5096236",
"0.5095167",
"0.508713",
"0.50741637",
"0.50684154",
"0.5066495",
"0.50592786",
"0.5052417",
"0.504456",
"0.50417",
"0.50416005",
"0.5034832",
"0.50309455",
"0.5028487",
"0.50264627",
"0.50199324",
"0.50119346",
"0.5010139",
"0.5009964",
"0.50030273",
"0.49972293",
"0.49951196",
"0.49859512",
"0.49829742",
"0.4982189",
"0.49794376",
"0.49760935",
"0.4975068",
"0.4972321",
"0.49711624",
"0.4970527",
"0.49676463",
"0.49601522",
"0.49599326"
] | 0.7858616 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.